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
......@@ -263,76 +264,76 @@ namespace GcDevicePc.CK_UI
return;
}
for (int i = 0; i < CKVocAnalyzer.GlobalCKV.vocparamlist.Count; i++)
for (int i = 0; i < CKVocAnalyzer.GlobalCKV.vocparamlist.Count; i++)
{
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[0].name)
{
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[0].name)
{
if (isppm)
{
textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y, 2).ToString() + "ppm";
}
else
{//此处计算成mg/m3 nmhc
if (isppm)
{
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, 2).ToString() + "mg/m³";
//textBox1.Text = Math.Round(listNmoc[listNmoc.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listNmoc[listNmoc.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox1.BackColor = waringcolor;
}
else
textBox1.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[1].name)
{
if (isppm)
{
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
{
textBox1.BackColor = waringcolor;
}
else
textBox1.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[1].name)
{
if (isppm)
{
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox2.Text = Math.Round(listTHC[listTHC.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listTHC[listTHC.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox2.BackColor = waringcolor;
}
else
textBox2.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[2].name)
{
if (isppm)
{
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
}
if (listTHC[listTHC.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox2.BackColor = waringcolor;
}
else
textBox2.BackColor = zcolor;
}
if (CKVocAnalyzer.GlobalCKV.vocparamlist[i].Name == CKVocAnalyzer.GlobalCKV.IngredientList[2].name)
{
if (isppm)
{
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "ppm";
}
else
{
textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y, 2).ToString() + "mg/m³";
//textBox3.Text = Math.Round(listCH4[listCH4.Count - 1].Y / (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 12) * (CKVocAnalyzer.GlobalCKV.vocparamlist[i].MWeight / 22.4), 2).ToString() + "mg/m³";
}
if (listCH4[listCH4.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox3.BackColor = waringcolor;
}
else
textBox3.BackColor = zcolor;
}
}
if (listCH4[listCH4.Count - 1].Y >= CKVocAnalyzer.GlobalCKV.vocparamlist[i].WaringValue)
{
textBox3.BackColor = waringcolor;
}
else
textBox3.BackColor = zcolor;
}
}
......
......@@ -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;
// 网络流列表
......@@ -157,46 +58,24 @@ 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,7 +202,18 @@ 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)
{
txtFlow.Text = this.methodconfig.auxs[index].pipFlowActual.ToString();
......@@ -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;
......
......@@ -950,6 +950,7 @@ namespace GcDevicePc
public Thread updateth;
GcDataTh mymodbus;
HMIControl hmiopt;
int lvindex;
public DataState()
......@@ -958,6 +959,7 @@ namespace GcDevicePc
this.datalist.Width = this.Width;
this.datalist.Height = this.Height;
hmiopt = new HMIControl(globaldata.connection_ip, globaldata.datamodbusport);
datalist.Scroll += new EventHandler(datalist_Scroll);
}
......@@ -981,7 +983,7 @@ namespace GcDevicePc
{
this.datalist.View = View.Details;
this.datalist.Columns.Add("仪器方法", 120, HorizontalAlignment.Left);
this.datalist.Columns.Add("当前值/设置值", 120, HorizontalAlignment.Center);
this.datalist.Columns.Add("当前/设置", 120, HorizontalAlignment.Center);
globaldata.m_profileMethod.GetDevState();
if (!String.IsNullOrEmpty(globaldata.connection_ip))
......@@ -1016,6 +1018,10 @@ namespace GcDevicePc
double iDetvalueold = 0;
double bDetvalueold = 0;
ListViewItem tempshow;
float[] temp = new float[7]{ 0, 0, 0, 0, 0, 0, 0 };
int[] timea = new int[7] { 10, 10, 10, 10, 10, 10, 10};
private void dataupdate_Tick(object sender, EventArgs e)
{
int i;
......@@ -1125,6 +1131,55 @@ namespace GcDevicePc
//errinfo = null;
if (globaldata.m_hmibuffer.gcinfo.HmiAbnormal[0] != 0 || globaldata.m_hmibuffer.gcinfo.HmiAbnormal[1] != 0 || globaldata.m_hmibuffer.gcinfo.HmiAbnormal[2] != 0)
{
tempshow = new ListViewItem();
this.datalist.Items.Add(tempshow);
tempshow = new ListViewItem();
tempshow.Text = "异常";
tempshow.Font = new Font(tempshow.Font, tempshow.Font.Style | FontStyle.Bold);
tempshow.SubItems.Add("");
this.datalist.Items.Add(tempshow);
if (globaldata.m_hmibuffer.gcinfo.HmiAbnormal[0] != 0)
{
tempshow = new ListViewItem();
tempshow.Text = "温度异常";
tempshow.SubItems.Add("XA00" + globaldata.m_hmibuffer.gcinfo.HmiAbnormal[0].ToString());
tempshow.BackColor = Color.LightYellow;
this.datalist.Items.Add(tempshow);
if (globaldata.m_hmibuffer.gcinfo.HmiAbnormal[1] != 0)
{
tempshow = new ListViewItem();
tempshow.Text = "";
tempshow.SubItems.Add("XB00" + globaldata.m_hmibuffer.gcinfo.HmiAbnormal[1].ToString());
tempshow.BackColor = Color.LightYellow;
this.datalist.Items.Add(tempshow);
}
}
else if (globaldata.m_hmibuffer.gcinfo.HmiAbnormal[1] != 0)
{
tempshow = new ListViewItem();
tempshow.Text = "温度异常";
tempshow.SubItems.Add("XB00" + globaldata.m_hmibuffer.gcinfo.HmiAbnormal[1].ToString());
tempshow.BackColor = Color.LightYellow;
this.datalist.Items.Add(tempshow);
}
if (globaldata.m_hmibuffer.gcinfo.HmiAbnormal[2] != 0)
{
tempshow = new ListViewItem();
tempshow.Text = "FID异常";
tempshow.SubItems.Add("XC00" + globaldata.m_hmibuffer.gcinfo.HmiAbnormal[2].ToString());
tempshow.BackColor = Color.LightYellow;
this.datalist.Items.Add(tempshow);
}
}
tempshow = new ListViewItem();
this.datalist.Items.Add(tempshow);
......@@ -1145,9 +1200,41 @@ namespace GcDevicePc
{
tempshow = new ListViewItem();
tempshow.Text = "前进样口";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp.ToString("0"));
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + CProfileDevice.m_DevParam.port[0].fHeaterSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16InjPortFPTemp + 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp>globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp - 1 && globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp < globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp + 1)
{
tempshow.BackColor = Color.White;
}
else
{
tempshow.BackColor = Color.LightYellow;
}
}
else
{
tempshow.BackColor = Color.PaleVioletRed;
}
this.datalist.Items.Add(tempshow);
//if (globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp + 20.0f)
//{
// if (globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp > temp[0])
// {
// }
// MessageBox.Show(tempshow.Text + "温度异常,系统停止中!");
// globaldata.OS_STOP = true;
// hmiopt.WriteEndVal();
//}
//temp[0] = globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp;
}
//else
//{
......@@ -1165,15 +1252,45 @@ namespace GcDevicePc
{
tempshow = new ListViewItem();
tempshow.Text = "后进样口";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp.ToString("0"));
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + CProfileDevice.m_DevParam.port[1].fHeaterSetTemp.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16InjPortBPTemp + 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp - 1 && globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp < globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp + 1)
{
tempshow.BackColor = Color.White;
}
else
{
tempshow.BackColor = Color.LightYellow;
}
}
else
{
tempshow.BackColor = Color.PaleVioletRed;
}
this.datalist.Items.Add(tempshow);
//if (globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp + 20.0f)
//{
// MessageBox.Show(tempshow.Text + "温度异常,系统停止中!");
// globaldata.OS_STOP = true;
// hmiopt.WriteEndVal();
//}
//temp[1] = globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp;
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + "未定义");
//else
}
}
if (CProfileDevice.m_DevParam.syspara.u16Col == 1)
{
......@@ -1183,7 +1300,27 @@ namespace GcDevicePc
tempshow = new ListViewItem();
tempshow.Text = "柱箱";
//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"));
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp) + " / " + CProfileDevice.m_DevParam.col.fColTempSet.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16ColPTemp + 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp - 1 && globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp < globaldata.m_dpbuffer.ShowList.showtemp.ColSetTemp + 1)
{
tempshow.BackColor = Color.White;
}
else
{
tempshow.BackColor = Color.LightYellow;
}
}
else
{
tempshow.BackColor = Color.PaleVioletRed;
}
this.datalist.Items.Add(tempshow);
}
......@@ -1214,9 +1351,40 @@ namespace GcDevicePc
{
tempshow.Text = "FPD1";
}
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp.ToString("0"));
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + CProfileDevice.m_DevParam.fid[0].fHeaterTempSet.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16DetFrontPTemp + 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp - 1 && globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp < globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp + 1)
{
tempshow.BackColor = Color.White;
}
else
{
tempshow.BackColor = Color.LightYellow;
}
}
else
{
tempshow.BackColor = Color.PaleVioletRed;
}
this.datalist.Items.Add(tempshow);
//if (globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp + 20.0f)
//{
// MessageBox.Show(tempshow.Text + "温度异常,系统停止中!");
// globaldata.OS_STOP = true;
// hmiopt.WriteEndVal();
//}
//temp[2] = globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp;
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + "未定义");
//else
......@@ -1244,9 +1412,38 @@ namespace GcDevicePc
{
tempshow.Text = "FPD2";
}
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp.ToString("0"));
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + CProfileDevice.m_DevParam.fid[1].fHeaterTempSet.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16DetInterPTemp + 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp - 1 && globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp < globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp + 1)
{
tempshow.BackColor = Color.White;
}
else
{
tempshow.BackColor = Color.LightYellow;
}
}
else
{
tempshow.BackColor = Color.PaleVioletRed;
}
this.datalist.Items.Add(tempshow);
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + "未定义");
//if (globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp + 20.0f)
//{
// MessageBox.Show(tempshow.Text + "温度异常,系统停止中!");
// globaldata.OS_STOP = true;
// hmiopt.WriteEndVal();
//}
//temp[3] = globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp;
}
......@@ -1274,9 +1471,36 @@ namespace GcDevicePc
tempshow.Text = "FPD3";
}
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp.ToString("0"));
this.datalist.Items.Add(tempshow);
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + CProfileDevice.m_DevParam.tcd[2].fHeaterTempSet.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16DetBehindPTemp + 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp - 1 && globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp < globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp + 1)
{
tempshow.BackColor = Color.White;
}
else
{
tempshow.BackColor = Color.LightYellow;
}
}
else
{
tempshow.BackColor = Color.PaleVioletRed;
}
this.datalist.Items.Add(tempshow);
//if (globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp > globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp + 20.0f)
//{
// MessageBox.Show(tempshow.Text + "温度异常,系统停止中!");
// globaldata.OS_STOP = true;
// hmiopt.WriteEndVal();
//}
//temp[4] = globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp;
}
}
......@@ -1295,14 +1519,39 @@ namespace GcDevicePc
tempshow.Text = "未命名";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1 < globaldata.m_hwconfig.hwconfiginfo.u16AuxHeaterPTemp1 + 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1 > globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1 - 1 && globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1 < globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1 + 1)
{
tempshow.BackColor = Color.White;
}
else
{
tempshow.BackColor = Color.LightYellow;
}
}
else
{
tempshow.BackColor = Color.PaleVioletRed;
}
this.datalist.Items.Add(tempshow);
//if (globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1 > globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp1 + 20.0f)
//{
// MessageBox.Show(tempshow.Text + "温度异常,系统停止中!");
// globaldata.OS_STOP = true;
// hmiopt.WriteEndVal();
//}
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1) + " / " + "未定义");
//else
//{
//}
//temp[5] = globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1;
}
......@@ -1318,8 +1567,35 @@ namespace GcDevicePc
tempshow.Text = "未命名";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp2.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2 < globaldata.m_hwconfig.hwconfiginfo.u16AuxHeaterPTemp2 + 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2 > globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp2 - 1 && globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2 < globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp2 + 1)
{
tempshow.BackColor = Color.White;
}
else
{
tempshow.BackColor = Color.LightYellow;
}
}
else
{
tempshow.BackColor = Color.PaleVioletRed;
}
this.datalist.Items.Add(tempshow);
//if (globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2 > globaldata.m_dpbuffer.ShowList.showtemp.AuxSetTemp2 + 20.0f)
//{
// MessageBox.Show(tempshow.Text + "温度异常,系统停止中!");
// globaldata.OS_STOP = true;
// hmiopt.WriteEndVal();
//}
//temp[6] = globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2;
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2) + " / " + "未定义");
//else
......@@ -1333,7 +1609,9 @@ namespace GcDevicePc
// tempshow.SubItems.Add(CProfileDevice.m_DevParam.aux.fActualTemp_HeatArea2.ToString("#0.00") + " / " + CProfileDevice.m_DevParam.aux.fSetTemp_HeatArea2.ToString("0"));
//this.datalist.Items.Add(tempshow);
}
}
#endregion
......@@ -1526,9 +1804,9 @@ namespace GcDevicePc
tempshow = new ListViewItem();
if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 1)
tempshow.Text = "FID1(mV)";
tempshow.Text = "FID1";
else
tempshow.Text = "FPD1(mV)";
tempshow.Text = "FPD1";
{
fDetvalue = globaldata.m_dpbuffer.ShowList.showDet.fDetValue;
......@@ -1538,7 +1816,7 @@ namespace GcDevicePc
fDetvalue = fDetvalueold;
if (fDetvalue != 0.0f)
tempshow.SubItems.Add(fDetvalue.ToString("0.000"));
tempshow.SubItems.Add(fDetvalue.ToString("0.000") + " mV");
}
this.datalist.Items.Add(tempshow);
......@@ -1628,7 +1906,7 @@ namespace GcDevicePc
if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 0) //TCD
{
tempshow = new ListViewItem();
tempshow.Text = "TCD2(mV)";
tempshow.Text = "TCD2";
iDetvalue = globaldata.m_dpbuffer.ShowList.showDet.iDetValue;
......@@ -1638,7 +1916,7 @@ namespace GcDevicePc
iDetvalue = iDetvalueold;
if (iDetvalue != 0.0f)
tempshow.SubItems.Add(iDetvalue.ToString("0.000"));
tempshow.SubItems.Add(iDetvalue.ToString("0.000") + " mV");
this.datalist.Items.Add(tempshow);
......@@ -1671,9 +1949,9 @@ namespace GcDevicePc
if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 1)
tempshow.Text = "FID2(mV)";
tempshow.Text = "FID2";
else
tempshow.Text = "FPD2(mV)";
tempshow.Text = "FPD2";
iDetvalue = globaldata.m_dpbuffer.ShowList.showDet.iDetValue;
......@@ -1683,7 +1961,7 @@ namespace GcDevicePc
iDetvalue = iDetvalueold;
if (iDetvalue != 0.0f)
tempshow.SubItems.Add(iDetvalue.ToString("0.000"));
tempshow.SubItems.Add(iDetvalue.ToString("0.000") + " mV");
this.datalist.Items.Add(tempshow);
......@@ -2047,6 +2325,7 @@ namespace GcDevicePc
#endregion
this.datalist.EndUpdate();
}
catch (Exception ex)
{
......
......@@ -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.u16ValveTwo = this.ValveTwo.Checked ? 1 : 0;
this.hWConfig.hwconfiginfo.u16ValveThree = this.ValveThree.Checked? 1: 0 ;
this.hWConfig.hwconfiginfo.u16ValveFour = this.ValveFour.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.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 //批处理
{
......@@ -900,9 +906,9 @@ namespace GcDevicePc
private void SetMainFormMethodName(string text)
{
this.toolStripStatusLabelText.Text = "当前运行方法:" + text;
this.toolStripStatusLabelText.Text = "当前运行方法:" + text;
}
private void SetMainFormMethodNameTH(string text)
......@@ -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();
......@@ -1332,7 +1339,7 @@ namespace GcDevicePc
private void Monitor_Connect()
{
UInt16[] dest = new UInt16[9];
ushort status_flag = 10;
ushort status_flag_old = 10;
ushort runtype = 0;
......@@ -1356,11 +1363,11 @@ namespace GcDevicePc
dest[7] = globaldata.m_hmibuffer.gcinfo.hmistatus;
dest[8] = globaldata.m_hmibuffer.gcinfo.runtime;
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue)
status_flag = dest[5];
else
status_flag = 10;
//if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue)
status_flag = dest[5];
//else
// status_flag = 10;
GCstatus = dest[5];
runtype = dest[7];
......@@ -1387,7 +1394,7 @@ namespace GcDevicePc
DataControl_Status(dest[5], 0);
break;
case 2:
BAT_HeadInfo(dest[0], dest[1]);
BAT_HeadInfo(dest[0], dest[1]);
DataControl_Status(dest[5], 2);
break;
case 3:
......@@ -1451,7 +1458,7 @@ namespace GcDevicePc
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 2)
{
if (globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName != globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName)
{
string tmpFileName = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName;
......@@ -1534,41 +1541,41 @@ namespace GcDevicePc
case 0:
case 1:
case 2:
{
SingleCancel.Enabled = false;
SingleStop.Enabled = false;
SingleStart.Enabled = false;
}
{
SingleCancel.Enabled = false;
SingleStop.Enabled = false;
SingleStart.Enabled = false;
}
break;
case 3: //已就绪
{
SingleCancel.Enabled = false;
SingleStop.Enabled = false;
SingleStart.Enabled = true;
}
{
SingleCancel.Enabled = false;
SingleStop.Enabled = false;
SingleStart.Enabled = true;
}
break;
case 4:
case 5:
{
SingleCancel.Enabled = true;
SingleStop.Enabled = true;
SingleStart.Enabled = false;
}
{
SingleCancel.Enabled = true;
SingleStop.Enabled = true;
SingleStart.Enabled = false;
}
break;
case 6:
case 7:
{
SingleCancel.Enabled = false;
SingleStop.Enabled = false;
SingleStart.Enabled = false;
}
{
SingleCancel.Enabled = false;
SingleStop.Enabled = false;
SingleStart.Enabled = false;
}
break;
default:
{
SingleCancel.Enabled = false;
SingleStop.Enabled = false;
SingleStart.Enabled = false;
}
{
SingleCancel.Enabled = false;
SingleStop.Enabled = false;
SingleStart.Enabled = false;
}
break;
}
}));
......@@ -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;
......
using GcDevicePc.GCBuffer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace GcDevicePc.ProThread
{
class SendDataToZB
{
[DllImport(@"SendData.dll")]
public static extern void GcSendDataToZb(Int32 data1, Int32 data2, Int32 data3);
#region 私有变量
ManualResetEvent datamre = new ManualResetEvent(false);
Thread t_DataToHw;
#endregion
#region
private void StartSendDataToZB()
{
GcSendDataToZb(1, 0, 1);
GcSendDataToZb(0, 1, 1);
}
private void StopSendDataToZB()
{
GcSendDataToZb(1, 0, 2);
GcSendDataToZb(0, 1, 2);
}
private void SendDataToZB_A(Int32 data)
{
GcSendDataToZb(data, 0, 3);
GcSendDataToZb(0, 0, 4);
}
private void SendDataToZB_B(Int32 data)
{
GcSendDataToZb(0, data, 4);
GcSendDataToZb(0, 0, 3);
}
private void SendDataToZB_AB(Int32 dataA, Int32 dataB)
{
GcSendDataToZb(dataA, dataB, 0);
}
#endregion
#region 数据输出逻辑
private ushort CheckNumandTime(int num, ushort[] Det, ushort[] Time)
{
ushort count = 0;
for (int i = 0; i < Det.Length; i++)
{
if (num == Det[i] || num == Time[i])
{
break;
}
else
{
count++;
}
}
return count;
}
private void CleanAllToZBData()
{
lock (globaldata.channelA_A)
{
globaldata.channelA_A.Clear();
}
lock (globaldata.channelA_B)
{
globaldata.channelA_B.Clear();
}
lock (globaldata.channelA_C)
{
globaldata.channelA_C.Clear();
}
lock (globaldata.channelB_A)
{
globaldata.channelB_A.Clear();
}
lock (globaldata.channelB_B)
{
globaldata.channelB_B.Clear();
}
lock (globaldata.channelB_C)
{
globaldata.channelB_C.Clear();
}
}
private void InitSendToZBData()
{
int mydataA = 0;
int mydataB = 0;
int i = 0;
for (i = 0; i < 5; i++)
{
switch (methodconfig.signal.uDetA[0])
{
case 1:
if (globaldata.channelA_A.Count >= 1)
{
mydataA = Int32.Parse(globaldata.channelA_A[globaldata.channelA_A.Count - 1].ToString());
globaldata.channelA_A.RemoveAt(0);
}
break;
case 2:
if (globaldata.channelA_B.Count >= 1)
{
mydataA = Int32.Parse(globaldata.channelA_B[globaldata.channelA_B.Count - 1].ToString());
globaldata.channelA_B.RemoveAt(0);
}
break;
case 3:
if (globaldata.channelA_C.Count >= 1)
{
mydataA = Int32.Parse(globaldata.channelA_C[globaldata.channelA_C.Count - 1].ToString());
globaldata.channelA_C.RemoveAt(0);
}
break;
}
switch (methodconfig.signal.uDetB[0])
{
case 1:
if (globaldata.channelB_A.Count >= 1)
{
mydataB = Int32.Parse(globaldata.channelB_A[globaldata.channelB_A.Count - 1].ToString());
globaldata.channelB_A.RemoveAt(0);
}
break;
case 2:
if (globaldata.channelB_B.Count >= 1)
{
mydataB = Int32.Parse(globaldata.channelB_B[globaldata.channelB_B.Count - 1].ToString());
globaldata.channelB_B.RemoveAt(0);
}
break;
case 3:
if (globaldata.channelB_C.Count >= 1)
{
mydataB = Int32.Parse(globaldata.channelB_C[globaldata.channelB_C.Count - 1].ToString());
globaldata.channelB_C.RemoveAt(0);
}
break;
}
if (methodconfig.signal.u16ChannelA == 1 && methodconfig.signal.u16ChannelB == 1)
{
SendDataToZB_AB(mydataA, mydataB);
Thread.Sleep(50);
}
//写入A
if (methodconfig.signal.u16ChannelA == 1 && methodconfig.signal.u16ChannelB != 1)
{
SendDataToZB_A(mydataA);
Thread.Sleep(50);
}
//写入B
if (methodconfig.signal.u16ChannelA != 1 && methodconfig.signal.u16ChannelB == 1)
{
SendDataToZB_B(mydataB);
Thread.Sleep(50);
}
}
}
private void EndSendToHWData(ushort lastA, int offsetA, ushort lastB, int offsetB)
{
int mydataA = 0;
int mydataB = 0;
int i = 0;
for (i = 0; i < 5; i++)
{
switch (methodconfig.signal.uDetA[lastA])
{
case 1:
if (globaldata.channelA_A.Count >= 1)
{
mydataA = Int32.Parse(globaldata.channelA_A[0].ToString()) - offsetA;
globaldata.channelA_A.RemoveAt(0);
}
break;
case 2:
if (globaldata.channelA_B.Count >= 1)
{
mydataA = Int32.Parse(globaldata.channelA_B[0].ToString()) - offsetA;
globaldata.channelA_B.RemoveAt(0);
}
break;
case 3:
if (globaldata.channelA_C.Count >= 1)
{
mydataA = Int32.Parse(globaldata.channelA_C[0].ToString()) - offsetA;
globaldata.channelA_C.RemoveAt(0);
}
break;
}
switch (methodconfig.signal.uDetB[lastB])
{
case 1:
if (globaldata.channelB_A.Count >= 1)
{
mydataB = Int32.Parse(globaldata.channelB_A[0].ToString()) - offsetB;
globaldata.channelB_A.RemoveAt(0);
}
break;
case 2:
if (globaldata.channelB_B.Count >= 1)
{
mydataB = Int32.Parse(globaldata.channelB_B[0].ToString()) - offsetB;
globaldata.channelB_B.RemoveAt(0);
}
break;
case 3:
if (globaldata.channelB_C.Count >= 1)
{
mydataB = Int32.Parse(globaldata.channelB_C[0].ToString()) - offsetB;
globaldata.channelB_C.RemoveAt(0);
}
break;
}
if (methodconfig.signal.u16ChannelA == 1 && methodconfig.signal.u16ChannelB == 1)
{
SendDataToZB_AB(mydataA, mydataB);
Thread.Sleep(50);
}
//写入A
if (methodconfig.signal.u16ChannelA == 1 && methodconfig.signal.u16ChannelB != 1)
{
SendDataToZB_A(mydataA);
Thread.Sleep(50);
}
//写入B
if (methodconfig.signal.u16ChannelA != 1 && methodconfig.signal.u16ChannelB == 1)
{
SendDataToZB_B(mydataB);
Thread.Sleep(50);
}
}
}
public static GCMethodConfig methodconfig { get; set; }
private void SendToZB_Draw()
{
DateTime StartTimeA;
DateTime StartTimeB;
DateTime EndTimeA;
DateTime EndTimeB;
TimeSpan tsA;
TimeSpan tsB;
int secA;
int secB;
int offetA = 0;
int offetB = 0;
bool run_stop = false;
ushort SendNumA = 0;
ushort SendNumB = 0;
//int i = 0;
bool runflag = false;
while (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)
{
int saveB = 0;
int recordB = 0;
int recordA = 0;
int saveA = 0;
int onea = 0;
int oneb = 0;
bool ackoneA = false;
bool ackoneB = false;
InitSendToZBData();
//清除所有数据,准备传输
CleanAllToZBData();
//开启绘图通知
StartSendDataToZB();
//绘图通知开启flag
runflag = true;
if (methodconfig.signal.u16ChannelA == 1)
{
SendNumA = CheckNumandTime(0, methodconfig.signal.uDetA, methodconfig.signal.u16DetTimeLengthA);
}
if (methodconfig.signal.u16ChannelB == 1)
{
SendNumB = CheckNumandTime(0, methodconfig.signal.uDetB, methodconfig.signal.u16DetTimeLengthB);
}
//LogHelper.I("StepA StpeB is", SendNumA.ToString() + " "+ SendNumB.ToString());
ushort MAXNum = SendNumA > SendNumB ? SendNumA : SendNumB;
if (methodconfig.signal.u16ChannelA == 1 || methodconfig.signal.u16ChannelB == 1)
{
int StepA = 0;
int StepB = 0;
{
StartTimeA = DateTime.Now;
StartTimeB = DateTime.Now;
int mydataA = 0;
int mydataB = 0;
while (true)
{
EndTimeA = DateTime.Now;
tsA = StartTimeA.Subtract(EndTimeA).Duration();
secA = (int)tsA.TotalSeconds;
EndTimeB = DateTime.Now;
tsB = StartTimeB.Subtract(EndTimeB).Duration();
secB = (int)tsB.TotalSeconds;
if (StepA < SendNumA)
{
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])
{
case 1:
if (globaldata.channelA_A.Count >= 1)
{
//if (changeA_flag)
//{
// offetA = Int32.Parse(globaldata.channelA_A[0].ToString()) - mydataA_old;
// changeA_flag = false;
//}
mydataA = Int32.Parse(globaldata.channelA_A[0].ToString()) - offetA;
if (ackoneA)
{
onea = mydataA;
ackoneA = false;
}
if (onea > saveA)
{
mydataA = mydataA - (onea - saveA);
}
else if (onea < saveA)
{
mydataA = mydataA + (saveA - onea);
}
mydataA_old = mydataA;
}
break;
case 2:
if (globaldata.channelA_B.Count >= 1)
{
//if (changeA_flag)
//{
// offetA = Int32.Parse(globaldata.channelA_B[0].ToString()) - mydataA_old;
// changeA_flag = false;
//}
mydataA = Int32.Parse(globaldata.channelA_B[0].ToString()) - offetA;
if (ackoneA)
{
onea = mydataA;
ackoneA = false;
}
if (onea > saveA)
{
mydataA = mydataA - (onea - saveA);
}
else if (onea < saveA)
{
mydataA = mydataA + (saveA - onea);
}
mydataA_old = mydataA;
}
break;
case 3:
if (globaldata.channelA_C.Count >= 1)
{
//if (changeA_flag)
//{
// offetA = Int32.Parse(globaldata.channelA_C[0].ToString()) - mydataA_old;
// changeA_flag = false;
//}
mydataA = Int32.Parse(globaldata.channelA_C[0].ToString()) - offetA;
if (ackoneA)
{
onea = mydataA;
ackoneA = false;
}
if (onea > saveA)
{
mydataA = mydataA - (onea - saveA);
}
else if (onea < saveA)
{
mydataA = mydataA + (saveA - onea);
}
mydataA_old = mydataA;
}
break;
}
if (globaldata.channelA_A.Count >= 1)
{
globaldata.channelA_A.RemoveAt(0);
}
if (globaldata.channelA_B.Count >= 1)
{
globaldata.channelA_B.RemoveAt(0);
}
if (globaldata.channelA_C.Count >= 1)
{
globaldata.channelA_C.RemoveAt(0);
}
recordA = mydataA;
}
else
{
// LogHelper.I("StepA++ ", StepA.ToString() + " " + SendNumA.ToString());
saveA = recordA;
ackoneA = true;
StepA++;
StartTimeA = DateTime.Now;
}
}
if (StepB < SendNumB)
{
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])
{
case 1:
if (globaldata.channelB_A.Count >= 1)
{
//if (changeB_flag)
//{
// offetB = Int32.Parse(globaldata.channelB_A[0].ToString()) - mydataB_old;
// changeB_flag = false;
//}
mydataB = Int32.Parse(globaldata.channelB_A[0].ToString()) - offetB;
if (ackoneB)
{
oneb = mydataB;
ackoneB = false;
}
if (oneb > saveB)
{
mydataB = mydataB - (oneb - saveB);
}
else if (oneb < saveB)
{
mydataB = mydataB + (saveB - oneb);
}
mydataB_old = mydataB;
}
break;
case 2:
if (globaldata.channelB_B.Count >= 1)
{
//if (changeB_flag)
//{
// offetB = Int32.Parse(globaldata.channelB_B[0].ToString()) - mydataB_old;
// changeB_flag = false;
//}
mydataB = Int32.Parse(globaldata.channelB_B[0].ToString()) - offetB;
if (ackoneB)
{
oneb = mydataB;
ackoneB = false;
}
if (oneb > saveB)
{
mydataB = mydataB - (oneb - saveB);
}
else if (oneb < saveB)
{
mydataB = mydataB + (saveB - oneb);
}
mydataB_old = mydataB;
}
break;
case 3:
if (globaldata.channelB_C.Count >= 1)
{
//if (changeB_flag)
//{
// offetB = Int32.Parse(globaldata.channelB_C[0].ToString()) - mydataB_old;
// changeB_flag = false;
//}
mydataB = Int32.Parse(globaldata.channelB_C[0].ToString()) - offetB;
if (ackoneB)
{
oneb = mydataB;
ackoneB = false;
}
if (oneb > saveB)
{
mydataB = mydataB - (oneb - saveB);
}
else if (oneb < saveB)
{
mydataB = mydataB + (saveB - oneb);
}
mydataB_old = mydataB;
}
break;
}
if (globaldata.channelB_A.Count >= 1)
{
globaldata.channelB_A.RemoveAt(0);
}
if (globaldata.channelB_B.Count >= 1)
{
globaldata.channelB_B.RemoveAt(0);
}
if (globaldata.channelB_C.Count >= 1)
{
globaldata.channelB_C.RemoveAt(0);
}
recordB = mydataB;
}
else
{
// LogHelper.I("StepB ", StepB.ToString() + " " + SendNumB.ToString());
saveB = recordB;
ackoneB = true;
StepB++;
StartTimeB = DateTime.Now;
}
}
//写入AB
if (StepA < SendNumA && StepB < SendNumB)
{
//Console.WriteLine("SendDataToHW A B", secA.ToString() + " "+ secB.ToString());
SendDataToZB_AB(mydataA, mydataB);
Thread.Sleep(50);
}
//写入A
if (StepA < SendNumA && StepB >= SendNumB)
{
// LogHelper.I("SendDataToHW_A", secA.ToString());
SendDataToZB_A(mydataA);
Thread.Sleep(50);
}
//写入B
if (StepB < SendNumB && StepA >= SendNumA)
{
// LogHelper.I("SendDataToHW_B", secB.ToString());
SendDataToZB_B(mydataB);
Thread.Sleep(50);
}
if (StepB >= SendNumB && StepA >= SendNumA)
{
run_stop = true;
break;
}
if ((globaldata.m_hmibuffer.gcinfo.methodstatus != 4 && globaldata.m_hmibuffer.gcinfo.methodstatus != 5))
{
//LogHelper.I("methodstatus", "stop");
run_stop = true;
break;
}
}
//if ((globaldata.m_hmibuffer.gcinfo.methodstatus != 4 && globaldata.m_hmibuffer.gcinfo.methodstatus != 5))
//{
// break;
//}
}
}
}
if ((globaldata.m_hmibuffer.gcinfo.methodstatus != 4 && globaldata.m_hmibuffer.gcinfo.methodstatus != 5) || run_stop)
{
if (runflag)
{
StopSendDataToZB();
CleanAllToZBData();
runflag = false;
run_stop = false;
}
}
}
}
#endregion
public void DataToZBStart()
{
if (datamre != null)
{
datamre.Reset();
}
t_DataToHw = new Thread(SendToZB_Draw);
t_DataToHw.IsBackground = true;
t_DataToHw.Start();
}
public void DataToZBStop()
{
datamre.Set();
}
}
}
......@@ -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)
{
saveB = 0;
recordB = 0;
recordA = 0;
saveA = 0;
onea = 0;
oneb = 0;
ackoneA = false;
ackoneB = false;
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)
{
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());
Application.Run(new TestForm());
{
using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew))
{
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,23 +357,38 @@ 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);
ret = test.INIWriteValue(file, "NetWorkConfig", "MAC地址", newMac);
if (ret)
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))
{
MessageBox.Show("MAC绑定修改成功,请重启软件!", "提示");
ret = test.INIWriteValue(file, "NetWorkConfig", "MAC地址", newMac);
MessageBox.Show("mac输入有误,已解除mac绑定,请重启软件");
}
else
{
MessageBox.Show("MAC绑定修改失败!", "提示");
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)
{
MessageBox.Show("MAC绑定修改成功,请重启软件!", "提示");
}
else
{
MessageBox.Show("MAC绑定修改失败!", "提示");
}
}
}
private void changip_Click(object sender, EventArgs e)
......@@ -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
{
......
......@@ -64,8 +64,6 @@
this.hair_a1 = new System.Windows.Forms.Button();
this.hair_h1 = new System.Windows.Forms.Button();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.tcdset3 = new System.Windows.Forms.Button();
this.tcdset2 = new System.Windows.Forms.Button();
this.label13 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.tcddac3 = new System.Windows.Forms.TextBox();
......@@ -74,20 +72,19 @@
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.tcd2_sw = new System.Windows.Forms.Button();
this.tcd3_sw = new System.Windows.Forms.Button();
this.tcd1_sw = new System.Windows.Forms.Button();
this.tcdset1 = new System.Windows.Forms.Button();
this.tcddac1 = new System.Windows.Forms.TextBox();
this.fidfire = new System.Windows.Forms.Timer(this.components);
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox8.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// groupBox1
......@@ -131,7 +128,7 @@
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(119, 12);
this.label14.TabIndex = 9;
this.label14.Text = "第一次点火延时(m):";
this.label14.Text = "第一次点火延时(s):";
//
// fireupbtn
//
......@@ -331,14 +328,14 @@
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(427, 35);
this.label6.Location = new System.Drawing.Point(427, 16);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(0, 12);
this.label6.TabIndex = 3;
//
// progressBar2
//
this.progressBar2.Location = new System.Drawing.Point(73, 50);
this.progressBar2.Location = new System.Drawing.Point(73, 23);
this.progressBar2.Name = "progressBar2";
this.progressBar2.Size = new System.Drawing.Size(382, 16);
this.progressBar2.TabIndex = 2;
......@@ -346,7 +343,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(6, 50);
this.label5.Location = new System.Drawing.Point(6, 23);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(65, 12);
this.label5.TabIndex = 1;
......@@ -354,7 +351,7 @@
//
// firmwareupdate
//
this.firmwareupdate.Location = new System.Drawing.Point(212, 16);
this.firmwareupdate.Location = new System.Drawing.Point(212, 55);
this.firmwareupdate.Name = "firmwareupdate";
this.firmwareupdate.Size = new System.Drawing.Size(75, 23);
this.firmwareupdate.TabIndex = 0;
......@@ -417,18 +414,18 @@
//
// groupBox5
//
this.groupBox5.Controls.Add(this.tcdset3);
this.groupBox5.Controls.Add(this.tcdset2);
this.groupBox5.Controls.Add(this.pictureBox1);
this.groupBox5.Controls.Add(this.tcd2_sw);
this.groupBox5.Controls.Add(this.label13);
this.groupBox5.Controls.Add(this.tcd3_sw);
this.groupBox5.Controls.Add(this.label12);
this.groupBox5.Controls.Add(this.tcd1_sw);
this.groupBox5.Controls.Add(this.tcddac3);
this.groupBox5.Controls.Add(this.tcddac2);
this.groupBox5.Controls.Add(this.label11);
this.groupBox5.Controls.Add(this.label10);
this.groupBox5.Controls.Add(this.label9);
this.groupBox5.Controls.Add(this.label8);
this.groupBox5.Controls.Add(this.groupBox6);
this.groupBox5.Controls.Add(this.tcdset1);
this.groupBox5.Controls.Add(this.tcddac1);
this.groupBox5.Location = new System.Drawing.Point(12, 155);
this.groupBox5.Name = "groupBox5";
......@@ -437,26 +434,6 @@
this.groupBox5.TabStop = false;
this.groupBox5.Text = "TCD设置";
//
// tcdset3
//
this.tcdset3.Location = new System.Drawing.Point(209, 92);
this.tcdset3.Name = "tcdset3";
this.tcdset3.Size = new System.Drawing.Size(51, 23);
this.tcdset3.TabIndex = 12;
this.tcdset3.Text = "设置";
this.tcdset3.UseVisualStyleBackColor = true;
this.tcdset3.Click += new System.EventHandler(this.tcdset3_Click);
//
// tcdset2
//
this.tcdset2.Location = new System.Drawing.Point(207, 61);
this.tcdset2.Name = "tcdset2";
this.tcdset2.Size = new System.Drawing.Size(51, 23);
this.tcdset2.TabIndex = 11;
this.tcdset2.Text = "设置";
this.tcdset2.UseVisualStyleBackColor = true;
this.tcdset2.Click += new System.EventHandler(this.tcdset2_Click);
//
// label13
//
this.label13.AutoSize = true;
......@@ -525,21 +502,9 @@
this.label8.TabIndex = 3;
this.label8.Text = "TCD(前):";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.tcd2_sw);
this.groupBox6.Controls.Add(this.tcd3_sw);
this.groupBox6.Controls.Add(this.tcd1_sw);
this.groupBox6.Location = new System.Drawing.Point(278, 15);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(211, 105);
this.groupBox6.TabIndex = 2;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "桥流开关";
//
// tcd2_sw
//
this.tcd2_sw.Location = new System.Drawing.Point(121, 29);
this.tcd2_sw.Location = new System.Drawing.Point(212, 61);
this.tcd2_sw.Name = "tcd2_sw";
this.tcd2_sw.Size = new System.Drawing.Size(75, 23);
this.tcd2_sw.TabIndex = 2;
......@@ -549,7 +514,7 @@
//
// tcd3_sw
//
this.tcd3_sw.Location = new System.Drawing.Point(71, 70);
this.tcd3_sw.Location = new System.Drawing.Point(212, 92);
this.tcd3_sw.Name = "tcd3_sw";
this.tcd3_sw.Size = new System.Drawing.Size(75, 23);
this.tcd3_sw.TabIndex = 1;
......@@ -559,7 +524,7 @@
//
// tcd1_sw
//
this.tcd1_sw.Location = new System.Drawing.Point(19, 29);
this.tcd1_sw.Location = new System.Drawing.Point(212, 27);
this.tcd1_sw.Name = "tcd1_sw";
this.tcd1_sw.Size = new System.Drawing.Size(75, 23);
this.tcd1_sw.TabIndex = 0;
......@@ -567,16 +532,6 @@
this.tcd1_sw.UseVisualStyleBackColor = true;
this.tcd1_sw.Click += new System.EventHandler(this.tcd1_sw_Click);
//
// tcdset1
//
this.tcdset1.Location = new System.Drawing.Point(209, 28);
this.tcdset1.Name = "tcdset1";
this.tcdset1.Size = new System.Drawing.Size(51, 23);
this.tcdset1.TabIndex = 1;
this.tcdset1.Text = "设置";
this.tcdset1.UseVisualStyleBackColor = true;
this.tcdset1.Click += new System.EventHandler(this.tcdset1_Click);
//
// tcddac1
//
this.tcddac1.Location = new System.Drawing.Point(85, 29);
......@@ -589,6 +544,16 @@
this.fidfire.Interval = 1000;
this.fidfire.Tick += new System.EventHandler(this.fidfire_Tick);
//
// pictureBox1
//
this.pictureBox1.Image = global::GcDevicePc.Properties.Resources.色谱3;
this.pictureBox1.Location = new System.Drawing.Point(335, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(139, 114);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 11;
this.pictureBox1.TabStop = false;
//
// auxtool
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -619,7 +584,7 @@
this.groupBox8.ResumeLayout(false);
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox6.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}
......@@ -659,8 +624,6 @@
private System.Windows.Forms.TextBox firstfiredelay;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Button tcdset3;
private System.Windows.Forms.Button tcdset2;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox tcddac3;
......@@ -669,13 +632,12 @@
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.Button tcd2_sw;
private System.Windows.Forms.Button tcd3_sw;
private System.Windows.Forms.Button tcd1_sw;
private System.Windows.Forms.Button tcdset1;
private System.Windows.Forms.TextBox tcddac1;
private System.Windows.Forms.Button fireupbtnI;
private System.Windows.Forms.Timer fidfire;
private System.Windows.Forms.PictureBox pictureBox1;
}
}
\ No newline at end of file
......@@ -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