Commit edc81683 authored by liu's avatar liu

仪器配置中仪器档次排序待验证

parent 592d4b65
...@@ -839,14 +839,6 @@ namespace GcDevicePc ...@@ -839,14 +839,6 @@ namespace GcDevicePc
string ip; string ip;
while (true) while (true)
{
Thread.Sleep(3000);
if (globaldata.OffLinkMode)
{
globaldata.connection_ip = "";
break;
}
else
{ {
ret = mysearch.ThStart(); ret = mysearch.ThStart();
...@@ -869,6 +861,11 @@ namespace GcDevicePc ...@@ -869,6 +861,11 @@ namespace GcDevicePc
mysearch.ReGetHmiIp(); mysearch.ReGetHmiIp();
Thread.Sleep(2000); Thread.Sleep(2000);
} }
if (globaldata.OffLinkMode)
{
globaldata.connection_ip = "";
break;
} }
} }
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
// //
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(722, 382); this.ClientSize = new System.Drawing.Size(971, 426);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "AdjustFrom"; this.Name = "AdjustFrom";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox(); this.textBox3 = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox6 = new System.Windows.Forms.TextBox(); this.textBox6 = new System.Windows.Forms.TextBox();
...@@ -44,6 +43,7 @@ ...@@ -44,6 +43,7 @@
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.timer1 = new System.Windows.Forms.Timer(this.components);
this.textBox2 = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -102,15 +102,6 @@ ...@@ -102,15 +102,6 @@
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(116, 29); this.textBox1.Size = new System.Drawing.Size(116, 29);
this.textBox1.TabIndex = 5; this.textBox1.TabIndex = 5;
this.textBox1.DoubleClick += new System.EventHandler(this.textBox1_DoubleClick);
//
// textBox2
//
this.textBox2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox2.Location = new System.Drawing.Point(6, 131);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(116, 29);
this.textBox2.TabIndex = 6;
// //
// textBox3 // textBox3
// //
...@@ -203,6 +194,14 @@ ...@@ -203,6 +194,14 @@
this.timer1.Interval = 60000; this.timer1.Interval = 60000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// //
// textBox2
//
this.textBox2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox2.Location = new System.Drawing.Point(6, 131);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(116, 29);
this.textBox2.TabIndex = 6;
//
// UserCtl // UserCtl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
...@@ -225,7 +224,6 @@ ...@@ -225,7 +224,6 @@
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Timer timer1; private System.Windows.Forms.Timer timer1;
...@@ -235,6 +233,6 @@ ...@@ -235,6 +233,6 @@
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox4; private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox2;
} }
} }
...@@ -58,7 +58,8 @@ namespace GcDevicePc.CK_UI ...@@ -58,7 +58,8 @@ namespace GcDevicePc.CK_UI
{ {
Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype; Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype;
isppm = false;
groupBox1.Text = "结果(mg/m³)";
switch (Systemtype) switch (Systemtype)
{ {
default: //非甲烷总烃 default: //非甲烷总烃
...@@ -273,7 +274,7 @@ namespace GcDevicePc.CK_UI ...@@ -273,7 +274,7 @@ namespace GcDevicePc.CK_UI
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "ppm"; textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "ppm";
} }
else 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³"; 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³";
} }
...@@ -302,6 +303,8 @@ namespace GcDevicePc.CK_UI ...@@ -302,6 +303,8 @@ namespace GcDevicePc.CK_UI
} }
else else
textBox2.BackColor = zcolor; textBox2.BackColor = zcolor;
} }
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[2].name) if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[2].name)
...@@ -323,8 +326,6 @@ namespace GcDevicePc.CK_UI ...@@ -323,8 +326,6 @@ namespace GcDevicePc.CK_UI
textBox3.BackColor = zcolor; textBox3.BackColor = zcolor;
} }
} }
...@@ -740,37 +741,37 @@ namespace GcDevicePc.CK_UI ...@@ -740,37 +741,37 @@ namespace GcDevicePc.CK_UI
} }
private void textBox1_DoubleClick(object sender, EventArgs e) //private void textBox1_DoubleClick(object sender, EventArgs e)
{ //{
isppm = !isppm; // isppm = !isppm;
if(isppm) // if(isppm)
{ // {
groupBox1.Text = "结果(ppm)"; // groupBox1.Text = "结果(ppm)";
}else // }else
groupBox1.Text = "结果(mg/m³)"; // groupBox1.Text = "结果(mg/m³)";
try // try
{ // {
switch (Systemtype) // switch (Systemtype)
{ // {
default: //非甲烷总烃 // default: //非甲烷总烃
data(); // data();
datadisp(); // datadisp();
UIVisible(false); // UIVisible(false);
break; // break;
case 1: // case 1:
data2(); // data2();
datadisp2(); // datadisp2();
break; // break;
} // }
// Trace.WriteLine("绘图","sys"); // // Trace.WriteLine("绘图","sys");
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
Trace.Write(ex); // Trace.Write(ex);
} // }
} //}
} }
} }
...@@ -90,6 +90,8 @@ namespace GcDevicePc.Common ...@@ -90,6 +90,8 @@ namespace GcDevicePc.Common
} }
static ushort slavereadhreg(ushort address) static ushort slavereadhreg(ushort address)
{
try
{ {
ushort value = 0; ushort value = 0;
ushort signalddress = 17; ushort signalddress = 17;
...@@ -127,14 +129,12 @@ namespace GcDevicePc.Common ...@@ -127,14 +129,12 @@ namespace GcDevicePc.Common
{ {
value = 0; value = 0;
} }
} }
else else
{ {
value = 0; value = 0;
} }
} }
//分析仪状态 //分析仪状态
if (address >= 1 && address < 20) if (address >= 1 && address < 20)
{ {
...@@ -142,12 +142,12 @@ namespace GcDevicePc.Common ...@@ -142,12 +142,12 @@ namespace GcDevicePc.Common
{ {
case 1: //进度 case 1: //进度
{ {
if ((ushort) SharedSpace.Data.typesint == 1 || (ushort) SharedSpace.Data.typesint == 2) if ((ushort)SharedSpace.Data.typesint == 1 || (ushort)SharedSpace.Data.typesint == 2)
{ {
if (SharedSpace.MControl.dateend != 0 && SharedSpace.MControl.zhouqi != 0) if (SharedSpace.MControl.dateend != 0 && SharedSpace.MControl.zhouqi != 0)
{ {
value = (ushort) ((globaldata.m_hmibuffer.gcinfo.batruncount * 1.0f) / value = (ushort)((globaldata.m_hmibuffer.gcinfo.batruncount * 1.0f) /
(ushort) (SharedSpace.MControl.dateend * 1.0f / (ushort)(SharedSpace.MControl.dateend * 1.0f /
SharedSpace.MControl.zhouqi) * 1000); SharedSpace.MControl.zhouqi) * 1000);
} }
else else
...@@ -166,16 +166,16 @@ namespace GcDevicePc.Common ...@@ -166,16 +166,16 @@ namespace GcDevicePc.Common
{ {
if (!SharedSpace.MControl.SetOut && !SharedSpace.MControl.SetRun) if (!SharedSpace.MControl.SetOut && !SharedSpace.MControl.SetRun)
{ {
if ((ushort) SharedSpace.Data.typesint == 3) if ((ushort)SharedSpace.Data.typesint == 3)
value = 5; value = 5;
else if ((ushort) SharedSpace.Data.typesint == 4) else if ((ushort)SharedSpace.Data.typesint == 4)
value = 6; value = 6;
else else
value = (ushort) SharedSpace.Data.typesint; value = (ushort)SharedSpace.Data.typesint;
} }
else else
{ {
value = (ushort) SharedSpace.Data.typesint; value = (ushort)SharedSpace.Data.typesint;
} }
} }
break; break;
...@@ -350,6 +350,15 @@ namespace GcDevicePc.Common ...@@ -350,6 +350,15 @@ namespace GcDevicePc.Common
} }
return value; return value;
} }
catch (Exception e)
{
Console.WriteLine("异常" + e.Message);
return 0;
}
}
//static ushort slavereadhreg(ushort address) //static ushort slavereadhreg(ushort address)
//{ //{
......
...@@ -31,7 +31,7 @@ namespace GcDevicePc.ConfigMethod ...@@ -31,7 +31,7 @@ namespace GcDevicePc.ConfigMethod
this.methodconfig.GetFidByID(index); this.methodconfig.GetFidByID(index);
fidsettemp.Text = this.methodconfig.fid[index].fHeaterTempSet.ToString(); fidsettemp.Text = this.methodconfig.fid[index].fHeaterTempSet.ToString();
if (hwconfig.hwconfiginfo.u16StartType == 1 || hwconfig.hwconfiginfo.u16StartType == 2) if (hwconfig.hwconfiginfo.u16StartType == 1 || hwconfig.hwconfiginfo.u16StartType == 3)
{ {
tb氢气压力设定.Text = this.methodconfig.fid[index].fSetH2Flow.ToString(); tb氢气压力设定.Text = this.methodconfig.fid[index].fSetH2Flow.ToString();
tb空气压力设定.Text = this.methodconfig.fid[index].fAirFlowSet.ToString(); tb空气压力设定.Text = this.methodconfig.fid[index].fAirFlowSet.ToString();
......
...@@ -34,7 +34,7 @@ namespace GcDevicePc.ConfigMethod.injectionport ...@@ -34,7 +34,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
txtHeater.Text = this.methodconfig.port[index].HeaterTmpActual.ToString(); txtHeater.Text = this.methodconfig.port[index].HeaterTmpActual.ToString();
if (this.hwconfig.hwconfiginfo.u16StartType == 1 || this.hwconfig.hwconfiginfo.u16StartType == 2) if (this.hwconfig.hwconfiginfo.u16StartType == 1 || this.hwconfig.hwconfiginfo.u16StartType == 3)
{ {
txtFlow.Text = this.methodconfig.port[index].pipFlowActual.ToString(); txtFlow.Text = this.methodconfig.port[index].pipFlowActual.ToString();
txtPressure.Text = this.methodconfig.port[index].pipPressureActual.ToString(); txtPressure.Text = this.methodconfig.port[index].pipPressureActual.ToString();
...@@ -180,7 +180,7 @@ namespace GcDevicePc.ConfigMethod.injectionport ...@@ -180,7 +180,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
label21.Text = "辅助载气类型:"; label21.Text = "辅助载气类型:";
if (this.hwconfig.hwconfiginfo.u16StartType == 1 || this.hwconfig.hwconfiginfo.u16StartType == 2) if (this.hwconfig.hwconfiginfo.u16StartType == 1 || this.hwconfig.hwconfiginfo.u16StartType == 3)
{ {
txtFlow.Text = this.methodconfig.auxs[index].pipFlowActual.ToString(); txtFlow.Text = this.methodconfig.auxs[index].pipFlowActual.ToString();
txtPressure.Text = this.methodconfig.auxs[index].pipPressureActual.ToString(); txtPressure.Text = this.methodconfig.auxs[index].pipPressureActual.ToString();
......
...@@ -1126,49 +1126,67 @@ namespace GcDevicePc ...@@ -1126,49 +1126,67 @@ namespace GcDevicePc
//前进样口 //前进样口
if (CProfileDevice.m_DevParam.syspara.u16InjPortFront == 1) if (CProfileDevice.m_DevParam.syspara.u16InjPortFront == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp != 0.0f)
{ {
tempshow = new ListViewItem(); tempshow = new ListViewItem();
tempshow.Text = "前进样口"; tempshow.Text = "前进样口";
if (globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp == 0.0f)
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + "未定义");
else
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp.ToString("0")); tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp.ToString("0"));
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
}
//else
//{
// //tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + "未定义");
//}
} }
if (CProfileDevice.m_DevParam.syspara.u16InjPortBehind == 1) if (CProfileDevice.m_DevParam.syspara.u16InjPortBehind == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp != 0.0f)
{ {
tempshow = new ListViewItem(); tempshow = new ListViewItem();
tempshow.Text = "后进样口"; tempshow.Text = "后进样口";
if (globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp == 0.0f)
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + "未定义");
else
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp.ToString("0")); tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp.ToString("0"));
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + "未定义");
//else
} }
if (CProfileDevice.m_DevParam.syspara.u16Col == 1) if (CProfileDevice.m_DevParam.syspara.u16Col == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp != 0.0f)
{ {
tempshow = new ListViewItem(); tempshow = new ListViewItem();
tempshow.Text = "柱箱"; tempshow.Text = "柱箱";
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp) + " / " + "未定义");
if (globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp == 0.0f)
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp) + " / " + "未定义");
else
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp.ToString("0")); tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp.ToString("0"));
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
}
//else
} }
if (CProfileDevice.m_DevParam.syspara.u16DetNum >= 1) if (CProfileDevice.m_DevParam.syspara.u16DetNum >= 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1) if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp != 0.0f)
{ {
tempshow = new ListViewItem(); tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 0) //TCD if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 0) //TCD
...@@ -1184,17 +1202,21 @@ namespace GcDevicePc ...@@ -1184,17 +1202,21 @@ namespace GcDevicePc
{ {
tempshow.Text = "FPD1"; tempshow.Text = "FPD1";
} }
if (globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp == 0.0f)
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + "未定义");
else
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp.ToString("0")); tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp.ToString("0"));
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + "未定义");
//else
} }
if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1 && CProfileDevice.m_DevParam.syspara.u16AuxHeater1 != 1) if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1 && CProfileDevice.m_DevParam.syspara.u16AuxHeater1 != 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp != 0.0f)
{ {
tempshow = new ListViewItem(); tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 0) //TCD if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 0) //TCD
...@@ -1210,22 +1232,21 @@ namespace GcDevicePc ...@@ -1210,22 +1232,21 @@ namespace GcDevicePc
{ {
tempshow.Text = "FPD2"; tempshow.Text = "FPD2";
} }
if (globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp == 0.0f)
{
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + "未定义");
}
else
{
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp.ToString("0")); tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp.ToString("0"));
}
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + "未定义");
}
} }
if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1 && CProfileDevice.m_DevParam.syspara.u16AuxHeater2 != 1) if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1 && CProfileDevice.m_DevParam.syspara.u16AuxHeater2 != 1)
{ {
if (globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp != 0.0f)
{
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + "未定义");
tempshow = new ListViewItem(); tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 0) if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 0)
{ {
...@@ -1241,23 +1262,19 @@ namespace GcDevicePc ...@@ -1241,23 +1262,19 @@ namespace GcDevicePc
tempshow.Text = "FPD3"; tempshow.Text = "FPD3";
} }
if (globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp == 0.0f)
{
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + "未定义");
}
else
{
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp.ToString("0")); tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp.ToString("0"));
}
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
} }
}
} }
if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterNum > 0) if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterNum > 0)
{ {
if (CProfileDevice.m_DevParam.syspara.u16AuxHeater1 == 1) //TCD if (CProfileDevice.m_DevParam.syspara.u16AuxHeater1 == 1) //TCD
{
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1 != 0.0f)
{ {
tempshow = new ListViewItem(); tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterName1 != null) if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterName1 != null)
...@@ -1265,18 +1282,22 @@ namespace GcDevicePc ...@@ -1265,18 +1282,22 @@ namespace GcDevicePc
else else
tempshow.Text = "未命名"; tempshow.Text = "未命名";
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1 == 0.0f)
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1) + " / " + "未定义");
else
{
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1.ToString("0")); tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1.ToString("0"));
this.datalist.Items.Add(tempshow);
} }
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1) + " / " + "未定义");
//else
//{
//}
this.datalist.Items.Add(tempshow);
} }
if (CProfileDevice.m_DevParam.syspara.u16AuxHeater2 == 1) if (CProfileDevice.m_DevParam.syspara.u16AuxHeater2 == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp2 != 0.0f)
{ {
tempshow = new ListViewItem(); tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterName2 != null) if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterName2 != null)
...@@ -1284,14 +1305,15 @@ namespace GcDevicePc ...@@ -1284,14 +1305,15 @@ namespace GcDevicePc
else else
tempshow.Text = "未命名"; tempshow.Text = "未命名";
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp2 == 0.0f)
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2) + " / " + "未定义");
else
{
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp2.ToString("0")); tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp2.ToString("0"));
}
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2) + " / " + "未定义");
//else
//{
//}
//if (CProfileDevice.m_DevParam.aux.fSetTemp_HeatArea2 == 0.0f) //if (CProfileDevice.m_DevParam.aux.fSetTemp_HeatArea2 == 0.0f)
// tempshow.SubItems.Add(CProfileDevice.m_DevParam.aux.fActualTemp_HeatArea2.ToString("#0.00") + " / " + "等待读取"); // tempshow.SubItems.Add(CProfileDevice.m_DevParam.aux.fActualTemp_HeatArea2.ToString("#0.00") + " / " + "等待读取");
...@@ -1505,7 +1527,7 @@ namespace GcDevicePc ...@@ -1505,7 +1527,7 @@ namespace GcDevicePc
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
if (CProfileDevice.m_DevParam.syspara.u16StartType == 2) if (CProfileDevice.m_DevParam.syspara.u16StartType == 3)
{ {
tempshow = new ListViewItem(); tempshow = new ListViewItem();
tempshow.Text = GettempName("氢气流量(mL/min)"); tempshow.Text = GettempName("氢气流量(mL/min)");
...@@ -1822,7 +1844,7 @@ namespace GcDevicePc ...@@ -1822,7 +1844,7 @@ namespace GcDevicePc
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
//tempshow = new ListViewItem(); //tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16StartType == 1 || CProfileDevice.m_DevParam.syspara.u16StartType == 2) if (CProfileDevice.m_DevParam.syspara.u16StartType == 1 || CProfileDevice.m_DevParam.syspara.u16StartType == 3)
{ {
tempshow = new ListViewItem(); tempshow = new ListViewItem();
tempshow.Text = GettempName("载气流量"); tempshow.Text = GettempName("载气流量");
......
...@@ -332,6 +332,8 @@ namespace GcDevicePc.DeviceConfigUI ...@@ -332,6 +332,8 @@ namespace GcDevicePc.DeviceConfigUI
#region 控件事件 #region 控件事件
private void HMIConfigTree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) private void HMIConfigTree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
try
{ {
if (e.Button == MouseButtons.Right || e.Node.Level == 0) if (e.Button == MouseButtons.Right || e.Node.Level == 0)
return; return;
...@@ -367,6 +369,12 @@ namespace GcDevicePc.DeviceConfigUI ...@@ -367,6 +369,12 @@ namespace GcDevicePc.DeviceConfigUI
} }
} }
catch
{
}
}
/// <summary> /// <summary>
/// ///
......
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
// //
this.StartType.FormattingEnabled = true; this.StartType.FormattingEnabled = true;
this.StartType.Items.AddRange(new object[] { this.StartType.Items.AddRange(new object[] {
"机械阀",
"进样EPC", "进样EPC",
"机械阀",
"全EPC"}); "全EPC"});
this.StartType.Location = new System.Drawing.Point(157, 143); this.StartType.Location = new System.Drawing.Point(157, 143);
this.StartType.Name = "StartType"; this.StartType.Name = "StartType";
......
...@@ -39,7 +39,7 @@ namespace GcDevicePc.DeviceConfigUI ...@@ -39,7 +39,7 @@ namespace GcDevicePc.DeviceConfigUI
{ {
this.GCNum.Text = this.hWConfig.hwconfiginfo.GCNum; this.GCNum.Text = this.hWConfig.hwconfiginfo.GCNum;
this.GCName.Text = this.hWConfig.hwconfiginfo.GCName; this.GCName.Text = this.hWConfig.hwconfiginfo.GCName;
this.StartType.SelectedIndex = this.hWConfig.hwconfiginfo.u16StartType; this.StartType.SelectedIndex = this.hWConfig.hwconfiginfo.u16StartType - 1;
} }
} }
catch catch
...@@ -57,7 +57,7 @@ namespace GcDevicePc.DeviceConfigUI ...@@ -57,7 +57,7 @@ namespace GcDevicePc.DeviceConfigUI
{ {
this.hWConfig.hwconfiginfo.GCNum = this.GCNum.Text; this.hWConfig.hwconfiginfo.GCNum = this.GCNum.Text;
this.hWConfig.hwconfiginfo.GCName = this.GCName.Text; this.hWConfig.hwconfiginfo.GCName = this.GCName.Text;
this.hWConfig.hwconfiginfo.u16StartType = this.StartType.SelectedIndex; this.hWConfig.hwconfiginfo.u16StartType = this.StartType.SelectedIndex + 1;
} }
this.Close(); this.Close();
} }
......
...@@ -36,7 +36,6 @@ namespace GcDevicePc ...@@ -36,7 +36,6 @@ namespace GcDevicePc
dataleft.CloseButtonVisible = false; dataleft.CloseButtonVisible = false;
//dataleft.Close_Threading(); //dataleft.Close_Threading();
//dataleft.Close(); //dataleft.Close();
} }
public void CloseThread() public void CloseThread()
......
using System; using GcDevicePc.Common;
using Ini.Net;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
...@@ -116,34 +118,64 @@ namespace GcDevicePc.GCBuffer ...@@ -116,34 +118,64 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.outputinfo.port = 0; gcpcinfo.outputinfo.port = 0;
try
{
//string file = System.Windows.Forms.Application.StartupPath+ "\\startup.ini"; //string file = System.Windows.Forms.Application.StartupPath+ "\\startup.ini";
//string file = System.Windows.Forms.Application.StartupPath+ "\\..\\GC_Config\\GC_Set\\启动参数" + "\\startup.ini"; //string file = System.Windows.Forms.Application.StartupPath+ "\\..\\GC_Config\\GC_Set\\启动参数" + "\\startup.ini";
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini"); string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
if (File.Exists(file)) if (File.Exists(file))
{ {
INIOperation test = new INIOperation(file); IniFile ini = new IniFile(file);
string opensys = test.INIGetStringValue("StartUp", "打开系统", null);
string runtype = test.INIGetStringValue("StartUp", "运行类型", null); int opensys = ini.ReadInteger("StartUp", "打开系统");
int runtype = ini.ReadInteger("StartUp", "运行类型");
int senddata = ini.ReadInteger("StartUp", "SendData");
gcpcinfo.pcfolderinfo.DataFolder = ini.ReadString("DataFolder", "历史数据");
gcpcinfo.pcworkinfo.hmimac = ini.ReadString("NetWorkConfig", "MAC地址");
if (opensys == 1)
{
gcpcinfo.pcworkinfo.RunType = (ushort)runtype;
}
else
{
gcpcinfo.pcworkinfo.RunType = 0;
}
if (senddata == 1)
{
gcpcinfo.pcworkinfo.sendtohw = true;
}
else
{
gcpcinfo.pcworkinfo.sendtohw = false;
}
string wtd624x_ip = test.INIGetStringValue("WTD624X", "IP", null); //INIOperation test = new INIOperation(file);
string wtd624x_mask = test.INIGetStringValue("WTD624X", "MASK", null); //string opensys = test.INIGetStringValue("StartUp", "打开系统", null);
string wtd624x_gw = test.INIGetStringValue("WTD624X", "GW", null); //string runtype = test.INIGetStringValue("StartUp", "运行类型", null);
string wtd624x_ip = ini.ReadString("WTD624X", "IP");
string wtd624x_mask = ini.ReadString("WTD624X", "MASK");
string wtd624x_gw = ini.ReadString("WTD624X", "GW");
string info_log = test.INIGetStringValue("Logs", "InfoLog", null);
string err_log = test.INIGetStringValue("Logs", "ErrLog", null);
string hmi_log = test.INIGetStringValue("Logs", "HmiLog", null);
string info_log = ini.ReadString("Logs", "InfoLog");
string err_log = ini.ReadString("Logs", "ErrLog");
string hmi_log = ini.ReadString("Logs", "HmiLog");
string gc485 = test.INIGetStringValue("GC485", "COM", null);
string gc485 = ini.ReadString("GC485", "COM");
//string senddata = test.INIGetStringValue("StartUp", "SendData", null); //string senddata = test.INIGetStringValue("StartUp", "SendData", null);
if (Convert.ToInt32(opensys) == 1) //if (Convert.ToInt32(opensys) == 1)
{ //{
gcpcinfo.pcworkinfo.RunType = Convert.ToUInt16(runtype); // gcpcinfo.pcworkinfo.RunType = Convert.ToUInt16(runtype);
} //}
if (!String.IsNullOrEmpty(wtd624x_ip)) if (!String.IsNullOrEmpty(wtd624x_ip))
{ {
...@@ -179,11 +211,25 @@ namespace GcDevicePc.GCBuffer ...@@ -179,11 +211,25 @@ namespace GcDevicePc.GCBuffer
{ {
gcpcinfo.pcworkinfo.hmi_log = hmi_log.Equals("1") ? true : false; gcpcinfo.pcworkinfo.hmi_log = hmi_log.Equals("1") ? true : false;
} }
}
//string file = System.Windows.Forms.Application.StartupPath + "\\startup.ini";
//if (File.Exists(file))
// gcpcinfo.pcworkinfo.RunType = 0; //运行类型 0 打开运行 1 智能运行 2 批处理 // gcpcinfo.pcworkinfo.RunType = 0; //运行类型 0 打开运行 1 智能运行 2 批处理
} }
else
{
gcpcinfo.pcworkinfo.RunType = 0;
gcpcinfo.pcworkinfo.sendtohw = false;
gcpcinfo.pcfolderinfo.DataFolder = null;
}
}
catch (Exception e)
{
Log.Error(e.Message);
}
}
} }
} }
...@@ -96,8 +96,9 @@ ...@@ -96,8 +96,9 @@
<Reference Include="CKVocAlgorithm"> <Reference Include="CKVocAlgorithm">
<HintPath>..\dll\CKVocAlgorithm.dll</HintPath> <HintPath>..\dll\CKVocAlgorithm.dll</HintPath>
</Reference> </Reference>
<Reference Include="CKVocAnalyzer"> <Reference Include="CKVocAnalyzer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\dll\CKVocAnalyzer.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>bin\x86\Debug\CKVocAnalyzer.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ini.Net, Version=1.0.5531.18665, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Ini.Net, Version=1.0.5531.18665, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ini.net.1.1.0\lib\net20\Ini.Net.dll</HintPath> <HintPath>..\packages\ini.net.1.1.0\lib\net20\Ini.Net.dll</HintPath>
......
...@@ -611,7 +611,8 @@ namespace GcDevicePc ...@@ -611,7 +611,8 @@ namespace GcDevicePc
try try
{ {
int opensys = 0; int opensys = 0;
String tmpfile = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini"; //String tmpfile = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string tmpfile = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
globaldata.starttimer = 0x7FFFFFFF; globaldata.starttimer = 0x7FFFFFFF;
IniFile IniParser = new IniFile(tmpfile); IniFile IniParser = new IniFile(tmpfile);
...@@ -1762,6 +1763,7 @@ namespace GcDevicePc ...@@ -1762,6 +1763,7 @@ namespace GcDevicePc
bool ret = false; bool ret = false;
try try
{ {
if(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue) if(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue)
{ {
MessageBox.Show("系统开启中......"); MessageBox.Show("系统开启中......");
...@@ -1770,6 +1772,9 @@ namespace GcDevicePc ...@@ -1770,6 +1772,9 @@ namespace GcDevicePc
if (!String.IsNullOrEmpty(globaldata.connection_ip)) if (!String.IsNullOrEmpty(globaldata.connection_ip))
{ {
if (!OSflag)
{
OSflag = !OSflag;
hmiopt.WriteStopVal(); hmiopt.WriteStopVal();
statestr = "系统准备中..."; statestr = "系统准备中...";
...@@ -1789,23 +1794,41 @@ namespace GcDevicePc ...@@ -1789,23 +1794,41 @@ namespace GcDevicePc
{ {
hmiopt.WriteSingleVal(); hmiopt.WriteSingleVal();
} }
Console.WriteLine("WaitHMIWork "); //Console.WriteLine("WaitHMIWork ");
WaitHMIWork(); WaitHMIWork();
Console.WriteLine("WaitHMIWork End"); //Console.WriteLine("WaitHMIWork End");
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = true; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = true;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
globaldata.starttimer = 0; globaldata.starttimer = 0;
globaldata.startimerIsSet = true; globaldata.startimerIsSet = true;
} }
else else
{ {
OSflag = !OSflag;
//SetTitleStatueName("系统停止中...", false);
globaldata.OS_STOP = true;
hmiopt.WriteEndVal();
WaitHMIFree();
//SetTitleStatueName("系统停止...", false);
//int tagnum = Convert.ToInt32(((PictureBox)panelMenu.Controls[14]).Tag);
//((PictureBox)panelMenu.Controls[14]).Image = menuList.Images[tagnum];
//((PictureBox)panelMenu.Controls[0]).Enabled = false;
//((PictureBox)panelMenu.Controls[0]).Image = menuList.Images[14];
//((PictureBox)panelMenu.Controls[1]).Enabled = false;
//((PictureBox)panelMenu.Controls[1]).Image = menuList.Images[15];
//((PictureBox)panelMenu.Controls[2]).Enabled = false;
//((PictureBox)panelMenu.Controls[2]).Image = menuList.Images[16];
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = false; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = false;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
} }
}
} }
catch(Exception ex) catch(Exception ex)
...@@ -1911,7 +1934,7 @@ namespace GcDevicePc ...@@ -1911,7 +1934,7 @@ namespace GcDevicePc
{ {
if (!String.IsNullOrEmpty(globaldata.connection_ip)) if (!String.IsNullOrEmpty(globaldata.connection_ip))
{ {
OSflag = !OSflag;
statestr = "系统停止中..."; statestr = "系统停止中...";
globaldata.OS_STOP = true; globaldata.OS_STOP = true;
hmiopt.WriteEndVal(); hmiopt.WriteEndVal();
......
...@@ -169,7 +169,7 @@ namespace GcDevicePc.ProThread ...@@ -169,7 +169,7 @@ namespace GcDevicePc.ProThread
{ {
if ((((UInt32)listRawTem[rami][0] < globaldata.starttimer))) if ((((UInt32)listRawTem[rami][0] < globaldata.starttimer)))
{ {
Console.WriteLine("listRawTem " + listRawTem[rami][0].ToString() + "starttimer " + globaldata.starttimer.ToString()); //Console.WriteLine("listRawTem " + listRawTem[rami][0].ToString() + "starttimer " + globaldata.starttimer.ToString());
} }
else else
{ {
...@@ -192,11 +192,11 @@ namespace GcDevicePc.ProThread ...@@ -192,11 +192,11 @@ namespace GcDevicePc.ProThread
if(((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f) > 70000) if(((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f) > 70000)
{ {
//time += 0.00083; //time += 0.00083;
Console.WriteLine("ctimer " + ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer.ToString() + "starttimer " + globaldata.starttimer.ToString()); //Console.WriteLine("ctimer " + ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer.ToString() + "starttimer " + globaldata.starttimer.ToString());
} }
else else
{ {
Console.WriteLine("两差 "+ ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f)); //Console.WriteLine("两差 "+ ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f));
time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f); time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f);
} }
...@@ -209,8 +209,8 @@ namespace GcDevicePc.ProThread ...@@ -209,8 +209,8 @@ namespace GcDevicePc.ProThread
{ {
listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) }); listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) });
listRaw.Add(new double[] {((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer, Math.Round(value, 6) }); listRaw.Add(new double[] {((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer, Math.Round(value, 6) });
Console.WriteLine("mathtime "+ Math.Round(time, 4) + " time " + time); //Console.WriteLine("mathtime "+ Math.Round(time, 4) + " time " + time);
Console.WriteLine("time1 "+ ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer + " i " + i); //Console.WriteLine("time1 "+ ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer + " i " + i);
} }
......
...@@ -178,7 +178,7 @@ namespace GcDevicePc.ProThread ...@@ -178,7 +178,7 @@ namespace GcDevicePc.ProThread
m_DeviceInfo.Gateway = String.Format("{0}.{1}.{2}.{3}", pBuf[120], pBuf[121], pBuf[122], pBuf[123]); m_DeviceInfo.Gateway = String.Format("{0}.{1}.{2}.{3}", pBuf[120], pBuf[121], pBuf[122], pBuf[123]);
string tmpmac = String.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}", pBuf[106], pBuf[107], pBuf[108], pBuf[109], pBuf[110], pBuf[111]); string tmpmac = String.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}", pBuf[106], pBuf[107], pBuf[108], pBuf[109], pBuf[110], pBuf[111]);
if (FMAC != null) if (!string.IsNullOrEmpty(FMAC))
{ {
if (FMAC == tmpmac) if (FMAC == tmpmac)
{ {
......
...@@ -14,6 +14,7 @@ using System.Management; ...@@ -14,6 +14,7 @@ using System.Management;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using System.IO;
namespace GcDevicePc namespace GcDevicePc
{ {
...@@ -27,7 +28,9 @@ namespace GcDevicePc ...@@ -27,7 +28,9 @@ namespace GcDevicePc
private void autorun_CheckedChanged(object sender, EventArgs e) private void autorun_CheckedChanged(object sender, EventArgs e)
{ {
string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini"; //string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
INIOperation test = new INIOperation(file); INIOperation test = new INIOperation(file);
int count = 0; int count = 0;
...@@ -74,7 +77,9 @@ namespace GcDevicePc ...@@ -74,7 +77,9 @@ namespace GcDevicePc
private void appstartup_CheckedChanged(object sender, EventArgs e) private void appstartup_CheckedChanged(object sender, EventArgs e)
{ {
string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini"; //string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
INIOperation test = new INIOperation(file); INIOperation test = new INIOperation(file);
string value; string value;
if(this.appstartup.Checked) if(this.appstartup.Checked)
...@@ -138,7 +143,9 @@ namespace GcDevicePc ...@@ -138,7 +143,9 @@ namespace GcDevicePc
private void UserConfig_Load(object sender, EventArgs e) private void UserConfig_Load(object sender, EventArgs e)
{ {
string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini"; //string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
INIOperation test = new INIOperation(file); INIOperation test = new INIOperation(file);
string MAC = test.INIGetStringValue("NetWorkConfig", "MAC地址", null); string MAC = test.INIGetStringValue("NetWorkConfig", "MAC地址", null);
string value = test.INIGetStringValue("StartUp", "自启动", null); string value = test.INIGetStringValue("StartUp", "自启动", null);
...@@ -149,15 +156,35 @@ namespace GcDevicePc ...@@ -149,15 +156,35 @@ namespace GcDevicePc
string err_log = test.INIGetStringValue("Logs", "ErrLog", null); string err_log = test.INIGetStringValue("Logs", "ErrLog", null);
string hmi_log = test.INIGetStringValue("Logs", "HmiLog", null); string hmi_log = test.INIGetStringValue("Logs", "HmiLog", null);
try
{
if (String.IsNullOrEmpty(MAC)) if (String.IsNullOrEmpty(MAC))
{ {
this.label1.Text = "目前Mac(未绑定):"; this.label1.Text = "目前Mac(未绑定):";
//this.label3.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr; this.label3.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr;
mac1.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr.Split(':')[0].ToString();
mac2.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr.Split(':')[1].ToString();
mac3.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr.Split(':')[2].ToString();
mac4.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr.Split(':')[3].ToString();
mac5.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr.Split(':')[4].ToString();
mac6.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr.Split(':')[5].ToString();
} }
else else
{ {
this.label3.Text = MAC; this.label3.Text = MAC;
mac1.Text = MAC.Split(':')[0].ToString();
mac2.Text = MAC.Split(':')[1].ToString();
mac3.Text = MAC.Split(':')[2].ToString();
mac4.Text = MAC.Split(':')[3].ToString();
mac5.Text = MAC.Split(':')[4].ToString();
mac6.Text = MAC.Split(':')[5].ToString();
}
} }
catch
{
}
if (Convert.ToInt32(value) == 1) if (Convert.ToInt32(value) == 1)
{ {
...@@ -277,17 +304,36 @@ namespace GcDevicePc ...@@ -277,17 +304,36 @@ namespace GcDevicePc
private void changemac_Click(object sender, EventArgs e) private void changemac_Click(object sender, EventArgs e)
{ {
//bool ret = false;
//string newMac = string.Format(String.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}", mac1.Text, mac2.Text, mac3.Text, mac4.Text, mac5.Text, mac6.Text));
//string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
//INIOperation test = new INIOperation(file);
//ret = test.INIWriteValue(file, "NetWorkConfig", "MAC地址", newMac);
//if (ret)
//{
// MessageBox.Show("MAC绑定修改成功!", "提示");
//}else
//{
// MessageBox.Show("MAC绑定修改失败!", "提示");
//}
bool ret = false; bool ret = false;
string newMac = string.Format(String.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}",mac1.Text,mac2.Text,mac3.Text,mac4.Text,mac5.Text,mac6.Text)); string newMac = string.Format(String.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}", mac1.Text, mac2.Text, mac3.Text, mac4.Text, mac5.Text, mac6.Text));
//string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
INIOperation test = new INIOperation(file); INIOperation test = new INIOperation(file);
ret = test.INIWriteValue(file, "NetWorkConfig", "MAC地址", newMac); ret = test.INIWriteValue(file, "NetWorkConfig", "MAC地址", newMac);
if (ret) if (ret)
{ {
MessageBox.Show("MAC绑定修改成功!", "提示"); MessageBox.Show("MAC绑定修改成功,请重启软件!", "提示");
}else }
else
{ {
MessageBox.Show("MAC绑定修改失败!", "提示"); MessageBox.Show("MAC绑定修改失败!", "提示");
} }
...@@ -316,7 +362,11 @@ namespace GcDevicePc ...@@ -316,7 +362,11 @@ namespace GcDevicePc
int i = 0; int i = 0;
string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini"; //string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
INIOperation test = new INIOperation(file); INIOperation test = new INIOperation(file);
string myMAC = test.INIGetStringValue("NetWorkConfig", "MAC地址", null); string myMAC = test.INIGetStringValue("NetWorkConfig", "MAC地址", null);
try try
...@@ -497,7 +547,10 @@ namespace GcDevicePc ...@@ -497,7 +547,10 @@ namespace GcDevicePc
/// <param name="e"></param> /// <param name="e"></param>
private void permin_CheckedChanged(object sender, EventArgs e) private void permin_CheckedChanged(object sender, EventArgs e)
{ {
string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini"; //string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
try try
{ {
INIOperation test = new INIOperation(file); INIOperation test = new INIOperation(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