Commit edc81683 authored by liu's avatar liu

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

parent 592d4b65
......@@ -839,14 +839,6 @@ namespace GcDevicePc
string ip;
while (true)
{
Thread.Sleep(3000);
if (globaldata.OffLinkMode)
{
globaldata.connection_ip = "";
break;
}
else
{
ret = mysearch.ThStart();
......@@ -869,6 +861,11 @@ namespace GcDevicePc
mysearch.ReGetHmiIp();
Thread.Sleep(2000);
}
if (globaldata.OffLinkMode)
{
globaldata.connection_ip = "";
break;
}
}
}
......
......@@ -35,7 +35,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
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.Name = "AdjustFrom";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
......
......@@ -34,7 +34,6 @@
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox6 = new System.Windows.Forms.TextBox();
......@@ -44,6 +43,7 @@
this.textBox4 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.textBox2 = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
......@@ -102,15 +102,6 @@
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(116, 29);
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
//
......@@ -203,6 +194,14 @@
this.timer1.Interval = 60000;
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
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -225,7 +224,6 @@
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Timer timer1;
......@@ -235,6 +233,6 @@
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox2;
}
}
......@@ -58,7 +58,8 @@ namespace GcDevicePc.CK_UI
{
Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype;
isppm = false;
groupBox1.Text = "结果(mg/m³)";
switch (Systemtype)
{
default: //非甲烷总烃
......@@ -273,7 +274,7 @@ namespace GcDevicePc.CK_UI
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "ppm";
}
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³";
}
......@@ -302,6 +303,8 @@ namespace GcDevicePc.CK_UI
}
else
textBox2.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[2].name)
......@@ -323,8 +326,6 @@ namespace GcDevicePc.CK_UI
textBox3.BackColor = zcolor;
}
}
......@@ -740,37 +741,37 @@ namespace GcDevicePc.CK_UI
}
private void textBox1_DoubleClick(object sender, EventArgs e)
{
isppm = !isppm;
if(isppm)
{
groupBox1.Text = "结果(ppm)";
}else
groupBox1.Text = "结果(mg/m³)";
try
{
switch (Systemtype)
{
default: //非甲烷总烃
data();
datadisp();
UIVisible(false);
break;
case 1:
data2();
datadisp2();
break;
}
// Trace.WriteLine("绘图","sys");
}
catch (Exception ex)
{
Trace.Write(ex);
}
}
//private void textBox1_DoubleClick(object sender, EventArgs e)
//{
// isppm = !isppm;
// if(isppm)
// {
// groupBox1.Text = "结果(ppm)";
// }else
// groupBox1.Text = "结果(mg/m³)";
// try
// {
// switch (Systemtype)
// {
// default: //非甲烷总烃
// data();
// datadisp();
// UIVisible(false);
// break;
// case 1:
// data2();
// datadisp2();
// break;
// }
// // Trace.WriteLine("绘图","sys");
// }
// catch (Exception ex)
// {
// Trace.Write(ex);
// }
//}
}
}
......@@ -90,6 +90,8 @@ namespace GcDevicePc.Common
}
static ushort slavereadhreg(ushort address)
{
try
{
ushort value = 0;
ushort signalddress = 17;
......@@ -127,14 +129,12 @@ namespace GcDevicePc.Common
{
value = 0;
}
}
else
{
value = 0;
}
}
//分析仪状态
if (address >= 1 && address < 20)
{
......@@ -142,12 +142,12 @@ namespace GcDevicePc.Common
{
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)
{
value = (ushort) ((globaldata.m_hmibuffer.gcinfo.batruncount * 1.0f) /
(ushort) (SharedSpace.MControl.dateend * 1.0f /
value = (ushort)((globaldata.m_hmibuffer.gcinfo.batruncount * 1.0f) /
(ushort)(SharedSpace.MControl.dateend * 1.0f /
SharedSpace.MControl.zhouqi) * 1000);
}
else
......@@ -166,16 +166,16 @@ namespace GcDevicePc.Common
{
if (!SharedSpace.MControl.SetOut && !SharedSpace.MControl.SetRun)
{
if ((ushort) SharedSpace.Data.typesint == 3)
if ((ushort)SharedSpace.Data.typesint == 3)
value = 5;
else if ((ushort) SharedSpace.Data.typesint == 4)
else if ((ushort)SharedSpace.Data.typesint == 4)
value = 6;
else
value = (ushort) SharedSpace.Data.typesint;
value = (ushort)SharedSpace.Data.typesint;
}
else
{
value = (ushort) SharedSpace.Data.typesint;
value = (ushort)SharedSpace.Data.typesint;
}
}
break;
......@@ -350,6 +350,15 @@ namespace GcDevicePc.Common
}
return value;
}
catch (Exception e)
{
Console.WriteLine("异常" + e.Message);
return 0;
}
}
//static ushort slavereadhreg(ushort address)
//{
......
......@@ -31,7 +31,7 @@ namespace GcDevicePc.ConfigMethod
this.methodconfig.GetFidByID(index);
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].fAirFlowSet.ToString();
......
......@@ -34,7 +34,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
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();
txtPressure.Text = this.methodconfig.port[index].pipPressureActual.ToString();
......@@ -180,7 +180,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
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();
txtPressure.Text = this.methodconfig.auxs[index].pipPressureActual.ToString();
......
......@@ -1126,49 +1126,67 @@ namespace GcDevicePc
//前进样口
if (CProfileDevice.m_DevParam.syspara.u16InjPortFront == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp != 0.0f)
{
tempshow = new ListViewItem();
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"));
this.datalist.Items.Add(tempshow);
}
//else
//{
// //tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + "未定义");
//}
}
if (CProfileDevice.m_DevParam.syspara.u16InjPortBehind == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp != 0.0f)
{
tempshow = new ListViewItem();
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"));
this.datalist.Items.Add(tempshow);
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + "未定义");
//else
}
if (CProfileDevice.m_DevParam.syspara.u16Col == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp != 0.0f)
{
tempshow = new ListViewItem();
tempshow.Text = "柱箱";
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) + " / " + "未定义");
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp.ToString("0"));
this.datalist.Items.Add(tempshow);
}
//else
}
if (CProfileDevice.m_DevParam.syspara.u16DetNum >= 1)
{
if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp != 0.0f)
{
tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 0) //TCD
......@@ -1184,17 +1202,21 @@ namespace GcDevicePc
{
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"));
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 (globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp != 0.0f)
{
tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 0) //TCD
......@@ -1210,22 +1232,21 @@ namespace GcDevicePc
{
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"));
}
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 (globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp != 0.0f)
{
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + "未定义");
tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 0)
{
......@@ -1241,23 +1262,19 @@ namespace GcDevicePc
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"));
}
this.datalist.Items.Add(tempshow);
}
}
}
if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterNum > 0)
{
if (CProfileDevice.m_DevParam.syspara.u16AuxHeater1 == 1) //TCD
{
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1 != 0.0f)
{
tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterName1 != null)
......@@ -1265,18 +1282,22 @@ namespace GcDevicePc
else
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"));
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 (globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp2 != 0.0f)
{
tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterName2 != null)
......@@ -1284,14 +1305,15 @@ namespace GcDevicePc
else
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"));
}
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)
// tempshow.SubItems.Add(CProfileDevice.m_DevParam.aux.fActualTemp_HeatArea2.ToString("#0.00") + " / " + "等待读取");
......@@ -1505,7 +1527,7 @@ namespace GcDevicePc
this.datalist.Items.Add(tempshow);
if (CProfileDevice.m_DevParam.syspara.u16StartType == 2)
if (CProfileDevice.m_DevParam.syspara.u16StartType == 3)
{
tempshow = new ListViewItem();
tempshow.Text = GettempName("氢气流量(mL/min)");
......@@ -1822,7 +1844,7 @@ namespace GcDevicePc
this.datalist.Items.Add(tempshow);
//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.Text = GettempName("载气流量");
......
......@@ -332,6 +332,8 @@ namespace GcDevicePc.DeviceConfigUI
#region 控件事件
private void HMIConfigTree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
try
{
if (e.Button == MouseButtons.Right || e.Node.Level == 0)
return;
......@@ -367,6 +369,12 @@ namespace GcDevicePc.DeviceConfigUI
}
}
catch
{
}
}
/// <summary>
///
......
......@@ -61,8 +61,8 @@
//
this.StartType.FormattingEnabled = true;
this.StartType.Items.AddRange(new object[] {
"机械阀",
"进样EPC",
"机械阀",
"全EPC"});
this.StartType.Location = new System.Drawing.Point(157, 143);
this.StartType.Name = "StartType";
......
......@@ -39,7 +39,7 @@ namespace GcDevicePc.DeviceConfigUI
{
this.GCNum.Text = this.hWConfig.hwconfiginfo.GCNum;
this.GCName.Text = this.hWConfig.hwconfiginfo.GCName;
this.StartType.SelectedIndex = this.hWConfig.hwconfiginfo.u16StartType;
this.StartType.SelectedIndex = this.hWConfig.hwconfiginfo.u16StartType - 1;
}
}
catch
......@@ -57,7 +57,7 @@ namespace GcDevicePc.DeviceConfigUI
{
this.hWConfig.hwconfiginfo.GCNum = this.GCNum.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();
}
......
......@@ -36,7 +36,6 @@ namespace GcDevicePc
dataleft.CloseButtonVisible = false;
//dataleft.Close_Threading();
//dataleft.Close();
}
public void CloseThread()
......
using System;
using GcDevicePc.Common;
using Ini.Net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
......@@ -116,34 +118,64 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.outputinfo.port = 0;
try
{
//string file = System.Windows.Forms.Application.StartupPath+ "\\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");
if (File.Exists(file))
{
INIOperation test = new INIOperation(file);
string opensys = test.INIGetStringValue("StartUp", "打开系统", null);
string runtype = test.INIGetStringValue("StartUp", "运行类型", null);
IniFile ini = new IniFile(file);
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);
string wtd624x_mask = test.INIGetStringValue("WTD624X", "MASK", null);
string wtd624x_gw = test.INIGetStringValue("WTD624X", "GW", null);
//INIOperation test = new INIOperation(file);
//string opensys = test.INIGetStringValue("StartUp", "打开系统", 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);
if (Convert.ToInt32(opensys) == 1)
{
gcpcinfo.pcworkinfo.RunType = Convert.ToUInt16(runtype);
}
//if (Convert.ToInt32(opensys) == 1)
//{
// gcpcinfo.pcworkinfo.RunType = Convert.ToUInt16(runtype);
//}
if (!String.IsNullOrEmpty(wtd624x_ip))
{
......@@ -179,11 +211,25 @@ namespace GcDevicePc.GCBuffer
{
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 批处理
}
else
{
gcpcinfo.pcworkinfo.RunType = 0;
gcpcinfo.pcworkinfo.sendtohw = false;
gcpcinfo.pcfolderinfo.DataFolder = null;
}
}
catch (Exception e)
{
Log.Error(e.Message);
}
}
}
}
......@@ -96,8 +96,9 @@
<Reference Include="CKVocAlgorithm">
<HintPath>..\dll\CKVocAlgorithm.dll</HintPath>
</Reference>
<Reference Include="CKVocAnalyzer">
<HintPath>..\dll\CKVocAnalyzer.dll</HintPath>
<Reference Include="CKVocAnalyzer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\x86\Debug\CKVocAnalyzer.dll</HintPath>
</Reference>
<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>
......
......@@ -611,7 +611,8 @@ namespace GcDevicePc
try
{
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;
IniFile IniParser = new IniFile(tmpfile);
......@@ -1762,6 +1763,7 @@ namespace GcDevicePc
bool ret = false;
try
{
if(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue)
{
MessageBox.Show("系统开启中......");
......@@ -1770,6 +1772,9 @@ namespace GcDevicePc
if (!String.IsNullOrEmpty(globaldata.connection_ip))
{
if (!OSflag)
{
OSflag = !OSflag;
hmiopt.WriteStopVal();
statestr = "系统准备中...";
......@@ -1789,23 +1794,41 @@ namespace GcDevicePc
{
hmiopt.WriteSingleVal();
}
Console.WriteLine("WaitHMIWork ");
//Console.WriteLine("WaitHMIWork ");
WaitHMIWork();
Console.WriteLine("WaitHMIWork End");
//Console.WriteLine("WaitHMIWork End");
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = true;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
globaldata.starttimer = 0;
globaldata.startimerIsSet = true;
}
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.work_Statue = 0;
}
}
}
catch(Exception ex)
......@@ -1911,7 +1934,7 @@ namespace GcDevicePc
{
if (!String.IsNullOrEmpty(globaldata.connection_ip))
{
OSflag = !OSflag;
statestr = "系统停止中...";
globaldata.OS_STOP = true;
hmiopt.WriteEndVal();
......
......@@ -169,7 +169,7 @@ namespace GcDevicePc.ProThread
{
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
{
......@@ -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)
{
//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
{
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);
}
......@@ -209,8 +209,8 @@ namespace GcDevicePc.ProThread
{
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) });
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("mathtime "+ Math.Round(time, 4) + " time " + time);
//Console.WriteLine("time1 "+ ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer + " i " + i);
}
......
......@@ -178,7 +178,7 @@ namespace GcDevicePc.ProThread
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]);
if (FMAC != null)
if (!string.IsNullOrEmpty(FMAC))
{
if (FMAC == tmpmac)
{
......
......@@ -14,6 +14,7 @@ using System.Management;
using System.Text.RegularExpressions;
using System.Threading;
using System.Net.NetworkInformation;
using System.IO;
namespace GcDevicePc
{
......@@ -27,7 +28,9 @@ namespace GcDevicePc
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);
int count = 0;
......@@ -74,7 +77,9 @@ namespace GcDevicePc
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);
string value;
if(this.appstartup.Checked)
......@@ -138,7 +143,9 @@ namespace GcDevicePc
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);
string MAC = test.INIGetStringValue("NetWorkConfig", "MAC地址", null);
string value = test.INIGetStringValue("StartUp", "自启动", null);
......@@ -149,15 +156,35 @@ namespace GcDevicePc
string err_log = test.INIGetStringValue("Logs", "ErrLog", null);
string hmi_log = test.INIGetStringValue("Logs", "HmiLog", null);
try
{
if (String.IsNullOrEmpty(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
{
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)
{
......@@ -277,17 +304,36 @@ namespace GcDevicePc
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;
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);
ret = test.INIWriteValue(file, "NetWorkConfig", "MAC地址", newMac);
if (ret)
{
MessageBox.Show("MAC绑定修改成功!", "提示");
}else
MessageBox.Show("MAC绑定修改成功,请重启软件!", "提示");
}
else
{
MessageBox.Show("MAC绑定修改失败!", "提示");
}
......@@ -316,7 +362,11 @@ namespace GcDevicePc
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);
string myMAC = test.INIGetStringValue("NetWorkConfig", "MAC地址", null);
try
......@@ -497,7 +547,10 @@ namespace GcDevicePc
/// <param name="e"></param>
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
{
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