Commit edc81683 authored by liu's avatar liu

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

parent 592d4b65
......@@ -840,35 +840,32 @@ namespace GcDevicePc
while (true)
{
Thread.Sleep(3000);
if (globaldata.OffLinkMode)
ret = mysearch.ThStart();
if (ret)
{
globaldata.connection_ip = "";
break;
Thread.Sleep(3000);
hmicount = mysearch.HMICount();
if (hmicount >= 1)
{
ip = (((globaldata.DeviceInfo)(mysearch.myHMIList[0])).IpAddr);
globaldata.connection_ip = ip;
mysearch.ThStop();
break;
}
mysearch.ThStop();
}
else
{
ret = mysearch.ThStart();
if (ret)
{
Thread.Sleep(3000);
hmicount = mysearch.HMICount();
if (hmicount >= 1)
{
ip = (((globaldata.DeviceInfo)(mysearch.myHMIList[0])).IpAddr);
globaldata.connection_ip = ip;
mysearch.ThStop();
break;
}
mysearch.ThStop();
mysearch.ReGetHmiIp();
Thread.Sleep(2000);
}
}
else
{
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;
}
}
......@@ -56,9 +56,10 @@ namespace GcDevicePc.CK_UI
{
try
{
Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype;
Systemtype = CKVocAnalyzer.GlobalCKV.Systemtype;
isppm = false;
groupBox1.Text = "结果(mg/m³)";
switch (Systemtype)
{
default: //非甲烷总烃
......@@ -264,7 +265,7 @@ namespace GcDevicePc.CK_UI
}
for (int i = 0; i < CKVocAnalyzer.GlobalCKV.vocparamlist.Count; i++)
{
{
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[0].name)
{
......@@ -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)
......@@ -322,10 +325,8 @@ namespace GcDevicePc.CK_UI
else
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);
// }
//}
}
}
This diff is collapsed.
......@@ -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();
......
This diff is collapsed.
......@@ -333,39 +333,47 @@ namespace GcDevicePc.DeviceConfigUI
#region 控件事件
private void HMIConfigTree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
if (e.Button == MouseButtons.Right || e.Node.Level == 0)
return;
int nodename = int.Parse(HMIConfigTree.SelectedNode.Tag.ToString());
if (nodename > 0 && nodename < 24)
try
{
if (nodename <= 3)
{
Device device = new Device(ref hWConfig);
device.ShowDialog();
}
else if (nodename <= 15)
{
Sampling sampling = new Sampling(ref hWConfig, nodename);
sampling.ShowDialog();
}
else if (nodename <= 18)
{
ColumnBox columnBox = new ColumnBox(ref hWConfig);
columnBox.ShowDialog();
}
else if (nodename <= 21)
{
Detection detection = new Detection(ref hWConfig);
detection.ShowDialog();
}
else
if (e.Button == MouseButtons.Right || e.Node.Level == 0)
return;
int nodename = int.Parse(HMIConfigTree.SelectedNode.Tag.ToString());
if (nodename > 0 && nodename < 24)
{
Auxiliary auxiliary = new Auxiliary(ref hWConfig);
auxiliary.ShowDialog();
}
if (nodename <= 3)
{
Device device = new Device(ref hWConfig);
device.ShowDialog();
}
else if (nodename <= 15)
{
Sampling sampling = new Sampling(ref hWConfig, nodename);
sampling.ShowDialog();
}
else if (nodename <= 18)
{
ColumnBox columnBox = new ColumnBox(ref hWConfig);
columnBox.ShowDialog();
}
else if (nodename <= 21)
{
Detection detection = new Detection(ref hWConfig);
detection.ShowDialog();
}
else
{
Auxiliary auxiliary = new Auxiliary(ref hWConfig);
auxiliary.ShowDialog();
}
}
}
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,74 +118,118 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.outputinfo.port = 0;
//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))
try
{
INIOperation test = new INIOperation(file);
string opensys = test.INIGetStringValue("StartUp", "打开系统", null);
string runtype = test.INIGetStringValue("StartUp", "运行类型", null);
//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");
string wtd624x_ip = test.INIGetStringValue("WTD624X", "IP", null);
string wtd624x_mask = test.INIGetStringValue("WTD624X", "MASK", null);
string wtd624x_gw = test.INIGetStringValue("WTD624X", "GW", null);
if (File.Exists(file))
{
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", "历史数据");
string info_log = test.INIGetStringValue("Logs", "InfoLog", null);
string err_log = test.INIGetStringValue("Logs", "ErrLog", null);
string hmi_log = test.INIGetStringValue("Logs", "HmiLog", null);
gcpcinfo.pcworkinfo.hmimac = ini.ReadString("NetWorkConfig", "MAC地址");
if (opensys == 1)
{
gcpcinfo.pcworkinfo.RunType = (ushort)runtype;
}
else
{
gcpcinfo.pcworkinfo.RunType = 0;
}
string gc485 = test.INIGetStringValue("GC485", "COM", null);
if (senddata == 1)
{
gcpcinfo.pcworkinfo.sendtohw = true;
}
else
{
gcpcinfo.pcworkinfo.sendtohw = false;
}
//string senddata = test.INIGetStringValue("StartUp", "SendData", null);
//INIOperation test = new INIOperation(file);
//string opensys = test.INIGetStringValue("StartUp", "打开系统", null);
//string runtype = test.INIGetStringValue("StartUp", "运行类型", null);
if (Convert.ToInt32(opensys) == 1)
{
gcpcinfo.pcworkinfo.RunType = Convert.ToUInt16(runtype);
}
string wtd624x_ip = ini.ReadString("WTD624X", "IP");
string wtd624x_mask = ini.ReadString("WTD624X", "MASK");
string wtd624x_gw = ini.ReadString("WTD624X", "GW");
if (!String.IsNullOrEmpty(wtd624x_ip))
{
gcpcinfo.moduleinfo.ip = wtd624x_ip;
}
if (!String.IsNullOrEmpty(wtd624x_mask))
{
gcpcinfo.moduleinfo.mask = wtd624x_mask;
}
string info_log = ini.ReadString("Logs", "InfoLog");
string err_log = ini.ReadString("Logs", "ErrLog");
string hmi_log = ini.ReadString("Logs", "HmiLog");
if (!String.IsNullOrEmpty(wtd624x_gw))
{
gcpcinfo.moduleinfo.gw = wtd624x_gw;
}
if (!String.IsNullOrEmpty(gc485))
{
gcpcinfo.outputinfo.port = Convert.ToByte(gc485);
}
string gc485 = ini.ReadString("GC485", "COM");
if (!String.IsNullOrEmpty(info_log))
{
gcpcinfo.pcworkinfo.info_log = info_log.Equals("1") ? true : false;
}
//string senddata = test.INIGetStringValue("StartUp", "SendData", null);
if (!String.IsNullOrEmpty(err_log))
{
gcpcinfo.pcworkinfo.error_log = err_log.Equals("1") ? true : false;
}
//if (Convert.ToInt32(opensys) == 1)
//{
// gcpcinfo.pcworkinfo.RunType = Convert.ToUInt16(runtype);
//}
if (!String.IsNullOrEmpty(hmi_log))
if (!String.IsNullOrEmpty(wtd624x_ip))
{
gcpcinfo.moduleinfo.ip = wtd624x_ip;
}
if (!String.IsNullOrEmpty(wtd624x_mask))
{
gcpcinfo.moduleinfo.mask = wtd624x_mask;
}
if (!String.IsNullOrEmpty(wtd624x_gw))
{
gcpcinfo.moduleinfo.gw = wtd624x_gw;
}
if (!String.IsNullOrEmpty(gc485))
{
gcpcinfo.outputinfo.port = Convert.ToByte(gc485);
}
if (!String.IsNullOrEmpty(info_log))
{
gcpcinfo.pcworkinfo.info_log = info_log.Equals("1") ? true : false;
}
if (!String.IsNullOrEmpty(err_log))
{
gcpcinfo.pcworkinfo.error_log = err_log.Equals("1") ? true : false;
}
if (!String.IsNullOrEmpty(hmi_log))
{
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.hmi_log = hmi_log.Equals("1") ? true : false;
gcpcinfo.pcworkinfo.RunType = 0;
gcpcinfo.pcworkinfo.sendtohw = false;
gcpcinfo.pcfolderinfo.DataFolder = null;
}
}
// gcpcinfo.pcworkinfo.RunType = 0; //运行类型 0 打开运行 1 智能运行 2 批处理
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,42 +1772,63 @@ namespace GcDevicePc
if (!String.IsNullOrEmpty(globaldata.connection_ip))
{
hmiopt.WriteStopVal();
statestr = "系统准备中...";
if (!OSflag)
{
OSflag = !OSflag;
hmiopt.WriteStopVal();
statestr = "系统准备中...";
WaitHMIFree();
WaitHMIFree();
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 2)
{
hmiopt.WriteBatVal();
}
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 2)
{
hmiopt.WriteBatVal();
}
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 0)
{
hmiopt.WriteOpenVal();
}
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 0)
{
hmiopt.WriteOpenVal();
}
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 1)
{
hmiopt.WriteSingleVal();
}
//Console.WriteLine("WaitHMIWork ");
WaitHMIWork();
//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;
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 1)
{
hmiopt.WriteSingleVal();
}
Console.WriteLine("WaitHMIWork ");
WaitHMIWork();
Console.WriteLine("WaitHMIWork End");
else
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = true;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
globaldata.starttimer = 0;
globaldata.startimerIsSet = true;
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;
}
}
else
{
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,16 +156,36 @@ namespace GcDevicePc
string err_log = test.INIGetStringValue("Logs", "ErrLog", null);
string hmi_log = test.INIGetStringValue("Logs", "HmiLog", null);
if (String.IsNullOrEmpty(MAC))
try
{
this.label1.Text = "目前Mac(未绑定):";
//this.label3.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr;
if (String.IsNullOrEmpty(MAC))
{
this.label1.Text = "目前Mac(未绑定):";
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();
}
}
else
catch
{
this.label3.Text = MAC;
}
if (Convert.ToInt32(value) == 1)
{
this.appstartup.Checked = true;
......@@ -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