Commit 4cffdb11 authored by 周磊's avatar 周磊

从1.9.1重新编辑,当前版本视为初始

parent 771e403f
...@@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.29409.12 ...@@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.29409.12
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GcDevicePc", "GcDevicePc\GcDevicePc.csproj", "{BBCD58CB-247D-4108-A135-F36F8ABA3289}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GcDevicePc", "GcDevicePc\GcDevicePc.csproj", "{BBCD58CB-247D-4108-A135-F36F8ABA3289}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedSpace", "SharedSpace\SharedSpace.csproj", "{5498F944-5721-461B-B07F-3105EF0BF643}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vocdll", "vocdll", "{17288597-04A1-40BD-8E6C-1E83CBD1A523}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vocdll", "vocdll", "{17288597-04A1-40BD-8E6C-1E83CBD1A523}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CKVocAlgorithm", "gcdevicepc_nmoc8-16\CKVocAlgorithm\CKVocAlgorithm.csproj", "{EEF7E2F6-A048-4577-B925-A145A4E48384}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CKVocAlgorithm", "gcdevicepc_nmoc8-16\CKVocAlgorithm\CKVocAlgorithm.csproj", "{EEF7E2F6-A048-4577-B925-A145A4E48384}"
...@@ -47,15 +45,6 @@ Global ...@@ -47,15 +45,6 @@ Global
{BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|Mixed Platforms.Build.0 = Release|x86 {BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|Mixed Platforms.Build.0 = Release|x86
{BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|x86.ActiveCfg = Release|x86 {BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|x86.ActiveCfg = Release|x86
{BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|x86.Build.0 = Release|x86 {BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|x86.Build.0 = Release|x86
{5498F944-5721-461B-B07F-3105EF0BF643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Debug|x86.ActiveCfg = Debug|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Release|Any CPU.Build.0 = Release|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Release|x86.ActiveCfg = Release|Any CPU
{EEF7E2F6-A048-4577-B925-A145A4E48384}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EEF7E2F6-A048-4577-B925-A145A4E48384}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEF7E2F6-A048-4577-B925-A145A4E48384}.Debug|Any CPU.Build.0 = Debug|Any CPU {EEF7E2F6-A048-4577-B925-A145A4E48384}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEF7E2F6-A048-4577-B925-A145A4E48384}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {EEF7E2F6-A048-4577-B925-A145A4E48384}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
......
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
namespace GcDevicePc
{
class AESfile
{
private string filename = "default.tw";
private string default_password = "Tet-chrom";
private string default_iv = "2016201620162016";
// private FileStream aesfs;
public AESfile(string file)
{
filename = file;
}
private string ByteToString(byte[] InBytes)
{
string StringOut = "";
foreach (byte InByte in InBytes)
{
StringOut = StringOut + String.Format("{0:X2} ", InByte);
}
return StringOut;
}
// 把十六进制字符串转换成字节型
private byte[] strToToHexByte(string hexString)
{
hexString = hexString.Replace(" ", "");
if ((hexString.Length % 2) != 0)
hexString += " ";
byte[] returnBytes = new byte[hexString.Length / 2];
for (int i = 0; i < returnBytes.Length; i++)
returnBytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
return returnBytes;
}
private string AESEncrypt(string text, string password, string iv)
{
RijndaelManaged rijndaelCipher = new RijndaelManaged();
rijndaelCipher.Mode = CipherMode.CBC;
rijndaelCipher.Padding = PaddingMode.PKCS7;
rijndaelCipher.KeySize = 128;
rijndaelCipher.BlockSize = 128;
byte[] pwdBytes = System.Text.Encoding.UTF8.GetBytes(password);
byte[] keyBytes = new byte[16];
int len = pwdBytes.Length;
if (len > keyBytes.Length) len = keyBytes.Length;
System.Array.Copy(pwdBytes, keyBytes, len);
rijndaelCipher.Key = keyBytes;
byte[] ivBytes = System.Text.Encoding.UTF8.GetBytes(iv);
rijndaelCipher.IV = ivBytes;
ICryptoTransform transform = rijndaelCipher.CreateEncryptor();
byte[] plainText = Encoding.UTF8.GetBytes(text);
byte[] cipherBytes = transform.TransformFinalBlock(plainText, 0, plainText.Length);
return ByteToString(cipherBytes);
}
private string AESDecrypt(string text, string password, string iv)
{
RijndaelManaged rijndaelCipher = new RijndaelManaged();
rijndaelCipher.Mode = CipherMode.CBC;
rijndaelCipher.Padding = PaddingMode.PKCS7;
rijndaelCipher.KeySize = 128;
rijndaelCipher.BlockSize = 128;
byte[] encryptedData = strToToHexByte(text);
byte[] pwdBytes = System.Text.Encoding.UTF8.GetBytes(password);
byte[] keyBytes = new byte[16];
int len = pwdBytes.Length;
if (len > keyBytes.Length) len = keyBytes.Length;
System.Array.Copy(pwdBytes, keyBytes, len);
rijndaelCipher.Key = keyBytes;
byte[] ivBytes = System.Text.Encoding.UTF8.GetBytes(iv);
rijndaelCipher.IV = ivBytes;
ICryptoTransform transform = rijndaelCipher.CreateDecryptor();
byte[] plainText = transform.TransformFinalBlock(encryptedData, 0, encryptedData.Length);
return Encoding.UTF8.GetString(plainText);
}
public bool Create_filetw()
{
if (File.Exists(this.filename) == true)
{
return false;
}
else
{
FileStream aesfs = new FileStream(this.filename, FileMode.Create);
aesfs.Close();
return true;
}
}
public bool Write_filetw(float Time, float Voltage)
{
string line;
StreamWriter fswriter = new StreamWriter(filename, true);
line = AESEncrypt(Time.ToString("0.000000"), this.default_password, this.default_iv);
fswriter.WriteLine(line);
line = AESEncrypt(Voltage.ToString("0.000"), this.default_password, this.default_iv);
fswriter.WriteLine(line);
fswriter.Close();
return true;
}
public bool Read_filetw(ref double[] Time, ref double[] Voltage)
{
string line;
int i = 0;
StreamReader fsread = new StreamReader(filename);
while(fsread.Peek() >= 0)
{
line = fsread.ReadLine();
Time[i] = double.Parse(AESDecrypt(line, this.default_password, this.default_iv));
line = fsread.ReadLine();
Voltage[i] = double.Parse(AESDecrypt(line, this.default_password, this.default_iv));
i++;
}
fsread.Close();
return true;
}
}
}
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</logger> </logger>
<logger name="TempDebugInfo"> <logger name="TempDebugInfo">
<level value="INFO"/> <level value="INFO"/>
<appender-ref ref="TempDebugRollingLog"/> <appender-ref ref="WorkErrRollingLog"/>
</logger> </logger>
...@@ -105,8 +105,8 @@ ...@@ -105,8 +105,8 @@
</filter> </filter>
</appender> </appender>
<appender name="TempDebugRollingLog" type="log4net.Appender.RollingFileAppender"> <appender name="WorkErrRollingLog" type="log4net.Appender.RollingFileAppender">
<file value="..\GC_User\Logs\TempDebug_"/> <file value="..\GC_User\Logs\WorkErrInfo_"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
<datePattern value="yyyyMMdd'.txt'"/> <datePattern value="yyyyMMdd'.txt'"/>
......
...@@ -114,123 +114,6 @@ namespace GcDevicePc ...@@ -114,123 +114,6 @@ namespace GcDevicePc
} }
public void InitFileCompleteness()
{
try
{
#if Use_English_Folder
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\Startup\\startup.ini");
#else
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
#endif
if (File.Exists(file))
{
IniFile ini = new IniFile(file);
int opensys = ini.ReadInteger("StartUp", "打开系统");
int runtype = ini.ReadInteger("StartUp", "运行类型");
globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.DataFolder = ini.ReadString("DataFolder", "历史数据");
globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.FileClassification = ini.ReadString("DataFolder", "分级文件夹");
int Version = ini.ReadInteger("Version", "VersionType");
string uname = ini.ReadString("User", "Name");
string upwd = ini.ReadString("User", "Password");
int dsf = ini.ReadInteger("SendData", "Thirdparty");
string strSendType=ini.ReadString("SendData","SendType");
int dw = ini.ReadInteger("SendData", "Foreign");
int sdzb = ini.ReadInteger("SaveData", "ZBSaveData");
string apname = ini.ReadString("Version", "AppName");
int fi = ini.ReadInteger("StartUp", "Forceintegral");
string unit = ini.ReadString("StartUp", "Unit");
globaldata.UserName = uname;
globaldata.UserPwd = upwd;
globaldata.CurrentVersion = Version;
globaldata.Foreign = dw;
globaldata.ZbDataSave = sdzb == 0 ? false : true;
globaldata.AppName = apname;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.hmimac = ini.ReadString("NetWorkConfig", "MAC地址");
CKVocAnalyzer.GlobalCKV.vocAlgorithm.Forceintegral = fi == 1 ? true : false;
if (opensys == 1)
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType = (ushort)runtype;
}
else
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType = 0;
}
if (dsf == 0)
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw = true;
}
else if (dsf == 1)
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb = true;
}
else if (dsf == 2)
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoSP = true;
}
else
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw = false;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb = false;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoSP = false;
}
if (strSendType=="Routine")
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendType="Routine";
}
else if (strSendType=="KeepSending")
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendType="KeepSending";
}
string info_log = ini.ReadString("Logs", "InfoLog");
string err_log = ini.ReadString("Logs", "ErrLog");
string hmi_log = ini.ReadString("Logs", "HmiLog");
string gc485 = ini.ReadString("GC485", "COM");
if (!String.IsNullOrEmpty(gc485))
{
globaldata.m_pcbuffer.gcpcinfo.outputinfo.port = Convert.ToByte(gc485);
}
if (!String.IsNullOrEmpty(info_log))
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.info_log = info_log.Equals("1") ? true : false;
}
if (!String.IsNullOrEmpty(err_log))
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.error_log = err_log.Equals("1") ? true : false;
}
if (!String.IsNullOrEmpty(hmi_log))
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.hmi_log = hmi_log.Equals("1") ? true : false;
}
}
else
{
//globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType = 0;
//globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw = false;
//globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb = false;
//globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoSP = false;
//globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.DataFolder = null;
}
}
catch (Exception e)
{
Log.Error(e.Message);
}
}
/// <summary> /// <summary>
/// 创建本地必要目录带设备名称 /// 创建本地必要目录带设备名称
/// </summary> /// </summary>
...@@ -633,15 +516,7 @@ namespace GcDevicePc ...@@ -633,15 +516,7 @@ namespace GcDevicePc
} }
} }
public void StartDataThread()
{
if (!String.IsNullOrEmpty(globaldata.connection_ip))
{
MoudbusOperation.GetInstance().SetModbusIP(globaldata.connection_ip);
//ThreadMonitor.GetInstance().StartALLCommunication();
ThreadMonitor.GetInstance().MonitorThStart();
}
}
// int hmicount = 0; // int hmicount = 0;
// private bool bSearchBool = false; // private bool bSearchBool = false;
// private System.Timers.Timer timer = new System.Timers.Timer(); // private System.Timers.Timer timer = new System.Timers.Timer();
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
// //
// CurveDisPlay // CurveDisPlay
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.WhiteSmoke; this.BackColor = System.Drawing.Color.WhiteSmoke;
this.ClientSize = new System.Drawing.Size(719, 516); this.ClientSize = new System.Drawing.Size(719, 516);
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
namespace GcDevicePc.CK_UI
{
public partial class UserCtlAuto : UserControl
{
public UserCtlAuto()
{
InitializeComponent();
}
private void UserCtlAuto_Load(object sender, EventArgs e)
{
}
}
}
版本:1.4.7 日期:20170915
Changlog:
1.添加程序启动保证HMI通讯成功功能
2.添加数据后处理阶段重传功能(测试中)
版本:1.4.6 日期:2017098
Changlog:
1.添加氢空阀测试
2.添加三路通道数据采集
3.添加方法开始时间和结束时间
4.添加senddata功能,通过ini控制
5.修复一些细小bug(开机网卡延迟,双击变浮动窗口)
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Runtime.InteropServices;
namespace GcDevicePc.Common
{
class GCModbus
{
[DllImport(@"LibModbus.dll", EntryPoint = "fnLibModbus", CharSet = CharSet.Unicode)]
public static extern uint fnLibModbus();
[DllImport(@"LibModbus.dll", EntryPoint = "fnReadCoilStatus")]
public static extern int fnReadCoilStatus(uint handle, ushort address, ushort num, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] System.Byte[] dest, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnReadInputStatus")]
public static extern int fnReadInputStatus(uint handle, ushort address, ushort num, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] System.Char[] dest, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnReadHoldingReg")]
public static extern int fnReadHoldingReg(uint handle, ushort address, ushort num, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] System.UInt16[] dest, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnReadInputReg")]
public static extern int fnReadInputReg(uint handle, ushort address, ushort num, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] System.UInt16[] dest, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnWriteSingleCoil")]
public static extern int fnWriteSingleCoil(uint handle, ushort address, ushort state, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnWriteHoldingReg")]
public static extern int fnWriteHoldingReg(uint handle, ushort address, ushort state, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnWriteMultipleCoils")]
public static extern int fnWriteMultipleCoils(uint handle, ushort address, ushort num, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] System.Char[] src, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnWriteMultipleRegs")]
public static extern int fnWriteMultipleRegs(uint handle, ushort address, ushort num, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] System.UInt16[] src, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnReportSlaveID")]
public static extern int fnReportSlaveID(uint handle, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] System.Char[] src, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnMaskWriteReg")]
public static extern int fnMaskWriteReg(uint handle, ushort address, ushort amask, ushort omask, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnReadWriteMultipleRegs")]
public static extern int fnReadWriteMultipleRegs(uint handle, ushort waddress, ushort wnum, ushort raddress, ushort rnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] System.UInt16[] dest, byte[] Ip, ushort wTcpPort);
[DllImport(@"LibModbus.dll", EntryPoint = "fnLibModbusClose")]
public static extern void fnLibModbusClose(uint handle);
private uint hModbusHandle;
private System.UInt16[] dest = new System.UInt16[10] { 0, 0, 3, 4, 5, 6, 7, 8, 9, 0 };
public GCModbus()
{
this.hModbusHandle = fnLibModbus();
}
~GCModbus()
{
fnLibModbusClose(hModbusHandle);
}
public int ReadCoilStatus(ushort addr, ushort num, String ip, ushort wport, ref byte[] buf)
{
int ret;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnReadCoilStatus(hModbusHandle, (ushort)(addr - 1), num, buf, bIp, wport);
return ret;
}
public int ReadInputStatus(ushort addr, ushort num, String ip, ushort wport, ref char[] buf)
{
int ret;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnReadInputStatus(hModbusHandle, addr, 1, buf, bIp, 502);
return ret;
}
public int ReadHoldingReg(ushort addr, ushort num, String ip, ushort wport, ref UInt16[] buf)
{
int ret;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnReadHoldingReg(hModbusHandle, (ushort)(addr - 1), num, buf, bIp, wport);
return ret;
}
public int ReadInputReg(ushort addr, ushort num, String ip, ushort wport, ref UInt16[] buf)
{
int ret;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnReadInputReg(hModbusHandle, addr, 1, dest, bIp, 502);
buf[0] = dest[0];
return ret;
}
public int WriteSingleCoil(ushort addr, ushort state, String ip, ushort wport)
{
int ret = 0;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnWriteSingleCoil(hModbusHandle, (ushort)(addr - 1), state, bIp, wport);
return ret;
}
public int WriteHoldingReg(ushort addr, ushort state, String ip, ushort wport)
{
int ret = 0;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnWriteHoldingReg(hModbusHandle, (ushort)(addr - 1), state, bIp, wport);
return ret;
}
//public int ReadHoldingReg(ushort addr, ushort num, String ip, ushort wport, ref char[] buf)
//{
// int ret;
// byte[] bIp = Encoding.Unicode.GetBytes(ip);
// ret = fnWriteMultipleCoils(hModbusHandle, addr, 1, buf, bIp, 502);
// return ret;
//}
public int WriteMultipleRegs(ushort addr, ushort num, String ip, ushort wport, ref ushort[] buf)
{
int ret;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnWriteMultipleRegs(hModbusHandle, (ushort)(addr - 1), num, buf, bIp, wport);
return ret;
}
public int ReportSlaveID(ushort addr, ushort num, String ip, ushort wport, ref char[] buf)
{
int ret;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnReportSlaveID(hModbusHandle, buf, bIp, 502);
return ret;
}
public int MaskWriteReg(ushort addr, ushort amask, ushort omask, String ip, ushort wport)
{
int ret = 0;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnMaskWriteReg(hModbusHandle, addr, amask, omask, bIp, 502);
return ret;
}
public int ReadWriteMultipleRegs(ushort waddr, ushort wnum, ushort raddr, ushort rnum, String ip, ushort wport,ref UInt16[] buf)
{
int ret = 0;
byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnReadWriteMultipleRegs(hModbusHandle, waddr, wnum, raddr, rnum, buf, bIp, 502);
return ret;
}
}
}
...@@ -111,6 +111,11 @@ namespace GcDevicePc.Common ...@@ -111,6 +111,11 @@ namespace GcDevicePc.Common
public int ReadHoldingReg(ushort addr, ushort num, String ip, ushort wport, ref UInt16[] buf) public int ReadHoldingReg(ushort addr, ushort num, String ip, ushort wport, ref UInt16[] buf)
{ {
if (MDIBase.bUpdateHMI)
{
Thread.Sleep(1);
return -1;
}
int ret; int ret;
byte[] bIp = Encoding.Unicode.GetBytes(ip); byte[] bIp = Encoding.Unicode.GetBytes(ip);
ret = fnReadHoldingReg(hModbusHandle,1, (ushort)(addr - 1), num, buf, bIp, wport); ret = fnReadHoldingReg(hModbusHandle,1, (ushort)(addr - 1), num, buf, bIp, wport);
......
This diff is collapsed.
...@@ -9,8 +9,8 @@ namespace GcDevicePc.Common ...@@ -9,8 +9,8 @@ namespace GcDevicePc.Common
private static readonly ILog logInfo = LogManager.GetLogger("Log"); private static readonly ILog logInfo = LogManager.GetLogger("Log");
private static readonly ILog hmiInfo = LogManager.GetLogger("HmiInfo"); private static readonly ILog hmiInfo = LogManager.GetLogger("HmiInfo");
private static readonly ILog logErr = LogManager.GetLogger("Err"); private static readonly ILog logErr = LogManager.GetLogger("Err");
private static readonly ILog debugInfo = LogManager.GetLogger("DebugInfo"); private static readonly ILog debugInfo = LogManager.GetLogger("DebugInfo");
private static readonly ILog tempdebugInfo = LogManager.GetLogger("TempDebugInfo"); private static readonly ILog workErrInfo = LogManager.GetLogger("WorkErrInfo");
private static readonly ILog antiControlLog = LogManager.GetLogger("AntiControlLog"); private static readonly ILog antiControlLog = LogManager.GetLogger("AntiControlLog");
/// <summary> /// <summary>
...@@ -19,32 +19,32 @@ namespace GcDevicePc.Common ...@@ -19,32 +19,32 @@ namespace GcDevicePc.Common
/// <param name="msg">消息内容</param> /// <param name="msg">消息内容</param>
public static void Info(string msg) public static void Info(string msg)
{ {
if(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.info_log) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.info_log)
logInfo.Info(msg); logInfo.Info(msg);
} }
/// <summary> /// <summary>
/// 记录debug信息(也是依据是否勾选min记录) /// 记录debug信息(也是依据是否勾选min记录)
/// </summary> /// </summary>
public static void DebugInfo(string msg) public static void DebugInfo(string msg)
{ {
if(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.info_log) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.info_log)
debugInfo.Info(msg); debugInfo.Info(msg);
} }
/// <summary> /// <summary>
/// 记录温控debug信息(全局记录) /// 记录运行中错误信息(XA,B,C,D,H,I)
/// </summary> /// </summary>
public static void TempDebugInfo(string msg) public static void WorkErrInfo(string msg)
{ {
tempdebugInfo.Info(msg); workErrInfo.Info(msg);
} }
/// <summary> /// <summary>
/// 记录反控信息(全局记录) /// 记录反控信息(全局记录)
/// </summary> /// </summary>
public static void AntiControlLog(string msg) public static void AntiControlLog(string msg)
{ {
antiControlLog.Info(msg); antiControlLog.Info(msg);
} }
/// <summary> /// <summary>
/// 记录HMI的消息 /// 记录HMI的消息
...@@ -55,7 +55,7 @@ namespace GcDevicePc.Common ...@@ -55,7 +55,7 @@ namespace GcDevicePc.Common
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.hmi_log) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.hmi_log)
hmiInfo.Info(msg); hmiInfo.Info(msg);
} }
/// <summary> /// <summary>
/// 记录异常信息 /// 记录异常信息
/// </summary> /// </summary>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace GcDevicePc.Common
{
class LogHelper
{
private enum ErrorType
{
W = 0, //警告信息
E = 1, //错误信息
I = 2, //普通信息
}
private static string filePath = System.Windows.Forms.Application.StartupPath;
private static string LogOutputFile = filePath + "\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".log";
private static ErrorType errType = LogHelper.ErrorType.I;
private static bool WriteLogToFile(string module, string strlog)
{
try
{
if (File.Exists(LogHelper.LogOutputFile) == false)
{
FileStream fsm = File.Create(LogHelper.LogOutputFile);
if (fsm != null)
fsm.Close();
}
DateTime dt = File.GetCreationTime(LogHelper.LogOutputFile);
dt = dt.AddDays(3);
//删除三天前log信息
if (dt.CompareTo(DateTime.Now) < 0)
{
File.Delete(LogHelper.LogOutputFile);
//File.Create(Log.LogOutputFile);
}
//时间
string inputstr = DateTime.Now.ToString();
inputstr += " ";
//错误类型
inputstr += errType.ToString();
inputstr += " ";
//模块名,只保留20个字符,文本统一
string modulename = "";
if (module.Length >= 20)
modulename = module.Substring(0, 20);
else
{
modulename = module;
do
{
modulename = modulename.Insert(modulename.Length, "-");
}
while (modulename.Length < 20);
}
//modulename = module;
inputstr += modulename;
inputstr += " ";
//log信息
inputstr += strlog;
//FileStream ot = File.OpenWrite(LogOutputFile);
//ot.w
StreamWriter output = File.AppendText(LogHelper.LogOutputFile);
output.WriteLine(inputstr);
//output.
output.Close();
}
catch (Exception)
{
return false;
}
return true;
}
public static bool I(string module, string strlog)
{
LogHelper.errType = ErrorType.I;
return WriteLogToFile(module, strlog);
}
public static bool W(string module, string strlog)
{
LogHelper.errType = ErrorType.W;
return WriteLogToFile(module, strlog);
}
public static bool E(string module, string strlog)
{
LogHelper.errType = ErrorType.E;
return WriteLogToFile(module, strlog);
}
public static void Clear()
{
if (File.Exists(LogHelper.LogOutputFile) == true)
File.Delete(LogHelper.LogOutputFile);
}
}
}
This diff is collapsed.
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace GcDevicePc.Common
{
class SendDataToHW
{
[DllImport(@"HWSendData.dll", EntryPoint = "SendDataToHW")]
public static extern void GCSendDataToHW(Int32 data1, Int32 data2, Int32 data3);
public SendDataToHW()
{
}
~SendDataToHW()
{
}
public void StartSendDataToHW()
{
GCSendDataToHW(1, 0, 1);
GCSendDataToHW(0, 1, 1);
}
public void StopSendDataToHW()
{
GCSendDataToHW(1, 0, 2);
GCSendDataToHW(0, 1, 2);
}
public void SendDataToHW_A(Int32 data)
{
GCSendDataToHW(data, 0, 3);
GCSendDataToHW(0, 0, 4);
}
public void SendDataToHW_B(Int32 data)
{
GCSendDataToHW(0, data, 4);
GCSendDataToHW(0, 0, 3);
}
public void SendDataToHW_AB(Int32 dataA, Int32 dataB)
{
GCSendDataToHW(dataA, dataB, 0);
}
}
}
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
this.datalist.Scrollable = false; this.datalist.Scrollable = false;
this.datalist.UseCompatibleStateImageBehavior = false; this.datalist.UseCompatibleStateImageBehavior = false;
this.datalist.View = System.Windows.Forms.View.Details; this.datalist.View = System.Windows.Forms.View.Details;
this.datalist.Click += new System.EventHandler(this.datalist_Click);
// //
// DataState // DataState
// //
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
[SYSINFO]
ECOUNT=3
[ENTITY0]
ECC=NMTHC,0,3,0,0,0,1,0,0,非数字,4,mV,1000,uV,ppm
ECCD0=1,浓度1,0,,0,,1
ECCD0_Orig0=0,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD1=1,浓度2,0,,0,,1
ECCD1_Orig0=0,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,0,,0,,1
ECCD2_Orig0=0,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,0,,0,,1
ECCD3_Orig0=0,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY1]
ECC=THC,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,200,,47343.28,,1
ECCD0_Orig0=47343.28,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD1=1,浓度2,800,,188311.4,,1
ECCD1_Orig0=188311.4,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,2016,,478659.9,,1
ECCD2_Orig0=478659.9,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,3204,,774391.9,,1
ECCD3_Orig0=774391.9,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY2]
ECC=CH4,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,50,,147851.3,,1
ECCD0_Orig0=147851.3,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD1=1,浓度2,200,,617721.8,,1
ECCD1_Orig0=617721.8,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,504,,1608550,,1
ECCD2_Orig0=1608550,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,801,,2573538,,1
ECCD3_Orig0=2573538,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[SYSINFO]
ECOUNT=3
[ENTITY0]
ECC=NMTHC,0,3,0,0,0,1,0,0,非数字,4,mV,1000,uV,ppm
ECCD0=1,浓度1,0,,0,,1
ECCD0_Orig0=0,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD1=1,浓度2,0,,0,,1
ECCD1_Orig0=0,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,0,,0,,1
ECCD2_Orig0=0,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,0,,0,,1
ECCD3_Orig0=0,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY1]
ECC=THC,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,200,,47343.28,,1
ECCD0_Orig0=47343.28,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD1=1,浓度2,800,,188311.4,,1
ECCD1_Orig0=188311.4,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,2016,,478659.9,,1
ECCD2_Orig0=478659.9,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,3204,,774391.9,,1
ECCD3_Orig0=774391.9,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY2]
ECC=CH4,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,50,,147851.3,,1
ECCD0_Orig0=147851.3,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD1=1,浓度2,200,,617721.8,,1
ECCD1_Orig0=617721.8,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,504,,1608550,,1
ECCD2_Orig0=1608550,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,801,,2573538,,1
ECCD3_Orig0=2573538,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[SYSINFO]
ECOUNT=3
[ENTITY0]
ECC=NMTHC,0,3,0,0,0,1,0,0,非数字,4,mV,1000,uV,ppm
ECCD0=1,浓度1,0,,0,,1
ECCD0_Orig0=0,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD1=1,浓度2,0,,0,,1
ECCD1_Orig0=0,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,0,,0,,1
ECCD2_Orig0=0,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,0,,0,,1
ECCD3_Orig0=0,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY1]
ECC=THC,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,200,,47343.28,,1
ECCD0_Orig0=47343.28,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD1=1,浓度2,800,,188311.4,,1
ECCD1_Orig0=188311.4,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,2016,,478659.9,,1
ECCD2_Orig0=478659.9,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,3204,,774391.9,,1
ECCD3_Orig0=774391.9,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY2]
ECC=CH4,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,50,,147851.3,,1
ECCD0_Orig0=147851.3,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD1=1,浓度2,200,,617721.8,,1
ECCD1_Orig0=617721.8,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,504,,1608550,,1
ECCD2_Orig0=1608550,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,801,,2573538,,1
ECCD3_Orig0=2573538,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[SYSINFO]
ECOUNT=3
[ENTITY0]
ECC=NMTHC,0,3,0,0,0,1,0,0,非数字,4,mV,1000,uV,ppm
ECCD0=1,浓度1,0,,0,,4
ECCD0_Orig0=0,uV*sec,03100912,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100912.raw
ECCD0_Orig0_Orig1=0,,03100914,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100914.raw
ECCD0_Orig0_Orig1_Orig2=0,,03100919,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100919.raw
ECCD0_Orig0_Orig1_Orig2_Orig3=0,,03100921,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100921.raw
ECCD1=1,浓度2,0,,0,,4
ECCD1_Orig0=0,uV*sec,03100941,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100941.raw
ECCD1_Orig0_Orig1=0,,03100939,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100939.raw
ECCD1_Orig0_Orig1_Orig2=0,,03100935,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100935.raw
ECCD1_Orig0_Orig1_Orig2_Orig3=0,,03100933,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100933.raw
ECCD2=1,浓度3,0,,0,,4
ECCD2_Orig0=0,uV*sec,03101000,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101000.raw
ECCD2_Orig0_Orig1=0,,03101002,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101002.raw
ECCD2_Orig0_Orig1_Orig2=0,,03101004,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101004.raw
ECCD2_Orig0_Orig1_Orig2_Orig3=0,,03101006,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101006.raw
ECCD3=1,浓度4,0,,0,,4
ECCD3_Orig0=0,uV*sec,03101039,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101039.raw
ECCD3_Orig0_Orig1=0,,03101042,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101042.raw
ECCD3_Orig0_Orig1_Orig2=0,,03101044,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101044.raw
ECCD3_Orig0_Orig1_Orig2_Orig3=0,,03101048,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101048.raw
[ENTITY1]
ECC=THC,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,200,,45667.52,,4
ECCD0_Orig0=45440.38,uV*sec,03100912,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100912.raw
ECCD0_Orig0_Orig1=46623.32,,03100914,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100914.raw
ECCD0_Orig0_Orig1_Orig2=46529.88,,03100919,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100919.raw
ECCD0_Orig0_Orig1_Orig2_Orig3=44076.48,,03100921,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100921.raw
ECCD1=1,浓度2,800,,179486.3,,4
ECCD1_Orig0=182459,uV*sec,03100941,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100941.raw
ECCD1_Orig0_Orig1=178131.5,,03100939,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100939.raw
ECCD1_Orig0_Orig1_Orig2=180159.4,,03100935,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100935.raw
ECCD1_Orig0_Orig1_Orig2_Orig3=177195.2,,03100933,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100933.raw
ECCD2=1,浓度3,2004,,476949.6,,4
ECCD2_Orig0=487498.3,uV*sec,03101000,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101000.raw
ECCD2_Orig0_Orig1=463501.3,,03101002,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101002.raw
ECCD2_Orig0_Orig1_Orig2=470798.7,,03101004,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101004.raw
ECCD2_Orig0_Orig1_Orig2_Orig3=486000.3,,03101006,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101006.raw
ECCD3=1,浓度4,3200,,763239.6,,4
ECCD3_Orig0=734724.4,uV*sec,03101039,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101039.raw
ECCD3_Orig0_Orig1=777362.8,,03101042,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101042.raw
ECCD3_Orig0_Orig1_Orig2=772691.5,,03101044,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101044.raw
ECCD3_Orig0_Orig1_Orig2_Orig3=768179.6,,03101048,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101048.raw
[ENTITY2]
ECC=CH4,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,50,,146780.4,,4
ECCD0_Orig0=146399.5,uV*sec,03100912,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100912.raw
ECCD0_Orig0_Orig1=145990.8,,03100914,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100914.raw
ECCD0_Orig0_Orig1_Orig2=149145.3,,03100919,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100919.raw
ECCD0_Orig0_Orig1_Orig2_Orig3=145586.1,,03100921,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100921.raw
ECCD1=1,浓度2,200,,593191.1,,4
ECCD1_Orig0=594257.6,uV*sec,03100941,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100941.raw
ECCD1_Orig0_Orig1=591262.8,,03100939,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100939.raw
ECCD1_Orig0_Orig1_Orig2=581841.9,,03100935,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100935.raw
ECCD1_Orig0_Orig1_Orig2_Orig3=605402.3,,03100933,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03100933.raw
ECCD2=1,浓度3,501,,1560436,,4
ECCD2_Orig0=1587066,uV*sec,03101000,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101000.raw
ECCD2_Orig0_Orig1=1567609,,03101002,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101002.raw
ECCD2_Orig0_Orig1_Orig2=1520456,,03101004,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101004.raw
ECCD2_Orig0_Orig1_Orig2_Orig3=1566613,,03101006,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101006.raw
ECCD3=1,浓度4,800,,2498467,,4
ECCD3_Orig0=2550550,uV*sec,03101039,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101039.raw
ECCD3_Orig0_Orig1=2517532,,03101042,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101042.raw
ECCD3_Orig0_Orig1_Orig2=2390662,,03101044,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101044.raw
ECCD3_Orig0_Orig1_Orig2_Orig3=2535124,,03101048,G:\调试数据\0310\Debug\RowData\2017年\03月\10日\03101048.raw
[SYSINFO]
ECOUNT=3
[ENTITY0]
ECC=NMTHC,0,3,0,0,0,1,0,0,非数字,4,mV,1000,uV,ppm
ECCD0=1,浓度1,0,,0,,3
ECCD0_Orig0=0,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD0_Orig1=0,,02090912,G:\调试数据\1.15\2017年\02月\09日\02090912.raw
ECCD0_Orig2=0,,01150006,G:\调试数据\1.15\2017年\01月\15日\01150006.raw
ECCD1=1,浓度2,0,,0,,1
ECCD1_Orig0=0,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,0,,0,,1
ECCD2_Orig0=0,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,0,,0,,1
ECCD3_Orig0=0,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY1]
ECC=THC,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,200,,16361.06,,3
ECCD0_Orig0=47343.28,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD0_Orig1=694.44,,02090912,G:\调试数据\1.15\2017年\02月\09日\02090912.raw
ECCD0_Orig2=1045.45,,01150006,G:\调试数据\1.15\2017年\01月\15日\01150006.raw
ECCD1=1,浓度2,800,,188311.4,,1
ECCD1_Orig0=188311.4,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,2016,,478659.9,,1
ECCD2_Orig0=478659.9,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,3204,,774391.9,,1
ECCD3_Orig0=774391.9,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY2]
ECC=CH4,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,50,,53625.51,,3
ECCD0_Orig0=147851.3,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD0_Orig1=6265.88,,02090912,G:\调试数据\1.15\2017年\02月\09日\02090912.raw
ECCD0_Orig2=6759.36,,01150006,G:\调试数据\1.15\2017年\01月\15日\01150006.raw
ECCD1=1,浓度2,200,,617721.8,,1
ECCD1_Orig0=617721.8,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,504,,1608550,,1
ECCD2_Orig0=1608550,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,801,,2573538,,1
ECCD3_Orig0=2573538,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[SYSINFO]
ECOUNT=3
[ENTITY0]
ECC=NMTHC,0,3,0,0,0,1,0,0,非数字,4,mV,1000,uV,ppm
ECCD0=1,浓度1,0,,0,,3
ECCD0_Orig0=0,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD0_Orig1=0,,02090912,G:\调试数据\1.15\2017年\02月\09日\02090912.raw
ECCD0_Orig2=0,,01150006,G:\调试数据\1.15\2017年\01月\15日\01150006.raw
ECCD1=1,浓度2,0,,0,,1
ECCD1_Orig0=0,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,0,,0,,1
ECCD2_Orig0=0,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,0,,0,,1
ECCD3_Orig0=0,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY1]
ECC=THC,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,200,,16361.06,,3
ECCD0_Orig0=47343.28,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD0_Orig1=694.44,,02090912,G:\调试数据\1.15\2017年\02月\09日\02090912.raw
ECCD0_Orig2=1045.45,,01150006,G:\调试数据\1.15\2017年\01月\15日\01150006.raw
ECCD1=1,浓度2,800,,188311.4,,1
ECCD1_Orig0=188311.4,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,2016,,478659.9,,1
ECCD2_Orig0=478659.9,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,3204,,774391.9,,1
ECCD3_Orig0=774391.9,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
[ENTITY2]
ECC=CH4,0,3,0,0,0,0,0,0,1,4,mV,1000,uV,ppm
ECCD0=1,浓度1,50,,53625.51,,3
ECCD0_Orig0=147851.3,uV*sec,50ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\50ppm.raw
ECCD0_Orig1=6265.88,,02090912,G:\调试数据\1.15\2017年\02月\09日\02090912.raw
ECCD0_Orig2=6759.36,,01150006,G:\调试数据\1.15\2017年\01月\15日\01150006.raw
ECCD1=1,浓度2,200,,617721.8,,1
ECCD1_Orig0=617721.8,uV*sec,200ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\200ppm.raw
ECCD2=1,浓度3,504,,1608550,,1
ECCD2_Orig0=1608550,uV*sec,504ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\504ppm.raw
ECCD3=1,浓度4,801,,2573538,,1
ECCD3_Orig0=2573538,uV*sec,801ppm,G:\调试数据\0224\800-200-500-50\Debug\RowData\801ppm.raw
This diff is collapsed.
【2017-02-27 10:39:51.5939】,系统初始化成功
【2017-03-09 14:58:31.1156】,系统初始化成功
【2017-03-09 15:06:21.1755】,系统初始化成功
【2017-03-09 16:00:36.5557】,系统初始化成功
【2017-03-09 16:05:49.6836】,系统初始化成功
【2017-03-10 10:50:13.2249】,系统初始化成功
【2017-03-10 10:51:08.0940】,系统初始化成功
【2017-03-10 11:00:58.5338】,系统初始化成功
【2017-03-10 11:02:15.7452】,系统初始化成功
【2017-03-10 11:04:27.5167】,系统初始化成功
【2017-03-10 11:07:08.9040】,系统初始化成功
【2017-03-10 11:07:23.2528】,系统初始化成功
【2017-03-10 11:09:52.7763】,系统初始化成功
【2017-03-13 09:58:23.9069】,系统初始化成功
【2017-03-13 10:00:17.6294】,系统初始化成功
【2017-03-13 10:32:22.3275】,系统初始化成功

namespace GcDevicePc
{
partial class ErrorLogForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.listView2 = new System.Windows.Forms.ListView();
this.listView1 = new System.Windows.Forms.ListView();
this.textBox1 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.listView2);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.textBox1);
this.splitContainer1.Panel2.Controls.Add(this.listView1);
this.splitContainer1.Size = new System.Drawing.Size(800, 450);
this.splitContainer1.SplitterDistance = 226;
this.splitContainer1.TabIndex = 1;
//
// listView2
//
this.listView2.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView2.HideSelection = false;
this.listView2.Location = new System.Drawing.Point(0, 0);
this.listView2.Name = "listView2";
this.listView2.Size = new System.Drawing.Size(226, 450);
this.listView2.TabIndex = 0;
this.listView2.UseCompatibleStateImageBehavior = false;
this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
//
// listView1
//
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(0, 0);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(570, 450);
this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(401, 271);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 21);
this.textBox1.TabIndex = 1;
//
// ErrorLogForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.splitContainer1);
this.Name = "ErrorLogForm";
this.Text = "ErrorLogForm";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ListView listView2;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.TextBox textBox1;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TTControl;
namespace GcDevicePc
{
public partial class ErrorLogForm : Form
{
private static string path = Path.Combine(IOOperations.GetParentFolder(Application.StartupPath), "GC_User\\Logs");
public ErrorLogForm()
{
InitializeComponent();
listView1.View = View.Details;
listView1.FullRowSelect = true;
UpdateUI(-1);
IOOperations.DocumentMonitoring(path, "*.txt", this,OnChanged,OnRenamed);
}
/// <summary>
/// 上次索引
/// </summary>
int oldindex = 0;
/// <summary>
/// 更新UI
/// </summary>
/// <param name="pos"></param>
private void UpdateUI(int pos)
{
//获取所有日志文件
Dictionary<string, string> allfile = new Dictionary<string, string>();
DirectoryInfo root = new DirectoryInfo(path);
FileInfo[] files = root.GetFiles();
foreach (var item in files)
{
if (item.Name.Contains("WorkErrInfo_"))
{
allfile.Add(item.Name, item.FullName);
}
}
this.SuspendLayout();
//更新左侧列表
listView2.Items.Clear();
foreach (var item in allfile)
{
ListViewItem listViewItem = new ListViewItem(item.Key);
listViewItem.Tag = item.Value;
listView2.Items.Add(listViewItem);
}
//读取选中日志文件
string[] data = default;
if (listView2.Items.Count > pos&&pos>-1)
{
listView2.Items[pos].Selected = true;
data = File.ReadAllLines(listView2.Items[pos].Tag.ToString());
}
else
{
if (listView2.Items.Count != 0)
{
listView2.Items[0].Selected = true;
data = File.ReadAllLines(listView2.Items[0].Tag.ToString());
}
}
//更新右侧列表
listView1.Items.Clear();
if (listView1.Columns.Count == 0)
{
//错误标题%错误内容%错误发生时仪器状态%错误发生后仪器处理"
listView1.Columns.AddRange(new ColumnHeader[] {
new ColumnHeader { Text = "错误标题", Width = listView1.Width/5-5,TextAlign= HorizontalAlignment.Center },
new ColumnHeader { Text ="错误内容", Width = listView1.Width/5-4,TextAlign= HorizontalAlignment.Center },
new ColumnHeader { Text ="错误发生时仪器状态", Width = listView1.Width/5-3,TextAlign= HorizontalAlignment.Center },
new ColumnHeader { Text = "错误发生后仪器处理", Width = listView1.Width/5-2,TextAlign= HorizontalAlignment.Center }, });
}
if (data != null)
{
foreach (var item in data)
{
//0=错误标题%1=错误内容%2=错误发生时仪器状态%3=错误发生后仪器处理"
string[]curdata=item.Split('%');
if (curdata.Length!=4)
{
continue ;
}
ListViewItem listViewItem = new ListViewItem();
listView1.Items.Add(listViewItem);
listViewItem.Text =curdata[0];
listViewItem.SubItems.Add(curdata[1]);
Button button = new Button();
button.Text = "当时状态";
button.Enabled = true;
button.AutoSize = true;
button.Click+=new EventHandler((object sender, EventArgs e)=> { PreviewAllStatuses(curdata[2]);});
Tool.ListViewAddControl(listView1, listView1.Items.Count - 1, 2, button);
listViewItem.SubItems.Add(curdata[4]);
}
}
this.ResumeLayout();
}
/// <summary>
/// 扩展显示
/// </summary>
/// <param name="value"></param>
private void PreviewAllStatuses(string value)
{
TextBox textBox=new TextBox();
textBox.Multiline=true;
textBox.Text=value;
Tool.ListViewPopUp(listView1,textBox);
}
/// <summary>
/// 监控更改,创建,删除触发事件
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
private void OnChanged(object source, FileSystemEventArgs e)
{
UpdateUI(oldindex);
}
/// <summary>
/// 监控重命名触发事件
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
private void OnRenamed(object source, RenamedEventArgs e)
{
UpdateUI(oldindex);
}
/// <summary>
/// 记录上次索引
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void listView2_SelectedIndexChanged(object sender, EventArgs e)
{
oldindex = listView2.SelectedIndices[0];
//日志还未写完
}
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WindowsFormsControlLibrary_PopUp;
namespace GcDevicePc.ExpansionMethod
{
public static class SelfAdaption
{
public static Point NewSize(this UserControl_PopUp UserControl_PopUp1, Size oldSize, Size newSize, Point oldtextPoint)
{
double scale = 0;
Point location = new Point();
scale = (double)((double)newSize.Height / (double)oldSize.Height);
location.Y = (int)(oldtextPoint.Y * scale)+newSize.Height*2/3;
scale = (double)((double)newSize.Width / (double)oldSize.Width);
location.X = (int)(oldtextPoint.X * scale);
return location;
}
}
}
namespace GcDevicePc
{
partial class Form5
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "Form5";
}
#endregion
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace GcDevicePc
{
public partial class Form5 : GcDevicePc.Form4
{
public Form5()
{
InitializeComponent();
}
}
}
...@@ -28,9 +28,13 @@ ...@@ -28,9 +28,13 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormUser)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormUser));
this.buttonFID = new System.Windows.Forms.Button(); this.buttonFID = new System.Windows.Forms.Button();
this.buttonauto = new System.Windows.Forms.Button(); this.buttonauto = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.infoBarUser1 = new GcDevicePc.CK_UI.InfoBarUser(); this.infoBarUser1 = new GcDevicePc.CK_UI.InfoBarUser();
this.userCtl1 = new GcDevicePc.CK_UI.UserCtl(); this.userCtl1 = new GcDevicePc.CK_UI.UserCtl();
this.SuspendLayout(); this.SuspendLayout();
...@@ -49,6 +53,22 @@ ...@@ -49,6 +53,22 @@
this.buttonauto.UseVisualStyleBackColor = true; this.buttonauto.UseVisualStyleBackColor = true;
this.buttonauto.Click += new System.EventHandler(this.buttonauto_Click); this.buttonauto.Click += new System.EventHandler(this.buttonauto_Click);
// //
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// infoBarUser1 // infoBarUser1
// //
resources.ApplyResources(this.infoBarUser1, "infoBarUser1"); resources.ApplyResources(this.infoBarUser1, "infoBarUser1");
...@@ -64,6 +84,8 @@ ...@@ -64,6 +84,8 @@
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.infoBarUser1); this.Controls.Add(this.infoBarUser1);
this.Controls.Add(this.buttonauto); this.Controls.Add(this.buttonauto);
this.Controls.Add(this.buttonFID); this.Controls.Add(this.buttonFID);
...@@ -74,6 +96,7 @@ ...@@ -74,6 +96,7 @@
this.Deactivate += new System.EventHandler(this.FormUser_Deactivate); this.Deactivate += new System.EventHandler(this.FormUser_Deactivate);
this.Load += new System.EventHandler(this.FormUser_Load); this.Load += new System.EventHandler(this.FormUser_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
...@@ -84,5 +107,8 @@ ...@@ -84,5 +107,8 @@
private System.Windows.Forms.Button buttonFID; private System.Windows.Forms.Button buttonFID;
private System.Windows.Forms.Button buttonauto; private System.Windows.Forms.Button buttonauto;
private CK_UI.InfoBarUser infoBarUser1; private CK_UI.InfoBarUser infoBarUser1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Timer timer1;
} }
} }
\ No newline at end of file
...@@ -23,8 +23,13 @@ namespace GcDevicePc ...@@ -23,8 +23,13 @@ namespace GcDevicePc
private void FormUser_Load(object sender, EventArgs e) private void FormUser_Load(object sender, EventArgs e)
{ {
// userCtl1.Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype; // userCtl1.Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype;
if (!MDIBase.bEnableTempHumi)
{
//不显示温湿度
label1.Enabled=false;
label2.Enabled=false;
}
} }
private void FormUser_Activated(object sender, EventArgs e) //激活 private void FormUser_Activated(object sender, EventArgs e) //激活
...@@ -128,5 +133,11 @@ namespace GcDevicePc ...@@ -128,5 +133,11 @@ namespace GcDevicePc
{ {
Radjust(t); Radjust(t);
} }
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text=$"环境温度:{globaldata.m_dpbuffer.ShowList.showtemp.AmbientTemp.ToString("#0.0")}";
label2.Text=$"环境湿度:{globaldata.m_dpbuffer.ShowList.showtemp.AmbientHumidity.ToString("#0.0")}";
}
} }
} }
This diff is collapsed.
...@@ -12,6 +12,7 @@ using GcDevicePc.Common; ...@@ -12,6 +12,7 @@ using GcDevicePc.Common;
using GcDevicePc.IniParam; using GcDevicePc.IniParam;
using System.Threading; using System.Threading;
using System.Globalization; using System.Globalization;
using CKVocAnalyzer;
namespace GcDevicePc namespace GcDevicePc
{ {
...@@ -23,7 +24,22 @@ namespace GcDevicePc ...@@ -23,7 +24,22 @@ namespace GcDevicePc
CurveDisPlay curdisplay = new CurveDisPlay(); CurveDisPlay curdisplay = new CurveDisPlay();
CurveDisPlay2 curdisplay2 = new CurveDisPlay2(); CurveDisPlay2 curdisplay2 = new CurveDisPlay2();
CurveDisPlay3 curdisplay3 = new CurveDisPlay3(); CurveDisPlay3 curdisplay3 = new CurveDisPlay3();
/// <summary>
/// 为兼容对数带来的新单位,开放组分单位修改,.往下更新
/// </summary>
/// <param name="unit1"></param>
/// <param name="unit2"></param>
/// <param name="unit3"></param>
public void ChangeParameterUnit(string unit, int index)
{
switch (index)
{
case 0: CurveDisPlay.curdisp.ChangeParameterUnit(unit); break;
case 1: CurveDisPlay2.curdisp2.ChangeParameterUnit(unit); break;
case 2: CurveDisPlay3.curdisp3.ChangeParameterUnit(unit); break;
default:break;
}
}
DataState dataleft = new DataState();//右侧状态显示窗口 DataState dataleft = new DataState();//右侧状态显示窗口
private bool bEnglishLanguage = (Thread.CurrentThread.CurrentUICulture == CultureInfo.GetCultureInfo("en")) ? true : false; private bool bEnglishLanguage = (Thread.CurrentThread.CurrentUICulture == CultureInfo.GetCultureInfo("en")) ? true : false;
public Formdebug() public Formdebug()
...@@ -176,15 +192,15 @@ namespace GcDevicePc ...@@ -176,15 +192,15 @@ namespace GcDevicePc
if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1) if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
{ {
Console.WriteLine("绘图show"); Console.WriteLine("绘图show");
this.dockPanel1.Contains(curdisplay); this.dockPanel1.Contains(curdisplay);
curdisplay.Show(this.dockPanel1); curdisplay.Show(this.dockPanel1);
// CurveDisPlay.nMHCCal=CurveDisPlay.curdisp.nMHCCal; // CurveDisPlay.nMHCCal=CurveDisPlay.curdisp.nMHCCal;
curdisplay.CloseButtonVisible = false; curdisplay.CloseButtonVisible = false;
} }
else else
{ {
curdisplay.Dispose(); curdisplay.Dispose();
} }
......
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GcDevicePc.GCBuffer
{
class DPBuffer
{
public struct TiemInfo
{
public ushort runtimenow;
public ushort alltime;
}
public struct TempInfo
{
//前进样口
public float FPActualTemp;
public float FPSetTemp;
//后进样口
public float BPActualTemp;
public float BPSetTemp;
//柱箱
public float ColActualTemp;
public float ColSetTemp;
//前检测器
public float fDetActualTemp;
public float fDetSetTemp;
//中检测器
public float iDetActualTemp;
public float iDetSetTemp;
//后检测器
public float bDetActualTemp;
public float bDetSetTemp;
//辅助Aux1
public float AuxActualTemp1;
public float AuxSetTemp1;
//辅助Aux2
public float AuxActualTemp2;
public float AuxSetTemp2;
}
public struct valvetime
{
public float start1;
public float end1;
public float start2;
public float end2;
public float start3;
public float end3;
public float start4;
public float end4;
}
public struct ValveShowInfo
{
public bool u16ValveOne; //阀开关状态
public valvetime ValveOneTime; //时间
public bool u16ValveTwo; //阀开关状态
public valvetime ValveTwoTime; //时间
public bool u16ValveThree; //阀开关状态
public valvetime ValveThreeTime;//时间
public bool u16ValveFour; //阀开关状态
public valvetime ValveFourTime; //时间
}
public struct ISportInfo
{
public float fallpressure;
public float fpressure1;
public float fpressure2;
public float fpressure3;
public float ballpressure;
public float bpressure1;
public float bpressure2;
public float bpressure3;
}
public struct DetInfo
{
public bool fDetSwitch; //点火状态
public float fDetValue; //信号值
public ushort fDetPol; //档位
public bool iDetSwitch;
public float iDetValue;
public ushort iDetPol;
public bool bDetSwitch;
public float bDetValue;
public ushort bDetPol;
}
public struct ShowInfo
{
public TiemInfo showtime;
public TempInfo showtemp;
public ValveShowInfo showValve;
public ISportInfo showISport;
public DetInfo showDet;
}
public ShowInfo ShowList = new ShowInfo();
public DPBuffer()
{
}
~DPBuffer()
{
}
}
}
...@@ -49,10 +49,14 @@ namespace GcDevicePc.GCBuffer ...@@ -49,10 +49,14 @@ namespace GcDevicePc.GCBuffer
public ushort[] HMIMac; public ushort[] HMIMac;
/////////////////////////////////////// /// <summary>
public ushort[] EPCStatus;//epc状态 /// epc状态
/// </summary>
public ushort[] HmiAbnormal;//hmi异常报警 public ushort[] EPCStatus;
/// <summary>
/// hmi异常报警{XA超过温度配置,XB超过设定温度一定阈值,XC检测器信号,XD升温速率低于阈值,XE环境温度,XF环境湿度}
/// </summary>
public ushort[] HmiAbnormal;
} }
public hmiinfo gcinfo = new hmiinfo(); public hmiinfo gcinfo = new hmiinfo();
...@@ -89,7 +93,7 @@ namespace GcDevicePc.GCBuffer ...@@ -89,7 +93,7 @@ namespace GcDevicePc.GCBuffer
gcinfo.hmioffline = false; gcinfo.hmioffline = false;
gcinfo.HMIMac = new ushort[3] { 0, 0, 0 }; gcinfo.HMIMac = new ushort[3] { 0, 0, 0 };
gcinfo.EPCStatus = new ushort[48] ; gcinfo.EPCStatus = new ushort[48] ;
gcinfo.HmiAbnormal = new ushort[4] { 0, 0, 0 ,0}; gcinfo.HmiAbnormal = new ushort[11] { 0, 0, 0 ,0,0,0, 0, 0 ,0,0,0};
gcadjust.executefun = 0; gcadjust.executefun = 0;
gcadjust.executestat = 0; gcadjust.executestat = 0;
...@@ -105,9 +109,13 @@ namespace GcDevicePc.GCBuffer ...@@ -105,9 +109,13 @@ namespace GcDevicePc.GCBuffer
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini"); string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
#endif #endif
INIOperation test = new INIOperation(file); INIOperation test = new INIOperation(file);
string myMAC = test.INIGetStringValue("NetWorkConfig", "MAC地址", null); string myMAC = test.INIGetStringValue("NetWorkConfig", "MAC地址", "");
try try
{ {
if (myMAC=="")
{
return ;
}
byte[] sMac = new byte[6]; byte[] sMac = new byte[6];
string[] sMAC = myMAC.Split(':'); string[] sMAC = myMAC.Split(':');
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
......
This diff is collapsed.
This diff is collapsed.
...@@ -227,6 +227,15 @@ namespace GcDevicePc.GCBuffer ...@@ -227,6 +227,15 @@ namespace GcDevicePc.GCBuffer
int fi = ini.ReadInteger("StartUp", "Forceintegral"); int fi = ini.ReadInteger("StartUp", "Forceintegral");
//string unit = ini.ReadString("StartUp", "Unit"); //string unit = ini.ReadString("StartUp", "Unit");
string zbname = ini.ReadString("StartUp", "TdName"); string zbname = ini.ReadString("StartUp", "TdName");
if (ini.ReadString("StartUp", "信号获取方式")=="")
{
globaldata.SignalAcquisition="Modbus";
}
else
{
globaldata.SignalAcquisition=ini.ReadString("StartUp", "信号获取方式");
}
globaldata.ZbName = zbname; globaldata.ZbName = zbname;
globaldata.UserName = uname; globaldata.UserName = uname;
globaldata.UserPwd = upwd; globaldata.UserPwd = upwd;
......
This diff is collapsed.
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace GcDevicePc
{
class GCStatusReq
{
//Thread GC_Run_Status;
//Thread GC_Connect_Status;
public void Get_GCRun_Status( ref UInt16 []GCRunStatus)
{
if(globaldata.connection_ip != null)
globaldata.m_modbus.ReadHoldingReg(144, 8, globaldata.connection_ip, globaldata.datamodbusport, ref GCRunStatus);
}
}
}
test
0;test;2016/9/10 13:15:05
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Vocs_opt @ a108d43a
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment