Commit 2f1c2e54 authored by liu's avatar liu

针对redmine上内容进行修改

parent 954dc085
......@@ -42,7 +42,7 @@ namespace GcDevicePc
this.fid1ver.Text = this.FID1version;
this.fid2ver.Text = this.FID2version;
this.tcdver.Text = this.TCD1version;
this.PCver.Text = this.Hmiversion + "/1.5.1";
this.PCver.Text = this.Hmiversion + "/1.5.4";
}
}
}
......@@ -252,6 +252,7 @@ namespace GcDevicePc.CK_UI
Trace.Write(ex);
}
}
private void datadisp()
{
try
......
......@@ -585,6 +585,7 @@ namespace GcDevicePc.Common
}
return ret;
}
/// <summary>
/// 获取HMI状态
/// </summary>
......@@ -634,7 +635,6 @@ namespace GcDevicePc.Common
{
globaldata.m_hmibuffer.gcinfo.EPCStatus = epcdata;
}
}
#endregion
......
......@@ -35,61 +35,11 @@ namespace GcDevicePc.Common
slave.Listen();
//// 后台线程1:用于接收tcp连接请求,并将网络流加入列表。随主线程的退出而退出。
//new Thread(() =>
//{
// while (true)
// {
// Thread.Sleep(100);// 可以根据需要设置时间
// if (!listener.Pending())
// {
// continue;
// }
// var client = listener.AcceptTcpClient();
// // 下面属性根据需要进行设置
// // client.ReceiveBufferSize
// // client.ReceiveTimeout
// // client.SendBufferSize
// // client.SendTimeout
// if (!client.Connected)
// {
// continue;
// }
// streams.Add(client.GetStream());
// }
//})
//{ IsBackground = true }.Start();
//// 后台线程2:用于接收请求,并作出响应。随主线程的退出而退出。
//new Thread(() =>
//{
// while (true)
// {
// Thread.Sleep(100);// 可以根据需要设置时间
// if (streams == null || streams.Count == 0)
// {
// continue;
// }
// streams = streams.Where(s => s.CanRead && s.CanWrite).ToList();
// foreach (var stream in streams.Where(stream => stream.CanRead && stream.CanWrite))
// {
// AsyncReceiveBytes(stream,
// s =>
// {
// // todo:对result进行解码
// // todo:对收到指令进行逻辑判断,得出待响应的C#对象
// AsyncSendBytes(s, new byte[0]); // todo:将待响应的C#对象转换成字节数组,替换new byte[0]。
// });
// }
// }
//})
//{ IsBackground = true }.Start();
}
public void NModbusSlaveClose()
{
//listener.Stop();
//slave.Dispose();
}
~NModbusSlave()
......@@ -97,55 +47,6 @@ namespace GcDevicePc.Common
listener.Stop();
slave.Dispose();
}
// 发送事件和目标的入口
//public void SendEventAndTarget()
//{
// if (streams == null || streams.Count == 0)
// {
// return;
// }
// streams = streams.Where(s => s.CanRead && s.CanWrite).ToList();
// foreach (var stream in streams.TakeWhile(stream => stream.CanWrite))
// {
// AsyncSendBytes(stream, new byte[0]);// todo:这里将待发送的C#对象转换的字节数组替换new byte[0]。
// }
//}
//private static void AsyncReceiveBytes(NetworkStream stream,
// Action<NetworkStream> callback)
//{
// // 短时后台线程:用于处理网络流的读操作,处理完成后即归还线程池。
// // 每个网络流都会分配一个线程。
// //ThreadPool.SetMaxThreads();根据需要设置。
// ThreadPool.QueueUserWorkItem(delegate
// {
// var buffer = new byte[1024];// 1024:根据需要进行设置。
// var result = new byte[0];
// do
// {
// var a = stream.Read(buffer, 0, buffer.Length);
// result = result.Concat(buffer.Take(a)).ToArray();
// } while (stream.DataAvailable);
// callback(stream);
// });
//}
//private static void AsyncSendBytes(NetworkStream stream, byte[] bytes)
//{
// // 短时后台线程:用于处理网络流的写操作,处理完成后即归还线程池。
// // 每个网络流都会分配一个线程。
// //ThreadPool.SetMaxThreads();根据需要设置。
// ThreadPool.QueueUserWorkItem(delegate
// {
// try
// {
// stream.Write(bytes, 0, bytes.Count());
// }
// catch (Exception)
// {
// Console.WriteLine("远程主机主动断开此连接!");// 也可以做其它处理。
// }
// });
//}
private readonly TcpListener listener;
// 网络流列表
......@@ -158,45 +59,23 @@ namespace GcDevicePc.Common
private void DataStore_DataStoreReadFrom(object sender, DataStoreEventArgs e)
{
//int iAddress = e.StartAddress;
try
{
//if (e.ModbusDataType == ModbusDataType.HoldingRegister)
//{
// //for (int i = 0; i < e.Data.B.Count; i++)
// {
// //Set AO
// //e.Data.B[i] already write to
// //slave.DataStore.HoldingRegisters[e.StartAddress + i + 1] = slavereadhreg(Convert.ToUInt16(e.StartAddress + i + 1));
// //e.StartAddress starts from 0
// //You can set AO value to hardware here
// }
// slave.DataStore.HoldingRegisters[e.StartAddress + 1] = slavereadhreg(Convert.ToUInt16(e.StartAddress + 1));
//}
switch (e.ModbusDataType)
{
case ModbusDataType.HoldingRegister:
for (int i = 0; i < e.Data.B.Count; i++)
{
//Set AO
//e.Data.B[i] already write to
//slave.DataStore.HoldingRegisters[e.StartAddress + i + 1] = 1;
slave.DataStore.HoldingRegisters[e.StartAddress + i + 1] = slavereadhreg(Convert.ToUInt16(e.StartAddress + i + 1));
//e.StartAddress starts from 0
//You can set AO value to hardware here
}
break;
case ModbusDataType.Coil:
for (int i = 0; i < e.Data.A.Count; i++)
{
//set DO
//e.Data.A[i] already write to
slave.DataStore.CoilDiscretes[e.StartAddress + i + 1] = slavereadcreg(Convert.ToUInt16(e.StartAddress + i + 1)) == 0 ? false : true;
//e.StartAddress starts from 0
//You can set DO value to hardware here
}
break;
}
......@@ -214,14 +93,7 @@ namespace GcDevicePc.Common
{
try
{
//if (e.ModbusDataType == ModbusDataType.HoldingRegister)
//{
// //for (int i = 0; i < e.Data.B.Count; i++)
// //{
// // Console.WriteLine("[" + i + "] " + e.Data.B[i]);
// //}
// slavewirtehreg(e.StartAddress, e.Data.B[e.StartAddress]);
//}
switch (e.ModbusDataType)
{
case ModbusDataType.HoldingRegister:
......@@ -241,16 +113,7 @@ namespace GcDevicePc.Common
//trigger Modbus_Request_Event
private void Modbus_Request_Event(object sender, ModbusSlaveRequestEventArgs e)
{
//disassemble packet from master
//byte fc = e.Message.FunctionCode;
//byte[] data = e.Message.MessageFrame;
//byte[] byteStartAddress = new byte[] { data[3], data[2] };
//byte[] byteNum = new byte[] { data[5], data[4] };
//Int16 StartAddress = BitConverter.ToInt16(byteStartAddress, 0);
//Int16 NumOfPoint = BitConverter.ToInt16(byteNum, 0);
//Console.WriteLine(fc.ToString() + "," + StartAddress.ToString() + "," +
//NumOfPoint.ToString());
//Console.WriteLine("asdadas");
}
......
......@@ -25,11 +25,28 @@ namespace GcDevicePc.ConfigMethod
this.methodconfig = methodconfig;
}
int configTemp;
public void reflashContent(int index)
{
this.methodconfig.GetFidByID(index);
switch (index)
{
case 0:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16DetFrontPTemp;
break;
case 1:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16DetInterPTemp;
break;
case 2:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16DetBehindPTemp;
break;
default:
break;
}
fidsettemp.Text = this.methodconfig.fid[index].fHeaterTempSet.ToString();
if (hwconfig.hwconfiginfo.u16StartType == 1 || hwconfig.hwconfiginfo.u16StartType == 3)
{
......@@ -165,7 +182,7 @@ namespace GcDevicePc.ConfigMethod
this.methodconfig.epc[0].ThirdFlow = string2float(tb空气压力设定.Text);
this.methodconfig.epc[0].gasType3 = (ushort)0;
}
bool isone = false;
private void fidsettemp_TextChanged(object sender, EventArgs e)
{
float tmpval = string2float(fidsettemp.Text);
......@@ -174,6 +191,21 @@ namespace GcDevicePc.ConfigMethod
MessageBox.Show("设置温度需要小于400");
fidsettemp.Text = "0";
}
else
{
if (isone)
{
if (tmpval > configTemp)
{
MessageBox.Show("设置温度不能大于保护温度");
(sender as TextBox).Text = "0";
}
}
else
{
isone = true;
}
}
}
}
}
......@@ -435,7 +435,7 @@ namespace GcDevicePc.ConfigMethod
}
SignalDataToHw.methodconfig = this.gcmethodconfig;
SendDataToZB.methodconfig = this.gcmethodconfig;
//string message = "提交成功!";
//MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
......
......@@ -278,7 +278,7 @@ namespace GcDevicePc.ConfigMethod
Page.UseVisualStyleBackColor = true;
tabControlDet.Controls.Add(Page);
tabControlDet.TabPages[tabControlDet.TabPages.Count-1].Text = "后进样口";
Detadd_Dlg(0,tabControlDet.TabPages.Count-1);
Detadd_Dlg(1,tabControlDet.TabPages.Count-1);
}
//if (hwconfig.hwconfiginfo.u16InjValveVA1 == 1)
......
......@@ -39,11 +39,28 @@ namespace GcDevicePc.ConfigMethod
return ret;
}
int configTemp;
public void reflashContent(int index)
{
this.methodconfig.GetTcdByID(index);
switch (index)
{
case 0:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16DetFrontPTemp;
break;
case 1:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16DetInterPTemp;
break;
case 2:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16DetBehindPTemp;
break;
default:
break;
}
//tb桥电流.Text = this.methodconfig.tcd[index].u16Electric.ToString();
tcdsettemp.Text = this.methodconfig.tcd[index].fHeaterTempSet.ToString();
......@@ -142,7 +159,7 @@ namespace GcDevicePc.ConfigMethod
//else if (cListBoxSign.GetItemChecked(2) == true)
// this.methodconfig.tcd[index].u16SigDeduct = 3;
}
bool isone = false;
private void tcdsettemp_TextChanged(object sender, EventArgs e)
{
float tmpval = string2float(tcdsettemp.Text);
......@@ -151,6 +168,21 @@ namespace GcDevicePc.ConfigMethod
MessageBox.Show("设置温度需要小于400");
tcdsettemp.Text = "0";
}
else
{
if (isone)
{
if (tmpval > configTemp)
{
MessageBox.Show("设置温度不能大于保护温度");
(sender as TextBox).Text = "0";
}
}
else
{
isone = true;
}
}
}
}
}
......@@ -88,6 +88,7 @@
this.txtHeater.Name = "txtHeater";
this.txtHeater.Size = new System.Drawing.Size(100, 24);
this.txtHeater.TabIndex = 4;
this.txtHeater.TextChanged += new System.EventHandler(this.TxtHeater_TextChanged);
//
// lblSamplePortType
//
......
......@@ -25,6 +25,8 @@ namespace GcDevicePc.ConfigMethod.injectionport
this.methodconfig = methodconfig;
}
int configTemp;
public void reflashContent(int index)
{
this.methodconfig.GetDevInjPortAllPara();
......@@ -32,8 +34,22 @@ namespace GcDevicePc.ConfigMethod.injectionport
label1.Text = "进样口类型:";
label21.Text = "进样口载气:";
switch (index)
{
case 0:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16InjPortFPTemp;
break;
case 1:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16InjPortBPTemp;
break;
default:
break;
}
txtHeater.Text = this.methodconfig.port[index].HeaterTmpActual.ToString();
if (this.hwconfig.hwconfiginfo.u16StartType == 1 || this.hwconfig.hwconfiginfo.u16StartType == 3)
{
txtFlow.Text = this.methodconfig.port[index].pipFlowActual.ToString();
......@@ -186,6 +202,17 @@ namespace GcDevicePc.ConfigMethod.injectionport
label1.Text = "辅助名:";
label21.Text = "辅助载气类型:";
switch (index)
{
case 0:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16AuxHeaterPTemp1;
break;
case 1:
configTemp = globaldata.m_hwconfig.hwconfiginfo.u16AuxHeaterPTemp2;
break;
default:
break;
}
if (this.hwconfig.hwconfiginfo.u16StartType == 1 || this.hwconfig.hwconfiginfo.u16StartType == 3)
{
......@@ -381,6 +408,34 @@ namespace GcDevicePc.ConfigMethod.injectionport
}
}
}
bool isone = false;
private void TxtHeater_TextChanged(object sender, EventArgs e)
{
float tmpval = string2float((sender as TextBox).Text);
if (tmpval > 400.0f)
{
MessageBox.Show("设置温度需要小于400");
(sender as TextBox).Text = "0";
}
else
{
if (isone)
{
if (tmpval > configTemp)
{
MessageBox.Show("设置温度不能大于保护温度");
(sender as TextBox).Text = "0";
}
}
else
{
isone = true;
}
}
}
//private void combControlMode_SelectedIndexChanged(object sender, EventArgs e)
//{
......
......@@ -42,6 +42,7 @@
this.datalist.Location = new System.Drawing.Point(0, 0);
this.datalist.Margin = new System.Windows.Forms.Padding(0);
this.datalist.Name = "datalist";
this.datalist.OwnerDraw = true;
this.datalist.Size = new System.Drawing.Size(286, 330);
this.datalist.TabIndex = 0;
this.datalist.UseCompatibleStateImageBehavior = false;
......
This diff is collapsed.
......@@ -74,7 +74,7 @@
// label6
//
this.label6.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label6.Location = new System.Drawing.Point(184, 73);
this.label6.Location = new System.Drawing.Point(205, 55);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(2, 100);
this.label6.TabIndex = 12;
......@@ -82,14 +82,14 @@
//
// AuxHeaterPTemp2
//
this.AuxHeaterPTemp2.Location = new System.Drawing.Point(283, 147);
this.AuxHeaterPTemp2.Location = new System.Drawing.Point(304, 129);
this.AuxHeaterPTemp2.Name = "AuxHeaterPTemp2";
this.AuxHeaterPTemp2.Size = new System.Drawing.Size(67, 24);
this.AuxHeaterPTemp2.TabIndex = 11;
//
// AuxHeaterName2
//
this.AuxHeaterName2.Location = new System.Drawing.Point(259, 119);
this.AuxHeaterName2.Location = new System.Drawing.Point(280, 95);
this.AuxHeaterName2.Name = "AuxHeaterName2";
this.AuxHeaterName2.Size = new System.Drawing.Size(91, 24);
this.AuxHeaterName2.TabIndex = 10;
......@@ -97,7 +97,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(212, 150);
this.label5.Location = new System.Drawing.Point(233, 132);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(82, 15);
this.label5.TabIndex = 9;
......@@ -106,7 +106,7 @@
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(212, 128);
this.label4.Location = new System.Drawing.Point(233, 104);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(52, 15);
this.label4.TabIndex = 8;
......@@ -114,14 +114,14 @@
//
// AuxHeaterPTemp1
//
this.AuxHeaterPTemp1.Location = new System.Drawing.Point(90, 147);
this.AuxHeaterPTemp1.Location = new System.Drawing.Point(111, 129);
this.AuxHeaterPTemp1.Name = "AuxHeaterPTemp1";
this.AuxHeaterPTemp1.Size = new System.Drawing.Size(67, 24);
this.AuxHeaterPTemp1.TabIndex = 7;
//
// AuxHeaterName1
//
this.AuxHeaterName1.Location = new System.Drawing.Point(66, 121);
this.AuxHeaterName1.Location = new System.Drawing.Point(87, 97);
this.AuxHeaterName1.Name = "AuxHeaterName1";
this.AuxHeaterName1.Size = new System.Drawing.Size(91, 24);
this.AuxHeaterName1.TabIndex = 6;
......@@ -129,7 +129,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(19, 153);
this.label3.Location = new System.Drawing.Point(40, 135);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(82, 15);
this.label3.TabIndex = 5;
......@@ -138,7 +138,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(19, 124);
this.label2.Location = new System.Drawing.Point(40, 100);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(52, 15);
this.label2.TabIndex = 4;
......@@ -151,24 +151,26 @@
"0",
"1",
"2"});
this.AuxHeaterNum.Location = new System.Drawing.Point(152, 26);
this.AuxHeaterNum.Location = new System.Drawing.Point(152, 17);
this.AuxHeaterNum.Name = "AuxHeaterNum";
this.AuxHeaterNum.Size = new System.Drawing.Size(73, 23);
this.AuxHeaterNum.TabIndex = 3;
this.AuxHeaterNum.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(19, 29);
this.label1.Location = new System.Drawing.Point(19, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(127, 15);
this.label1.TabIndex = 2;
this.label1.Text = "辅助加热器数目:";
this.label1.Visible = false;
//
// AuxHeater2
//
this.AuxHeater2.AutoSize = true;
this.AuxHeater2.Location = new System.Drawing.Point(212, 90);
this.AuxHeater2.Location = new System.Drawing.Point(233, 72);
this.AuxHeater2.Name = "AuxHeater2";
this.AuxHeater2.Size = new System.Drawing.Size(79, 19);
this.AuxHeater2.TabIndex = 1;
......@@ -178,7 +180,7 @@
// AuxHeater1
//
this.AuxHeater1.AutoSize = true;
this.AuxHeater1.Location = new System.Drawing.Point(19, 90);
this.AuxHeater1.Location = new System.Drawing.Point(40, 72);
this.AuxHeater1.Name = "AuxHeater1";
this.AuxHeater1.Size = new System.Drawing.Size(79, 19);
this.AuxHeater1.TabIndex = 0;
......
......@@ -34,7 +34,7 @@ namespace GcDevicePc.DeviceConfigUI
{
if (this.hWConfig != null)
{
this.AuxHeaterNum.SelectedIndex = this.hWConfig.hwconfiginfo.u16AuxHeaterNum;
//this.AuxHeaterNum.SelectedIndex = this.hWConfig.hwconfiginfo.u16AuxHeaterNum;
this.AuxHeater1.Checked = this.hWConfig.hwconfiginfo.u16AuxHeater1 == 1 ? true : false;
this.AuxHeaterName1.Text = this.hWConfig.hwconfiginfo.u16AuxHeaterName1;
this.AuxHeaterPTemp1.Text = this.hWConfig.hwconfiginfo.u16AuxHeaterPTemp1.ToString();
......@@ -53,7 +53,9 @@ namespace GcDevicePc.DeviceConfigUI
{
if (this.hWConfig != null)
{
this.hWConfig.hwconfiginfo.u16AuxHeaterNum = this.AuxHeaterNum.SelectedIndex;
//this.hWConfig.hwconfiginfo.u16AuxHeaterNum = this.AuxHeaterNum.SelectedIndex;
this.hWConfig.hwconfiginfo.u16AuxHeaterNum = (this.AuxHeater1.Checked ? 1 : 0) + (this.AuxHeater2.Checked ? 1 : 0);
this.hWConfig.hwconfiginfo.u16AuxHeater1 = this.AuxHeater1.Checked ? 1 : 0;
this.hWConfig.hwconfiginfo.u16AuxHeaterName1 = this.AuxHeaterName1.Text;
this.hWConfig.hwconfiginfo.u16AuxHeaterPTemp1 = int.Parse(this.AuxHeaterPTemp1.Text);
......
......@@ -296,6 +296,7 @@
this.ChromNum.Name = "ChromNum";
this.ChromNum.Size = new System.Drawing.Size(78, 23);
this.ChromNum.TabIndex = 1;
this.ChromNum.Visible = false;
//
// label3
//
......@@ -305,6 +306,7 @@
this.label3.Size = new System.Drawing.Size(97, 15);
this.label3.TabIndex = 0;
this.label3.Text = "色谱柱数目:";
this.label3.Visible = false;
//
// ColPTemp
//
......
......@@ -66,7 +66,8 @@ namespace GcDevicePc.DeviceConfigUI
this.hWConfig.hwconfiginfo.u16ColType = this.ColType.SelectedIndex;
this.hWConfig.hwconfiginfo.u16ColPTemp = int.Parse(this.ColPTemp.Text);
this.hWConfig.hwconfiginfo.u16ChromNum = this.ChromNum.SelectedIndex;
this.hWConfig.hwconfiginfo.u16ChromNum = (this.ChromFront.Checked ? 1 : 0) + (this.ChromBehind.Checked ? 1 : 0);
this.hWConfig.hwconfiginfo.u16ChromFront = this.ChromFront.Checked ? 1: 0;
this.hWConfig.hwconfiginfo.u16ChromFrontType = this.ChromFrontType.SelectedIndex;
this.hWConfig.hwconfiginfo.u16ChromFront_Length = int.Parse(this.ChromFront_Length.Text);
......
......@@ -94,7 +94,7 @@
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(395, 222);
this.label10.Location = new System.Drawing.Point(395, 196);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(45, 15);
this.label10.TabIndex = 22;
......@@ -103,7 +103,7 @@
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(395, 157);
this.label9.Location = new System.Drawing.Point(395, 131);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(45, 15);
this.label9.TabIndex = 21;
......@@ -115,7 +115,7 @@
this.DetBehindAisle.Items.AddRange(new object[] {
"A",
"B"});
this.DetBehindAisle.Location = new System.Drawing.Point(440, 218);
this.DetBehindAisle.Location = new System.Drawing.Point(440, 192);
this.DetBehindAisle.Name = "DetBehindAisle";
this.DetBehindAisle.Size = new System.Drawing.Size(64, 23);
this.DetBehindAisle.TabIndex = 20;
......@@ -126,7 +126,7 @@
this.DetInterAisle.Items.AddRange(new object[] {
"A",
"B"});
this.DetInterAisle.Location = new System.Drawing.Point(440, 154);
this.DetInterAisle.Location = new System.Drawing.Point(440, 128);
this.DetInterAisle.Name = "DetInterAisle";
this.DetInterAisle.Size = new System.Drawing.Size(64, 23);
this.DetInterAisle.TabIndex = 19;
......@@ -137,7 +137,7 @@
this.DetFrontAisle.Items.AddRange(new object[] {
"A",
"B"});
this.DetFrontAisle.Location = new System.Drawing.Point(440, 87);
this.DetFrontAisle.Location = new System.Drawing.Point(440, 61);
this.DetFrontAisle.Name = "DetFrontAisle";
this.DetFrontAisle.Size = new System.Drawing.Size(64, 23);
this.DetFrontAisle.TabIndex = 18;
......@@ -145,7 +145,7 @@
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(395, 90);
this.label8.Location = new System.Drawing.Point(395, 64);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(52, 15);
this.label8.TabIndex = 17;
......@@ -153,21 +153,21 @@
//
// DetBehindPTemp
//
this.DetBehindPTemp.Location = new System.Drawing.Point(307, 218);
this.DetBehindPTemp.Location = new System.Drawing.Point(307, 192);
this.DetBehindPTemp.Name = "DetBehindPTemp";
this.DetBehindPTemp.Size = new System.Drawing.Size(73, 24);
this.DetBehindPTemp.TabIndex = 16;
//
// DetInterPTemp
//
this.DetInterPTemp.Location = new System.Drawing.Point(307, 154);
this.DetInterPTemp.Location = new System.Drawing.Point(307, 128);
this.DetInterPTemp.Name = "DetInterPTemp";
this.DetInterPTemp.Size = new System.Drawing.Size(73, 24);
this.DetInterPTemp.TabIndex = 15;
//
// DetFrontPTemp
//
this.DetFrontPTemp.Location = new System.Drawing.Point(307, 87);
this.DetFrontPTemp.Location = new System.Drawing.Point(307, 61);
this.DetFrontPTemp.Name = "DetFrontPTemp";
this.DetFrontPTemp.Size = new System.Drawing.Size(73, 24);
this.DetFrontPTemp.TabIndex = 14;
......@@ -175,7 +175,7 @@
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(236, 222);
this.label7.Location = new System.Drawing.Point(236, 196);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(82, 15);
this.label7.TabIndex = 13;
......@@ -184,7 +184,7 @@
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(236, 158);
this.label6.Location = new System.Drawing.Point(236, 132);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(82, 15);
this.label6.TabIndex = 12;
......@@ -199,7 +199,7 @@
"ECD",
"FPD",
"PID"});
this.DetBehindType.Location = new System.Drawing.Point(158, 218);
this.DetBehindType.Location = new System.Drawing.Point(158, 192);
this.DetBehindType.Name = "DetBehindType";
this.DetBehindType.Size = new System.Drawing.Size(67, 23);
this.DetBehindType.TabIndex = 11;
......@@ -213,7 +213,7 @@
"ECD",
"FPD",
"PID"});
this.DetInterType.Location = new System.Drawing.Point(158, 154);
this.DetInterType.Location = new System.Drawing.Point(158, 128);
this.DetInterType.Name = "DetInterType";
this.DetInterType.Size = new System.Drawing.Size(67, 23);
this.DetInterType.TabIndex = 10;
......@@ -221,7 +221,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(111, 222);
this.label5.Location = new System.Drawing.Point(111, 196);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(52, 15);
this.label5.TabIndex = 9;
......@@ -230,7 +230,7 @@
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(111, 158);
this.label4.Location = new System.Drawing.Point(111, 132);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(52, 15);
this.label4.TabIndex = 8;
......@@ -239,7 +239,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(236, 92);
this.label3.Location = new System.Drawing.Point(236, 66);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(82, 15);
this.label3.TabIndex = 7;
......@@ -254,7 +254,7 @@
"ECD",
"FPD",
"PID"});
this.DetFrontType.Location = new System.Drawing.Point(158, 88);
this.DetFrontType.Location = new System.Drawing.Point(158, 62);
this.DetFrontType.Name = "DetFrontType";
this.DetFrontType.Size = new System.Drawing.Size(67, 23);
this.DetFrontType.TabIndex = 6;
......@@ -262,7 +262,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(111, 92);
this.label2.Location = new System.Drawing.Point(111, 66);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(52, 15);
this.label2.TabIndex = 5;
......@@ -271,7 +271,7 @@
// DetBehind
//
this.DetBehind.AutoSize = true;
this.DetBehind.Location = new System.Drawing.Point(24, 220);
this.DetBehind.Location = new System.Drawing.Point(24, 194);
this.DetBehind.Name = "DetBehind";
this.DetBehind.Size = new System.Drawing.Size(86, 19);
this.DetBehind.TabIndex = 4;
......@@ -281,7 +281,7 @@
// DetInter
//
this.DetInter.AutoSize = true;
this.DetInter.Location = new System.Drawing.Point(24, 156);
this.DetInter.Location = new System.Drawing.Point(24, 130);
this.DetInter.Name = "DetInter";
this.DetInter.Size = new System.Drawing.Size(86, 19);
this.DetInter.TabIndex = 3;
......@@ -291,7 +291,7 @@
// DetFront
//
this.DetFront.AutoSize = true;
this.DetFront.Location = new System.Drawing.Point(24, 91);
this.DetFront.Location = new System.Drawing.Point(24, 65);
this.DetFront.Name = "DetFront";
this.DetFront.Size = new System.Drawing.Size(86, 19);
this.DetFront.TabIndex = 2;
......@@ -306,19 +306,21 @@
"1",
"2",
"3"});
this.DetNum.Location = new System.Drawing.Point(144, 31);
this.DetNum.Location = new System.Drawing.Point(341, 14);
this.DetNum.Name = "DetNum";
this.DetNum.Size = new System.Drawing.Size(79, 23);
this.DetNum.TabIndex = 1;
this.DetNum.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(38, 34);
this.label1.Location = new System.Drawing.Point(235, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(112, 15);
this.label1.TabIndex = 0;
this.label1.Text = "检测单元数目:";
this.label1.Visible = false;
//
// okbtn
//
......
......@@ -61,7 +61,8 @@ namespace GcDevicePc.DeviceConfigUI
{
if (this.hWConfig != null)
{
this.hWConfig.hwconfiginfo.u16DetNum = this.DetNum.SelectedIndex;
this.hWConfig.hwconfiginfo.u16DetNum = (this.DetFront.Checked ? 1 : 0) + (this.DetInter.Checked ? 1 : 0) + (this.DetBehind.Checked ? 1 : 0);
this.hWConfig.hwconfiginfo.u16DetFront = this.DetFront.Checked ? 1 : 0;
this.hWConfig.hwconfiginfo.u16DetFrontType = this.DetFrontType.SelectedIndex;
this.hWConfig.hwconfiginfo.u16DetFrontPTemp = int.Parse(this.DetFrontPTemp.Text);
......
......@@ -200,7 +200,7 @@
// ValveSix
//
this.ValveSix.AutoSize = true;
this.ValveSix.Location = new System.Drawing.Point(447, 187);
this.ValveSix.Location = new System.Drawing.Point(457, 178);
this.ValveSix.Name = "ValveSix";
this.ValveSix.Size = new System.Drawing.Size(57, 19);
this.ValveSix.TabIndex = 7;
......@@ -210,7 +210,7 @@
// ValveFive
//
this.ValveFive.AutoSize = true;
this.ValveFive.Location = new System.Drawing.Point(286, 187);
this.ValveFive.Location = new System.Drawing.Point(296, 178);
this.ValveFive.Name = "ValveFive";
this.ValveFive.Size = new System.Drawing.Size(49, 19);
this.ValveFive.TabIndex = 6;
......@@ -220,7 +220,7 @@
// ValveFour
//
this.ValveFour.AutoSize = true;
this.ValveFour.Location = new System.Drawing.Point(83, 187);
this.ValveFour.Location = new System.Drawing.Point(93, 178);
this.ValveFour.Name = "ValveFour";
this.ValveFour.Size = new System.Drawing.Size(49, 19);
this.ValveFour.TabIndex = 5;
......@@ -230,7 +230,7 @@
// ValveThree
//
this.ValveThree.AutoSize = true;
this.ValveThree.Location = new System.Drawing.Point(447, 107);
this.ValveThree.Location = new System.Drawing.Point(457, 98);
this.ValveThree.Name = "ValveThree";
this.ValveThree.Size = new System.Drawing.Size(49, 19);
this.ValveThree.TabIndex = 4;
......@@ -240,7 +240,7 @@
// ValveTwo
//
this.ValveTwo.AutoSize = true;
this.ValveTwo.Location = new System.Drawing.Point(286, 107);
this.ValveTwo.Location = new System.Drawing.Point(296, 98);
this.ValveTwo.Name = "ValveTwo";
this.ValveTwo.Size = new System.Drawing.Size(49, 19);
this.ValveTwo.TabIndex = 3;
......@@ -250,7 +250,7 @@
// ValveOne
//
this.ValveOne.AutoSize = true;
this.ValveOne.Location = new System.Drawing.Point(83, 107);
this.ValveOne.Location = new System.Drawing.Point(93, 98);
this.ValveOne.Name = "ValveOne";
this.ValveOne.Size = new System.Drawing.Size(49, 19);
this.ValveOne.TabIndex = 2;
......@@ -272,6 +272,7 @@
this.ValveBox.Name = "ValveBox";
this.ValveBox.Size = new System.Drawing.Size(121, 23);
this.ValveBox.TabIndex = 1;
this.ValveBox.Visible = false;
//
// label3
//
......@@ -281,6 +282,7 @@
this.label3.Size = new System.Drawing.Size(67, 15);
this.label3.TabIndex = 0;
this.label3.Text = "阀总数:";
this.label3.Visible = false;
//
// tabPage3
//
......
......@@ -145,13 +145,13 @@ namespace GcDevicePc.DeviceConfigUI
this.hWConfig.hwconfiginfo.u16SampleBehindType = this.SampleBehindType.SelectedIndex;
//阀
this.hWConfig.hwconfiginfo.u16ValveBox = this.ValveBox.SelectedIndex;
this.hWConfig.hwconfiginfo.u16ValveOne = this.ValveOne.Checked?1 :0;
this.hWConfig.hwconfiginfo.u16ValveBox = (this.ValveOne.Checked ? 1 : 0) + (this.ValveTwo.Checked ? 1 : 0) + (this.ValveThree.Checked ? 1 : 0) + (this.ValveFour.Checked ? 1 : 0) + (this.ValveFive.Checked ? 1 : 0) + (this.ValveSix.Checked ? 1 : 0);
this.hWConfig.hwconfiginfo.u16ValveOne = this.ValveOne.Checked ? 1 : 0;
this.hWConfig.hwconfiginfo.u16ValveTwo = this.ValveTwo.Checked ? 1 : 0;
this.hWConfig.hwconfiginfo.u16ValveThree = this.ValveThree.Checked? 1: 0 ;
this.hWConfig.hwconfiginfo.u16ValveThree = this.ValveThree.Checked ? 1 : 0;
this.hWConfig.hwconfiginfo.u16ValveFour = this.ValveFour.Checked ? 1 : 0;
this.hWConfig.hwconfiginfo.u16ValveFive = this.ValveFive.Checked ? 1 : 0;
this.hWConfig.hwconfiginfo.u16ValveSix = this.ValveSix.Checked ? 1: 0;
this.hWConfig.hwconfiginfo.u16ValveSix = this.ValveSix.Checked ? 1 : 0;
//进样口
int num = 0;
......
......@@ -50,6 +50,8 @@ namespace GcDevicePc.GCBuffer
///////////////////////////////////////
public ushort[] EPCStatus;
public ushort[] HmiAbnormal;
}
public hmiinfo gcinfo = new hmiinfo();
......@@ -71,6 +73,7 @@ namespace GcDevicePc.GCBuffer
gcinfo.hmioffline = false;
gcinfo.HMIMac = new ushort[3] { 0, 0, 0};
gcinfo.EPCStatus = new ushort[16] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
gcinfo.HmiAbnormal = new ushort[3] { 0, 0, 0 };
}
~HMIBuffer()
......
......@@ -639,6 +639,7 @@
<Compile Include="ProThread\HMIControl.cs" />
<Compile Include="ProThread\HMISearch.cs" />
<Compile Include="ProThread\HmiStatueTh.cs" />
<Compile Include="ProThread\SendDataToZB.cs" />
<Compile Include="ProThread\SignalDataToHw.cs" />
<Compile Include="ProThread\ThreadMonitor.cs" />
<Compile Include="QuitForm.cs">
......@@ -1011,6 +1012,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="logo.ico" />
<Content Include="UI\picture\色谱3.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SharedSpace\SharedSpace.csproj">
......
......@@ -47,9 +47,6 @@
this.MethodBrowseMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SettingSeparator = new System.Windows.Forms.ToolStripSeparator();
this.GCConfigMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ConfigCreateSubMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ConfigShowSubMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ConfigSendSubMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DataMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.HistoryDataMenu = new System.Windows.Forms.ToolStripMenuItem();
this.CalibrationMenu = new System.Windows.Forms.ToolStripMenuItem();
......@@ -176,7 +173,7 @@
//
this.NetWorkMenu.Name = "NetWorkMenu";
this.NetWorkMenu.Size = new System.Drawing.Size(176, 26);
this.NetWorkMenu.Text = "网络配置";
this.NetWorkMenu.Text = "通讯设置";
this.NetWorkMenu.Click += new System.EventHandler(this.NetWorkMenu_Click);
//
// MethodBatMenu
......@@ -214,34 +211,10 @@
//
// GCConfigMenuItem
//
this.GCConfigMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ConfigCreateSubMenuItem,
this.ConfigShowSubMenuItem,
this.ConfigSendSubMenuItem});
this.GCConfigMenuItem.Name = "GCConfigMenuItem";
this.GCConfigMenuItem.Size = new System.Drawing.Size(176, 26);
this.GCConfigMenuItem.Text = "仪器配置";
//
// ConfigCreateSubMenuItem
//
this.ConfigCreateSubMenuItem.Name = "ConfigCreateSubMenuItem";
this.ConfigCreateSubMenuItem.Size = new System.Drawing.Size(144, 26);
this.ConfigCreateSubMenuItem.Text = "配置创建";
this.ConfigCreateSubMenuItem.Click += new System.EventHandler(this.ConfigCreateSubMenuItem_Click);
//
// ConfigShowSubMenuItem
//
this.ConfigShowSubMenuItem.Name = "ConfigShowSubMenuItem";
this.ConfigShowSubMenuItem.Size = new System.Drawing.Size(144, 26);
this.ConfigShowSubMenuItem.Text = "配置查看";
this.ConfigShowSubMenuItem.Click += new System.EventHandler(this.ConfigShowSubMenuItem_Click);
//
// ConfigSendSubMenuItem
//
this.ConfigSendSubMenuItem.Name = "ConfigSendSubMenuItem";
this.ConfigSendSubMenuItem.Size = new System.Drawing.Size(144, 26);
this.ConfigSendSubMenuItem.Text = "配置发送";
this.ConfigSendSubMenuItem.Click += new System.EventHandler(this.ConfigSendSubMenuItem_Click);
this.GCConfigMenuItem.Click += new System.EventHandler(this.ConfigCreateSubMenuItem_Click);
//
// DataMainMenu
//
......@@ -257,21 +230,21 @@
// HistoryDataMenu
//
this.HistoryDataMenu.Name = "HistoryDataMenu";
this.HistoryDataMenu.Size = new System.Drawing.Size(176, 26);
this.HistoryDataMenu.Text = "历史数据查询";
this.HistoryDataMenu.Size = new System.Drawing.Size(144, 26);
this.HistoryDataMenu.Text = "数据查询";
this.HistoryDataMenu.Click += new System.EventHandler(this.HistoryDataMenu_Click);
//
// CalibrationMenu
//
this.CalibrationMenu.Name = "CalibrationMenu";
this.CalibrationMenu.Size = new System.Drawing.Size(176, 26);
this.CalibrationMenu.Text = "校准查看";
this.CalibrationMenu.Size = new System.Drawing.Size(144, 26);
this.CalibrationMenu.Text = "数据校准";
this.CalibrationMenu.Click += new System.EventHandler(this.CalibrationMenu_Click);
//
// HistoryPicMenu
//
this.HistoryPicMenu.Name = "HistoryPicMenu";
this.HistoryPicMenu.Size = new System.Drawing.Size(176, 26);
this.HistoryPicMenu.Size = new System.Drawing.Size(144, 26);
this.HistoryPicMenu.Text = "历史谱图";
this.HistoryPicMenu.Click += new System.EventHandler(this.HistoryPicMenu_Click);
//
......@@ -472,9 +445,6 @@
private System.Windows.Forms.ToolStripMenuItem AuxToolMenu;
private System.Windows.Forms.ToolStripSeparator SettingSeparator;
private System.Windows.Forms.ToolStripMenuItem GCConfigMenuItem;
private System.Windows.Forms.ToolStripMenuItem ConfigCreateSubMenuItem;
private System.Windows.Forms.ToolStripMenuItem ConfigShowSubMenuItem;
private System.Windows.Forms.ToolStripMenuItem ConfigSendSubMenuItem;
private System.Windows.Forms.ToolStripMenuItem ParameterSettingMenu;
private System.Windows.Forms.ToolStripMenuItem DebugMainMenu;
private System.Windows.Forms.ToolStripMenuItem SingleControlMenu;
......
......@@ -85,6 +85,7 @@ namespace GcDevicePc
private DataOutput wtd624xOutput = new DataOutput();
private SignalDataToHw signalDataTohw = new SignalDataToHw();
private SendDataToZB signalDataTozb = new SendDataToZB();
#endregion
#region Author by zjx
......@@ -754,6 +755,7 @@ namespace GcDevicePc
else
{
UserMainMenu.Visible = false;
ParameterSettingMenu.Visible = false;
}
}
......@@ -771,7 +773,7 @@ namespace GcDevicePc
/// 1.0.2.3 添加了周期完成后,重新绘图功能
private void timer1_Tick(object sender, EventArgs e)
{
this.Text = String.Format("Tetchrom色谱工作站-1.5.2 {0}", Formstr);
this.Text = String.Format("Tetchrom色谱工作站-1.5.4 {0}", Formstr);
//if (LandIn.Island)
//{
// HmiStatus.Text = String.Format("状态:{0}", statestr);
......@@ -845,17 +847,21 @@ namespace GcDevicePc
{
hmiopt.WriteStopVal();
WaitHMIFree();
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue)
{
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 0)
hmiopt.WriteOpenVal();
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 1)
hmiopt.WriteSingleVal();
}
WaitHMIWork();
}
else //批处理
{
......@@ -1178,7 +1184,7 @@ namespace GcDevicePc
{
globaldata.m_profileMethod.SetStatusFullName(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_StatusName);
globaldata.m_profileMethod.GetDevState();
if (globaldata.CurrentVersion == "1")
//if (globaldata.CurrentVersion == "1")
{
tmpname = globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 2 ?
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName :
......@@ -1228,6 +1234,7 @@ namespace GcDevicePc
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw)
{
signalDataTohw.DataToHwStart();
signalDataTozb.DataToZBStart();
}
try
......@@ -1264,7 +1271,7 @@ namespace GcDevicePc
}
}
Thread gethmistaues;
//Thread gethmistaues;
//private void Start_Thread()
//{
// // mydatasave.ChannelDataStart();
......@@ -1357,10 +1364,10 @@ namespace GcDevicePc
dest[8] = globaldata.m_hmibuffer.gcinfo.runtime;
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue)
//if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue)
status_flag = dest[5];
else
status_flag = 10;
//else
// status_flag = 10;
GCstatus = dest[5];
runtype = dest[7];
......@@ -1585,7 +1592,7 @@ namespace GcDevicePc
bool color_flag = true;
switch (flag)
{
case 0:
//case 0:
case 1:
status_text = "空闲中...";
this.HmiStatus.BackColor = Color.LightGreen;
......@@ -1662,7 +1669,7 @@ namespace GcDevicePc
}
statestr = status_text;
IsStateColor = color_flag;
Console.WriteLine(flag.ToString());
//Console.WriteLine(""+ globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue);
//if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 0)
......@@ -1677,6 +1684,29 @@ namespace GcDevicePc
//{
// (this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMOptbtnstatus = 0;
//}
if (flag!=10 && flag != 0)
{
OSflag = true;
(this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMOptbtnstatus = 4;
(this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMSysbtnstatus = 1;
//globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = true;
//globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
}
else
{
OSflag = false;
(this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMOptbtnstatus = 0;
(this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMSysbtnstatus = 0;
//globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = false;
//globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
}
if (oldflag != flag)
{
oldflag = flag;
......@@ -1685,7 +1715,7 @@ namespace GcDevicePc
private void tips_Show(ushort[] data)
{
string tips = "";
string tips = string.Empty;
if (data[0] == 1)
{
......
......@@ -39,7 +39,7 @@
this.ClientSize = new System.Drawing.Size(1008, 730);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Text = "Tetchrom色谱工作站-1.5.2 用户界面";
this.Text = "Tetchrom色谱工作站-1.5.4 用户界面";
this.ResumeLayout(false);
this.PerformLayout();
......
......@@ -414,6 +414,24 @@ namespace GcDevicePc.ProThread
return ret;
}
private int GetHmiAbnormalHoldingReg(ushort address, ushort num, ref UInt16[] state)
{
int ret = -1;
int count = 0;
if (setflag)
{
ret = globaldata.global_moudbus.ReadHoldingReg(address, num, this.strIP, netPost, ref state);
while (ret != 0)
{
count++;
if (count > 3)
break;
ret = globaldata.global_moudbus.ReadHoldingReg(address, num, this.strIP, netPost, ref state);
}
}
return ret;
}
#endregion
......@@ -465,6 +483,20 @@ namespace GcDevicePc.ProThread
return ret == 0 ? true : false;
}
public int GetHmiAbnormal(ref ushort[] data)
{
int ret = -1;
try
{
ret = GetHmiAbnormalHoldingReg(1101, 3, ref data);
}
catch (Exception e)
{
Log.Error(e.Message);
}
return ret;
}
public int GetFireUpTime(ref ushort[] state)
{
int ret = -1;
......@@ -696,6 +728,7 @@ namespace GcDevicePc.ProThread
byte[] tenstate = new byte[2] { 0, 0 };
ushort[] firestatus = new ushort[4] { 0, 0, 0, 0 };
ushort[] dacstatus = new ushort[6] { 0, 0, 0, 0, 0, 0 };
ushort[] hmiabnormal = new ushort[3];
//ushort[] epcdata = new ushort[36];
ushort[] epc1 = new ushort[6];
......@@ -936,6 +969,11 @@ namespace GcDevicePc.ProThread
globaldata.m_dpbuffer.ShowList.showepc.EPC2_2_Set = (epc2[4] > 64000 ? (ushort)0 : epc2[4]);
globaldata.m_dpbuffer.ShowList.showepc.EPC2_3_Set = (epc2[5] > 64000 ? (ushort)0 : epc2[5]);
}
if (GetHmiAbnormal(ref hmiabnormal) == 0)
{
globaldata.m_hmibuffer.gcinfo.HmiAbnormal = hmiabnormal;
}
}
......@@ -976,6 +1014,8 @@ namespace GcDevicePc.ProThread
globaldata.m_hmibuffer.gcinfo.NowEndTime = Get_Method_EndTime();
}
}
}
/// <summary>
......
......@@ -363,6 +363,7 @@ namespace GcDevicePc.ProThread
else
{
writestatue = 0;
TCD_SetDAC(port, 0);
}
count = 0;
......
This diff is collapsed.
......@@ -11,7 +11,7 @@ namespace GcDevicePc.ProThread
{
class SignalDataToHw
{
[DllImport(@"HWSendData.dll", EntryPoint = "SendDataToHW")]
[DllImport(@"HWSendData.dll")]
public static extern void GCSendDataToHW(Int32 data1, Int32 data2, Int32 data3);
#region 私有变量
ManualResetEvent datamre = new ManualResetEvent(false);
......@@ -277,60 +277,28 @@ namespace GcDevicePc.ProThread
TimeSpan tsB;
int secA;
int secB;
int mydataA = 0;
int mydataA_old = 0;
int mydataB = 0;
int mydataB_old = 0;
int offetA = 0;
int offetB = 0;
int StepA = 0;
int StepB = 0;
//bool StepA_flag = false;
// bool StepB_flag = false;
bool changeA_flag = false;
bool changeB_flag = false;
bool run_stop = false;
int recordA = 0;
int saveA = 0;
int recordB = 0;
int saveB = 0;
int onea = 0;
int oneb = 0;
bool ackoneA = false;
bool ackoneB = false;
ushort SendNumA = 0;
ushort SendNumB = 0;
ushort MAXNum = 0;
//int i = 0;
bool runflag = false;
while (true)
{
if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) && globaldata.m_hmibuffer.gcinfo.hmistatus == 4 && run_stop != true)
if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) && methodconfig != null && run_stop != true)
//if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) && globaldata.m_hmibuffer.gcinfo.hmistatus == 4 && run_stop != true)
{
saveB = 0;
recordB = 0;
recordA = 0;
saveA = 0;
onea = 0;
oneb = 0;
ackoneA = false;
ackoneB = false;
int saveB = 0;
int recordB = 0;
int recordA = 0;
int saveA = 0;
mydataA_old = 0;
mydataB_old = 0;
int onea = 0;
int oneb = 0;
bool ackoneA = false;
bool ackoneB = false;
InitSendToHWData();
//清除所有数据,准备传输
CleanAllToHWData();
......@@ -349,26 +317,20 @@ namespace GcDevicePc.ProThread
SendNumB = CheckNumandTime(0, methodconfig.signal.uDetB, methodconfig.signal.u16DetTimeLengthB);
}
// LogHelper.I("StepA StpeB is", SendNumA.ToString() + " "+ SendNumB.ToString());
//LogHelper.I("StepA StpeB is", SendNumA.ToString() + " "+ SendNumB.ToString());
MAXNum = SendNumA > SendNumB ? SendNumA : SendNumB;
ushort MAXNum = SendNumA > SendNumB ? SendNumA : SendNumB;
if (methodconfig.signal.u16ChannelA == 1 || methodconfig.signal.u16ChannelB == 1)
{
StepA = 0;
StepB = 0;
int StepA = 0;
int StepB = 0;
{
StartTimeA = DateTime.Now;
StartTimeB = DateTime.Now;
changeA_flag = false;
changeB_flag = false;
mydataA = 0;
mydataB = 0;
int mydataA = 0;
int mydataB = 0;
while (true)
{
EndTimeA = DateTime.Now;
......@@ -382,6 +344,7 @@ namespace GcDevicePc.ProThread
{
if (secA <= methodconfig.signal.u16DetTimeLengthA[StepA])
{
int mydataA_old;
//Console.WriteLine("总共:" + SendNumA.ToString() + " 阶段,现在是第" + StepA.ToString() + "个阶段:" + secA.ToString() + "/" + methodconfig.signal.u16DetTimeLengthA[StepA].ToString());
switch (methodconfig.signal.uDetA[StepA])
......@@ -504,7 +467,6 @@ namespace GcDevicePc.ProThread
ackoneA = true;
StepA++;
StartTimeA = DateTime.Now;
changeA_flag = true;
}
}
......@@ -513,6 +475,7 @@ namespace GcDevicePc.ProThread
{
if (secB <= methodconfig.signal.u16DetTimeLengthB[StepB])
{
int mydataB_old;
//Console.WriteLine("总共:" + SendNumB.ToString() + " 阶段,现在是第" + StepB.ToString() + "个阶段:" + secB.ToString() + "/" + methodconfig.signal.u16DetTimeLengthB[i].ToString());
switch (methodconfig.signal.uDetB[StepB])
......@@ -537,7 +500,7 @@ namespace GcDevicePc.ProThread
{
mydataB = mydataB - (oneb - saveB);
}
else if(oneb < saveB)
else if (oneb < saveB)
{
mydataB = mydataB + (saveB - oneb);
}
......@@ -627,7 +590,6 @@ namespace GcDevicePc.ProThread
ackoneB = true;
StepB++;
StartTimeB = DateTime.Now;
changeB_flag = true;
}
}
......
......@@ -11,27 +11,25 @@ namespace GcDevicePc
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
bool createNew;
//Application.Run(new TestForm());
{
using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew))
Application.Run(new TestForm());
{
if (createNew)
{
Application.Run(new StartForm());
mutex.ReleaseMutex();
// Application.Run(new MDIBase());
}
else
{
MessageBox.Show("应用程序已经在运行中...");
System.Threading.Thread.Sleep(1000);
Application.Exit();
System.Diagnostics.Process.GetCurrentProcess().Kill();
// System.Environment.Exit(1);
}
}
//using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew))
//{
// if (createNew)
// {
// Application.Run(new StartForm());
// mutex.ReleaseMutex();
// }
// else
// {
// MessageBox.Show("应用程序已经在运行中...");
// System.Threading.Thread.Sleep(1000);
// Application.Exit();
// System.Diagnostics.Process.GetCurrentProcess().Kill();
// // System.Environment.Exit(1);
// }
//}
}
}
}
......
......@@ -19,7 +19,7 @@ namespace GcDevicePc.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
......@@ -47,7 +47,7 @@ namespace GcDevicePc.Properties {
}
/// <summary>
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
......@@ -59,5 +59,15 @@ namespace GcDevicePc.Properties {
resourceCulture = value;
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 色谱3 {
get {
object obj = ResourceManager.GetObject("色谱3", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
......@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
......@@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
......@@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
......@@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
......@@ -109,9 +112,13 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="色谱3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\UI\picture\色谱3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
......@@ -30,7 +30,6 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RunTables));
this.rtsave = new System.Windows.Forms.Button();
this.tabrun = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.LocalMethodView = new System.Windows.Forms.DataGridView();
......@@ -65,16 +64,6 @@
((System.ComponentModel.ISupportInitialize)(this.LocalRunTableView)).BeginInit();
this.SuspendLayout();
//
// rtsave
//
this.rtsave.Location = new System.Drawing.Point(448, 316);
this.rtsave.Name = "rtsave";
this.rtsave.Size = new System.Drawing.Size(75, 23);
this.rtsave.TabIndex = 0;
this.rtsave.Text = "保存";
this.rtsave.UseVisualStyleBackColor = true;
this.rtsave.Click += new System.EventHandler(this.rtsave_Click);
//
// tabrun
//
this.tabrun.Location = new System.Drawing.Point(539, 316);
......@@ -342,7 +331,6 @@
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.tabrun);
this.Controls.Add(this.rtsave);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
......@@ -365,8 +353,6 @@
}
#endregion
private System.Windows.Forms.Button rtsave;
private System.Windows.Forms.Button tabrun;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.DataGridView LocalMethodView;
......
......@@ -304,7 +304,7 @@ namespace GcDevicePc
this.AddMethodbtn.Enabled = false;
this.RunTableView.Enabled = false;
this.updategv.Enabled = true;
this.rtsave.Enabled = false;
//this.rtsave.Enabled = false;
}
private void DelRow_Click(object sender, EventArgs e)
......@@ -381,7 +381,7 @@ namespace GcDevicePc
this.AddMethodbtn.Enabled = true;
this.RunTableView.Enabled = true;
this.rtsave.Enabled = true;
//this.rtsave.Enabled = true;
this.updategv.Enabled = false;
this.rtbox.Text = "";
......@@ -441,13 +441,75 @@ namespace GcDevicePc
public event SendUpdateCMD sendupdatecmd;
private void tabrun_Click(object sender, EventArgs e)
{
this.tabrun.Enabled = false;
if (!File.Exists(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab))
{
StreamWriter sw = new StreamWriter(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab, false, System.Text.Encoding.Unicode);
sw.WriteLine("[运行表]");
sw.Close();
}
string file = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab;
INIOperation runtable = new INIOperation(file);
string subkey;
runtable.INIEmptySection(file, "运行表");
runtable.INIEmptySection(file, "循环");
runtable.INIEmptySection(file, "运行时间");
runtable.INIWriteValue(file, "运行表", "0", "开机");
runtable.INIWriteValue(file, "循环", "0", "1");
runtable.INIWriteValue(file, "运行时间", "0", "1");
runtable.INIWriteValue(file, "间隔时间", "0", "1");
bool rbet;
FileServerClient rtclient = null;
if (!String.IsNullOrEmpty(globaldata.connection_ip))
{
rtclient = new FileServerClient();
rtclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
}
string lfilename;
string rfilename;
for (int i = 0; i < RunTableView.RowCount; i++)
{
subkey = (Convert.ToInt32(RunTableView.Rows[i].Cells[0].Value) + 1).ToString();
rbet = runtable.INIWriteValue(file, "运行表", subkey, RunTableView.Rows[i].Cells[1].Value.ToString());
if (RunTableView.Rows[i].Cells[3].Value.ToString() == "-1")
rbet = runtable.INIWriteValue(file, "循环", subkey, "-1");
else if (RunTableView.Rows[i].Cells[3].Value.ToString() == "0")
rbet = runtable.INIWriteValue(file, "循环", subkey, "0");
else
rbet = runtable.INIWriteValue(file, "循环", subkey, RunTableView.Rows[i].Cells[3].Value.ToString());
rbet = runtable.INIWriteValue(file, "运行时间", subkey, RunTableView.Rows[i].Cells[2].Value.ToString());
rbet = runtable.INIWriteValue(file, "间隔时间", subkey, RunTableView.Rows[i].Cells[4].Value.ToString());
lfilename = null;
rfilename = null;
rfilename = RunTableView.Rows[i].Cells[1].Value.ToString();
lfilename = Path.Combine(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.MethodFolder, rfilename);
if (rtclient != null)
rtclient.WtClientCopytoServer(rfilename, lfilename, globaldata.remoteFolder + "仪器方法\\");
}
if (rtclient != null)
rtclient.WtClientClose();
//string message = "运行表保存成功";
//MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
if ( !String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab) && !String.IsNullOrEmpty(globaldata.connection_ip))
{
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType = 2;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
this.tabrun.Enabled = false;
if (File.Exists(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab))
{
......@@ -461,8 +523,8 @@ namespace GcDevicePc
}
sendupdatecmd(false);
this.tabrun.Enabled = true;
}
this.tabrun.Enabled = true;
this.Close();
}
......
......@@ -31,6 +31,8 @@
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.gcTitle1 = new GcDevicePc.Controls.GCTitle();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
......@@ -61,11 +63,33 @@
this.gcTitle1.Size = new System.Drawing.Size(800, 20);
this.gcTitle1.TabIndex = 2;
//
// button3
//
this.button3.Location = new System.Drawing.Point(440, 364);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 3;
this.button3.Text = "button3";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.Button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(544, 364);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 23);
this.button4.TabIndex = 4;
this.button4.Text = "button4";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.Button4_Click);
//
// TestForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 583);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.gcTitle1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
......@@ -80,5 +104,7 @@
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private Controls.GCTitle gcTitle1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
}
}
\ No newline at end of file
using GcDevicePc.ConfigMethod;
using GcDevicePc.Common;
using GcDevicePc.ConfigMethod;
using GcDevicePc.Controls;
using System;
using System.Collections.Generic;
......@@ -79,6 +80,7 @@ namespace GcDevicePc
private void btnShow_Click(object sender, EventArgs e)
{
//loadingCtl.TipsInfo = "提示信息";
////显示加载动画
//loadingCtl.ShowLoading(this);
......@@ -89,21 +91,28 @@ namespace GcDevicePc
//(this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMOptbtnstatus = 4;
//kailiang
if (form1 == null)
{
form1 = new Form1("asdasdasdsa");
form1.Show();
//if (form1 == null)
//{
// form1 = new Form1("asdasdasdsa");
// form1.Show();
//}
//else if(form1.IsDisposed)
//{
// form1 = new Form1("asdasdasdsa");
// form1.Show();
//}
//else
//{
// form1.Activate();
//}
//string savefilename = "C:\\Users\\24042\\Pictures\\新建文件夹\\test11.hw";
//TWFile twfile = new TWFile(savefilename);
//twfile.TW_Open();
//twfile.TW_Close(0);
}
else if(form1.IsDisposed)
{
form1 = new Form1("asdasdasdsa");
form1.Show();
}
else
{
form1.Activate();
}
}
......@@ -117,5 +126,15 @@ namespace GcDevicePc
//LMessageBox box = new LMessageBox();
//box.Show(100, 100, this.Location, true, "1230", "3214", LMessageBox.MessageBoxType.MBT_ButtonOK);
}
private void Button3_Click(object sender, EventArgs e)
{
}
private void Button4_Click(object sender, EventArgs e)
{
}
}
}
......@@ -30,6 +30,8 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserConfig));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmbMeshport = new System.Windows.Forms.ComboBox();
this.label15 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.mac6 = new System.Windows.Forms.TextBox();
......@@ -69,8 +71,6 @@
this.label12 = new System.Windows.Forms.Label();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.permin = new System.Windows.Forms.CheckBox();
this.label15 = new System.Windows.Forms.Label();
this.cmbMeshport = new System.Windows.Forms.ComboBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -106,6 +106,24 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "通讯配置";
//
// cmbMeshport
//
this.cmbMeshport.FormattingEnabled = true;
this.cmbMeshport.Location = new System.Drawing.Point(97, 21);
this.cmbMeshport.Name = "cmbMeshport";
this.cmbMeshport.Size = new System.Drawing.Size(148, 20);
this.cmbMeshport.TabIndex = 15;
this.cmbMeshport.SelectedIndexChanged += new System.EventHandler(this.cmbMeshport_SelectedIndexChanged);
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(43, 26);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(47, 12);
this.label15.TabIndex = 14;
this.label15.Text = "网 口:";
//
// label8
//
this.label8.AutoSize = true;
......@@ -313,6 +331,7 @@
// runsingle
//
this.runsingle.AutoSize = true;
this.runsingle.Enabled = false;
this.runsingle.Location = new System.Drawing.Point(11, 20);
this.runsingle.Name = "runsingle";
this.runsingle.Size = new System.Drawing.Size(72, 16);
......@@ -320,6 +339,7 @@
this.runsingle.Tag = "0";
this.runsingle.Text = "单次分析";
this.runsingle.UseVisualStyleBackColor = true;
this.runsingle.Visible = false;
this.runsingle.CheckedChanged += new System.EventHandler(this.autorun_CheckedChanged);
//
// groupBox4
......@@ -502,24 +522,6 @@
this.permin.UseVisualStyleBackColor = true;
this.permin.CheckedChanged += new System.EventHandler(this.permin_CheckedChanged);
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(43, 26);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(47, 12);
this.label15.TabIndex = 14;
this.label15.Text = "网 口:";
//
// cmbMeshport
//
this.cmbMeshport.FormattingEnabled = true;
this.cmbMeshport.Location = new System.Drawing.Point(97, 21);
this.cmbMeshport.Name = "cmbMeshport";
this.cmbMeshport.Size = new System.Drawing.Size(148, 20);
this.cmbMeshport.TabIndex = 15;
this.cmbMeshport.SelectedIndexChanged += new System.EventHandler(this.cmbMeshport_SelectedIndexChanged);
//
// UserConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......
......@@ -42,12 +42,13 @@ namespace GcDevicePc
chk.Checked = false;
}
if( int.Parse((sender as CheckBox).Tag.ToString()) == 0)
{
test.INIWriteValue(file, "StartUp", "打开系统", "1");
test.INIWriteValue(file, "StartUp", "运行类型", "0");
//if( int.Parse((sender as CheckBox).Tag.ToString()) == 0)
//{
// test.INIWriteValue(file, "StartUp", "打开系统", "1");
// test.INIWriteValue(file, "StartUp", "运行类型", "0");
}else if( int.Parse((sender as CheckBox).Tag.ToString()) == 1)
//}else
if( int.Parse((sender as CheckBox).Tag.ToString()) == 1)
{
test.INIWriteValue(file, "StartUp", "打开系统", "1");
test.INIWriteValue(file, "StartUp", "运行类型", "1");
......@@ -55,11 +56,12 @@ namespace GcDevicePc
{
test.INIWriteValue(file, "StartUp", "打开系统", "1");
test.INIWriteValue(file, "StartUp", "运行类型", "2");
}else
{
test.INIWriteValue(file, "StartUp", "打开系统", "0");
test.INIWriteValue(file, "StartUp", "运行类型", "0");
}
//else
// {
// test.INIWriteValue(file, "StartUp", "打开系统", "0");
// test.INIWriteValue(file, "StartUp", "运行类型", "0");
// }
}
foreach (CheckBox chk in this.groupBox3.Controls)
......@@ -218,11 +220,12 @@ namespace GcDevicePc
if (Convert.ToInt32(opensys) == 1)
{
if(Convert.ToInt32(runtype) == 0)
{
this.runsingle.Checked = true;
}
else if (Convert.ToInt32(runtype) == 2)
//if(Convert.ToInt32(runtype) == 0)
//{
// this.runsingle.Checked = true;
//}
//else
if (Convert.ToInt32(runtype) == 2)
{
this.runbat.Checked = true;
}
......@@ -354,13 +357,25 @@ namespace GcDevicePc
//}
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";
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
INIOperation test = new INIOperation(file);
string newMac = string.Empty;
if (string.IsNullOrEmpty(mac1.Text) || string.IsNullOrEmpty(mac2.Text) || string.IsNullOrEmpty(mac3.Text) || string.IsNullOrEmpty(mac4.Text) || string.IsNullOrEmpty(mac5.Text) || string.IsNullOrEmpty(mac6.Text))
{
ret = test.INIWriteValue(file, "NetWorkConfig", "MAC地址", newMac);
MessageBox.Show("mac输入有误,已解除mac绑定,请重启软件");
}
else
{
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));
ret = test.INIWriteValue(file, "NetWorkConfig", "MAC地址", newMac);
if (ret)
......@@ -373,6 +388,9 @@ namespace GcDevicePc
}
}
}
private void changip_Click(object sender, EventArgs e)
{
UdpClient client = new UdpClient(new IPEndPoint(IPAddress.Any, 0));
......@@ -580,7 +598,7 @@ namespace GcDevicePc
{
//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 = Path.Combine(Path.GetDirectoryName(Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
try
{
......
This diff is collapsed.
......@@ -41,7 +41,8 @@ namespace GcDevicePc
this.fireuptime.Text = time1.ToString();
this.hvalvetime.Text = time2.ToString();
this.firstfiredelay.Text = (Convert.ToDouble(time3) / 60).ToString();
this.firstfiredelay.Text = time3.ToString();
fidfire.Start();
}
......@@ -50,7 +51,7 @@ namespace GcDevicePc
{
this.fireuptime.Text = time1.ToString();
this.hvalvetime.Text = time2.ToString();
this.firstfiredelay.Text = (Convert.ToDouble(time3) / 60).ToString();
this.firstfiredelay.Text = time3.ToString();
}
......@@ -125,7 +126,7 @@ namespace GcDevicePc
ushort time1 = ushort.Parse(fireuptime.Text);
ushort time2 = ushort.Parse(hvalvetime.Text);
ushort time3 = Convert.ToUInt16(Convert.ToInt32(firstfiredelay.Text) * 60);
ushort time3 = ushort.Parse(firstfiredelay.Text);
if (time1 >= time2)
{
auxtoolforfireup(0, time1, time2, time3);
......@@ -575,6 +576,26 @@ namespace GcDevicePc
private void tcd1_sw_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(tcddac1.Text))
{
MessageBox.Show("设置值不能为空!!!");
}
else
{
ushort val = ushort.Parse(tcddac1.Text);
if (val >= 0 && val < 150)
{
gctcd_setdac(0, val);
}
else
{
MessageBox.Show("超过设置值(0~150)!!!");
}
}
String tcd1_flag = tcd1_sw.Text;
string[] sArray = tcd1_flag.Split(new char[2] { '(', ')' });
if (sArray[1] == "关")
......@@ -591,6 +612,25 @@ namespace GcDevicePc
private void tcd2_sw_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(tcddac2.Text))
{
MessageBox.Show("设置值不能为空!!!");
}
else
{
ushort val = ushort.Parse(tcddac2.Text);
if (val >= 0 && val < 150)
{
gctcd_setdac(1, val);
}
else
{
MessageBox.Show("超过设置值(0~150)!!!");
}
}
String tcd2_flag = tcd2_sw.Text;
string[] sArray = tcd2_flag.Split(new char[2] { '(', ')' });
if (sArray[1] == "关")
......@@ -607,6 +647,25 @@ namespace GcDevicePc
private void tcd3_sw_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(tcddac3.Text))
{
MessageBox.Show("设置值不能为空!!!");
}
else
{
ushort val = ushort.Parse(tcddac3.Text);
if (val >= 0 && val < 150)
{
gctcd_setdac(2, val);
}
else
{
MessageBox.Show("超过设置值(0~150)!!!");
}
}
String tcd3_flag = tcd3_sw.Text;
string[] sArray = tcd3_flag.Split(new char[2] { '(', ')' });
if (sArray[1] == "关")
......@@ -633,7 +692,7 @@ namespace GcDevicePc
{
ushort time1 = ushort.Parse(fireuptime.Text);
ushort time2 = ushort.Parse(hvalvetime.Text);
ushort time3 = Convert.ToUInt16(Convert.ToInt32(firstfiredelay.Text) * 60);
ushort time3 = ushort.Parse(firstfiredelay.Text);
if (time1 >= time2)
{
......@@ -679,6 +738,8 @@ namespace GcDevicePc
}
}
this.tcd1_sw.Enabled = this.tcd2_sw.Enabled = this.tcd3_sw.Enabled = globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue;
}
private void auxtool_FormClosed(object sender, FormClosedEventArgs e)
......
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