Commit 0f79d20c authored by wangjunqiang's avatar wangjunqiang

添加624X输出限制开关

parent b0741b9c
...@@ -91,7 +91,7 @@ namespace GcDevicePc.GCBuffer ...@@ -91,7 +91,7 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.pcworkinfo.system_Statue = false; gcpcinfo.pcworkinfo.system_Statue = false;
gcpcinfo.pcworkinfo.work_Statue = 0; gcpcinfo.pcworkinfo.work_Statue = 0;
gcpcinfo.moduleinfo.ip = "192.168.1.54"; gcpcinfo.moduleinfo.ip = "";
string file = System.Windows.Forms.Application.StartupPath + "\\startup.ini"; string file = System.Windows.Forms.Application.StartupPath + "\\startup.ini";
......
...@@ -369,7 +369,7 @@ namespace GcDevicePc ...@@ -369,7 +369,7 @@ namespace GcDevicePc
if (i != 99) if (i != 99)
{ {
worker.ReportProgress(i); worker.ReportProgress(i);
break; //break;
} }
} }
...@@ -585,7 +585,8 @@ namespace GcDevicePc ...@@ -585,7 +585,8 @@ namespace GcDevicePc
dataVOC.CKvocUpdataStart(); dataVOC.CKvocUpdataStart();
mytcptest.DataRcvStart(); mytcptest.DataRcvStart();
wtd624xOutput.DataOutStart(); if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
wtd624xOutput.DataOutStart();
} }
private void Stop_Thread() private void Stop_Thread()
...@@ -601,7 +602,8 @@ namespace GcDevicePc ...@@ -601,7 +602,8 @@ namespace GcDevicePc
mymodbus.ChannelDataStop(); mymodbus.ChannelDataStop();
} }
wtd624xOutput.DataOutStop(); if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
wtd624xOutput.DataOutStop();
} }
/// <summary> /// <summary>
...@@ -998,7 +1000,7 @@ namespace GcDevicePc ...@@ -998,7 +1000,7 @@ namespace GcDevicePc
conmre.Set(); conmre.Set();
globaldata.m_pcbuffer.gcpcinfo.pcthreadinfo.HMI_Monitor_TH = 1; globaldata.m_pcbuffer.gcpcinfo.pcthreadinfo.HMI_Monitor_TH = 1;
Thread.Sleep(1500); Thread.Sleep(1000);
count = 0; count = 0;
......
...@@ -15,7 +15,7 @@ namespace GcDevicePc.ProThread ...@@ -15,7 +15,7 @@ namespace GcDevicePc.ProThread
ManualResetEvent outputmre = new ManualResetEvent(false); ManualResetEvent outputmre = new ManualResetEvent(false);
Thread t_DataOut; Thread t_DataOut;
private WTD624X wtd624x = new WTD624X(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip, 502); private WTD624X wtd624x;
private bool c6h6 = false; private bool c6h6 = false;
private bool c7h8 = false; private bool c7h8 = false;
...@@ -157,28 +157,41 @@ namespace GcDevicePc.ProThread ...@@ -157,28 +157,41 @@ namespace GcDevicePc.ProThread
public void DataOutStart() public void DataOutStart()
{ {
if (outputmre != null) if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
{ {
outputmre.Reset(); wtd624x = new WTD624X(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip, 502);
} }
t_DataOut = new Thread(OutPut_DataList); if (wtd624x!= null)
t_DataOut.IsBackground = true;
t_DataOut.Start();
if (!wtd624x.GetWorkFlag())
{ {
wtd624x.WTD624X_Open(); if (outputmre != null)
{
outputmre.Reset();
}
t_DataOut = new Thread(OutPut_DataList);
t_DataOut.IsBackground = true;
t_DataOut.Start();
if (!wtd624x.GetWorkFlag())
{
wtd624x.WTD624X_Open();
}
} }
} }
public void DataOutStop() public void DataOutStop()
{ {
outputmre.Set(); if (wtd624x != null)
if (wtd624x.GetWorkFlag())
{ {
wtd624x.WTD624X_Open(); outputmre.Set();
if (wtd624x.GetWorkFlag())
{
wtd624x.WTD624X_Open();
}
} }
} }
} }
......
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