Commit 06c79fd5 authored by liu's avatar liu

主要将libmodbus slave改用nmodbus4 slave 用以解决modbus slave组分输出时间过程卡住的问题,其次修改了自定义控件实施谱图上单位显示问题和增加了多网口时可选择

parent edc81683
......@@ -5,12 +5,12 @@ VisualStudioVersion = 15.0.27428.2002
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GcDevicePc", "GcDevicePc\GcDevicePc.csproj", "{BBCD58CB-247D-4108-A135-F36F8ABA3289}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "VocAnalyzer", "VocAnalyzer\VocAnalyzer.vdproj", "{8260B9BB-618D-42C5-9F82-9881AD0B65FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedSpace", "SharedSpace\SharedSpace.csproj", "{5498F944-5721-461B-B07F-3105EF0BF643}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VocsMonitor", "VocsMonitor\VocsMonitor\VocsMonitor.csproj", "{25AB743D-235C-4F11-96C3-2356AC90BF81}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "VocAnalyzer", "VocAnalyzer\VocAnalyzer.vdproj", "{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -33,12 +33,6 @@ Global
{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.Build.0 = Release|x86
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Debug|Any CPU.ActiveCfg = Debug
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Debug|Mixed Platforms.ActiveCfg = Debug
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Debug|x86.ActiveCfg = Debug
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Release|Any CPU.ActiveCfg = Release
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Release|Mixed Platforms.ActiveCfg = Release
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Release|x86.ActiveCfg = Release
{5498F944-5721-461B-B07F-3105EF0BF643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5498F944-5721-461B-B07F-3105EF0BF643}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
......@@ -61,6 +55,18 @@ Global
{25AB743D-235C-4F11-96C3-2356AC90BF81}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{25AB743D-235C-4F11-96C3-2356AC90BF81}.Release|x86.ActiveCfg = Release|Any CPU
{25AB743D-235C-4F11-96C3-2356AC90BF81}.Release|x86.Build.0 = Release|Any CPU
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Debug|Any CPU.ActiveCfg = Debug
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Debug|Any CPU.Build.0 = Debug
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Debug|Mixed Platforms.ActiveCfg = Debug
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Debug|Mixed Platforms.Build.0 = Debug
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Debug|x86.ActiveCfg = Debug
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Debug|x86.Build.0 = Debug
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Release|Any CPU.ActiveCfg = Release
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Release|Any CPU.Build.0 = Release
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Release|Mixed Platforms.ActiveCfg = Release
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Release|Mixed Platforms.Build.0 = Release
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Release|x86.ActiveCfg = Release
{9A8B92E2-7CFA-43AE-8EC6-561827F41EF4}.Release|x86.Build.0 = Release
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -42,7 +42,7 @@ namespace GcDevicePc
this.fid1ver.Text = this.FID1version;
this.fid2ver.Text = this.FID2version;
this.tcdver.Text = this.TCD1version;
this.PCver.Text = this.Hmiversion + "/1.4.8";
this.PCver.Text = this.Hmiversion + "/1.4.9";
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<legacyUnhandledExceptionPolicy enabled="true"/>
<legacyUnhandledExceptionPolicy enabled="true" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.104.0" newVersion="1.0.104.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<log4net>
......
......@@ -316,7 +316,7 @@
// if (hmicount >= 1)
// {
// ip = (((globaldata.DeviceInfo) (mysearch.myHMIList[0])).IpAddr);
// globaldata.connection_ip = ip;
//globaldata.connection_ip = ip;
// mysearch.ThStop();
// break;
// }
......@@ -416,7 +416,7 @@ namespace GcDevicePc
/// </summary>
public void InitDeviceInfo()
{
int checkflag = 0;
//int checkflag = 0;
int ret = 0;
int initret = 0;
......@@ -650,7 +650,7 @@ namespace GcDevicePc
"RunMethod.ini"
};
int checkflag = 0;
//int checkflag = 0;
int ret = 0;
int initret = 0;
......@@ -782,10 +782,20 @@ namespace GcDevicePc
{
try
{
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
INIOperation test = new INIOperation(file);
string Meshport = test.INIGetStringValue("NetWorkConfig", "网口", null);
if (string.IsNullOrEmpty(Meshport))
{
Meshport = "本地连接";
}
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics)
{
if (adapter.Name == "本地连接")
if (adapter.Name == Meshport)
{
bool pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet || adapter.NetworkInterfaceType == NetworkInterfaceType.Wireless80211);
if (pd1)
......@@ -795,7 +805,11 @@ namespace GcDevicePc
foreach (UnicastIPAddressInformation ipadd in ipCollection)
{
if (ipadd.Address.AddressFamily == AddressFamily.InterNetwork)
{
localip = ipadd.Address.ToString();
globaldata.myIpaddr = ipadd.Address;
}
}
if (!String.IsNullOrEmpty(localip))
......
......@@ -39,7 +39,7 @@
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "CurveDisPlay";
this.Text = "实时图谱";
this.Text = "实时谱图";
this.ResumeLayout(false);
}
......
......@@ -275,10 +275,12 @@ namespace GcDevicePc.CK_UI
}
else
{//此处计算成mg/m3 nmhc
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listNmoc[listNmoc.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listNmoc[listNmoc.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox1.BackColor = waringcolor;
}
......@@ -294,7 +296,9 @@ namespace GcDevicePc.CK_UI
}
else
{
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listTHC[listTHC.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
......@@ -315,7 +319,9 @@ namespace GcDevicePc.CK_UI
}
else
{
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listCH4[listCH4.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
......@@ -404,7 +410,9 @@ namespace GcDevicePc.CK_UI
}
else
{
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listNmoc[listNmoc.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
......@@ -423,7 +431,9 @@ namespace GcDevicePc.CK_UI
}
else
{
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listTHC[listTHC.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
......@@ -442,7 +452,9 @@ namespace GcDevicePc.CK_UI
}
else
{
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listCH4[listCH4.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
......@@ -462,7 +474,9 @@ namespace GcDevicePc.CK_UI
}
else
{
textBox4.Text = Math.Round(listben[listben.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox4.Text = Math.Round(listben[listben.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listben[listben.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
......@@ -481,7 +495,9 @@ namespace GcDevicePc.CK_UI
}
else
{
textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listjiaben[listjiaben.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
......@@ -500,7 +516,9 @@ namespace GcDevicePc.CK_UI
}
else
{
textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listerjiaben[listerjiaben.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
......
......@@ -4,6 +4,12 @@ using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using GcDevicePc.IniParam;
using Modbus.Device;
using System.Net;
using System.Data;
using System.Net.Sockets;
using Modbus.Data;
using System.Threading;
namespace GcDevicePc.Common
{
......@@ -43,7 +49,7 @@ namespace GcDevicePc.Common
{
}
}
~GCModbusSlave()
......@@ -51,7 +57,10 @@ namespace GcDevicePc.Common
try
{
fnLibModbusSlaveClose(hModbusHandle);
}catch
//slave.Dispose();
}
catch
{
}
......@@ -63,6 +72,9 @@ namespace GcDevicePc.Common
try
{
ret = fnLibModbusSlaveClose(hModbusHandle);
//slave.Dispose();
}
catch
{
......@@ -72,11 +84,14 @@ namespace GcDevicePc.Common
return ret;
}
public void CModbusSlaveInit(ushort hstartaddr, ushort hnreg, ushort cstartaddr, ushort cnreg)
{
setHoldingRegisterFunc(hstartaddr, hnreg);
//setHoldingRegisterFunc(hstartaddr, hnreg);
setCoilsRegisterFunc(cstartaddr, cnreg);
}
SlaveReadHoldingRegister MySlaveReadHoldingRegister;
......@@ -123,7 +138,8 @@ namespace GcDevicePc.Common
f[0] = float.Parse(SharedSpace.Data.listValue[readnum].vale.ToString());
Buffer.BlockCopy(f, 2, s, 0, 2);
Buffer.BlockCopy(f, 0, s, 2, 2);
value = s[(address - baseaddress) % 2];
//value = s[(address - baseaddress) % 2];
value = address;
}
else
{
......@@ -687,10 +703,5 @@ namespace GcDevicePc.Common
{
//Console.WriteLine("MoudbusSlave Wirte adder:" + address.ToString() + " value:" + value.ToString());
}
}
}
......@@ -68,7 +68,6 @@ namespace GcDevicePc.Common
return ret;
}
public void CModbusSlave485Init(ushort hstartaddr, ushort hnreg, ushort cstartaddr, ushort cnreg)
{
setHoldingRegisterFunc(hstartaddr, hnreg);
......
This diff is collapsed.
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GcDevicePc.Common
{
class TWFile
{
private string filename = "default.hw";
private FileStream twfsopen;
public BinaryWriter bw;
private String head = "HW Data Fi03\n";
private byte[] headdata;
private byte[] enddata = new byte[]
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x1E,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x40,0x0D,0x03,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x62,0xC5,0xF2,0x59,
0x05,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1A,0x4F,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x3F,0x00,0x00,0x80,0x3F,
0x00,0x00,0x80,0x3F,0x00,0x00,0x80,0x3F,0x00,0x00,0xE0,0x74,0xFE,0x02,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x86,0x32,0x31,0x33,0x3A,0x33,0x36,0x36,0x36,0x3A,
0x40,0x2A,0x3C,0x3F,0x47,0x41,0x43,0x4A,0x43,0x48,0x1C,0x87,0x89,0x77,0x89,0x8C,
0x7E,0x7E,0x3B,0x7D,0x80,0x8F,0x94,0x89,0x94,0x8B,0x97,0x8D,0x94,0x94,0x47,0x9F,
0x92,0x9E,0x93,0x4C,0xA0,0x93,0xA1,0x99,0x92,0x9E,0x53,0xA2,0xAA,0xA3,0x99,0x9D,
0xAB,0x5A,0x6B,0x6C,0x6D,0x6E,0x6F,0x71,0x4B,0x74,0x73,0x75,0x7C,0x75,0x78,0x78,
0x78,0x7C,0x82,0x6C,0x7E,0x81,0x89,0x83,0x85,0x8C,0x85,0x8A,0x5E,0xC8,0xBC,0xC1,
0xC0,0xC3,0xCE,0xC5,0xD1,0xC3,0xC3,0x80,0xC3,0xDB,0x83,0xD8,0xCA,0xD3,0xD7,0xD7,
0xDB,0xCB,0xDD,0xE5,0x95,0x97,0x9B,0x90,0xE4,0xEB,0xE6,0xE8,0xDA,0xE3,0x97,0xD9,
0xDD,0xE7,0xE4,0xEA,0xE6,0xF1,0xF3,0xF2,0xE2,0xF6,0xF2,0xF6,0x8F,0x00,0x00,0x00,
0x00
};
public TWFile(string file)
{
this.filename = file;
if (File.Exists(filename))
{
File.Delete(filename);
}
FileStream twfs = new FileStream(filename, FileMode.Create);
twfs.Close();
headdata = System.Text.Encoding.ASCII.GetBytes(head);
}
public void TW_Open()
{
twfsopen = new FileStream(filename, FileMode.OpenOrCreate);
bw = new BinaryWriter(twfsopen);
bw.Write(headdata);
bw.Write(0);
}
public void TW_Close(int datanum)
{
int i;
for (i = 0; i < enddata.Length; i++ )
{
bw.Write(enddata[i]);
}
bw.Seek(headdata.Length, SeekOrigin.Begin);
bw.Write(datanum);
bw.Close();
twfsopen.Close();
}
}
}
......@@ -473,7 +473,6 @@ namespace GcDevicePc.ConfigMethod
if (pagenum > 0)
{
foreach (TabPage tabPage in tabControlDet.TabPages)
{
this.tabControlDet.TabPages.Remove(tabPage);
......@@ -493,7 +492,6 @@ namespace GcDevicePc.ConfigMethod
Page.UseVisualStyleBackColor = true;
tabControlDet.Controls.Add(Page);
}
if (hwconfig.hwconfiginfo.u16DetFront == 1)
......
......@@ -236,12 +236,17 @@ namespace GcDevicePc.ConfigMethod
}
if (float.Parse(OSetTemp.Text) > 400.0f)
if (float.Parse(OSetTemp.Text) > float.Parse(OMAXTemp.Text))
{
MessageBox.Show("设置温度需要小于4000");
MessageBox.Show("设置温度不能大于最高温度");
OSetTemp.Text = "0";
}else if (float.Parse(OSetTemp.Text) > 400.0f)
{
MessageBox.Show("设置温度需要小于400");
OSetTemp.Text = "0";
}
// int line = ProUpTab.Rows.Count;
//if (line == 1)
......
......@@ -203,7 +203,7 @@ namespace GcDevicePc.ConfigMethod
{
ushort pagenum = (ushort)hwconfig.hwconfiginfo.u16InjPortNum;
int i;
//int i;
foreach (TabPage tabPage in tabControlDet.TabPages)
{
this.tabControlDet.TabPages.Remove(tabPage);
......
......@@ -45,6 +45,9 @@
this.label21 = new System.Windows.Forms.Label();
this.combSampleCarrierGas = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
......@@ -221,17 +224,47 @@
this.label4.TabIndex = 14;
this.label4.Text = "流量3:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(293, 64);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(67, 15);
this.label3.TabIndex = 30;
this.label3.Text = "保护温度";
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox1.Location = new System.Drawing.Point(367, 58);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 24);
this.textBox1.TabIndex = 4;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(473, 64);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(22, 15);
this.label5.TabIndex = 16;
this.label5.Text = "℃";
//
// IPPIP
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(592, 332);
this.Controls.Add(this.label3);
this.Controls.Add(this.combSampleCarrierGas);
this.Controls.Add(this.label21);
this.Controls.Add(this.label12);
this.Controls.Add(this.label11);
this.Controls.Add(this.label10);
this.Controls.Add(this.label5);
this.Controls.Add(this.label9);
this.Controls.Add(this.label4);
this.Controls.Add(this.label8);
......@@ -240,6 +273,7 @@
this.Controls.Add(this.txtPressure);
this.Controls.Add(this.txtFlow);
this.Controls.Add(this.lblSamplePortType);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.txtHeater);
this.Controls.Add(this.cbHeater);
this.Controls.Add(this.label2);
......@@ -271,5 +305,8 @@
private System.Windows.Forms.Label label21;
private System.Windows.Forms.ComboBox combSampleCarrierGas;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label5;
}
}
\ No newline at end of file
......@@ -53,7 +53,14 @@ namespace GcDevicePc.ConfigMethod.injectionport
//txtSampleProtecttemp.Text = this.methodconfig.port[index].Protecttemp.ToString();
//combControlMode.SelectedIndex = this.methodconfig.port[index].ControlMode;
combSampleCarrierGas.SelectedIndex = this.methodconfig.port[index].CarrierGasType;
try
{
combSampleCarrierGas.SelectedIndex = this.methodconfig.port[index].CarrierGasType;
}
catch
{
}
if (this.methodconfig.port[index].Heater == 1)
cbHeater.CheckState = CheckState.Checked;
......@@ -229,6 +236,8 @@ namespace GcDevicePc.ConfigMethod.injectionport
this.methodconfig.auxs[index].SamplePortType = lblSamplePortType.Text;
this.methodconfig.auxs[index].CarrierGasType = (ushort)combSampleCarrierGas.SelectedIndex;
//this.methodconfig.auxs[index].Protecttemp =
if (cbHeater.CheckState == CheckState.Checked)
this.methodconfig.auxs[index].Heater = 1;
else
......@@ -240,6 +249,14 @@ namespace GcDevicePc.ConfigMethod.injectionport
// this.methodconfig.auxs[index].pipSeptumBlowFlow = 0;
this.methodconfig.auxs[index].pipSeptumBlowFlow = 1;
this.methodconfig.epc[1].fristFlow = string2float(txtFlow.Text);
this.methodconfig.epc[1].gasType1 = (ushort)0;
this.methodconfig.epc[1].SecondFlow = string2float(txtPressure.Text);
this.methodconfig.epc[1].gasType2 = (ushort)0;
this.methodconfig.epc[1].ThirdFlow = string2float(txtSeptumBlowingflow.Text);
this.methodconfig.epc[1].gasType3 = (ushort)0;
}
float string2float(string s)
......
......@@ -47,7 +47,7 @@ namespace GcDevicePc.Controls
{
switch (pmoptbtnstatus)
{
case 0:
case 0://全暗
((PictureBox)PMPanel.Controls[0]).Image = pmoptimage.Images[6];
((PictureBox)PMPanel.Controls[0]).Enabled = false;
((PictureBox)PMPanel.Controls[1]).Image = pmoptimage.Images[7];
......@@ -55,7 +55,7 @@ namespace GcDevicePc.Controls
((PictureBox)PMPanel.Controls[2]).Image = pmoptimage.Images[8];
((PictureBox)PMPanel.Controls[2]).Enabled = false;
break;
case 3:
case 3://停止亮
((PictureBox)PMPanel.Controls[0]).Image = pmoptimage.Images[6];
((PictureBox)PMPanel.Controls[0]).Enabled = false;
((PictureBox)PMPanel.Controls[1]).Image = pmoptimage.Images[1];
......@@ -63,7 +63,7 @@ namespace GcDevicePc.Controls
((PictureBox)PMPanel.Controls[2]).Image = pmoptimage.Images[2];
((PictureBox)PMPanel.Controls[2]).Enabled = true;
break;
case 4:
case 4://开始亮
((PictureBox)PMPanel.Controls[0]).Image = pmoptimage.Images[0];
((PictureBox)PMPanel.Controls[0]).Enabled = true;
((PictureBox)PMPanel.Controls[1]).Image = pmoptimage.Images[7];
......
......@@ -1023,8 +1023,8 @@ namespace GcDevicePc
double iDetvalue = 0;
double bDetvalue = 0;
string errinfo;
string gasno = "";
//string errinfo;
//string gasno = "";
int topItemIndex = 0;
try
......@@ -1111,7 +1111,7 @@ namespace GcDevicePc
#endregion
errinfo = null;
//errinfo = null;
tempshow = new ListViewItem();
this.datalist.Items.Add(tempshow);
......
......@@ -154,6 +154,16 @@ namespace GcDevicePc.DeviceConfigUI
this.hWConfig.hwconfiginfo.u16ValveSix = this.ValveSix.Checked ? 1: 0;
//进样口
int num = 0;
if (InjPortFront.Checked)
{
num++;
}
if (InjPortBehind.Checked)
{
num++;
}
this.hWConfig.hwconfiginfo.u16InjPortNum = num;
this.hWConfig.hwconfiginfo.u16InjPortFront = this.InjPortFront.Checked? 1: 0;
this.hWConfig.hwconfiginfo.u16InjPortFPTemp = int.Parse(this.InjPortFPTemp.Text);
this.hWConfig.hwconfiginfo.u16InjPortType_Front = this.InjPortType_Front.SelectedIndex;
......
......@@ -65,6 +65,7 @@
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "EPCTips";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "EPCTips";
this.ResumeLayout(false);
this.PerformLayout();
......
......@@ -178,7 +178,7 @@ namespace GcDevicePc
#region 内部操作接口
void ClientInit()
{
int bret = 0;
//int bret = 0;
try
{
this.hFileServerHandle = fnWtClientInit(fIP, wport);
......@@ -192,7 +192,7 @@ namespace GcDevicePc
void ClientClose()
{
int bret = 0;
//int bret = 0;
try
{
fnWtClientClose(this.hFileServerHandle);
......
namespace GcDevicePc
{
partial class Form1
{
/// <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.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(208, 181);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
//
// Form1
//
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.label1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
}
}
\ 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.Threading.Tasks;
using System.Windows.Forms;
namespace GcDevicePc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public Form1(string i)
{
InitializeComponent();
label1.Text = i;
}
public Form1(int i)
{
InitializeComponent();
label1.Text = i.ToString();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
......@@ -9,13 +9,17 @@ using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using GcDevicePc.CK_UI;
using GcDevicePc.Common;
using GcDevicePc.IniParam;
namespace GcDevicePc
{
public partial class Formdebug : Form
{
CurveDisPlay cuidisp = new CurveDisPlay();//显示波形
//CurveDisPlay cuidisp = new CurveDisPlay();//显示波形
CurveDisPlay curdisplay = new CurveDisPlay();
//CurveDisPlay2 curdisplay2 = new CurveDisPlay2();
//CurveDisPlay3 curdisplay3 = new CurveDisPlay3();
DataState dataleft = new DataState();//状态显示
public Formdebug()
......@@ -29,15 +33,101 @@ namespace GcDevicePc
}
private void loadPanel() //加载界面
{
this.dockPanel1.Contains(cuidisp);
cuidisp.Show(this.dockPanel1);
cuidisp.CloseButtonVisible = false;
this.dockPanel1.Contains(curdisplay);
curdisplay.Show(this.dockPanel1);
curdisplay.CloseButtonVisible = false;
//Load_Win();
dataleft.Show(this.dockPanel1,DockState.DockRight);
dataleft.CloseButtonVisible = false;
//dataleft.Close_Threading();
//dataleft.Close();
}
//private void Load_Win()
//{
// if (!String.IsNullOrEmpty(globaldata.connection_ip))
// {
// if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
// {
// curdisplay.Text = "前检测器";
// }
// if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
// {
// curdisplay2.Text = "中检测器";
// }
// if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
// {
// curdisplay3.Text = "后检测器";
// }
// }
// else
// {
// if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
// {
// curdisplay.Text = "前检测器";
// }
// if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
// {
// curdisplay2.Text = "中检测器";
// }
// if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
// {
// curdisplay3.Text = "后检测器";
// }
// }
// if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
// {
// this.dockPanel1.Contains(curdisplay);
// curdisplay.Show(this.dockPanel1);
// curdisplay.CloseButtonVisible = false;
// }
// else
// {
// curdisplay.Dispose();
// }
// if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
// {
// this.dockPanel1.Contains(curdisplay2);
// curdisplay2.Show(this.dockPanel1);
// curdisplay2.CloseButtonVisible = false;
// }
// else
// {
// curdisplay2.Dispose();
// }
// if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
// {
// this.dockPanel1.Contains(curdisplay3);
// curdisplay3.Show(this.dockPanel1);
// curdisplay3.CloseButtonVisible = false;
// }
// else
// {
// curdisplay3.Dispose();
// }
// //Start_Thread();
// //dockPanelSideLeft.Show(this.dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
// //dockPanelSideLeft.CloseButtonVisible = false;
//}
public void CloseThread()
{
try
......
......@@ -1131,13 +1131,13 @@ namespace GcDevicePc.GCBuffer
//strKey = "EPC2";
//savemethodconfig.WriteProfileFloat(strKey, "第一路流量设定值", epc[cBehind].fristFlow);
//savemethodconfig.WriteProfileInt(strKey, "第一路载气类型", epc[cBehind].gasType1);
//savemethodconfig.WriteProfileFloat(strKey, "第二路流量设定值", epc[cBehind].SecondFlow);
//savemethodconfig.WriteProfileInt(strKey, "第二路载气类型", epc[cBehind].gasType2);
//savemethodconfig.WriteProfileFloat(strKey, "第三路流量设定值", epc[cBehind].ThirdFlow);
//savemethodconfig.WriteProfileFloat(strKey, "第三路载气类型", epc[cBehind].gasType3);
strKey = "EPC2";
savemethodconfig.WriteProfileFloat(strKey, "第一路流量设定值", epc[cBehind].fristFlow);
savemethodconfig.WriteProfileInt(strKey, "第一路载气类型", epc[cBehind].gasType1);
savemethodconfig.WriteProfileFloat(strKey, "第二路流量设定值", epc[cBehind].SecondFlow);
savemethodconfig.WriteProfileInt(strKey, "第二路载气类型", epc[cBehind].gasType2);
savemethodconfig.WriteProfileFloat(strKey, "第三路流量设定值", epc[cBehind].ThirdFlow);
savemethodconfig.WriteProfileFloat(strKey, "第三路载气类型", epc[cBehind].gasType3);
}
......@@ -1593,12 +1593,12 @@ namespace GcDevicePc.GCBuffer
fid[cFront].u16Sensitive = methodconfigini.GetProfileInt(sAppName, "灵敏度", iDefault);
fid[cFront].u16KeyHeater = methodconfigini.GetProfileInt(sAppName, "加热器开关", iDefault);
fid[cFront].fHeaterTempSet = methodconfigini.GetProfileFloat(sAppName, "加热器设定温度", fDefault);
fid[cFront].u16KeyH2Flow = methodconfigini.GetProfileInt(sAppName, "氢气流量开关", iDefault);
fid[cFront].fSetH2Flow = methodconfigini.GetProfileFloat(sAppName, "氢气流量值", fDefault);
fid[cFront].u16KeyH2Flow = methodconfigini.GetProfileInt(sAppName, "氢气燃气流量开关", iDefault);
fid[cFront].fSetH2Flow = methodconfigini.GetProfileFloat(sAppName, "氢气燃气流量设定值", fDefault);
fid[cFront].u16KeyAirFlow = methodconfigini.GetProfileInt(sAppName, "空气流量开关", iDefault);
fid[cFront].fAirFlowSet = methodconfigini.GetProfileFloat(sAppName, "空气流量值", fDefault);
fid[cFront].fAirFlowSet = methodconfigini.GetProfileFloat(sAppName, "空气流量设定值", fDefault);
fid[cFront].u16KeyTailGas = methodconfigini.GetProfileInt(sAppName, "尾吹气流量开关", iDefault);
fid[cFront].fSetTailGas = methodconfigini.GetProfileFloat(sAppName, "尾吹气流量值", fDefault);
fid[cFront].fSetTailGas = methodconfigini.GetProfileFloat(sAppName, "尾吹气流量设定值", fDefault);
fid[cFront].u16SigDeduct = methodconfigini.GetProfileInt(sAppName, "补偿", iDefault);
}
else if (flag == 1)
......
......@@ -60,7 +60,7 @@
<ManifestKeyFile>GcDevicePc_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
......@@ -92,6 +92,12 @@
<ApplicationIcon>logo.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="CKVocAlgorithm">
<HintPath>..\dll\CKVocAlgorithm.dll</HintPath>
......@@ -112,6 +118,9 @@
<Reference Include="ModbusLib">
<HintPath>..\dll\ModbusLib.dll</HintPath>
</Reference>
<Reference Include="NModbus4, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NModbus4.2.1.0\lib\net40\NModbus4.dll</HintPath>
</Reference>
<Reference Include="SpaceM">
<HintPath>..\dll\SpaceM.dll</HintPath>
</Reference>
......@@ -173,6 +182,18 @@
<Compile Include="CK_UI\AdjustFrom.Designer.cs">
<DependentUpon>AdjustFrom.cs</DependentUpon>
</Compile>
<Compile Include="CK_UI\CurveDisPlay2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CK_UI\CurveDisPlay2.Designer.cs">
<DependentUpon>CurveDisPlay2.cs</DependentUpon>
</Compile>
<Compile Include="CK_UI\CurveDisPlay3.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CK_UI\CurveDisPlay3.Designer.cs">
<DependentUpon>CurveDisPlay3.cs</DependentUpon>
</Compile>
<Compile Include="CK_UI\HistChartForm.cs">
<SubType>Form</SubType>
</Compile>
......@@ -212,8 +233,10 @@
<Compile Include="Common\GCModbusSlave485.cs" />
<Compile Include="Common\Log.cs" />
<Compile Include="Common\MoudbusOperation.cs" />
<Compile Include="Common\NModbusSlave.cs" />
<Compile Include="Common\RunTableHelper.cs" />
<Compile Include="Common\SendDataToHW.cs" />
<Compile Include="Common\TWFile.cs" />
<Compile Include="ConfigDlg\ChromeDlg.cs">
<SubType>Form</SubType>
</Compile>
......@@ -510,6 +533,12 @@
<DependentUpon>EPCTips.cs</DependentUpon>
</Compile>
<Compile Include="FileServerClient.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Formdebug.cs">
<SubType>Form</SubType>
</Compile>
......@@ -591,8 +620,12 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ProThread\ChannelDataSave.cs" />
<Compile Include="ProThread\ChannelDataSave2.cs" />
<Compile Include="ProThread\ChannelDataSave3.cs" />
<Compile Include="ProThread\ChannelDataTh.cs" />
<Compile Include="ProThread\CKvocUpdata.cs" />
<Compile Include="ProThread\CKvocUpdata2.cs" />
<Compile Include="ProThread\CKvocUpdata3.cs" />
<Compile Include="ProThread\DataOutput.cs" />
<Compile Include="ProThread\DataRcv.cs" />
<Compile Include="ProThread\DisplayDataTh.cs" />
......@@ -600,6 +633,7 @@
<Compile Include="ProThread\HMIControl.cs" />
<Compile Include="ProThread\HMISearch.cs" />
<Compile Include="ProThread\HmiStatueTh.cs" />
<Compile Include="ProThread\SignalDataToHw.cs" />
<Compile Include="ProThread\ThreadMonitor.cs" />
<Compile Include="QuitForm.cs">
<SubType>Form</SubType>
......@@ -676,6 +710,12 @@
<EmbeddedResource Include="CK_UI\AdjustFrom.resx">
<DependentUpon>AdjustFrom.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CK_UI\CurveDisPlay2.resx">
<DependentUpon>CurveDisPlay2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CK_UI\CurveDisPlay3.resx">
<DependentUpon>CurveDisPlay3.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CK_UI\HistChartForm.resx">
<DependentUpon>HistChartForm.cs</DependentUpon>
</EmbeddedResource>
......@@ -842,6 +882,9 @@
<EmbeddedResource Include="EPCTips.resx">
<DependentUpon>EPCTips.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Formdebug.resx">
<DependentUpon>Formdebug.cs</DependentUpon>
</EmbeddedResource>
......@@ -913,6 +956,9 @@
<DependentUpon>WaitForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
This diff is collapsed.
......@@ -39,7 +39,7 @@
this.ClientSize = new System.Drawing.Size(1008, 730);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Text = "VOCs在线监测-1.0.0.0 用户窗口";
this.Text = "VOCs在线监测-1.4.9 用户窗口";
this.ResumeLayout(false);
this.PerformLayout();
......
......@@ -5,6 +5,7 @@ using System.Text;
using System.Threading;
using GcDevicePc.GCBuffer;
using System.Diagnostics;
using GcDevicePc.CK_UI;
namespace GcDevicePc.ProThread
{
......
......@@ -5,6 +5,7 @@ using System.Text;
using System.Threading;
using GcDevicePc.GCBuffer;
using System.Diagnostics;
using GcDevicePc.CK_UI;
//using GcDevicePc.CK_UI;
namespace GcDevicePc.ProThread
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -96,7 +96,6 @@ namespace GcDevicePc.ProThread
}
}
public int WriteStartVal()
{
int ret = -1;
......@@ -426,7 +425,6 @@ namespace GcDevicePc.ProThread
return (ret == 0) ? true : false;
}
public bool SetBatCount(ushort val)
{
ushort mystate = val;
......
......@@ -6,6 +6,7 @@ using System.Threading;
using System.Collections;
using System.Net.NetworkInformation;
using GcDevicePc.Common;
using System.IO;
namespace GcDevicePc.ProThread
{
......@@ -43,10 +44,20 @@ namespace GcDevicePc.ProThread
Log.Info("Start Get PC Local IP...");
try
{
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
INIOperation test = new INIOperation(file);
string Meshport = test.INIGetStringValue("NetWorkConfig", "网口", null);
if (string.IsNullOrEmpty(Meshport))
{
Meshport = "本地连接";
}
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics)
{
if (adapter.Name == "本地连接")
if (adapter.Name == Meshport)
{
bool pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet || adapter.NetworkInterfaceType == NetworkInterfaceType.Wireless80211); //判断是否是以太网连接
if (pd1)
......
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。n
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- 指示该应用程序可以感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。-->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
\ No newline at end of file
......@@ -30,6 +30,7 @@
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.gcTitle1 = new GcDevicePc.Controls.GCTitle();
this.SuspendLayout();
//
// button1
......@@ -44,7 +45,7 @@
//
// button2
//
this.button2.Location = new System.Drawing.Point(81, 211);
this.button2.Location = new System.Drawing.Point(250, 364);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 1;
......@@ -52,11 +53,20 @@
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// gcTitle1
//
this.gcTitle1.Dock = System.Windows.Forms.DockStyle.Top;
this.gcTitle1.Location = new System.Drawing.Point(0, 0);
this.gcTitle1.Name = "gcTitle1";
this.gcTitle1.Size = new System.Drawing.Size(800, 20);
this.gcTitle1.TabIndex = 2;
//
// TestForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 583);
this.Controls.Add(this.gcTitle1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Name = "TestForm";
......@@ -69,5 +79,6 @@
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private Controls.GCTitle gcTitle1;
}
}
\ No newline at end of file
using GcDevicePc.Controls;
using GcDevicePc.ConfigMethod;
using GcDevicePc.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
......@@ -17,9 +18,12 @@ namespace GcDevicePc
public TestForm()
{
InitializeComponent();
bgWorker.DoWork += BgWorker_DoWork;
bgWorker.RunWorkerCompleted += BgWorker_RunWorkerCompleted;
//bgWorker.DoWork += BgWorker_DoWork;
//title.Show();
//bgWorker.RunWorkerCompleted += BgWorker_RunWorkerCompleted;
}
//GCTitle title = new GCTitle();
BackgroundWorker bgWorker = new BackgroundWorker();
PrompBox loadingCtl = new PrompBox(162, true);//定义加载控件
......@@ -35,19 +39,59 @@ namespace GcDevicePc
loadingCtl.Hide();
}
Form1 form1;
private void btnShow_Click(object sender, EventArgs e)
{
loadingCtl.TipsInfo = "提示信息";
//显示加载动画
loadingCtl.ShowLoading(this);
Application.DoEvents();
bgWorker.RunWorkerAsync();
//loadingCtl.TipsInfo = "提示信息";
////显示加载动画
//loadingCtl.ShowLoading(this);
//Application.DoEvents();
//bgWorker.RunWorkerAsync();
//this.pictureMenu1.PMOptbtnstatus = 3;
//(this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMOptbtnstatus = 4;
//kailiang
if (form1 == null)
{
form1 = new Form1("asdasdasdsa");
form1.Show();
}
else if(form1.IsDisposed)
{
form1 = new Form1("asdasdasdsa");
form1.Show();
}
else
{
form1.Activate();
}
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("asd");
//MessageBox.Show("asd");
//this.pictureMenu1.PMOptbtnstatus = 4;
//(this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMOptbtnstatus = 3;
//tinfliang
if (form1 == null)
{
form1 = new Form1(1111);
form1.Show();
}
else if (form1.IsDisposed)
{
form1 = new Form1(1111);
form1.Show();
}
else
{
form1.Activate();
}
}
}
}
......@@ -69,6 +69,8 @@
this.label12 = new System.Windows.Forms.Label();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.permin = new System.Windows.Forms.CheckBox();
this.label15 = new System.Windows.Forms.Label();
this.cmbMeshport = new System.Windows.Forms.ComboBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -80,6 +82,8 @@
//
// groupBox1
//
this.groupBox1.Controls.Add(this.cmbMeshport);
this.groupBox1.Controls.Add(this.label15);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.mac6);
......@@ -130,6 +134,7 @@
this.mac6.Size = new System.Drawing.Size(35, 21);
this.mac6.TabIndex = 7;
this.mac6.Text = "00";
this.mac6.Click += new System.EventHandler(this.CaseNo_TextClick);
this.mac6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.CaseNo_KeyPress);
//
// mac5
......@@ -140,6 +145,8 @@
this.mac5.Size = new System.Drawing.Size(35, 21);
this.mac5.TabIndex = 6;
this.mac5.Text = "00";
this.mac5.Click += new System.EventHandler(this.CaseNo_TextClick);
this.mac5.TextChanged += new System.EventHandler(this.CaseNo_TextBoxChange);
this.mac5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.CaseNo_KeyPress);
//
// label6
......@@ -175,11 +182,12 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(103, 26);
this.label3.Location = new System.Drawing.Point(333, 89);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(107, 12);
this.label3.TabIndex = 7;
this.label3.Text = "00:00:00:00:00:00";
this.label3.Visible = false;
//
// changemac
//
......@@ -199,6 +207,8 @@
this.mac4.Size = new System.Drawing.Size(35, 21);
this.mac4.TabIndex = 5;
this.mac4.Text = "00";
this.mac4.Click += new System.EventHandler(this.CaseNo_TextClick);
this.mac4.TextChanged += new System.EventHandler(this.CaseNo_TextBoxChange);
this.mac4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.CaseNo_KeyPress);
//
// mac3
......@@ -209,6 +219,8 @@
this.mac3.Size = new System.Drawing.Size(35, 21);
this.mac3.TabIndex = 4;
this.mac3.Text = "00";
this.mac3.Click += new System.EventHandler(this.CaseNo_TextClick);
this.mac3.TextChanged += new System.EventHandler(this.CaseNo_TextBoxChange);
this.mac3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.CaseNo_KeyPress);
//
// mac2
......@@ -219,6 +231,8 @@
this.mac2.Size = new System.Drawing.Size(35, 21);
this.mac2.TabIndex = 3;
this.mac2.Text = "00";
this.mac2.Click += new System.EventHandler(this.CaseNo_TextClick);
this.mac2.TextChanged += new System.EventHandler(this.CaseNo_TextBoxChange);
this.mac2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.CaseNo_KeyPress);
//
// mac1
......@@ -229,6 +243,8 @@
this.mac1.Size = new System.Drawing.Size(35, 21);
this.mac1.TabIndex = 2;
this.mac1.Text = "00";
this.mac1.Click += new System.EventHandler(this.CaseNo_TextClick);
this.mac1.TextChanged += new System.EventHandler(this.CaseNo_TextBoxChange);
this.mac1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.CaseNo_KeyPress);
//
// label2
......@@ -243,11 +259,12 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(7, 26);
this.label1.Location = new System.Drawing.Point(237, 89);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(83, 12);
this.label1.TabIndex = 0;
this.label1.Text = "目前MAC绑定:";
this.label1.Visible = false;
//
// groupBox2
//
......@@ -485,6 +502,24 @@
this.permin.UseVisualStyleBackColor = true;
this.permin.CheckedChanged += new System.EventHandler(this.permin_CheckedChanged);
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(43, 26);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(47, 12);
this.label15.TabIndex = 14;
this.label15.Text = "网 口:";
//
// cmbMeshport
//
this.cmbMeshport.FormattingEnabled = true;
this.cmbMeshport.Location = new System.Drawing.Point(97, 21);
this.cmbMeshport.Name = "cmbMeshport";
this.cmbMeshport.Size = new System.Drawing.Size(148, 20);
this.cmbMeshport.TabIndex = 15;
this.cmbMeshport.SelectedIndexChanged += new System.EventHandler(this.cmbMeshport_SelectedIndexChanged);
//
// UserConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -561,5 +596,7 @@
private System.Windows.Forms.Button changelocal;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.CheckBox permin;
private System.Windows.Forms.ComboBox cmbMeshport;
private System.Windows.Forms.Label label15;
}
}
\ No newline at end of file
......@@ -112,10 +112,21 @@ namespace GcDevicePc
private bool ChosenAdapter(string localip)
{
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
INIOperation test = new INIOperation(file);
string Meshport = test.INIGetStringValue("NetWorkConfig", "网口", null);
if (string.IsNullOrEmpty(Meshport))
{
Meshport = "本地连接";
}
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics)
{
if (adapter.Name == "本地连接")
if (adapter.Name == Meshport)
{
bool Pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet); //判断是否是以太网连接
if (Pd1)
......@@ -148,6 +159,7 @@ namespace GcDevicePc
INIOperation test = new INIOperation(file);
string MAC = test.INIGetStringValue("NetWorkConfig", "MAC地址", null);
string Meshport = test.INIGetStringValue("NetWorkConfig", "网口", null);
string value = test.INIGetStringValue("StartUp", "自启动", null);
string opensys = test.INIGetStringValue("StartUp", "打开系统", null);
string runtype = test.INIGetStringValue("StartUp", "运行类型", null);
......@@ -156,8 +168,16 @@ namespace GcDevicePc
string err_log = test.INIGetStringValue("Logs", "ErrLog", null);
string hmi_log = test.INIGetStringValue("Logs", "HmiLog", null);
try
{
NetworkInterface[] port = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in port)
{
cmbMeshport.Items.Add(adapter.Name);
}
if (String.IsNullOrEmpty(MAC))
{
this.label1.Text = "目前Mac(未绑定):";
......@@ -185,6 +205,10 @@ namespace GcDevicePc
{
}
if (!string.IsNullOrEmpty(Meshport))
{
cmbMeshport.SelectedText = Meshport;
}
if (Convert.ToInt32(value) == 1)
{
......@@ -300,8 +324,23 @@ namespace GcDevicePc
else e.Handled = true;
}
}
}
private void CaseNo_TextBoxChange(object sender, EventArgs e)
{
TextBox text = sender as TextBox;
if (text.Text.Length == 2)
{
text.Parent.SelectNextControl(ActiveControl, true, true, true, true);
}
}
private void CaseNo_TextClick(object sender, EventArgs e)
{
TextBox text = sender as TextBox;
text.SelectAll();
}
private void changemac_Click(object sender, EventArgs e)
{
//bool ret = false;
......@@ -570,5 +609,22 @@ namespace GcDevicePc
}
}
private void cmbMeshport_SelectedIndexChanged(object sender, EventArgs e)
{
string file = Path.Combine(Path.GetDirectoryName(Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
try
{
INIOperation test = new INIOperation(file);
test.INIWriteValue(file, "NetWorkConfig", "网口", cmbMeshport.Items[cmbMeshport.SelectedIndex].ToString());
}
catch
{
}
}
}
}
This diff is collapsed.
......@@ -500,6 +500,121 @@ namespace GcDevicePc
hairsw(4);
}
public event TCD_SetDAC gctcd_setdac;
public event TCD_SW gctcd_sw;
private void tcdset1_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(tcddac1.Text))
{
MessageBox.Show("设置值不能为空!!!");
}
else
{
ushort val = ushort.Parse(tcddac1.Text);
if (val >= 0 && val < 150)
{
gctcd_setdac(0, val);
}
else
{
MessageBox.Show("超过设置值(0~150)!!!");
}
}
}
private void tcdset2_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(tcddac2.Text))
{
MessageBox.Show("设置值不能为空!!!");
}
else
{
ushort val = ushort.Parse(tcddac2.Text);
if (val >= 0 && val < 150)
{
gctcd_setdac(1, val);
}
else
{
MessageBox.Show("超过设置值(0~150)!!!");
}
}
}
private void tcdset3_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(tcddac3.Text))
{
MessageBox.Show("设置值不能为空!!!");
}
else
{
ushort val = ushort.Parse(tcddac3.Text);
if (val >= 0 && val < 150)
{
gctcd_setdac(2, val);
}
else
{
MessageBox.Show("超过设置值(0~150)!!!");
}
}
}
private void tcd1_sw_Click(object sender, EventArgs e)
{
String tcd1_flag = tcd1_sw.Text;
string[] sArray = tcd1_flag.Split(new char[2] { '(', ')' });
if (sArray[1] == "关")
{
tcd1_sw.Text = "前TCD(开)";
}
else if (sArray[1] == "开")
{
tcd1_sw.Text = "前TCD(关)";
}
Console.WriteLine(sArray[1]);
gctcd_sw(0);
}
private void tcd2_sw_Click(object sender, EventArgs e)
{
String tcd2_flag = tcd2_sw.Text;
string[] sArray = tcd2_flag.Split(new char[2] { '(', ')' });
if (sArray[1] == "关")
{
tcd2_sw.Text = "中TCD(开)";
}
else if (sArray[1] == "开")
{
tcd2_sw.Text = "中TCD(关)";
}
Console.WriteLine(sArray[1]);
gctcd_sw(1);
}
private void tcd3_sw_Click(object sender, EventArgs e)
{
String tcd3_flag = tcd3_sw.Text;
string[] sArray = tcd3_flag.Split(new char[2] { '(', ')' });
if (sArray[1] == "关")
{
tcd3_sw.Text = "后TCD(开)";
}
else if (sArray[1] == "开")
{
tcd3_sw.Text = "后TCD(关)";
}
Console.WriteLine(sArray[1]);
gctcd_sw(2);
}
}
}
......@@ -6,6 +6,7 @@ using System.Text;
using GcDevicePc.Common;
using GcDevicePc.IniParam;
using GcDevicePc.GCBuffer;
using System.Net;
namespace GcDevicePc
{
......@@ -98,19 +99,19 @@ namespace GcDevicePc
//
public static HWConfig m_hwconfig = new HWConfig();
//public static long channel_A = 0;
//public static long channel_B = 0;
//public static long channel_C = 0;
public static long channel_A = 0;
public static long channel_B = 0;
public static long channel_C = 0;
//public static ArrayList channelA_A = new ArrayList();
//public static ArrayList channelA_B = new ArrayList();
//public static ArrayList channelA_C = new ArrayList();
public static ArrayList channelA_A = new ArrayList();
public static ArrayList channelA_B = new ArrayList();
public static ArrayList channelA_C = new ArrayList();
//public static ArrayList channelB_A = new ArrayList();
//public static ArrayList channelB_B = new ArrayList();
//public static ArrayList channelB_C = new ArrayList();
public static ArrayList channelB_A = new ArrayList();
public static ArrayList channelB_B = new ArrayList();
public static ArrayList channelB_C = new ArrayList();
// public static RingBufferManager m_rsbuffer = new RingBufferManager(100000);
//public static RingBufferManager m_rsbuffer = new RingBufferManager(100000);
public static bool OS_STOP = false;
......@@ -177,6 +178,7 @@ namespace GcDevicePc
///
public static String DeviceNo; //HMI编号
public static String DeviceName; //HMI名字
public static IPAddress myIpaddr;
//public static AppInit m_appinit = new AppInit(); //程序初始化
......
......@@ -4,5 +4,6 @@
<package id="ini.net" version="1.1.0" targetFramework="net45" />
<package id="log4net" version="2.0.8" targetFramework="net45" />
<package id="M2Mqtt" version="4.3.0.0" targetFramework="net45" />
<package id="NModbus4" version="2.1.0" targetFramework="net45" />
<package id="WinFormAnimation" version="1.5.6298.3372" targetFramework="net40" />
</packages>
\ No newline at end of file
No preview for this file type
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