Commit 13c31e92 authored by leon.huang's avatar leon.huang

1.版本变更为1.7.7.ζ

2.合并第三方工作站类(ZB,HW)为SendDataToSum.cs,通过new实现各自功能(ZB和HW作为字符串传入参数表明型号),已验证555min与raw数据点数几乎相同
3.更改传输频率为直接读取检测器传过来的值,通过检测器本身的传输频率来控制转向第三方工作站的传输频率
4.对于HW增加(!=4或5)时发送信号,以解决起始信号为0的问题(具体原因见SendDataToSum代码注释),同时解决HW单个通道无法提停止的问题
5.gcdatath.cs下的添加检测器信号值到globaldata.channel线程休眠(1ms),避免锁混乱,同时合并这里的ZB和HW添加代码
6.去除gcgata.cs下1411行的lock,反复测试验证去除后,前中后相关lock处理耗时由200~500ms降为基本0
parent dd073a92
...@@ -42,7 +42,7 @@ namespace GcDevicePc ...@@ -42,7 +42,7 @@ namespace GcDevicePc
this.fid1ver.Text = this.FID1version; this.fid1ver.Text = this.FID1version;
this.fid2ver.Text = this.FID2version; this.fid2ver.Text = this.FID2version;
this.tcdver.Text = this.TCD1version; this.tcdver.Text = this.TCD1version;
this.PCver.Text = this.Hmiversion + "/1.7.7.ε"; this.PCver.Text = this.Hmiversion + "/1.7.7.ζ";
} }
} }
} }
...@@ -889,8 +889,8 @@ namespace GcDevicePc ...@@ -889,8 +889,8 @@ namespace GcDevicePc
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.show_MethodName = "SingleAnal.ini"; globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.show_MethodName = "SingleAnal.ini";
} }
SignalDataToHw.methodconfig = InitGetConfig(tmpfile); // SignalDataToHw.methodconfig = InitGetConfig(tmpfile);
SendDataToZB.methodconfig = InitGetConfig(tmpfile); SendDataToSum.methodconfig = InitGetConfig(tmpfile);
} }
else else
{ {
......
...@@ -473,8 +473,8 @@ namespace GcDevicePc.ConfigMethod ...@@ -473,8 +473,8 @@ namespace GcDevicePc.ConfigMethod
globaldata.m_configDlg.m_SignalDlg.reflashContent(); globaldata.m_configDlg.m_SignalDlg.reflashContent();
} }
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType = 0; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType = 0;
SignalDataToHw.methodconfig = this.gcmethodconfig; //SignalDataToHw.methodconfig = this.gcmethodconfig;
SendDataToZB.methodconfig = this.gcmethodconfig; SendDataToSum.methodconfig = this.gcmethodconfig;
//string message = "提交成功!"; //string message = "提交成功!";
......
...@@ -254,7 +254,6 @@ ...@@ -254,7 +254,6 @@
<Compile Include="Common\MoudbusOperation.cs" /> <Compile Include="Common\MoudbusOperation.cs" />
<Compile Include="Common\NModbusSlave.cs" /> <Compile Include="Common\NModbusSlave.cs" />
<Compile Include="Common\RunTableHelper.cs" /> <Compile Include="Common\RunTableHelper.cs" />
<Compile Include="Common\SendDataToHW.cs" />
<Compile Include="Common\TWFile.cs" /> <Compile Include="Common\TWFile.cs" />
<Compile Include="Compound.cs"> <Compile Include="Compound.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
...@@ -669,8 +668,7 @@ ...@@ -669,8 +668,7 @@
<Compile Include="ProThread\HMIControl.cs" /> <Compile Include="ProThread\HMIControl.cs" />
<Compile Include="ProThread\HMISearch.cs" /> <Compile Include="ProThread\HMISearch.cs" />
<Compile Include="ProThread\HmiStatueTh.cs" /> <Compile Include="ProThread\HmiStatueTh.cs" />
<Compile Include="ProThread\SendDataToZB.cs" /> <Compile Include="ProThread\SendDataToSum.cs" />
<Compile Include="ProThread\SignalDataToHw.cs" />
<Compile Include="ProThread\SwitchController.cs" /> <Compile Include="ProThread\SwitchController.cs" />
<Compile Include="ProThread\ThreadMonitor.cs" /> <Compile Include="ProThread\ThreadMonitor.cs" />
<Compile Include="QuitForm.cs"> <Compile Include="QuitForm.cs">
......
...@@ -93,8 +93,8 @@ namespace GcDevicePc ...@@ -93,8 +93,8 @@ namespace GcDevicePc
//private DataOutput wtd624xOutput = new DataOutput(); //private DataOutput wtd624xOutput = new DataOutput();
private SignalDataToHw signalDataTohw = new SignalDataToHw(); // private SignalDataToHw signalDataTohw = new SignalDataToHw();
private SendDataToZB signalDataTozb = new SendDataToZB(); //private SendDataToSum signalDataTozb = new SendDataToSum();
private CPipeCtl sendSPdata = new CPipeCtl(); private CPipeCtl sendSPdata = new CPipeCtl();
#endregion #endregion
...@@ -849,7 +849,7 @@ namespace GcDevicePc ...@@ -849,7 +849,7 @@ namespace GcDevicePc
/// 1.0.2.3 添加了周期完成后,重新绘图功能 /// 1.0.2.3 添加了周期完成后,重新绘图功能
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
this.Text = String.Format("{0}-1.7.7.ε{1}", globaldata.AppName,Formstr); this.Text = String.Format("{0}-1.7.7.ζ{1}", globaldata.AppName,Formstr);
HmiStatus.Text = bEnglishLanguage == false ? String.Format("状态:{0}", statestr) : String.Format("State:{0}", statestr); HmiStatus.Text = bEnglishLanguage == false ? String.Format("状态:{0}", statestr) : String.Format("State:{0}", statestr);
...@@ -1338,15 +1338,17 @@ namespace GcDevicePc ...@@ -1338,15 +1338,17 @@ namespace GcDevicePc
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw)
{ {
signalDataTohw.DataToHwStart(); SendDataToSum signalDataTohw = new SendDataToSum("HW");
signalDataTohw.DataToSumStart();
//signalDataTozb.DataToZBStart(); //signalDataTozb.DataToZBStart();
} }
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
{ {
SendDataToSum signalDataTohw = new SendDataToSum("ZB");
signalDataTohw.DataToSumStart();
//signalDataTohw.DataToHwStart(); //signalDataTohw.DataToHwStart();
//signalDataTozb.DataToZBStart();
signalDataTozb.DataToZBStart();
} }
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoSP) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoSP)
{ {
......
...@@ -57,14 +57,14 @@ namespace GcDevicePc.ProThread ...@@ -57,14 +57,14 @@ namespace GcDevicePc.ProThread
if (globaldata.m_signalbuffer.Draw_Port.Count > 1) if (globaldata.m_signalbuffer.Draw_Port.Count > 1)
{ {
#region #region
if (globaldata.startclear1)//清除开始按键之前的数据,默认false,从未进入 if (globaldata.startclear1)
{ {
CurveDisPlay.curdisp.cleardata(); CurveDisPlay.curdisp.cleardata();
globaldata.starttimer = globaldata.starttimer =
((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0]).ctimer; ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0]).ctimer;
time = 0; time = 0;
globaldata.startclear1 = false; globaldata.startclear1 = false;
} }//清除开始按键之前的数据,默认false,从未进入
else else
{ {
if (globaldata.startimerIsSet1||time>600) if (globaldata.startimerIsSet1||time>600)
...@@ -143,7 +143,7 @@ namespace GcDevicePc.ProThread ...@@ -143,7 +143,7 @@ namespace GcDevicePc.ProThread
listRawTem.Clear(); //缓存3000点,大于3000,重新开始 listRawTem.Clear(); //缓存3000点,大于3000,重新开始
} }
//TCP数据回传 //TCP数据回传
lock (globaldata.m_signalbuffer.TCP_Port) lock (globaldata.m_signalbuffer.TCP_Port)//TCP_Port读取的时间和检测器信号
{ {
if (globaldata.m_signalbuffer.TCP_Port.Count > 0) if (globaldata.m_signalbuffer.TCP_Port.Count > 0)
{ {
...@@ -164,13 +164,13 @@ namespace GcDevicePc.ProThread ...@@ -164,13 +164,13 @@ namespace GcDevicePc.ProThread
} }
if (tcpraw.Count > 0) if (tcpraw.Count > 0)
{ {
CurveDisPlay.curdisp.WriteTcp(tcpraw); CurveDisPlay.curdisp.WriteTcp(tcpraw);//引用dll-CKVocAnalyzer
} }
} }
globaldata.m_signalbuffer.TCP_Port.Clear(); globaldata.m_signalbuffer.TCP_Port.Clear();
} }
} }
if (isstart == 2 && listRawTem.Count > 0) //回填数据 if (isstart == 2 && listRawTem.Count > 0)
{ {
int rami = listRawTem.FindIndex(s => s[0] >= globaldata.starttimer); int rami = listRawTem.FindIndex(s => s[0] >= globaldata.starttimer);
if (rami > -1) //有需要回填数据 if (rami > -1) //有需要回填数据
...@@ -191,7 +191,7 @@ namespace GcDevicePc.ProThread ...@@ -191,7 +191,7 @@ namespace GcDevicePc.ProThread
} }
} }
listRawTem.Clear(); listRawTem.Clear();
} } //回填数据
if (globaldata.starttimer <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer && (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) > 0) if (globaldata.starttimer <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer && (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) > 0)
{ {
time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f); time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f);
...@@ -278,7 +278,8 @@ namespace GcDevicePc.ProThread ...@@ -278,7 +278,8 @@ namespace GcDevicePc.ProThread
//} //}
#endregion #endregion
CurveDisPlay.curdisp.addDataRaw(listRaw); //记录原始数据 CurveDisPlay.curdisp.addDataRaw(listRaw); //记录原始数据
CurveDisPlay.curdisp.addPoint(listPoint, drbool); //更新绘画区域,停止系统后依旧处于累计状态 // Console.WriteLine("ss"+ listPoint.Count);
CurveDisPlay.curdisp.addPoint(listPoint, drbool); //更新绘画区域,停止系统后依旧处于累计状态,为了避免数据量太大,改为全程(即使停止系统)绘制基线
//lp.Clear(); //lp.Clear();
//lr.Clear(); //lr.Clear();
if (drbool) if (drbool)
......
...@@ -260,7 +260,6 @@ namespace GcDevicePc.ProThread ...@@ -260,7 +260,6 @@ namespace GcDevicePc.ProThread
lock (globaldata.m_signalbuffer.Draw_Port) lock (globaldata.m_signalbuffer.Draw_Port)
{ {
Thread.Sleep(1); Thread.Sleep(1);
//缓存信号值,最大5120,最大后重置 //缓存信号值,最大5120,最大后重置
if (globaldata.m_signalbuffer.Draw_Port.Count < globaldata.MAX_ARRAY_LEN) if (globaldata.m_signalbuffer.Draw_Port.Count < globaldata.MAX_ARRAY_LEN)
{ {
...@@ -288,13 +287,14 @@ namespace GcDevicePc.ProThread ...@@ -288,13 +287,14 @@ namespace GcDevicePc.ProThread
} }
#endregion #endregion
// public static ArrayList channelSum = new ArrayList() {channelA_A,channelA_B,channelA_C,channelB_A,channelB_B,channelB_C };
#region 是否向第三方工作站(HL3000ZB2040)传输所有信号值(具体传输频率在各自senddata子类中) #region 是否向第三方工作站(HL3000ZB2040)传输所有信号值(具体传输频率在各自senddata子类中)
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw||globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
{ {
lock (globaldata.channelA_A) lock (globaldata.channelA_A)
{ {
Thread.Sleep(1);
if (globaldata.channelA_A.Count < globaldata.MAX_ARRAY_LEN) if (globaldata.channelA_A.Count < globaldata.MAX_ARRAY_LEN)
{ {
globaldata.channelA_A.Add((long)(fidv[i] * 1000000)); globaldata.channelA_A.Add((long)(fidv[i] * 1000000));
...@@ -302,29 +302,15 @@ namespace GcDevicePc.ProThread ...@@ -302,29 +302,15 @@ namespace GcDevicePc.ProThread
} }
lock (globaldata.channelB_A) lock (globaldata.channelB_A)
{ {
Thread.Sleep(1);
if (globaldata.channelB_A.Count < globaldata.MAX_ARRAY_LEN) if (globaldata.channelB_A.Count < globaldata.MAX_ARRAY_LEN)
{ {
globaldata.channelB_A.Add((long)(fidv[i] * 1000000)); globaldata.channelB_A.Add((long)(fidv[i] * 1000000));
} }
} }
}
else if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
{
lock (globaldata.channelA_A)
{
if (globaldata.channelA_A.Count < globaldata.MAX_ARRAY_LEN)
{
globaldata.channelA_A.Add((long)(fidv[i] * 1000000));
}
}
lock (globaldata.channelB_A)
{
if (globaldata.channelB_A.Count < globaldata.MAX_ARRAY_LEN)
{
globaldata.channelB_A.Add((long)(fidv[i] * 1000000));
}
} }
}
#endregion #endregion
} }
else else
...@@ -405,35 +391,17 @@ namespace GcDevicePc.ProThread ...@@ -405,35 +391,17 @@ namespace GcDevicePc.ProThread
{ {
globaldata.m_signalbuffer.Save_Port2.Add(globaldata.m_signalbuffer.Channel2_Port); globaldata.m_signalbuffer.Save_Port2.Add(globaldata.m_signalbuffer.Channel2_Port);
} }
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw||globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw)
{ {
lock (globaldata.channelA_B)
{
if (globaldata.channelA_B.Count < globaldata.MAX_ARRAY_LEN)
{
globaldata.channelA_B.Add((long)(fidv[i] * 1000000));
}
}
lock (globaldata.channelB_B) lock (globaldata.channelA_B)
{
if (globaldata.channelB_B.Count < globaldata.MAX_ARRAY_LEN)
{
globaldata.channelB_B.Add((long)(fidv[i] * 1000000));
}
}
}
else if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
{
lock (globaldata.channelA_B)
{ {
Thread.Sleep(1);
if (globaldata.channelA_B.Count < globaldata.MAX_ARRAY_LEN) if (globaldata.channelA_B.Count < globaldata.MAX_ARRAY_LEN)
{ {
globaldata.channelA_B.Add((long)(fidv[i] * 1000000)); globaldata.channelA_B.Add((long)(fidv[i] * 1000000));
} }
} }
lock (globaldata.channelB_B) lock (globaldata.channelB_B)
{ {
if (globaldata.channelB_B.Count < globaldata.MAX_ARRAY_LEN) if (globaldata.channelB_B.Count < globaldata.MAX_ARRAY_LEN)
...@@ -517,28 +485,12 @@ namespace GcDevicePc.ProThread ...@@ -517,28 +485,12 @@ namespace GcDevicePc.ProThread
{ {
globaldata.m_signalbuffer.Save_Port3.Add(globaldata.m_signalbuffer.Channel3_Port); globaldata.m_signalbuffer.Save_Port3.Add(globaldata.m_signalbuffer.Channel3_Port);
} }
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw||globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw)
{
lock (globaldata.channelA_C)
{
if (globaldata.channelA_C.Count < globaldata.MAX_ARRAY_LEN)
{
globaldata.channelA_C.Add((long)(fidv[i] * 1000000));
}
}
lock (globaldata.channelB_C)
{
if (globaldata.channelB_C.Count < globaldata.MAX_ARRAY_LEN)
{
globaldata.channelB_C.Add((long)(fidv[i] * 1000000));
}
}
}
else if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
{ {
lock (globaldata.channelA_C) lock (globaldata.channelA_C)
{ {
Thread.Sleep(1);
if (globaldata.channelA_C.Count < globaldata.MAX_ARRAY_LEN) if (globaldata.channelA_C.Count < globaldata.MAX_ARRAY_LEN)
{ {
globaldata.channelA_C.Add((long)(fidv[i] * 1000000)); globaldata.channelA_C.Add((long)(fidv[i] * 1000000));
...@@ -546,12 +498,15 @@ namespace GcDevicePc.ProThread ...@@ -546,12 +498,15 @@ namespace GcDevicePc.ProThread
} }
lock (globaldata.channelB_C) lock (globaldata.channelB_C)
{ {
Thread.Sleep(1);
if (globaldata.channelB_C.Count < globaldata.MAX_ARRAY_LEN) if (globaldata.channelB_C.Count < globaldata.MAX_ARRAY_LEN)
{ {
globaldata.channelB_C.Add((long)(fidv[i] * 1000000)); globaldata.channelB_C.Add((long)(fidv[i] * 1000000));
} }
} }
} }
} }
} }
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -139,11 +139,11 @@ namespace GcDevicePc ...@@ -139,11 +139,11 @@ namespace GcDevicePc
dataToZB.testzbb(); dataToZB.testzbb();
} }
SendDataToZB dataToZB = new SendDataToZB(); SendDataToSum dataToZB = new SendDataToSum("ZB");
private void Button8_Click(object sender, EventArgs e) private void Button8_Click(object sender, EventArgs e)
{ {
//dataToZB.InitsendData(); //dataToZB.InitsendData();
dataToZB.StartSendDataToZB(); dataToZB.StartSendDataToSum();
starttr(); starttr();
} }
......
...@@ -113,7 +113,8 @@ namespace GcDevicePc ...@@ -113,7 +113,8 @@ namespace GcDevicePc
public static long channel_A = 0; public static long channel_A = 0;
public static long channel_B = 0; public static long channel_B = 0;
public static long channel_C = 0; public static long channel_C = 0;
public static ArrayList channelA_A = new ArrayList(); public static ArrayList channelA_A = new ArrayList();
public static ArrayList channelA_B = new ArrayList(); public static ArrayList channelA_B = new ArrayList();
public static ArrayList channelA_C = new ArrayList(); public static ArrayList channelA_C = new ArrayList();
...@@ -121,7 +122,6 @@ namespace GcDevicePc ...@@ -121,7 +122,6 @@ namespace GcDevicePc
public static ArrayList channelB_A = new ArrayList(); public static ArrayList channelB_A = new ArrayList();
public static ArrayList channelB_B = new ArrayList(); public static ArrayList channelB_B = new ArrayList();
public static ArrayList channelB_C = new ArrayList(); public static ArrayList channelB_C = new ArrayList();
//public static RingBufferManager m_rsbuffer = new RingBufferManager(100000); //public static RingBufferManager m_rsbuffer = new RingBufferManager(100000);
public static bool OS_STOP = false; public static bool OS_STOP = false;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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