Commit 7b0a1056 authored by liu's avatar liu

新增林工通讯的通讯协议,添加zb2040后处理软件的通讯,修改外部用户界面和对外部自动校准的逻辑问题

parent 245b0043
...@@ -42,7 +42,7 @@ namespace GcDevicePc ...@@ -42,7 +42,7 @@ namespace GcDevicePc
this.fid1ver.Text = this.FID1version; this.fid1ver.Text = this.FID1version;
this.fid2ver.Text = this.FID2version; this.fid2ver.Text = this.FID2version;
this.tcdver.Text = this.TCD1version; this.tcdver.Text = this.TCD1version;
this.PCver.Text = this.Hmiversion + "/1.5.6"; this.PCver.Text = this.Hmiversion + "/1.5.7";
} }
} }
} }
...@@ -594,7 +594,6 @@ namespace GcDevicePc ...@@ -594,7 +594,6 @@ namespace GcDevicePc
globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.FwFolder = tmpMainFolder; globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.FwFolder = tmpMainFolder;
} }
//Logs //Logs
tmpMainFolder = Path.Combine(tmpFolder, "Logs"); tmpMainFolder = Path.Combine(tmpFolder, "Logs");
CheckFolderandFile(0, tmpMainFolder); CheckFolderandFile(0, tmpMainFolder);
...@@ -615,6 +614,16 @@ namespace GcDevicePc ...@@ -615,6 +614,16 @@ namespace GcDevicePc
CheckFolderandFile(0, globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.SubStatusFolder); CheckFolderandFile(0, globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.SubStatusFolder);
tmpFolder = null; tmpFolder = null;
//string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
//IniFile ini = new IniFile(file);
//string Version = ini.ReadString("Version", "VersionType");
//if (string.IsNullOrEmpty(Version))
//{
// Version = "1";
//}
globaldata.CurrentVersion = "1";
} }
/// <summary> /// <summary>
...@@ -683,6 +692,35 @@ namespace GcDevicePc ...@@ -683,6 +692,35 @@ namespace GcDevicePc
return true; return true;
} }
public GCMethodConfig InitGetConfig(string filename)
{
GCMethodConfig gCMethodConfig = new GCMethodConfig();
IniFile iniFile = new IniFile(filename);
if (File.Exists(filename))
{
string section = "信号";
gCMethodConfig.signal.u16ChannelA = (ushort)iniFile.ReadInteger(section, "通道A");
gCMethodConfig.signal.u16ChannelB = (ushort)iniFile.ReadInteger(section, "通道B");
for (int i = 0; i < 8; i++)
{
gCMethodConfig.signal.uDetA[i] = (ushort)iniFile.ReadInteger(section, "通道A检测器" + (i + 1).ToString());
gCMethodConfig.signal.uDetB[i] = (ushort)iniFile.ReadInteger(section, "通道B检测器" + (i + 1).ToString());
}
for (int i = 0; i < 8; i++)
{
gCMethodConfig.signal.u16DetTimeLengthA[i] = (ushort)iniFile.ReadInteger(section, "通道A检测时间" + (i + 1).ToString());
gCMethodConfig.signal.u16DetTimeLengthB[i] = (ushort)iniFile.ReadInteger(section, "通道B检测时间" + (i + 1).ToString());
}
}
return gCMethodConfig;
}
/// <summary> /// <summary>
/// 配置文件初始化 /// 配置文件初始化
/// </summary> /// </summary>
...@@ -722,6 +760,9 @@ namespace GcDevicePc ...@@ -722,6 +760,9 @@ namespace GcDevicePc
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName = tmpfile; globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName = tmpfile;
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.show_MethodName = "SingleAnal.ini"; globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.show_MethodName = "SingleAnal.ini";
} }
//SignalDataToHw.methodconfig = InitGetConfig(tmpfile);
SendDataToZB.methodconfig = InitGetConfig(tmpfile);
} }
else else
{ {
...@@ -774,17 +815,7 @@ namespace GcDevicePc ...@@ -774,17 +815,7 @@ namespace GcDevicePc
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_StatusName = tmpfile; globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_StatusName = tmpfile;
tmpfile = null; tmpfile = null;
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
IniFile ini = new IniFile(file);
string Version = ini.ReadString("Version", "VersionType");
if (string.IsNullOrEmpty(Version))
{
Version = "0";
}
globaldata.CurrentVersion = Version;
} }
public void LocalNetworkCheck() public void LocalNetworkCheck()
......
...@@ -28,7 +28,7 @@ namespace GcDevicePc.CK_UI ...@@ -28,7 +28,7 @@ namespace GcDevicePc.CK_UI
{ {
//温度显示 //温度显示
Color zcolor = Color.White; Color zcolor = Color.White;
Color waringcolor = Color.LightGreen; Color waringcolor = Color.White;
//前进样口 //前进样口
...@@ -73,12 +73,12 @@ namespace GcDevicePc.CK_UI ...@@ -73,12 +73,12 @@ namespace GcDevicePc.CK_UI
} }
else else
{ {
textBoxport.Text = ""; textBoxport.Text = "0.0/0";
textBoxport.BackColor = Color.LightGray; textBoxport.BackColor = waringcolor; ;
} }
//柱箱 //柱箱
...@@ -97,24 +97,24 @@ namespace GcDevicePc.CK_UI ...@@ -97,24 +97,24 @@ namespace GcDevicePc.CK_UI
} }
else else
{
if (globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp >= 1001.0f)
{
textBoven.Text = "铂电阻断开";
}
else
{ {
if (globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp >= 1001.0f)
{
textBoven.Text = "铂电阻断开";
}
else
{
textBoven.Text = globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp.ToString("#0.0") + "/" + globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp.ToString("#0"); textBoven.Text = globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp.ToString("#0.0") + "/" + globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp.ToString("#0");
} }
if (Math.Abs(globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp- globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp)<=0.1) if (Math.Abs(globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp - globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp) <= 0.1)
{ {
textBoven.BackColor = zcolor; textBoven.BackColor = zcolor;
}
else
textBoven.BackColor = waringcolor;
} }
else
textBoven.BackColor = waringcolor;
}
textBoven.BackColor = waringcolor; textBoven.BackColor = waringcolor;
//阀箱 //阀箱
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1 == 0.0f) if (globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1 == 0.0f)
...@@ -192,7 +192,7 @@ namespace GcDevicePc.CK_UI ...@@ -192,7 +192,7 @@ namespace GcDevicePc.CK_UI
textBFid.BackColor = waringcolor; textBFid.BackColor = waringcolor;
//epc //epc
if (globaldata.m_hwconfig.hwconfiginfo.u16StartType != 0) if (globaldata.m_hwconfig.hwconfiginfo.u16StartType != 2)
{ {
hflow.Text = (globaldata.m_dpbuffer.ShowList.showepc.EPC1_2_Cur / 10.0f).ToString("#0.0") + "/" + (globaldata.m_dpbuffer.ShowList.showepc.EPC1_2_Set / 10.0f).ToString("#0"); hflow.Text = (globaldata.m_dpbuffer.ShowList.showepc.EPC1_2_Cur / 10.0f).ToString("#0.0") + "/" + (globaldata.m_dpbuffer.ShowList.showepc.EPC1_2_Set / 10.0f).ToString("#0");
hflow.BackColor = waringcolor; hflow.BackColor = waringcolor;
...@@ -205,10 +205,14 @@ namespace GcDevicePc.CK_UI ...@@ -205,10 +205,14 @@ namespace GcDevicePc.CK_UI
} }
else else
{ {
hflow.BackColor = Color.LightGray; hflow.Enabled = false;
airflow.BackColor = Color.LightGray; airflow.Enabled = false;
foneflow.BackColor = Color.LightGray; foneflow.Enabled = false;
ftwoflow.BackColor = Color.LightGray; ftwoflow.Enabled = false;
//hflow.BackColor = waringcolor;
//airflow.BackColor = waringcolor;
//foneflow.BackColor = waringcolor;
//ftwoflow.BackColor = waringcolor;
} }
...@@ -288,8 +292,9 @@ namespace GcDevicePc.CK_UI ...@@ -288,8 +292,9 @@ namespace GcDevicePc.CK_UI
//setStatus(ref strtext, ref bkcolor); //setStatus(ref strtext, ref bkcolor);
//txtstats.Text = strtext; //txtstats.Text = strtext;
//txtstats.BackColor = bkcolor; //txtstats.BackColor = bkcolor;
}catch(Exception ex) }
catch (Exception ex)
{ {
Trace.Write(ex); Trace.Write(ex);
} }
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.textBox4 = new System.Windows.Forms.TextBox(); this.textBox4 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
this.groupBox1.Size = new System.Drawing.Size(131, 413); this.groupBox1.Size = new System.Drawing.Size(131, 413);
this.groupBox1.TabIndex = 8; this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "结果(ppm)"; this.groupBox1.Text = "结果浓度";
// //
// textBox6 // textBox6
// //
...@@ -188,12 +188,6 @@ ...@@ -188,12 +188,6 @@
this.label1.TabIndex = 9; this.label1.TabIndex = 9;
this.label1.Text = "苯"; this.label1.Text = "苯";
// //
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 60000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// textBox2 // textBox2
// //
this.textBox2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.textBox2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
...@@ -202,6 +196,12 @@ ...@@ -202,6 +196,12 @@
this.textBox2.Size = new System.Drawing.Size(116, 29); this.textBox2.Size = new System.Drawing.Size(116, 29);
this.textBox2.TabIndex = 6; this.textBox2.TabIndex = 6;
// //
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 60000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// UserCtl // UserCtl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......
...@@ -59,7 +59,7 @@ namespace GcDevicePc.CK_UI ...@@ -59,7 +59,7 @@ namespace GcDevicePc.CK_UI
Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype; Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype;
isppm = false; isppm = false;
groupBox1.Text = "结果(mg/m³)"; groupBox1.Text = "结果浓度";
switch (Systemtype) switch (Systemtype)
{ {
default: //非甲烷总烃 default: //非甲烷总烃
...@@ -272,11 +272,11 @@ namespace GcDevicePc.CK_UI ...@@ -272,11 +272,11 @@ namespace GcDevicePc.CK_UI
{ {
if (isppm) if (isppm)
{ {
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "ppm"; textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString();
} }
else else
{//此处计算成mg/m3 nmhc {//此处计算成mg/m3 nmhc
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "mg/m³"; textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString();
//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 / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
} }
...@@ -293,11 +293,11 @@ namespace GcDevicePc.CK_UI ...@@ -293,11 +293,11 @@ namespace GcDevicePc.CK_UI
{ {
if (isppm) if (isppm)
{ {
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "ppm"; textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString();
} }
else else
{ {
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "mg/m³"; textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString();
//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 / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
} }
...@@ -316,11 +316,11 @@ namespace GcDevicePc.CK_UI ...@@ -316,11 +316,11 @@ namespace GcDevicePc.CK_UI
{ {
if (isppm) if (isppm)
{ {
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "ppm"; textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString();
} }
else else
{ {
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "mg/m³"; textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString();
//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 / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
} }
...@@ -391,12 +391,12 @@ namespace GcDevicePc.CK_UI ...@@ -391,12 +391,12 @@ namespace GcDevicePc.CK_UI
{ {
return; return;
} }
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "ppm"; textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString();
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "ppm"; textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString();
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "ppm"; textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString();
textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString() + "ppm"; textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString();
textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString() + "ppm"; textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString();
textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString() + "ppm"; textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString();
...@@ -407,11 +407,11 @@ namespace GcDevicePc.CK_UI ...@@ -407,11 +407,11 @@ namespace GcDevicePc.CK_UI
{ {
if (isppm) if (isppm)
{ {
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "ppm"; textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString();
} }
else else
{ {
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "mg/m³"; textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString();
//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 / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
} }
...@@ -428,11 +428,11 @@ namespace GcDevicePc.CK_UI ...@@ -428,11 +428,11 @@ namespace GcDevicePc.CK_UI
{ {
if (isppm) if (isppm)
{ {
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "ppm"; textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString();
} }
else else
{ {
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "mg/m³"; textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString();
//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 / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
} }
...@@ -449,11 +449,11 @@ namespace GcDevicePc.CK_UI ...@@ -449,11 +449,11 @@ namespace GcDevicePc.CK_UI
{ {
if (isppm) if (isppm)
{ {
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "ppm"; textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString();
} }
else else
{ {
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "mg/m³"; textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString();
//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 / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
} }
...@@ -471,11 +471,11 @@ namespace GcDevicePc.CK_UI ...@@ -471,11 +471,11 @@ namespace GcDevicePc.CK_UI
{ {
if (isppm) if (isppm)
{ {
textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString() + "ppm"; textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString();
} }
else else
{ {
textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString() + "mg/m³"; textBox4.Text = Math.Round(listben[listben.Count - 1].Y, 2).ToString();
//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 / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
} }
...@@ -492,11 +492,11 @@ namespace GcDevicePc.CK_UI ...@@ -492,11 +492,11 @@ namespace GcDevicePc.CK_UI
{ {
if (isppm) if (isppm)
{ {
textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString() + "ppm"; textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString();
} }
else else
{ {
textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString() + "mg/m³"; textBox5.Text = Math.Round(listjiaben[listjiaben.Count - 1].Y, 2).ToString();
//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 / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
} }
...@@ -513,11 +513,11 @@ namespace GcDevicePc.CK_UI ...@@ -513,11 +513,11 @@ namespace GcDevicePc.CK_UI
{ {
if (isppm) if (isppm)
{ {
textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString() + "ppm"; textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString();
} }
else else
{ {
textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString() + "mg/m³"; textBox6.Text = Math.Round(listerjiaben[listerjiaben.Count - 1].Y, 2).ToString();
//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 / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
} }
......
This diff is collapsed.
...@@ -434,8 +434,8 @@ namespace GcDevicePc.ConfigMethod ...@@ -434,8 +434,8 @@ namespace GcDevicePc.ConfigMethod
globaldata.m_configDlg.m_SignalDlg.reflashContent(); globaldata.m_configDlg.m_SignalDlg.reflashContent();
} }
SignalDataToHw.methodconfig = this.gcmethodconfig; //SignalDataToHw.methodconfig = this.gcmethodconfig;
//SendDataToZB.methodconfig = this.gcmethodconfig; SendDataToZB.methodconfig = this.gcmethodconfig;
//string message = "提交成功!"; //string message = "提交成功!";
//MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); //MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.datalist.FullRowSelect = true; this.datalist.FullRowSelect = true;
this.datalist.GridLines = true; this.datalist.GridLines = true;
this.datalist.HideSelection = false;
this.datalist.Location = new System.Drawing.Point(0, 0); this.datalist.Location = new System.Drawing.Point(0, 0);
this.datalist.Margin = new System.Windows.Forms.Padding(0); this.datalist.Margin = new System.Windows.Forms.Padding(0);
this.datalist.Name = "datalist"; this.datalist.Name = "datalist";
......
...@@ -1072,6 +1072,7 @@ namespace GcDevicePc ...@@ -1072,6 +1072,7 @@ namespace GcDevicePc
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
#region #region
//tempshow = new ListViewItem(); //tempshow = new ListViewItem();
//this.datalist.Items.Add(tempshow); //this.datalist.Items.Add(tempshow);
...@@ -2163,6 +2164,41 @@ namespace GcDevicePc ...@@ -2163,6 +2164,41 @@ namespace GcDevicePc
GetSetValue(globaldata.m_dpbuffer.ShowList.showepc.EPC2_2_Set)); GetSetValue(globaldata.m_dpbuffer.ShowList.showepc.EPC2_2_Set));
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
} }
tempshow.SubItems.Add("");
this.datalist.Items.Add(tempshow);
tempshow = new ListViewItem();
tempshow.Text = GettempName("6路功率");
tempshow.Font = new Font(tempshow.Font, tempshow.Font.Style | FontStyle.Bold);
tempshow.SubItems.Add("");
this.datalist.Items.Add(tempshow);
;
tempshow = new ListViewItem();
tempshow.Text = GettempName("前检测器功率");
tempshow.SubItems.Add(globaldata.m_dpbuffer.ShowList.pwmInfo.fDPower.ToString());
this.datalist.Items.Add(tempshow);
tempshow = new ListViewItem();
tempshow.Text = GettempName("中检测器功率");
tempshow.SubItems.Add(globaldata.m_dpbuffer.ShowList.pwmInfo.iDPower.ToString());
this.datalist.Items.Add(tempshow);
tempshow = new ListViewItem();
tempshow.Text = GettempName("后检测器功率");
tempshow.SubItems.Add(globaldata.m_dpbuffer.ShowList.pwmInfo.bDPower.ToString());
this.datalist.Items.Add(tempshow);
tempshow = new ListViewItem();
tempshow.Text = GettempName("前进样器功率");
tempshow.SubItems.Add(globaldata.m_dpbuffer.ShowList.pwmInfo.fSPower.ToString());
this.datalist.Items.Add(tempshow);
tempshow = new ListViewItem();
tempshow.Text = GettempName("后进样器功率");
tempshow.SubItems.Add(globaldata.m_dpbuffer.ShowList.pwmInfo.bSPower.ToString());
this.datalist.Items.Add(tempshow);
tempshow = new ListViewItem();
tempshow.Text = GettempName("柱箱功率");
tempshow.SubItems.Add(globaldata.m_dpbuffer.ShowList.pwmInfo.CbPower.ToString());
this.datalist.Items.Add(tempshow);
#region #region
//if (CProfileDevice.m_DevParam.syspara.u16InjPortCtlMode_Behind == 3 && //if (CProfileDevice.m_DevParam.syspara.u16InjPortCtlMode_Behind == 3 &&
// CProfileDevice.m_DevParam.syspara.u16InjPortCtlMode_Front == 3) // CProfileDevice.m_DevParam.syspara.u16InjPortCtlMode_Front == 3)
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
this.buttonauto.Name = "buttonauto"; this.buttonauto.Name = "buttonauto";
this.buttonauto.Size = new System.Drawing.Size(89, 34); this.buttonauto.Size = new System.Drawing.Size(89, 34);
this.buttonauto.TabIndex = 3; this.buttonauto.TabIndex = 3;
this.buttonauto.Text = "自动校准"; this.buttonauto.Text = "校准";
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);
// //
......
...@@ -60,7 +60,7 @@ namespace GcDevicePc ...@@ -60,7 +60,7 @@ namespace GcDevicePc
// MessageBox.Show("点火操作禁止,FID已经点火成功"); // MessageBox.Show("点火操作禁止,FID已经点火成功");
} }
CKVocAnalyzer.AutoAdjust auto; public CKVocAnalyzer.AutoAdjust auto;
//自动校准 //自动校准
private void buttonauto_Click(object sender, EventArgs e) private void buttonauto_Click(object sender, EventArgs e)
...@@ -75,17 +75,28 @@ namespace GcDevicePc ...@@ -75,17 +75,28 @@ namespace GcDevicePc
if (auto == null) if (auto == null)
{ {
auto = new CKVocAnalyzer.AutoAdjust(); auto = new CKVocAnalyzer.AutoAdjust();
auto.Isadmin = false;
auto.Show(); auto.Show();
} }
else if (auto.IsDisposed) else if (auto.IsDisposed)
{ {
auto = null; auto = null;
auto = new CKVocAnalyzer.AutoAdjust(); auto = new CKVocAnalyzer.AutoAdjust();
auto.Isadmin = false;
auto.Show(); auto.Show();
} }
else else
{ {
auto.Activate(); //auto.Activate();
if (!auto.Visible)
{
auto.Isadmin = false;
auto.Show();
auto.IsinitShow();
//auto.ShowKB();
}
} }
//if (!globaldata.usable)//表示上位机处于运行状态下不可进行自动校准 //if (!globaldata.usable)//表示上位机处于运行状态下不可进行自动校准
......
...@@ -165,14 +165,29 @@ namespace GcDevicePc.GCBuffer ...@@ -165,14 +165,29 @@ namespace GcDevicePc.GCBuffer
public ushort bDetPol; public ushort bDetPol;
} }
public struct PwmInfo
{
public int fDPower;
public int iDPower;
public int bDPower;
public int fSPower;
public int bSPower;
public int CbPower;
}
public struct ShowInfo public struct ShowInfo
{ {
public TiemInfo showtime; public TiemInfo showtime;
public TempInfo showtemp; public TempInfo showtemp;
public ValveShowInfo showValve; public ValveShowInfo showValve;
public ISportInfo showISport; public ISportInfo showISport;
public DetInfo showDet; public DetInfo showDet;
public EPCInfo showepc; public EPCInfo showepc;
public PwmInfo pwmInfo;
} }
public ShowInfo ShowList = new ShowInfo(); public ShowInfo ShowList = new ShowInfo();
...@@ -289,6 +304,13 @@ namespace GcDevicePc.GCBuffer ...@@ -289,6 +304,13 @@ namespace GcDevicePc.GCBuffer
this.ShowList.showDet.bDetSwitch = false; this.ShowList.showDet.bDetSwitch = false;
// this.ShowList.errorifo.ErrorStatus = new byte[9]; // this.ShowList.errorifo.ErrorStatus = new byte[9];
this.ShowList.pwmInfo.bDPower = 0;
this.ShowList.pwmInfo.fDPower = 0;
this.ShowList.pwmInfo.iDPower = 0;
this.ShowList.pwmInfo.bSPower = 0;
this.ShowList.pwmInfo.fDPower = 0;
this.ShowList.pwmInfo.CbPower = 0;
} }
public DPBuffer() public DPBuffer()
......
...@@ -44,6 +44,7 @@ namespace GcDevicePc.GCBuffer ...@@ -44,6 +44,7 @@ namespace GcDevicePc.GCBuffer
public ushort work_Statue; //系统工作状态 public ushort work_Statue; //系统工作状态
public ushort RunType; //运行类型 0 打开运行 1 智能运行 2 批处理 public ushort RunType; //运行类型 0 打开运行 1 智能运行 2 批处理
public bool sendtohw; public bool sendtohw;
public bool sendtoZb;
public bool info_log; public bool info_log;
public bool error_log; public bool error_log;
public string hmimac; public string hmimac;
...@@ -78,11 +79,19 @@ namespace GcDevicePc.GCBuffer ...@@ -78,11 +79,19 @@ namespace GcDevicePc.GCBuffer
public ThreadInfo pcthreadinfo; public ThreadInfo pcthreadinfo;
public OutPutInfo outputinfo; public OutPutInfo outputinfo;
public Adjust adjust;
} }
public PCInfo gcpcinfo = new PCInfo(); public PCInfo gcpcinfo = new PCInfo();
public struct Adjust
{
public int AdjustType;
public int AdjustOS;
public int AdjustTime;
}
public PCBuffer() public PCBuffer()
{ {
...@@ -117,7 +126,9 @@ namespace GcDevicePc.GCBuffer ...@@ -117,7 +126,9 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.moduleinfo.ip = ""; gcpcinfo.moduleinfo.ip = "";
gcpcinfo.outputinfo.port = 0; gcpcinfo.outputinfo.port = 0;
gcpcinfo.adjust.AdjustOS = 0;
gcpcinfo.adjust.AdjustType = 0;
gcpcinfo.adjust.AdjustTime = 0;
try try
{ {
...@@ -131,7 +142,8 @@ namespace GcDevicePc.GCBuffer ...@@ -131,7 +142,8 @@ namespace GcDevicePc.GCBuffer
int opensys = ini.ReadInteger("StartUp", "打开系统"); int opensys = ini.ReadInteger("StartUp", "打开系统");
int runtype = ini.ReadInteger("StartUp", "运行类型"); int runtype = ini.ReadInteger("StartUp", "运行类型");
int senddata = ini.ReadInteger("StartUp", "SendData"); int senddatatohw = ini.ReadInteger("StartUp", "SendDataToHw");
int senddatatozb = ini.ReadInteger("StartUp", "SendDataToZB");
gcpcinfo.pcfolderinfo.DataFolder = ini.ReadString("DataFolder", "历史数据"); gcpcinfo.pcfolderinfo.DataFolder = ini.ReadString("DataFolder", "历史数据");
gcpcinfo.pcworkinfo.hmimac = ini.ReadString("NetWorkConfig", "MAC地址"); gcpcinfo.pcworkinfo.hmimac = ini.ReadString("NetWorkConfig", "MAC地址");
...@@ -145,13 +157,18 @@ namespace GcDevicePc.GCBuffer ...@@ -145,13 +157,18 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.pcworkinfo.RunType = 0; gcpcinfo.pcworkinfo.RunType = 0;
} }
if (senddata == 1) if (senddatatohw == 1)
{ {
gcpcinfo.pcworkinfo.sendtohw = true; gcpcinfo.pcworkinfo.sendtohw = true;
} }
else if (senddatatozb == 1)
{
gcpcinfo.pcworkinfo.sendtoZb = true;
}
else else
{ {
gcpcinfo.pcworkinfo.sendtohw = false; gcpcinfo.pcworkinfo.sendtohw = false;
gcpcinfo.pcworkinfo.sendtoZb = false;
} }
//INIOperation test = new INIOperation(file); //INIOperation test = new INIOperation(file);
...@@ -223,6 +240,7 @@ namespace GcDevicePc.GCBuffer ...@@ -223,6 +240,7 @@ namespace GcDevicePc.GCBuffer
{ {
gcpcinfo.pcworkinfo.RunType = 0; gcpcinfo.pcworkinfo.RunType = 0;
gcpcinfo.pcworkinfo.sendtohw = false; gcpcinfo.pcworkinfo.sendtohw = false;
gcpcinfo.pcworkinfo.sendtoZb = false;
gcpcinfo.pcfolderinfo.DataFolder = null; gcpcinfo.pcfolderinfo.DataFolder = null;
} }
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -247,6 +247,17 @@ namespace GcDevicePc.ProThread ...@@ -247,6 +247,17 @@ namespace GcDevicePc.ProThread
globaldata.channelB_A.Add((long)(fidv[i] * 1000000)); globaldata.channelB_A.Add((long)(fidv[i] * 1000000));
} }
} }
else if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
{
lock (globaldata.channelA_A)
{
globaldata.channelA_A.Add((long)(fidv[i] * 1000000));
}
lock (globaldata.channelB_A)
{
globaldata.channelB_A.Add((long)(fidv[i] * 1000000));
}
}
} }
} }
} }
...@@ -306,6 +317,18 @@ namespace GcDevicePc.ProThread ...@@ -306,6 +317,18 @@ namespace GcDevicePc.ProThread
globaldata.channelA_B.Add((long)(fidv[i] * 1000000)); globaldata.channelA_B.Add((long)(fidv[i] * 1000000));
} }
lock (globaldata.channelB_B)
{
globaldata.channelB_B.Add((long)(fidv[i] * 1000000));
}
}
else if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
{
lock (globaldata.channelA_B)
{
globaldata.channelA_B.Add((long)(fidv[i] * 1000000));
}
lock (globaldata.channelB_B) lock (globaldata.channelB_B)
{ {
globaldata.channelB_B.Add((long)(fidv[i] * 1000000)); globaldata.channelB_B.Add((long)(fidv[i] * 1000000));
...@@ -374,6 +397,17 @@ namespace GcDevicePc.ProThread ...@@ -374,6 +397,17 @@ namespace GcDevicePc.ProThread
globaldata.channelB_C.Add((long)(fidv[i] * 1000000)); globaldata.channelB_C.Add((long)(fidv[i] * 1000000));
} }
} }
else if(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
{
lock (globaldata.channelA_C)
{
globaldata.channelA_C.Add((long)(fidv[i] * 1000000));
}
lock (globaldata.channelB_C)
{
globaldata.channelB_C.Add((long)(fidv[i] * 1000000));
}
}
} }
} }
} }
...@@ -729,6 +763,7 @@ namespace GcDevicePc.ProThread ...@@ -729,6 +763,7 @@ namespace GcDevicePc.ProThread
ushort[] firestatus = new ushort[4] { 0, 0, 0, 0 }; ushort[] firestatus = new ushort[4] { 0, 0, 0, 0 };
ushort[] dacstatus = new ushort[6] { 0, 0, 0, 0, 0, 0 }; ushort[] dacstatus = new ushort[6] { 0, 0, 0, 0, 0, 0 };
ushort[] hmiabnormal = new ushort[3]; ushort[] hmiabnormal = new ushort[3];
ushort[] hmipower = new ushort[6] { 0,0,0,0,0,0};
//ushort[] epcdata = new ushort[36]; //ushort[] epcdata = new ushort[36];
ushort[] epc1 = new ushort[6]; ushort[] epc1 = new ushort[6];
...@@ -974,6 +1009,48 @@ namespace GcDevicePc.ProThread ...@@ -974,6 +1009,48 @@ namespace GcDevicePc.ProThread
{ {
globaldata.m_hmibuffer.gcinfo.HmiAbnormal = hmiabnormal; globaldata.m_hmibuffer.gcinfo.HmiAbnormal = hmiabnormal;
} }
if (GetHmiPower(ref hmipower) == 0)
{
globaldata.m_dpbuffer.ShowList.pwmInfo.fDPower = hmipower[0];
globaldata.m_dpbuffer.ShowList.pwmInfo.iDPower = hmipower[1];
globaldata.m_dpbuffer.ShowList.pwmInfo.bDPower = hmipower[2];
globaldata.m_dpbuffer.ShowList.pwmInfo.fSPower = hmipower[3];
globaldata.m_dpbuffer.ShowList.pwmInfo.fSPower = hmipower[4];
globaldata.m_dpbuffer.ShowList.pwmInfo.CbPower = hmipower[5];
}
}
private int GetHmiPower(ref ushort[] hmipower)
{
int ret = -1;
try
{
ret = GetHmiPowerHoldingReg(1151, 6, ref hmipower);
}
catch (Exception e)
{
Log.Error(e.Message);
}
return ret;
}
private int GetHmiPowerHoldingReg(ushort address, ushort num, ref ushort[] state)
{
int ret = -1;
int count = 0;
if (setflag)
{
ret = globaldata.global_moudbus.ReadHoldingReg(address, num, this.strIP, netPost, ref state);
while (ret != 0)
{
count++;
if (count > 3)
break;
ret = globaldata.global_moudbus.ReadHoldingReg(address, num, this.strIP, netPost, ref state);
}
}
return ret;
} }
......
...@@ -331,10 +331,10 @@ namespace GcDevicePc.ProThread ...@@ -331,10 +331,10 @@ namespace GcDevicePc.ProThread
} }
public void Adjust_ling_biao(int type,ushort oc) public bool Adjust_ling_biao(int type,ushort oc)
{ {
int lret; int lret = 0;
int bret; int bret = 0;
int count = 0; int count = 0;
if (type == 0) if (type == 0)
{ {
...@@ -380,6 +380,16 @@ namespace GcDevicePc.ProThread ...@@ -380,6 +380,16 @@ namespace GcDevicePc.ProThread
break; break;
} }
} }
if (lret == 0 && bret == 0)
{
return true;
}
else
{
return false;
}
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -132,7 +132,7 @@ namespace GcDevicePc ...@@ -132,7 +132,7 @@ namespace GcDevicePc
RunTableView.Rows[index].Cells[1].Value = runtable.INIGetStringValue("运行表", key[i], "无"); RunTableView.Rows[index].Cells[1].Value = runtable.INIGetStringValue("运行表", key[i], "无");
RunTableView.Rows[index].Cells[2].Value = runtable.INIGetStringValue("运行时间", key[i], "无"); RunTableView.Rows[index].Cells[2].Value = runtable.INIGetStringValue("运行时间", key[i], "无");
RunTableView.Rows[index].Cells[3].Value = runtable.INIGetStringValue("循环", key[i], "无"); RunTableView.Rows[index].Cells[3].Value = runtable.INIGetStringValue("循环", key[i], "无");
RunTableView.Rows[index].Cells[4].Value = "1"; RunTableView.Rows[index].Cells[4].Value = runtable.INIGetStringValue("间隔时间", key[i], "无"); ;
} }
this.updategv.Enabled = false; this.updategv.Enabled = false;
...@@ -406,7 +406,7 @@ namespace GcDevicePc ...@@ -406,7 +406,7 @@ namespace GcDevicePc
tmp.filename = (string)LocalMethodView.Rows[i].Cells[1].Value; tmp.filename = (string)LocalMethodView.Rows[i].Cells[1].Value;
tmp.runtime = "0"; tmp.runtime = "0";
tmp.runcount = "1"; tmp.runcount = "1";
tmp.rundelay = "1"; tmp.rundelay = "0";
RunTabList.Add(tmp); RunTabList.Add(tmp);
} }
} }
......
...@@ -3,6 +3,8 @@ using System.ComponentModel; ...@@ -3,6 +3,8 @@ using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using System.Threading; using System.Threading;
using System.IO;
using Ini.Net;
namespace GcDevicePc namespace GcDevicePc
{ {
...@@ -147,7 +149,8 @@ namespace GcDevicePc ...@@ -147,7 +149,8 @@ namespace GcDevicePc
private void PreLoadingProc() private void PreLoadingProc()
{ {
bool ret = false; bool ret = false;
// globaldata.m_appinit.InitAppFolderGC();
//globaldata.m_appinit.InitAppFolderGC();
_appInitInfo = "系统初始化开始"; _appInitInfo = "系统初始化开始";
_appInitInfo = "检测本地网络"; _appInitInfo = "检测本地网络";
globaldata.m_appinit.LocalNetworkCheck(); globaldata.m_appinit.LocalNetworkCheck();
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.gcTitle1 = new GcDevicePc.Controls.GCTitle();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.button3 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button();
...@@ -39,6 +38,15 @@ ...@@ -39,6 +38,15 @@
this.button6 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button();
this.button7 = new System.Windows.Forms.Button(); this.button7 = new System.Windows.Forms.Button();
this.button8 = new System.Windows.Forms.Button(); this.button8 = new System.Windows.Forms.Button();
this.gcTitle1 = new GcDevicePc.Controls.GCTitle();
this.button9 = new System.Windows.Forms.Button();
this.button10 = new System.Windows.Forms.Button();
this.button11 = new System.Windows.Forms.Button();
this.button12 = new System.Windows.Forms.Button();
this.button13 = new System.Windows.Forms.Button();
this.button14 = new System.Windows.Forms.Button();
this.button15 = new System.Windows.Forms.Button();
this.button16 = new System.Windows.Forms.Button();
this.SuspendLayout(); this.SuspendLayout();
// //
// button1 // button1
...@@ -53,7 +61,7 @@ ...@@ -53,7 +61,7 @@
// //
// button2 // button2
// //
this.button2.Location = new System.Drawing.Point(128, 314); this.button2.Location = new System.Drawing.Point(110, 231);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23); this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 1; this.button2.TabIndex = 1;
...@@ -61,14 +69,6 @@ ...@@ -61,14 +69,6 @@
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click); 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;
//
// timer1 // timer1
// //
this.timer1.Interval = 5000; this.timer1.Interval = 5000;
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
// //
// button7 // button7
// //
this.button7.Location = new System.Drawing.Point(244, 314); this.button7.Location = new System.Drawing.Point(191, 231);
this.button7.Name = "button7"; this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(75, 23); this.button7.Size = new System.Drawing.Size(75, 23);
this.button7.TabIndex = 4; this.button7.TabIndex = 4;
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
// //
// button8 // button8
// //
this.button8.Location = new System.Drawing.Point(389, 314); this.button8.Location = new System.Drawing.Point(272, 231);
this.button8.Name = "button8"; this.button8.Name = "button8";
this.button8.Size = new System.Drawing.Size(75, 23); this.button8.Size = new System.Drawing.Size(75, 23);
this.button8.TabIndex = 5; this.button8.TabIndex = 5;
...@@ -130,11 +130,107 @@ ...@@ -130,11 +130,107 @@
this.button8.UseVisualStyleBackColor = true; this.button8.UseVisualStyleBackColor = true;
this.button8.Click += new System.EventHandler(this.Button8_Click); this.button8.Click += new System.EventHandler(this.Button8_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;
//
// button9
//
this.button9.Location = new System.Drawing.Point(110, 352);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(75, 23);
this.button9.TabIndex = 6;
this.button9.Text = "button9";
this.button9.UseVisualStyleBackColor = true;
this.button9.Click += new System.EventHandler(this.Button9_Click);
//
// button10
//
this.button10.Location = new System.Drawing.Point(110, 381);
this.button10.Name = "button10";
this.button10.Size = new System.Drawing.Size(75, 23);
this.button10.TabIndex = 6;
this.button10.Text = "button9";
this.button10.UseVisualStyleBackColor = true;
this.button10.Click += new System.EventHandler(this.Button10_Click);
//
// button11
//
this.button11.Location = new System.Drawing.Point(272, 352);
this.button11.Name = "button11";
this.button11.Size = new System.Drawing.Size(75, 23);
this.button11.TabIndex = 6;
this.button11.Text = "button9";
this.button11.UseVisualStyleBackColor = true;
this.button11.Click += new System.EventHandler(this.Button11_Click);
//
// button12
//
this.button12.Location = new System.Drawing.Point(272, 381);
this.button12.Name = "button12";
this.button12.Size = new System.Drawing.Size(75, 23);
this.button12.TabIndex = 6;
this.button12.Text = "button9";
this.button12.UseVisualStyleBackColor = true;
this.button12.Click += new System.EventHandler(this.Button12_Click);
//
// button13
//
this.button13.Location = new System.Drawing.Point(395, 352);
this.button13.Name = "button13";
this.button13.Size = new System.Drawing.Size(75, 23);
this.button13.TabIndex = 6;
this.button13.Text = "button9";
this.button13.UseVisualStyleBackColor = true;
this.button13.Click += new System.EventHandler(this.Button13_Click);
//
// button14
//
this.button14.Location = new System.Drawing.Point(395, 381);
this.button14.Name = "button14";
this.button14.Size = new System.Drawing.Size(75, 23);
this.button14.TabIndex = 6;
this.button14.Text = "button9";
this.button14.UseVisualStyleBackColor = true;
this.button14.Click += new System.EventHandler(this.Button14_Click);
//
// button15
//
this.button15.Location = new System.Drawing.Point(557, 352);
this.button15.Name = "button15";
this.button15.Size = new System.Drawing.Size(75, 23);
this.button15.TabIndex = 6;
this.button15.Text = "button9";
this.button15.UseVisualStyleBackColor = true;
this.button15.Click += new System.EventHandler(this.Button15_Click);
//
// button16
//
this.button16.Location = new System.Drawing.Point(557, 381);
this.button16.Name = "button16";
this.button16.Size = new System.Drawing.Size(75, 23);
this.button16.TabIndex = 6;
this.button16.Text = "button9";
this.button16.UseVisualStyleBackColor = true;
this.button16.Click += new System.EventHandler(this.Button16_Click);
//
// TestForm // TestForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 583); this.ClientSize = new System.Drawing.Size(800, 583);
this.Controls.Add(this.button16);
this.Controls.Add(this.button14);
this.Controls.Add(this.button12);
this.Controls.Add(this.button15);
this.Controls.Add(this.button13);
this.Controls.Add(this.button11);
this.Controls.Add(this.button10);
this.Controls.Add(this.button9);
this.Controls.Add(this.button8); this.Controls.Add(this.button8);
this.Controls.Add(this.button7); this.Controls.Add(this.button7);
this.Controls.Add(this.button6); this.Controls.Add(this.button6);
...@@ -162,5 +258,13 @@ ...@@ -162,5 +258,13 @@
private System.Windows.Forms.Button button6; private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button7; private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button8; private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button button10;
private System.Windows.Forms.Button button11;
private System.Windows.Forms.Button button12;
private System.Windows.Forms.Button button13;
private System.Windows.Forms.Button button14;
private System.Windows.Forms.Button button15;
private System.Windows.Forms.Button button16;
} }
} }
\ No newline at end of file
using GcDevicePc.Common; using GcDevicePc.Common;
using GcDevicePc.ConfigMethod; using GcDevicePc.ConfigMethod;
using GcDevicePc.Controls; using GcDevicePc.Controls;
using GcDevicePc.GCBuffer;
using GcDevicePc.ProThread; using GcDevicePc.ProThread;
using Ini.Net;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
...@@ -10,6 +12,7 @@ using System.Drawing; ...@@ -10,6 +12,7 @@ using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
...@@ -121,6 +124,7 @@ namespace GcDevicePc ...@@ -121,6 +124,7 @@ namespace GcDevicePc
private void button2_Click(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e)
{ {
dataToZB.testzba();
} }
int i = 0; int i = 0;
...@@ -132,7 +136,7 @@ namespace GcDevicePc ...@@ -132,7 +136,7 @@ namespace GcDevicePc
private void Button7_Click(object sender, EventArgs e) private void Button7_Click(object sender, EventArgs e)
{ {
dataToZB.testzbb();
} }
SendDataToZB dataToZB = new SendDataToZB(); SendDataToZB dataToZB = new SendDataToZB();
...@@ -140,6 +144,64 @@ namespace GcDevicePc ...@@ -140,6 +144,64 @@ namespace GcDevicePc
{ {
//dataToZB.InitsendData(); //dataToZB.InitsendData();
dataToZB.StartSendDataToZB(); dataToZB.StartSendDataToZB();
starttr();
}
Thread tr;
private void starttr()
{
tr = new Thread(ths);
tr.Start();
}
private void ths()
{
while (true)
{
dataToZB.testzb(2,10);
Thread.Sleep(50);
}
}
private void Button9_Click(object sender, EventArgs e)
{
dataToZB.testzbb(1, 0, 1);
}
private void Button10_Click(object sender, EventArgs e)
{
dataToZB.testzbb(1, 0, 2);
}
private void Button11_Click(object sender, EventArgs e)
{
dataToZB.testzbb(0, 1, 1);
}
private void Button12_Click(object sender, EventArgs e)
{
dataToZB.testzbb(0, 1, 2);
}
private void Button13_Click(object sender, EventArgs e)
{
dataToZB.testzbb(1, 0, 3);
}
private void Button14_Click(object sender, EventArgs e)
{
dataToZB.testzbb(1, 0, 4);
}
private void Button15_Click(object sender, EventArgs e)
{
dataToZB.testzbb(0, 1, 3);
}
private void Button16_Click(object sender, EventArgs e)
{
dataToZB.testzbb(0, 1, 4);
} }
} }
} }
...@@ -95,7 +95,7 @@ namespace GcDevicePc ...@@ -95,7 +95,7 @@ namespace GcDevicePc
public static PCBuffer m_pcbuffer = new PCBuffer(); public static PCBuffer m_pcbuffer = new PCBuffer();
public static SignalBuffer m_signalbuffer = new SignalBuffer(); public static SignalBuffer m_signalbuffer = new SignalBuffer();
public static bool IsShowPower = false;//暂时判断是否显示功率
// //
public static HWConfig m_hwconfig = new HWConfig(); public static HWConfig m_hwconfig = new HWConfig();
......
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