Commit 521df5d2 authored by liu's avatar liu

添加三通道三检测相关,实验室在线合一。

parent 06c79fd5
...@@ -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.4.9"; this.PCver.Text = this.Hmiversion + "/1.5.1";
} }
} }
} }
...@@ -773,6 +773,18 @@ namespace GcDevicePc ...@@ -773,6 +773,18 @@ namespace GcDevicePc
} }
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_StatusName = tmpfile; globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_StatusName = tmpfile;
tmpfile = null; tmpfile = null;
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
IniFile ini = new IniFile(file);
string Version = ini.ReadString("Version", "VersionType");
if (string.IsNullOrEmpty(Version))
{
Version = "0";
}
globaldata.CurrentVersion = Version;
} }
public void LocalNetworkCheck() public void LocalNetworkCheck()
......
...@@ -23,6 +23,8 @@ namespace GcDevicePc ...@@ -23,6 +23,8 @@ namespace GcDevicePc
InitializeComponent(); InitializeComponent();
curdisp.Location = new Point(5, 5); curdisp.Location = new Point(5, 5);
curdisp.Fidname = "A";
Size size = curdisp.Size; Size size = curdisp.Size;
size.Width = size.Width - 20; size.Width = size.Width - 20;
size.Height = size.Height - 25; size.Height = size.Height - 25;
......
...@@ -18,6 +18,8 @@ namespace GcDevicePc.CK_UI ...@@ -18,6 +18,8 @@ namespace GcDevicePc.CK_UI
InitializeComponent(); InitializeComponent();
curdisp2.Location = new Point(5, 5); curdisp2.Location = new Point(5, 5);
curdisp2.Fidname = "B";
Size size = curdisp2.Size; Size size = curdisp2.Size;
size.Width = size.Width - 20; size.Width = size.Width - 20;
size.Height = size.Height - 25; size.Height = size.Height - 25;
......
...@@ -18,6 +18,8 @@ namespace GcDevicePc.CK_UI ...@@ -18,6 +18,8 @@ namespace GcDevicePc.CK_UI
InitializeComponent(); InitializeComponent();
curdisp3.Location = new Point(5, 5); curdisp3.Location = new Point(5, 5);
curdisp3.Fidname = "C";
Size size = curdisp3.Size; Size size = curdisp3.Size;
size.Width = size.Width - 20; size.Width = size.Width - 20;
size.Height = size.Height - 25; size.Height = size.Height - 25;
......
using System; using GcDevicePc.GCBuffer;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
...@@ -13,10 +14,12 @@ namespace GcDevicePc ...@@ -13,10 +14,12 @@ namespace GcDevicePc
public partial class HistChartForm : Form public partial class HistChartForm : Form
{ {
CKVocAnalyzer.CtrlWaveHistory adjust; CKVocAnalyzer.CtrlWaveHistory adjust;
public HistChartForm() public HistChartForm(string file)
{ {
InitializeComponent(); InitializeComponent();
adjust = new CKVocAnalyzer.CtrlWaveHistory(); adjust = new CKVocAnalyzer.CtrlWaveHistory();
adjust.ZbRecord = file;
adjust.Location = new Point(1, 1); adjust.Location = new Point(1, 1);
Size size = this.Size; Size size = this.Size;
size.Width = size.Width - 15; size.Width = size.Width - 15;
......
...@@ -13,19 +13,21 @@ namespace GcDevicePc.CK_UI ...@@ -13,19 +13,21 @@ namespace GcDevicePc.CK_UI
{ {
private string user = "admin"; private string user = "admin";
public static bool Island = false; public static bool Island = false;
private string dt;
CKVocAnalyzer.NumForm form; CKVocAnalyzer.NumForm form;
public LandIn(string userstr) public LandIn(string userstr,string pwd)
{ {
InitializeComponent(); InitializeComponent();
this.ControlBox = false; this.ControlBox = false;
this.user = userstr; this.user = userstr;
this.dt = pwd;
} }
private void button1_Click(object sender, EventArgs e) //登录系统 private void button1_Click(object sender, EventArgs e) //登录系统
{ {
string strpw = DateTime.Now.ToString("HHmm"); string strpw = this.dt;
if (textBox1.Text == user && textBox2.Text == strpw) if (textBox1.Text == user && textBox2.Text == strpw)
{ {
Island = true; Island = true;
......
...@@ -34,7 +34,7 @@ namespace GcDevicePc.Common ...@@ -34,7 +34,7 @@ namespace GcDevicePc.Common
0xC0,0xC3,0xCE,0xC5,0xD1,0xC3,0xC3,0x80,0xC3,0xDB,0x83,0xD8,0xCA,0xD3,0xD7,0xD7, 0xC0,0xC3,0xCE,0xC5,0xD1,0xC3,0xC3,0x80,0xC3,0xDB,0x83,0xD8,0xCA,0xD3,0xD7,0xD7,
0xDB,0xCB,0xDD,0xE5,0x95,0x97,0x9B,0x90,0xE4,0xEB,0xE6,0xE8,0xDA,0xE3,0x97,0xD9, 0xDB,0xCB,0xDD,0xE5,0x95,0x97,0x9B,0x90,0xE4,0xEB,0xE6,0xE8,0xDA,0xE3,0x97,0xD9,
0xDD,0xE7,0xE4,0xEA,0xE6,0xF1,0xF3,0xF2,0xE2,0xF6,0xF2,0xF6,0x8F,0x00,0x00,0x00, 0xDD,0xE7,0xE4,0xEA,0xE6,0xF1,0xF3,0xF2,0xE2,0xF6,0xF2,0xF6,0x8F,0x00,0x00,0x00,
0x00 0x00
}; };
public TWFile(string file) public TWFile(string file)
...@@ -60,7 +60,7 @@ namespace GcDevicePc.Common ...@@ -60,7 +60,7 @@ namespace GcDevicePc.Common
public void TW_Close(int datanum) public void TW_Close(int datanum)
{ {
int i; int i;
for (i = 0; i < enddata.Length; i++ ) for (i = 0; i < enddata.Length; i++)
{ {
bw.Write(enddata[i]); bw.Write(enddata[i]);
} }
......
...@@ -10,6 +10,7 @@ using System.Threading; ...@@ -10,6 +10,7 @@ using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using GcDevicePc.ConfigMethod.injectionport; using GcDevicePc.ConfigMethod.injectionport;
using GcDevicePc.GCBuffer; using GcDevicePc.GCBuffer;
using GcDevicePc.ProThread;
namespace GcDevicePc.ConfigMethod namespace GcDevicePc.ConfigMethod
{ {
...@@ -103,7 +104,7 @@ namespace GcDevicePc.ConfigMethod ...@@ -103,7 +104,7 @@ namespace GcDevicePc.ConfigMethod
this.auxTabs = new AuxTabs(this.gchwconfig, ref this.gcmethodconfig); this.auxTabs = new AuxTabs(this.gchwconfig, ref this.gcmethodconfig);
} }
#region #region
...@@ -201,9 +202,8 @@ namespace GcDevicePc.ConfigMethod ...@@ -201,9 +202,8 @@ namespace GcDevicePc.ConfigMethod
m_ReadColTab.reflashContent(); m_ReadColTab.reflashContent();
m_DetTab.reflashContent(); m_DetTab.reflashContent();
m_SignalTab.reflashContent(); m_SignalTab.reflashContent();
//m_AuxTab.reflashContent();
auxTabs.reflashContent(); auxTabs.reflashContent();
//m_AuxTab.reflashContent();
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
//fID.reflashContent(0); //fID.reflashContent(0);
//m_ePCFID.reflashContent(0); //m_ePCFID.reflashContent(0);
...@@ -252,7 +252,7 @@ namespace GcDevicePc.ConfigMethod ...@@ -252,7 +252,7 @@ namespace GcDevicePc.ConfigMethod
auxTabs.TopLevel = false; auxTabs.TopLevel = false;
auxTabs.Show(); auxTabs.Show();
tabmain.TabPages[7].Controls.Add(auxTabs); tabmain.TabPages[7].Controls.Add(auxTabs);
InitAllTab(); InitAllTab();
} }
...@@ -300,10 +300,7 @@ namespace GcDevicePc.ConfigMethod ...@@ -300,10 +300,7 @@ namespace GcDevicePc.ConfigMethod
//{ //{
// this.gcmethodconfig.SetValInjPortAllPara(); // this.gcmethodconfig.SetValInjPortAllPara();
//} //}
m_chromTabs.recordCurData(); m_chromTabs.recordCurData();
this.gcmethodconfig.SetChromAllPara(); this.gcmethodconfig.SetChromAllPara();
...@@ -321,7 +318,6 @@ namespace GcDevicePc.ConfigMethod ...@@ -321,7 +318,6 @@ namespace GcDevicePc.ConfigMethod
{ {
this.gcmethodconfig.SetFidByID(0); this.gcmethodconfig.SetFidByID(0);
} }
} }
if (this.gchwconfig.hwconfiginfo.u16DetInter == 1) if (this.gchwconfig.hwconfiginfo.u16DetInter == 1)
...@@ -438,6 +434,8 @@ namespace GcDevicePc.ConfigMethod ...@@ -438,6 +434,8 @@ namespace GcDevicePc.ConfigMethod
globaldata.m_configDlg.m_SignalDlg.reflashContent(); globaldata.m_configDlg.m_SignalDlg.reflashContent();
} }
SignalDataToHw.methodconfig = this.gcmethodconfig;
//string message = "提交成功!"; //string message = "提交成功!";
//MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); //MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
...@@ -446,6 +444,8 @@ namespace GcDevicePc.ConfigMethod ...@@ -446,6 +444,8 @@ namespace GcDevicePc.ConfigMethod
{ {
} }
} }
} }
else else
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -133,7 +133,6 @@ namespace GcDevicePc.ConfigMethod ...@@ -133,7 +133,6 @@ namespace GcDevicePc.ConfigMethod
private void InjPortBox_SelectedIndexChanged(object sender, EventArgs e) private void InjPortBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
recordCurData(); recordCurData();
int index; int index;
......
...@@ -7,6 +7,7 @@ using System.Linq; ...@@ -7,6 +7,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using GcDevicePc.GCBuffer; using GcDevicePc.GCBuffer;
using GcDevicePc.IniParam;
namespace GcDevicePc.ConfigMethod namespace GcDevicePc.ConfigMethod
{ {
...@@ -89,7 +90,6 @@ namespace GcDevicePc.ConfigMethod ...@@ -89,7 +90,6 @@ namespace GcDevicePc.ConfigMethod
tmptextbox = (TextBox)(this.Controls.Find("signalAT" + channel.ToString(), true)[0]); tmptextbox = (TextBox)(this.Controls.Find("signalAT" + channel.ToString(), true)[0]);
tmpcombox.SelectedIndex = (int)this.methodconfig.signal.uDetA[i]; tmpcombox.SelectedIndex = (int)this.methodconfig.signal.uDetA[i];
if (this.methodconfig.signal.u16DetTimeLengthA[i] > 0) if (this.methodconfig.signal.u16DetTimeLengthA[i] > 0)
{ {
tmptextbox.Text = ((float)this.methodconfig.signal.u16DetTimeLengthA[i] / 60).ToString("#0.0"); tmptextbox.Text = ((float)this.methodconfig.signal.u16DetTimeLengthA[i] / 60).ToString("#0.0");
...@@ -103,7 +103,6 @@ namespace GcDevicePc.ConfigMethod ...@@ -103,7 +103,6 @@ namespace GcDevicePc.ConfigMethod
tmptextbox = (TextBox)(this.Controls.Find("signalBT" + channel.ToString(), true)[0]); tmptextbox = (TextBox)(this.Controls.Find("signalBT" + channel.ToString(), true)[0]);
tmpcombox.SelectedIndex = (int)this.methodconfig.signal.uDetB[i]; tmpcombox.SelectedIndex = (int)this.methodconfig.signal.uDetB[i];
if (this.methodconfig.signal.u16DetTimeLengthB[i] > 0) if (this.methodconfig.signal.u16DetTimeLengthB[i] > 0)
{ {
tmptextbox.Text = ((float)this.methodconfig.signal.u16DetTimeLengthB[i] / 60).ToString("#0.0"); tmptextbox.Text = ((float)this.methodconfig.signal.u16DetTimeLengthB[i] / 60).ToString("#0.0");
...@@ -239,6 +238,10 @@ namespace GcDevicePc.ConfigMethod ...@@ -239,6 +238,10 @@ namespace GcDevicePc.ConfigMethod
this.methodconfig.signal.u16ChannelA = (signalA_sw.CheckState == CheckState.Checked) ? (ushort)1 : (ushort)0; this.methodconfig.signal.u16ChannelA = (signalA_sw.CheckState == CheckState.Checked) ? (ushort)1 : (ushort)0;
this.methodconfig.signal.u16ChannelB = (signalB_sw.CheckState == CheckState.Checked) ? (ushort)1 : (ushort)0; this.methodconfig.signal.u16ChannelB = (signalB_sw.CheckState == CheckState.Checked) ? (ushort)1 : (ushort)0;
CProfileDevice.m_DevParam.signal.u16ChannelA = (signalA_sw.CheckState == CheckState.Checked) ? (ushort)1 : (ushort)0;
CProfileDevice.m_DevParam.signal.u16ChannelB = (signalB_sw.CheckState == CheckState.Checked) ? (ushort)1 : (ushort)0;
for (i = 0; i < MAX_NUM; i++) for (i = 0; i < MAX_NUM; i++)
{ {
channel = i + 1; channel = i + 1;
...@@ -261,6 +264,24 @@ namespace GcDevicePc.ConfigMethod ...@@ -261,6 +264,24 @@ namespace GcDevicePc.ConfigMethod
this.methodconfig.signal.u16DetTimeLengthA[i] = newtime; this.methodconfig.signal.u16DetTimeLengthA[i] = newtime;
} }
if (tmpcombox.SelectedIndex < 0)
CProfileDevice.m_DevParam.signal.uDetA[i] = 0;
else
CProfileDevice.m_DevParam.signal.uDetA[i] = (ushort)tmpcombox.SelectedIndex;
if (string.IsNullOrEmpty(tmptextbox.Text))
{
CProfileDevice.m_DevParam.signal.u16DetTimeLengthA[i] = 0;
}
else
{
time = (float)Convert.ToDecimal(tmptextbox.Text);
newtime = (ushort)Convert.ToDecimal((time * 60).ToString());
CProfileDevice.m_DevParam.signal.u16DetTimeLengthA[i] = newtime;
}
} }
for (i = 0; i < MAX_NUM; i++) for (i = 0; i < MAX_NUM; i++)
...@@ -284,7 +305,24 @@ namespace GcDevicePc.ConfigMethod ...@@ -284,7 +305,24 @@ namespace GcDevicePc.ConfigMethod
newtime = (ushort)Convert.ToDecimal((time * 60).ToString()); newtime = (ushort)Convert.ToDecimal((time * 60).ToString());
this.methodconfig.signal.u16DetTimeLengthB[i] = newtime; this.methodconfig.signal.u16DetTimeLengthB[i] = newtime;
} }
if (tmpcombox.SelectedIndex < 0)
CProfileDevice.m_DevParam.signal.uDetB[i] = 0;
else
CProfileDevice.m_DevParam.signal.uDetB[i] = (ushort)tmpcombox.SelectedIndex;
if (string.IsNullOrEmpty(tmptextbox.Text))
{
CProfileDevice.m_DevParam.signal.u16DetTimeLengthB[i] = 0;
}
else
{
time = (float)Convert.ToDecimal(tmptextbox.Text);
newtime = (ushort)Convert.ToDecimal((time * 60).ToString());
CProfileDevice.m_DevParam.signal.u16DetTimeLengthB[i] = newtime;
}
} }
} }
......
...@@ -1048,9 +1048,21 @@ namespace GcDevicePc ...@@ -1048,9 +1048,21 @@ namespace GcDevicePc
tempshow = new ListViewItem(); tempshow = new ListViewItem();
tempshow.Text = "运行时间/总时间"; tempshow.Text = "运行时间/总时间";
if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5) if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5)
tempshow.SubItems.Add((globaldata.m_dpbuffer.ShowList.showtime.runtimenow / 60.0f).ToString("0.00") + "/" + (globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0f).ToString("0.0")); {
if (globaldata.m_dpbuffer.ShowList.showtime.runtimenow <= globaldata.m_dpbuffer.ShowList.showtime.alltime)
{
tempshow.SubItems.Add((globaldata.m_dpbuffer.ShowList.showtime.runtimenow / 60.0f).ToString("0.00") + "/" + (globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0f).ToString("0.0"));
}
else
{
tempshow.SubItems.Add((globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0f).ToString("0.00") + "/" + (globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0f).ToString("0.0"));
}
}
else else
{
tempshow.SubItems.Add("0.00 /" + (globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0f).ToString("0.0")); tempshow.SubItems.Add("0.00 /" + (globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0f).ToString("0.0"));
}
this.datalist.Items.Add(tempshow); this.datalist.Items.Add(tempshow);
......
...@@ -63,9 +63,7 @@ namespace GcDevicePc ...@@ -63,9 +63,7 @@ namespace GcDevicePc
//自动校准 //自动校准
private void buttonauto_Click(object sender, EventArgs e) private void buttonauto_Click(object sender, EventArgs e)
{ {
DialogResult dr = new CK_UI.LandIn("calibration", DateTime.Now.ToString("HHmm")).ShowDialog();
DialogResult dr = new CK_UI.LandIn("calibration").ShowDialog();
if (dr == DialogResult.OK) if (dr == DialogResult.OK)
{ {
......
...@@ -17,8 +17,8 @@ namespace GcDevicePc ...@@ -17,8 +17,8 @@ namespace GcDevicePc
{ {
//CurveDisPlay cuidisp = new CurveDisPlay();//显示波形 //CurveDisPlay cuidisp = new CurveDisPlay();//显示波形
CurveDisPlay curdisplay = new CurveDisPlay(); CurveDisPlay curdisplay = new CurveDisPlay();
//CurveDisPlay2 curdisplay2 = new CurveDisPlay2(); CurveDisPlay2 curdisplay2 = new CurveDisPlay2();
//CurveDisPlay3 curdisplay3 = new CurveDisPlay3(); CurveDisPlay3 curdisplay3 = new CurveDisPlay3();
DataState dataleft = new DataState();//状态显示 DataState dataleft = new DataState();//状态显示
...@@ -33,11 +33,11 @@ namespace GcDevicePc ...@@ -33,11 +33,11 @@ namespace GcDevicePc
} }
private void loadPanel() //加载界面 private void loadPanel() //加载界面
{ {
this.dockPanel1.Contains(curdisplay); //this.dockPanel1.Contains(curdisplay);
curdisplay.Show(this.dockPanel1); //curdisplay.Show(this.dockPanel1);
curdisplay.CloseButtonVisible = false; //curdisplay.CloseButtonVisible = false;
//Load_Win(); Load_Win();
dataleft.Show(this.dockPanel1,DockState.DockRight); dataleft.Show(this.dockPanel1,DockState.DockRight);
dataleft.CloseButtonVisible = false; dataleft.CloseButtonVisible = false;
...@@ -45,88 +45,88 @@ namespace GcDevicePc ...@@ -45,88 +45,88 @@ namespace GcDevicePc
//dataleft.Close(); //dataleft.Close();
} }
//private void Load_Win() private void Load_Win()
//{ {
// if (!String.IsNullOrEmpty(globaldata.connection_ip)) if (!String.IsNullOrEmpty(globaldata.connection_ip))
// { {
// if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1) if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
// { {
// curdisplay.Text = "前检测器"; curdisplay.Text = "前检测器";
// } }
// if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1) if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
// { {
// curdisplay2.Text = "中检测器"; curdisplay2.Text = "中检测器";
// } }
// if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1) if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
// { {
// curdisplay3.Text = "后检测器"; curdisplay3.Text = "后检测器";
// } }
// } }
// else else
// { {
// if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1) if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
// { {
// curdisplay.Text = "前检测器"; curdisplay.Text = "前检测器";
// } }
// if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1) if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
// { {
// curdisplay2.Text = "中检测器"; curdisplay2.Text = "中检测器";
// } }
// if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1) if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
// { {
// curdisplay3.Text = "后检测器"; curdisplay3.Text = "后检测器";
// } }
// } }
// if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1) if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
// { {
// this.dockPanel1.Contains(curdisplay); this.dockPanel1.Contains(curdisplay);
// curdisplay.Show(this.dockPanel1); curdisplay.Show(this.dockPanel1);
// curdisplay.CloseButtonVisible = false; curdisplay.CloseButtonVisible = false;
// } }
// else else
// { {
// curdisplay.Dispose(); curdisplay.Dispose();
// } }
// if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1) if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
// { {
// this.dockPanel1.Contains(curdisplay2); this.dockPanel1.Contains(curdisplay2);
// curdisplay2.Show(this.dockPanel1); curdisplay2.Show(this.dockPanel1);
// curdisplay2.CloseButtonVisible = false; curdisplay2.CloseButtonVisible = false;
// } }
// else else
// { {
// curdisplay2.Dispose(); curdisplay2.Dispose();
// } }
// if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1) if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
// { {
// this.dockPanel1.Contains(curdisplay3); this.dockPanel1.Contains(curdisplay3);
// curdisplay3.Show(this.dockPanel1); curdisplay3.Show(this.dockPanel1);
// curdisplay3.CloseButtonVisible = false; curdisplay3.CloseButtonVisible = false;
// } }
// else else
// { {
// curdisplay3.Dispose(); curdisplay3.Dispose();
// } }
// //Start_Thread(); //Start_Thread();
// //dockPanelSideLeft.Show(this.dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight); //dockPanelSideLeft.Show(this.dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
// //dockPanelSideLeft.CloseButtonVisible = false; //dockPanelSideLeft.CloseButtonVisible = false;
//} }
public void CloseThread() public void CloseThread()
{ {
......
...@@ -2148,10 +2148,6 @@ namespace GcDevicePc.GCBuffer ...@@ -2148,10 +2148,6 @@ namespace GcDevicePc.GCBuffer
sw.WriteLine("[方法名称]"); sw.WriteLine("[方法名称]");
sw.Close(); sw.Close();
} }
} }
} }
......
...@@ -11,10 +11,10 @@ namespace GcDevicePc ...@@ -11,10 +11,10 @@ namespace GcDevicePc
{ {
public partial class GCMain : Form public partial class GCMain : Form
{ {
CurveDisPlay curdisplay = new CurveDisPlay(); //CurveDisPlay curdisplay = new CurveDisPlay();
DataState dockPanelSideLeft = new DataState(); //DataState dockPanelSideLeft = new DataState();
GCTitle title = new GCTitle(); //GCTitle title = new GCTitle();
public GCMain() public GCMain()
...@@ -24,16 +24,16 @@ namespace GcDevicePc ...@@ -24,16 +24,16 @@ namespace GcDevicePc
private void GCMain_Load(object sender, EventArgs e) private void GCMain_Load(object sender, EventArgs e)
{ {
this.showdockPanel.Contains(curdisplay); // this.showdockPanel.Contains(curdisplay);
curdisplay.Show(this.showdockPanel); // curdisplay.Show(this.showdockPanel);
curdisplay.CloseButtonVisible = false; // curdisplay.CloseButtonVisible = false;
dockPanelSideLeft.Show(this.showdockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockRight); // dockPanelSideLeft.Show(this.showdockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockRight);
dockPanelSideLeft.CloseButtonVisible = false; // dockPanelSideLeft.CloseButtonVisible = false;
// title.Height = 62; //// title.Height = 62;
title.Show(this.showdockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockTop); // title.Show(this.showdockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockTop);
title.CloseButtonVisible = false; // title.CloseButtonVisible = false;
} }
} }
} }
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
this.SingleCancel = new System.Windows.Forms.ToolStripMenuItem(); this.SingleCancel = new System.Windows.Forms.ToolStripMenuItem();
this.HelpMainMenu = new System.Windows.Forms.ToolStripMenuItem(); this.HelpMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.AboutMenu = new System.Windows.Forms.ToolStripMenuItem(); this.AboutMenu = new System.Windows.Forms.ToolStripMenuItem();
this.changeVsi = new System.Windows.Forms.ToolStripMenuItem();
this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
...@@ -105,14 +106,14 @@ ...@@ -105,14 +106,14 @@
// UserLoginMenu // UserLoginMenu
// //
this.UserLoginMenu.Name = "UserLoginMenu"; this.UserLoginMenu.Name = "UserLoginMenu";
this.UserLoginMenu.Size = new System.Drawing.Size(144, 26); this.UserLoginMenu.Size = new System.Drawing.Size(180, 26);
this.UserLoginMenu.Text = "用户登录"; this.UserLoginMenu.Text = "用户登录";
this.UserLoginMenu.Click += new System.EventHandler(this.UserLoginMenu_Click); this.UserLoginMenu.Click += new System.EventHandler(this.UserLoginMenu_Click);
// //
// UserLogoutMenu // UserLogoutMenu
// //
this.UserLogoutMenu.Name = "UserLogoutMenu"; this.UserLogoutMenu.Name = "UserLogoutMenu";
this.UserLogoutMenu.Size = new System.Drawing.Size(144, 26); this.UserLogoutMenu.Size = new System.Drawing.Size(180, 26);
this.UserLogoutMenu.Text = "用户注销"; this.UserLogoutMenu.Text = "用户注销";
this.UserLogoutMenu.Click += new System.EventHandler(this.UserLogoutMenu_Click); this.UserLogoutMenu.Click += new System.EventHandler(this.UserLogoutMenu_Click);
// //
...@@ -317,7 +318,8 @@ ...@@ -317,7 +318,8 @@
// HelpMainMenu // HelpMainMenu
// //
this.HelpMainMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.HelpMainMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.AboutMenu}); this.AboutMenu,
this.changeVsi});
this.HelpMainMenu.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.HelpMainMenu.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.HelpMainMenu.Name = "HelpMainMenu"; this.HelpMainMenu.Name = "HelpMainMenu";
this.HelpMainMenu.Size = new System.Drawing.Size(54, 25); this.HelpMainMenu.Size = new System.Drawing.Size(54, 25);
...@@ -326,10 +328,17 @@ ...@@ -326,10 +328,17 @@
// AboutMenu // AboutMenu
// //
this.AboutMenu.Name = "AboutMenu"; this.AboutMenu.Name = "AboutMenu";
this.AboutMenu.Size = new System.Drawing.Size(112, 26); this.AboutMenu.Size = new System.Drawing.Size(144, 26);
this.AboutMenu.Text = "关于"; this.AboutMenu.Text = "关于";
this.AboutMenu.Click += new System.EventHandler(this.AboutMenu_Click); this.AboutMenu.Click += new System.EventHandler(this.AboutMenu_Click);
// //
// changeVsi
//
this.changeVsi.Name = "changeVsi";
this.changeVsi.Size = new System.Drawing.Size(144, 26);
this.changeVsi.Text = "切换版本";
this.changeVsi.Click += new System.EventHandler(this.changeVsi_Click);
//
// timer1 // timer1
// //
this.timer1.Enabled = true; this.timer1.Enabled = true;
...@@ -481,6 +490,7 @@ ...@@ -481,6 +490,7 @@
private System.Windows.Forms.StatusStrip statusStrip; private System.Windows.Forms.StatusStrip statusStrip;
private System.Windows.Forms.ToolStripProgressBar workProgress; private System.Windows.Forms.ToolStripProgressBar workProgress;
private System.Windows.Forms.Timer timer2; private System.Windows.Forms.Timer timer2;
private System.Windows.Forms.ToolStripMenuItem changeVsi;
} }
} }
......
...@@ -53,10 +53,9 @@ namespace GcDevicePc ...@@ -53,10 +53,9 @@ namespace GcDevicePc
GcDataTh mymodbus; GcDataTh mymodbus;
/// <summary> /// <summary>
/// Modbus Slave 变量 /// NModbus Slave 变量
/// </summary> /// </summary>
//GCModbusSlave Slavetest; //GCModbusSlave Slavetest;
NModbusSlave nmodbusSlave; NModbusSlave nmodbusSlave;
/// <summary> /// <summary>
...@@ -322,7 +321,11 @@ namespace GcDevicePc ...@@ -322,7 +321,11 @@ namespace GcDevicePc
// debugForm.Hide(); // debugForm.Hide();
_userForm.MdiParent = this; _userForm.MdiParent = this;
_userForm.Dock = DockStyle.Fill; _userForm.Dock = DockStyle.Fill;
_userForm.Show();
if (globaldata.CurrentVersion == "1")
{
_userForm.Show();
}
_EPCTipsForm = new EPCTips(); _EPCTipsForm = new EPCTips();
_EPCTipsForm.MdiParent = this; _EPCTipsForm.MdiParent = this;
...@@ -499,9 +502,14 @@ namespace GcDevicePc ...@@ -499,9 +502,14 @@ namespace GcDevicePc
(this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMSysbtnstatus = 1; (this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMSysbtnstatus = 1;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = true; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = true;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
globaldata.starttimer = 0; globaldata.starttimer = 0;
globaldata.startimerIsSet = true;
globaldata.startimerIsSet = true;
globaldata.startimerIsSet1 = true;
globaldata.startimerIsSet2 = true;
globaldata.startimerIsSet3 = true;
} }
else else
{ {
...@@ -696,35 +704,43 @@ namespace GcDevicePc ...@@ -696,35 +704,43 @@ namespace GcDevicePc
{ {
try try
{ {
if (isbool) if (globaldata.CurrentVersion == "1")
{ {
NetWorkMenu.Visible = true; if (isbool)
MethodBrowseMenuItem.Visible = true; {
NewMethodMenu.Visible = true; NetWorkMenu.Visible = true;
OpenMethodMenu.Visible = true; MethodBrowseMenuItem.Visible = true;
MethodBrowseMenuItem.Visible = true; NewMethodMenu.Visible = true;
CalibrationMenu.Visible = true; OpenMethodMenu.Visible = true;
GCConfigMenuItem.Visible = true; MethodBrowseMenuItem.Visible = true;
AuxToolMenu.Visible = true; CalibrationMenu.Visible = true;
ParameterSettingMenu.Visible = true; GCConfigMenuItem.Visible = true;
DebugMainMenu.Visible = true; AuxToolMenu.Visible = true;
// HmiStatus.Visible = true; ParameterSettingMenu.Visible = true;
SettingSeparator.Visible = true; DebugMainMenu.Visible = true;
// HmiStatus.Visible = true;
}else SettingSeparator.Visible = true;
{
NetWorkMenu.Visible = false; }
MethodBrowseMenuItem.Visible = false; else
NewMethodMenu.Visible = false; {
OpenMethodMenu.Visible = false; NetWorkMenu.Visible = false;
MethodBrowseMenuItem.Visible = false; MethodBrowseMenuItem.Visible = false;
CalibrationMenu.Visible = false; NewMethodMenu.Visible = false;
GCConfigMenuItem.Visible = false; OpenMethodMenu.Visible = false;
AuxToolMenu.Visible = false; MethodBrowseMenuItem.Visible = false;
ParameterSettingMenu.Visible = false; CalibrationMenu.Visible = false;
DebugMainMenu.Visible = false; GCConfigMenuItem.Visible = false;
// HmiStatus.Visible = false; AuxToolMenu.Visible = false;
SettingSeparator.Visible = false; ParameterSettingMenu.Visible = false;
DebugMainMenu.Visible = false;
// HmiStatus.Visible = false;
SettingSeparator.Visible = false;
}
}
else
{
UserMainMenu.Visible = false;
} }
} }
...@@ -742,7 +758,7 @@ namespace GcDevicePc ...@@ -742,7 +758,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("VOCs在线监测-1.4.9 {0}",Formstr); this.Text = String.Format("VOCs在线监测-1.5.1 {0}",Formstr);
//if (LandIn.Island) //if (LandIn.Island)
//{ //{
// HmiStatus.Text = String.Format("状态:{0}", statestr); // HmiStatus.Text = String.Format("状态:{0}", statestr);
...@@ -1054,50 +1070,50 @@ namespace GcDevicePc ...@@ -1054,50 +1070,50 @@ namespace GcDevicePc
#region 线程接口 #region 线程接口
//private void Start_Thread() private void Start_Thread()
//{ {
// mydatasave.ChannelDataStart(); mydatasave.ChannelDataStart();
// mydatasave2.ChannelDataStart(); mydatasave2.ChannelDataStart();
// mydatasave3.ChannelDataStart(); mydatasave3.ChannelDataStart();
// if (!String.IsNullOrEmpty(globaldata.connection_ip)) if (!String.IsNullOrEmpty(globaldata.connection_ip))
// { {
// mymodbus.HmiStatueStart(); mymodbus.HmiStatueStart();
// mymodbus.ChannelDataStart(); mymodbus.ChannelDataStart();
// } }
// dataVOC.CKvocUpdataStart(); dataVOC.CKvocUpdataStart();
// dataVoc2.CKvocUpdataStart(); dataVoc2.CKvocUpdataStart();
// dataVoc3.CKvocUpdataStart(); dataVoc3.CKvocUpdataStart();
// mytcptest.DataRcvStart(); //mytcptest.DataRcvStart();
// if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip)) //if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
// wtd624xOutput.DataOutStart(); // wtd624xOutput.DataOutStart();
//} }
//public void Stop_Thread() public void Stop_Thread()
//{ {
// mydatasave.ChannelDataStop(); mydatasave.ChannelDataStop();
// mydatasave2.ChannelDataStop(); mydatasave2.ChannelDataStop();
// mydatasave3.ChannelDataStop(); mydatasave3.ChannelDataStop();
// if (!String.IsNullOrEmpty(globaldata.connection_ip)) if (!String.IsNullOrEmpty(globaldata.connection_ip))
// { {
// mymodbus.HmiStatueStop(); mymodbus.HmiStatueStop();
// mymodbus.ChannelDataStop(); mymodbus.ChannelDataStop();
// ThreadMonitor.GetInstance().MonitorThStop(); //ThreadMonitor.GetInstance().MonitorThStop();
// ThreadMonitor.GetInstance().StopALLCommunication(); //ThreadMonitor.GetInstance().StopALLCommunication();
// } }
// dataVOC.CKvocUpdataStop(); dataVOC.CKvocUpdataStop();
// dataVoc2.CKvocUpdataStop(); dataVoc2.CKvocUpdataStop();
// dataVoc3.CKvocUpdataStop(); dataVoc3.CKvocUpdataStop();
// mytcptest.DataRcvStop(); //mytcptest.DataRcvStop();
// if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip)) //if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
// wtd624xOutput.DataOutStop(); // wtd624xOutput.DataOutStop();
//} }
#endregion #endregion
private void InitConfig() private void InitConfig()
...@@ -1158,9 +1174,17 @@ namespace GcDevicePc ...@@ -1158,9 +1174,17 @@ namespace GcDevicePc
Start_Thread(); Start_Thread();
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw)
{
signalDataTohw.DataToHwStart();
}
try try
{ {
nmodbusSlave = new NModbusSlave(); if (globaldata.CurrentVersion == "1")
{
nmodbusSlave = new NModbusSlave();
}
//Slavetest = new GCModbusSlave(); //Slavetest = new GCModbusSlave();
//Slavetest.CModbusSlaveInit(1, 2, 3, 5); //Slavetest.CModbusSlaveInit(1, 2, 3, 5);
...@@ -1190,43 +1214,43 @@ namespace GcDevicePc ...@@ -1190,43 +1214,43 @@ namespace GcDevicePc
} }
Thread gethmistaues; Thread gethmistaues;
private void Start_Thread() //private void Start_Thread()
{ //{
// mydatasave.ChannelDataStart(); // // mydatasave.ChannelDataStart();
if (!String.IsNullOrEmpty(globaldata.connection_ip)) // if (!String.IsNullOrEmpty(globaldata.connection_ip))
{ // {
mymodbus.HmiStatueStart(); // mymodbus.HmiStatueStart();
mymodbus.ChannelDataStart(); // mymodbus.ChannelDataStart();
//ThreadMonitor.GetInstance().StartALLCommunication(); // //ThreadMonitor.GetInstance().StartALLCommunication();
} // }
dataVOC.CKvocUpdataStart(); // dataVOC.CKvocUpdataStart();
mytcptest.DataRcvStart(); // mytcptest.DataRcvStart();
if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip)) // if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
wtd624xOutput.DataOutStart(); // wtd624xOutput.DataOutStart();
} //}
private void Stop_Thread() //private void Stop_Thread()
{ //{
// mydatasave.ChannelDataStop(); // // mydatasave.ChannelDataStop();
dataVOC.CKvocUpdataStop(); // dataVOC.CKvocUpdataStop();
mytcptest.DataRcvStop(); // mytcptest.DataRcvStop();
if (!String.IsNullOrEmpty(globaldata.connection_ip)) // if (!String.IsNullOrEmpty(globaldata.connection_ip))
{ // {
// mymodbus.HmiStatueStop(); // // mymodbus.HmiStatueStop();
mymodbus.ChannelDataStop(); // mymodbus.ChannelDataStop();
ThreadMonitor.GetInstance().MonitorThStop(); // ThreadMonitor.GetInstance().MonitorThStop();
ThreadMonitor.GetInstance().StopALLCommunication(); // ThreadMonitor.GetInstance().StopALLCommunication();
} // }
if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip)) // if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
wtd624xOutput.DataOutStop(); // wtd624xOutput.DataOutStop();
} //}
/// <summary> /// <summary>
/// 状态改变信号量 /// 状态改变信号量
...@@ -1561,7 +1585,7 @@ namespace GcDevicePc ...@@ -1561,7 +1585,7 @@ namespace GcDevicePc
break; break;
case 9: case 9:
status_text = "设备断开"; status_text = "设备断开";
this.HmiStatus.BackColor = Color.OrangeRed; this.HmiStatus.BackColor = Color.LightYellow;
color_flag = false; color_flag = false;
break; break;
case 10: case 10:
...@@ -1579,14 +1603,12 @@ namespace GcDevicePc ...@@ -1579,14 +1603,12 @@ namespace GcDevicePc
default: default:
status_text = "设备连接"; status_text = "设备连接";
this.HmiStatus.BackColor = Color.LightGreen; this.HmiStatus.BackColor = Color.LightGreen;
break; break;
} }
statestr = status_text; statestr = status_text;
IsStateColor = color_flag; IsStateColor = color_flag;
Console.WriteLine(""+ globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue); //Console.WriteLine(""+ globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue);
//if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 0) //if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 0)
//{ //{
...@@ -1741,7 +1763,26 @@ namespace GcDevicePc ...@@ -1741,7 +1763,26 @@ namespace GcDevicePc
count = 0; count = 0;
//ret = Slavetest.CModbusSlaveClose(); //ret = Slavetest.CModbusSlaveClose();
nmodbusSlave.NModbusSlaveClose(); if (globaldata.CurrentVersion == "1")
{
nmodbusSlave.NModbusSlaveClose();
if (globaldata.m_pcbuffer.gcpcinfo.outputinfo.port != 0)
{
count = 0;
ret = Slave485test.CModbusSlave485Close();
while (ret != 0)
{
count++;
ret = Slave485test.CModbusSlave485Close();
Thread.Sleep(100);
if (count > 3)
{
break;
}
}
}
}
//while (ret != 0) //while (ret != 0)
//{ //{
// count++; // count++;
...@@ -1753,21 +1794,7 @@ namespace GcDevicePc ...@@ -1753,21 +1794,7 @@ namespace GcDevicePc
// } // }
//} //}
if (globaldata.m_pcbuffer.gcpcinfo.outputinfo.port != 0)
{
count = 0;
ret = Slave485test.CModbusSlave485Close();
while (ret != 0)
{
count++;
ret = Slave485test.CModbusSlave485Close();
Thread.Sleep(100);
if (count > 3)
{
break;
}
}
}
} }
...@@ -1794,7 +1821,6 @@ namespace GcDevicePc ...@@ -1794,7 +1821,6 @@ namespace GcDevicePc
count = 0; count = 0;
//ret = Slavetest.CModbusSlaveClose(); //ret = Slavetest.CModbusSlaveClose();
nmodbusSlave.NModbusSlaveClose();
//while (ret != 0) //while (ret != 0)
//{ //{
// count++; // count++;
...@@ -1805,19 +1831,23 @@ namespace GcDevicePc ...@@ -1805,19 +1831,23 @@ namespace GcDevicePc
// break; // break;
// } // }
//} //}
if (globaldata.CurrentVersion == "1")
if (globaldata.m_pcbuffer.gcpcinfo.outputinfo.port != 0)
{ {
count = 0; nmodbusSlave.NModbusSlaveClose();
ret = Slave485test.CModbusSlave485Close();
while (ret != 0) if (globaldata.m_pcbuffer.gcpcinfo.outputinfo.port != 0)
{ {
count++; count = 0;
ret = Slave485test.CModbusSlave485Close(); ret = Slave485test.CModbusSlave485Close();
Thread.Sleep(100); while (ret != 0)
if (count > 3)
{ {
break; count++;
ret = Slave485test.CModbusSlave485Close();
Thread.Sleep(100);
if (count > 3)
{
break;
}
} }
} }
} }
...@@ -1885,9 +1915,15 @@ namespace GcDevicePc ...@@ -1885,9 +1915,15 @@ namespace GcDevicePc
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = true; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue = true;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
//globaldata.starttimer = 0;
//globaldata.startimerIsSet = true;
globaldata.starttimer = 0; globaldata.starttimer = 0;
globaldata.startimerIsSet = true;
globaldata.startimerIsSet = true;
globaldata.startimerIsSet1 = true;
globaldata.startimerIsSet2 = true;
globaldata.startimerIsSet3 = true;
} }
else else
{ {
...@@ -2061,9 +2097,11 @@ namespace GcDevicePc ...@@ -2061,9 +2097,11 @@ namespace GcDevicePc
private void UserLoginMenu_Click(object sender, EventArgs e) private void UserLoginMenu_Click(object sender, EventArgs e)
{ {
string lgpwd = DateTime.Now.ToString("HHmm");
while (true) while (true)
{ {
DialogResult dr = new LandIn("admin").ShowDialog(); DialogResult dr = new LandIn("admin", lgpwd).ShowDialog();
if (dr == DialogResult.OK) if (dr == DialogResult.OK)
{ {
if (LandIn.Island) if (LandIn.Island)
...@@ -2310,15 +2348,12 @@ namespace GcDevicePc ...@@ -2310,15 +2348,12 @@ namespace GcDevicePc
if (myform == null) if (myform == null)
{ {
myform = new MethodMain(); myform = new MethodMain();
myform.SetGCConfig(globaldata.m_hwconfig, methodconfig); myform.SetGCConfig(globaldata.m_hwconfig, methodconfig);
myform.Show(); myform.Show();
} }
else if (myform.IsDisposed) else if (myform.IsDisposed)
{ {
myform = new MethodMain(); myform = new MethodMain();
myform.SetGCConfig(globaldata.m_hwconfig, methodconfig); myform.SetGCConfig(globaldata.m_hwconfig, methodconfig);
myform.Show(); myform.Show();
} }
...@@ -2326,7 +2361,7 @@ namespace GcDevicePc ...@@ -2326,7 +2361,7 @@ namespace GcDevicePc
{ {
myform.Activate(); myform.Activate();
} }
} }
} }
...@@ -2391,6 +2426,7 @@ namespace GcDevicePc ...@@ -2391,6 +2426,7 @@ namespace GcDevicePc
} }
} }
MethodMain myformbb; MethodMain myformbb;
private void MethodBrowseMenuItem_Click(object sender, EventArgs e) private void MethodBrowseMenuItem_Click(object sender, EventArgs e)
...@@ -2409,7 +2445,7 @@ namespace GcDevicePc ...@@ -2409,7 +2445,7 @@ namespace GcDevicePc
//MethodMain myform = new MethodMain(true, false); //MethodMain myform = new MethodMain(true, false);
//myform.SetGCConfig(globaldata.m_hwconfig, methodconfig); //myform.SetGCConfig(globaldata.m_hwconfig, methodconfig);
//myform.Show(); //myform.Show();
Console.WriteLine("前 " + globaldata.m_hmibuffer.gcinfo.methodstatus);
if (myformbb == null) if (myformbb == null)
{ {
myformbb = new MethodMain(true, false); myformbb = new MethodMain(true, false);
...@@ -2420,6 +2456,7 @@ namespace GcDevicePc ...@@ -2420,6 +2456,7 @@ namespace GcDevicePc
{ {
myformbb = null; myformbb = null;
myformbb = new MethodMain(true, false); myformbb = new MethodMain(true, false);
myformbb.SetGCConfig(globaldata.m_hwconfig, methodconfig); myformbb.SetGCConfig(globaldata.m_hwconfig, methodconfig);
myformbb.Show(); myformbb.Show();
} }
...@@ -2465,6 +2502,8 @@ namespace GcDevicePc ...@@ -2465,6 +2502,8 @@ namespace GcDevicePc
} }
} }
Console.WriteLine(" 后 "+ globaldata.m_hmibuffer.gcinfo.methodstatus);
} }
WaveTotalForm total; WaveTotalForm total;
...@@ -2495,6 +2534,7 @@ namespace GcDevicePc ...@@ -2495,6 +2534,7 @@ namespace GcDevicePc
Log.Error(ex.Message); Log.Error(ex.Message);
} }
} }
AdjustFrom just; AdjustFrom just;
private void CalibrationMenu_Click(object sender, EventArgs e) private void CalibrationMenu_Click(object sender, EventArgs e)
{ {
...@@ -2523,6 +2563,7 @@ namespace GcDevicePc ...@@ -2523,6 +2563,7 @@ namespace GcDevicePc
Log.Error(ex.Message); Log.Error(ex.Message);
} }
} }
HistChartForm hist; HistChartForm hist;
private void HistoryPicMenu_Click(object sender, EventArgs e) private void HistoryPicMenu_Click(object sender, EventArgs e)
{ {
...@@ -2530,13 +2571,13 @@ namespace GcDevicePc ...@@ -2530,13 +2571,13 @@ namespace GcDevicePc
{ {
if (hist == null) if (hist == null)
{ {
hist = new HistChartForm(); hist = new HistChartForm(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.DataFolder);
hist.Show(); hist.Show();
} }
else if (hist.IsDisposed) else if (hist.IsDisposed)
{ {
hist = null; hist = null;
hist = new HistChartForm(); hist = new HistChartForm(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.DataFolder);
hist.Show(); hist.Show();
} }
else else
...@@ -2608,6 +2649,7 @@ namespace GcDevicePc ...@@ -2608,6 +2649,7 @@ namespace GcDevicePc
} }
ShowConfig showConfig; ShowConfig showConfig;
private void ConfigShowSubMenuItem_Click(object sender, EventArgs e) private void ConfigShowSubMenuItem_Click(object sender, EventArgs e)
{ {
...@@ -2671,8 +2713,16 @@ namespace GcDevicePc ...@@ -2671,8 +2713,16 @@ namespace GcDevicePc
globaldata.stopflag = false; globaldata.stopflag = false;
globaldata.cancelflag = false; globaldata.cancelflag = false;
globaldata.startclear = true; globaldata.startclear = true;
//globaldata.starttimer = 0;
//globaldata.startimerIsSet = true;
globaldata.starttimer = 0; globaldata.starttimer = 0;
globaldata.startimerIsSet = true; globaldata.startimerIsSet = true;
globaldata.startimerIsSet1 = true;
globaldata.startimerIsSet2 = true;
globaldata.startimerIsSet3 = true;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 1; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 1;
} }
...@@ -2814,7 +2864,6 @@ namespace GcDevicePc ...@@ -2814,7 +2864,6 @@ namespace GcDevicePc
#endregion #endregion
AboutForm f_showcfg; AboutForm f_showcfg;
private void AboutMenu_Click(object sender, EventArgs e) private void AboutMenu_Click(object sender, EventArgs e)
{ {
int ret = 0; int ret = 0;
...@@ -2937,8 +2986,6 @@ namespace GcDevicePc ...@@ -2937,8 +2986,6 @@ namespace GcDevicePc
{ {
SharedSpace.MControl.IsEnd = false; SharedSpace.MControl.IsEnd = false;
if (RunTableOpt(SharedSpace.MControl.defaultPath, SharedSpace.MControl.defaultName) == 1&&SharedSpace.MControl.MethodType == 1) if (RunTableOpt(SharedSpace.MControl.defaultPath, SharedSpace.MControl.defaultName) == 1&&SharedSpace.MControl.MethodType == 1)
{ {
SharedSpace.MControl.SetOut = false; SharedSpace.MControl.SetOut = false;
...@@ -2988,6 +3035,29 @@ namespace GcDevicePc ...@@ -2988,6 +3035,29 @@ namespace GcDevicePc
} }
private void changeVsi_Click(object sender, EventArgs e)
{
DialogResult dl = MessageBox.Show("是否切换", "版本切换", MessageBoxButtons.OKCancel);
if (dl == DialogResult.OK)
{
string file = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.StartupPath), "GC_Config\\GC_Set\\启动参数\\startup.ini");
IniFile iniFile = new IniFile(file);
//iniFile.ReadSection("").
if (iniFile.ReadString("Version", "VersionType") == "0")
{
iniFile.WriteInteger("Version", "VersionType", 1);//实验室
}
else
{
iniFile.WriteInteger("Version", "VersionType", 0);//在线
}
Application.ExitThread();
Application.Exit();
Application.Restart();
Process.GetCurrentProcess().Kill();
}
}
//private void debugSubMenu_Click(object sender, EventArgs e) //private void debugSubMenu_Click(object sender, EventArgs e)
//{ //{
// try // try
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
this.ClientSize = new System.Drawing.Size(1008, 730); this.ClientSize = new System.Drawing.Size(1008, 730);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm"; this.Name = "MainForm";
this.Text = "VOCs在线监测-1.4.9 用户窗口"; this.Text = "VOCs在线监测-1.5.1 用户窗口";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
......
//#define debug using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using GcDevicePc.GCBuffer; using GcDevicePc.GCBuffer;
using System.Diagnostics; using System.Diagnostics;
using GcDevicePc.IniParam;
namespace GcDevicePc.ProThread namespace GcDevicePc.ProThread
{ {
...@@ -15,7 +15,6 @@ namespace GcDevicePc.ProThread ...@@ -15,7 +15,6 @@ namespace GcDevicePc.ProThread
Thread t_DataSave; Thread t_DataSave;
int isstart = 0; int isstart = 0;
//批量更新 //批量更新
//用于更新记录数据 //用于更新记录数据
private void Monitor_DataList() private void Monitor_DataList()
...@@ -27,20 +26,23 @@ namespace GcDevicePc.ProThread ...@@ -27,20 +26,23 @@ namespace GcDevicePc.ProThread
//float dtime = 0.0f; //float dtime = 0.0f;
//float dvalue = 0.0f; //float dvalue = 0.0f;
List<double[]> listPoint = new List<double[]>();//临时数据区 List<double[]> listPoint = new List<double[]>(); //临时数据区
List<double[]> listRaw = new List<double[]>();//原始数据 List<double[]> listRaw = new List<double[]>(); //原始数据
List<double[]> listRawTem = new List<double[]>();//原始数据缓存 List<double[]> listRawTem = new List<double[]>(); //原始数据缓存
bool drbool = false; bool drbool = false;
uint NowTimeOld=0;//上一周期开始 uint NowTimeOld = 0; //上一周期开始
while (!datamre.WaitOne(500)) while (!datamre.WaitOne(500))
{ {
drbool = false; drbool = false;
listPoint.Clear(); listPoint.Clear();
listRaw.Clear(); listRaw.Clear();
if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) || globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue) //判断HMI工作模式 0-空闲 1-2 准备 3准备就绪 4-5 运行(分保持和程升) 6-7结束后处理 if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 ||
// if(true) globaldata.m_hmibuffer.gcinfo.methodstatus == 5) ||
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue
) //判断HMI工作模式 0-空闲 1-2 准备 3准备就绪 4-5 运行(分保持和程升) 6-7结束后处理
// if(true)
{ {
#if(debug) #if(debug)
Stopwatch st = new Stopwatch(); //计时 Stopwatch st = new Stopwatch(); //计时
...@@ -53,44 +55,50 @@ namespace GcDevicePc.ProThread ...@@ -53,44 +55,50 @@ namespace GcDevicePc.ProThread
if (globaldata.m_signalbuffer.Draw_Port.Count > 1) if (globaldata.m_signalbuffer.Draw_Port.Count > 1)
{ {
if (globaldata.startclear) if (globaldata.startclear1)
{ {
CurveDisPlay.curdisp.cleardata(); CurveDisPlay.curdisp.cleardata();
globaldata.starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0]).ctimer; globaldata.starttimer =
((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0]).ctimer;
time = 0; time = 0;
globaldata.startclear = false; globaldata.startclear1 = false;
} }
else else
{ {
if (globaldata.startimerIsSet) if (globaldata.startimerIsSet1)
{ {
CurveDisPlay.curdisp.cleardata(); CurveDisPlay.curdisp.cleardata();
globaldata.starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0]).ctimer; globaldata.starttimer =
((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0]).ctimer;
time = 0; time = 0;
globaldata.startimerIsSet = false; globaldata.startimerIsSet1 = false;
} }
ushort timeend = globaldata.m_dpbuffer.ShowList.showtime.alltime; ushort timeend = globaldata.m_dpbuffer.ShowList.showtime.alltime;
timeend -= 5; timeend -= 5;
if (globaldata.starttimer == 0) if (globaldata.starttimer == 0)
globaldata.starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0]).ctimer; globaldata.starttimer =
((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0]).ctimer;
#if(debug) #if(debug)
st.Start(); //计时开始 st.Start(); //计时开始
#endif #endif
for (int i = 0; i < globaldata.m_signalbuffer.Draw_Port.Count; i++) for (int i = 0; i < globaldata.m_signalbuffer.Draw_Port.Count; i++)
{ {
if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5) if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5)
// if (true) // if (true)
{ {
if ((globaldata.m_hmibuffer.gcinfo.NowStartTime <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0]).ctimer) && isstart == 0 && (NowTimeOld != globaldata.m_hmibuffer.gcinfo.NowStartTime)) if ((globaldata.m_hmibuffer.gcinfo.NowStartTime <=
((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[0])
.ctimer) && isstart == 0 &&
(NowTimeOld != globaldata.m_hmibuffer.gcinfo.NowStartTime))
{ {
if (CKVocAnalyzer.GlobalCKV.debugwork == 5) if (CKVocAnalyzer.GlobalCKV.debugwork == 5)
{ {
CKVocAnalyzer.GlobalCKV.debugwork = 4; CKVocAnalyzer.GlobalCKV.debugwork = 4;
...@@ -100,148 +108,181 @@ namespace GcDevicePc.ProThread ...@@ -100,148 +108,181 @@ namespace GcDevicePc.ProThread
globaldata.starttimer = globaldata.m_hmibuffer.gcinfo.NowStartTime; globaldata.starttimer = globaldata.m_hmibuffer.gcinfo.NowStartTime;
NowTimeOld = globaldata.m_hmibuffer.gcinfo.NowStartTime; NowTimeOld = globaldata.m_hmibuffer.gcinfo.NowStartTime;
CurveDisPlay.curdisp.cleardata(); CurveDisPlay.curdisp.cleardata();
} }
else else
{ {
isstart = 2; isstart = 2;
CurveDisPlay.curdisp.SetAxisX((double)globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0);
CurveDisPlay.curdisp.SetAxisX(
(double)globaldata.m_dpbuffer.ShowList.showtime
.alltime / 60.0);
time = 0; time = 0;
drbool = false; drbool = false;
globaldata.starttimer = globaldata.m_hmibuffer.gcinfo.NowStartTime; globaldata.starttimer = globaldata.m_hmibuffer.gcinfo.NowStartTime;
NowTimeOld = globaldata.m_hmibuffer.gcinfo.NowStartTime; NowTimeOld = globaldata.m_hmibuffer.gcinfo.NowStartTime;
CurveDisPlay.curdisp.cleardata(); CurveDisPlay.curdisp.cleardata();
// Trace.WriteLine("周期开始"+globaldata.m_hmibuffer.gcinfo.NowStartTime.ToString(), "sys"); Trace.WriteLine(
globaldata.m_hmibuffer.gcinfo.NowStartTime.ToString(), "sys");
} }
CKVocAnalyzer.GlobalCKV.dataFtime.FTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
listPoint.Clear(); //清除记录 CKVocAnalyzer.GlobalCKV.dataFtime.FTime =
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
listPoint.Clear(); //清除记录
listRaw.Clear(); listRaw.Clear();
} }
} }
//Console.WriteLine(time.ToString());
//数据回填 //数据回填
if (isstart == 0) //方法结束,缓存原始数据 if (isstart == 0) //方法结束,缓存原始数据
{ {
if (listRawTem.Count < 3000) if (listRawTem.Count < 3000)
{ {
listRawTem.Add(new double[] { ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer, Math.Round((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).cdata * 1000.0f), 6) }); listRawTem.Add(new double[]
{
((SignalBuffer.Channel_XY) globaldata.m_signalbuffer.Draw_Port[i])
.ctimer,
Math.Round(
(((SignalBuffer.Channel_XY) globaldata.m_signalbuffer.Draw_Port[
i]).cdata * 1000.0f), 6)
});
} }
else else
{ {
listRawTem.Clear();//缓存3000点,大于3000,重新开始 listRawTem.Clear(); //缓存3000点,大于3000,重新开始
} }
//TCP数据回传 //TCP数据回传
//Console.WriteLine(time.ToString());
lock (globaldata.m_signalbuffer.TCP_Port) lock (globaldata.m_signalbuffer.TCP_Port)
{ {
if(globaldata.m_signalbuffer.TCP_Port.Count>0) if (globaldata.m_signalbuffer.TCP_Port.Count > 0)
{ {
// Trace.WriteLine("TCP数据回传","sys"); Trace.WriteLine("TCP数据回传", "sys");
List<double[]> tcpraw = new List<double[]>(); List<double[]> tcpraw = new List<double[]>();
for (int tcpi = 0; tcpi < globaldata.m_signalbuffer.TCP_Port.Count;tcpi++ ) for (int tcpi = 0;
tcpi < globaldata.m_signalbuffer.TCP_Port.Count;
tcpi++)
{ {
tcpraw.Add(new double[] { ((SignalBuffer.TCP_Channel)globaldata.m_signalbuffer.TCP_Port[tcpi]).dettimer, Math.Round(((SignalBuffer.TCP_Channel)globaldata.m_signalbuffer.TCP_Port[tcpi]).detdata1*1000.0f,6) }); tcpraw.Add(new double[]
{
((SignalBuffer.TCP_Channel) globaldata.m_signalbuffer
.TCP_Port[tcpi]).dettimer,
Math.Round(
((SignalBuffer.TCP_Channel) globaldata.m_signalbuffer
.TCP_Port[tcpi]).detdata1 * 1000.0f, 6)
});
} }
if (tcpraw.Count > 0) if (tcpraw.Count > 0)
{ {
CurveDisPlay.curdisp.WriteTcp(tcpraw); CurveDisPlay.curdisp.WriteTcp(tcpraw);
} }
} }
globaldata.m_signalbuffer.TCP_Port.Clear(); globaldata.m_signalbuffer.TCP_Port.Clear();
} }
} }
//Console.WriteLine(time.ToString());
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) //有需要回填数据
{ {
for (; rami < listRawTem.Count;rami++ ) for (; rami < listRawTem.Count; rami++)
{ {
if ((((UInt32)listRawTem[rami][0] < globaldata.starttimer))) time += (((UInt32)listRawTem[rami][0] - globaldata.starttimer) /
{ 1000.0f / 60.0f);
//Console.WriteLine("listRawTem " + listRawTem[rami][0].ToString() + "starttimer " + globaldata.starttimer.ToString());
}
else
{
time += (((UInt32)listRawTem[rami][0] - globaldata.starttimer) / 1000.0f / 60.0f);
}
globaldata.starttimer = (UInt32)listRawTem[rami][0]; globaldata.starttimer = (UInt32)listRawTem[rami][0];
value = listRawTem[rami][1]; value = listRawTem[rami][1];
listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) }); listPoint.Add(new double[]
listRaw.Add(new double[] { listRawTem[rami][0], Math.Round(value, 6) }); {Math.Round(time, 4), Math.Round(value, 6)});
listRaw.Add(
new double[] { listRawTem[rami][0], Math.Round(value, 6) });
} }
} }
listRawTem.Clear(); listRawTem.Clear();
} }
//Console.WriteLine(time.ToString());
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)) 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(((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f) > 70000)
{ time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i])
//time += 0.00083; .ctimer - globaldata.starttimer) / 1000.0f / 60.0f);
//Console.WriteLine("ctimer " + ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer.ToString() + "starttimer " + globaldata.starttimer.ToString());
}
else
{
//Console.WriteLine("两差 "+ ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f));
time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f);
}
//time += 0.00083; //time += 0.00083;
//time>70000? globaldata.starttimer =
globaldata.starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer; ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i])
value = (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).cdata * 1000.0f); .ctimer;
value = (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i])
.cdata * 1000.0f);
if (time < 600) if (time < 600)
{ {
listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) }); listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) });
listRaw.Add(new double[] {((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer, Math.Round(value, 6) }); listRaw.Add(new double[]
//Console.WriteLine("mathtime "+ Math.Round(time, 4) + " time " + time); {
//Console.WriteLine("time1 "+ ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer + " i " + i); ((SignalBuffer.Channel_XY) globaldata.m_signalbuffer.Draw_Port[i])
.ctimer,
Math.Round(value, 6)
});
} }
drbool = false;
//时间判断终点 //时间判断终点
// if ((globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5)) // if ((globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5))
if (globaldata.m_hmibuffer.gcinfo.methodstatus <4 || globaldata.m_hmibuffer.gcinfo.methodstatus > 5) if (globaldata.m_hmibuffer.gcinfo.methodstatus < 4 ||
{ globaldata.m_hmibuffer.gcinfo.methodstatus > 5)
{
if ((globaldata.m_hmibuffer.gcinfo.NowStartTime<=globaldata.m_hmibuffer.gcinfo.NowEndTime)&&(globaldata.m_hmibuffer.gcinfo.NowEndTime <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer)&&isstart==2)
if ((globaldata.m_hmibuffer.gcinfo.NowStartTime <
globaldata.m_hmibuffer.gcinfo.NowEndTime) &&
(globaldata.m_hmibuffer.gcinfo.NowEndTime <=
((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i])
.ctimer) && isstart == 2)
{ {
drbool = true; drbool = true;
isstart = 0; isstart = 0;
Trace.WriteLine("周期结束" + globaldata.m_hmibuffer.gcinfo.NowEndTime.ToString(), "sys");
break; break;
} }
} }
} }
else else
globaldata.starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer; globaldata.starttimer =
((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i])
.ctimer;
} }
//读取数据完毕 //读取数据完毕
globaldata.m_signalbuffer.Draw_Port.Clear(); globaldata.m_signalbuffer.Draw_Port.Clear();
} }
} }
...@@ -250,24 +291,37 @@ namespace GcDevicePc.ProThread ...@@ -250,24 +291,37 @@ namespace GcDevicePc.ProThread
st.Stop(); //计时终止 st.Stop(); //计时终止
Trace.WriteLine("后处理更新时间:" + st.Elapsed.ToString(), "sys"); Trace.WriteLine("后处理更新时间:" + st.Elapsed.ToString(), "sys");
#endif #endif
//if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
//{
// for (int i = 0; i < listRaw.Count / CProfileDevice.m_DevParam.syspara.u16DetNum; i++)
// {
// lr.Add(listRaw[i]);
// }
// for (int i = 0; i < listPoint.Count / CProfileDevice.m_DevParam.syspara.u16DetNum; i++)
// {
// lp.Add(listPoint[i]);
// }
//}
CurveDisPlay.curdisp.addDataRaw(listRaw); //记录原始数据 CurveDisPlay.curdisp.addDataRaw(listRaw); //记录原始数据
CurveDisPlay.curdisp.addPoint(listPoint, drbool); //更新绘画区域 CurveDisPlay.curdisp.addPoint(listPoint, drbool); //更新绘画区域
//绘制完,重新画图 //lp.Clear();
if (drbool || CurveDisPlay.forcePurge) //lr.Clear();
if (drbool)
{ {
time = 0; time = 0;
CurveDisPlay.curdisp.cleardata(); CurveDisPlay.curdisp.cleardata();
CurveDisPlay.forcePurge = false;
} }
// Console.WriteLine(string.Format("【{0}】读取个数结束 {1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), globaldata.m_signalbuffer.Draw_Port.Count)); // Console.WriteLine(string.Format("【{0}】读取个数结束 {1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), globaldata.m_signalbuffer.Draw_Port.Count));
} }
if (globaldata.cancelflag) if (globaldata.cancelflag1)
{ {
globaldata.cancelflag = false; globaldata.cancelflag1 = false;
} }
// Thread.Sleep(500); // Thread.Sleep(500);
...@@ -279,15 +333,22 @@ namespace GcDevicePc.ProThread ...@@ -279,15 +333,22 @@ namespace GcDevicePc.ProThread
{ {
Trace.Write(ex); Trace.Write(ex);
} }
finally
{
}
} }
//List<double[]> lr = new List<double[]>();
//List<double[]> lp = new List<double[]>();
public void CKvocUpdataStart() public void CKvocUpdataStart()
{ {
if (datamre != null) if (datamre != null)
{ {
datamre.Reset(); datamre.Reset();
} }
// t_DataSave = new Thread(Monitor_Data); // t_DataSave = new Thread(Monitor_Data);
t_DataSave = new Thread(Monitor_DataList); t_DataSave = new Thread(Monitor_DataList);
t_DataSave.IsBackground = true; t_DataSave.IsBackground = true;
t_DataSave.Start(); t_DataSave.Start();
......
...@@ -6,6 +6,7 @@ using System.Threading; ...@@ -6,6 +6,7 @@ using System.Threading;
using GcDevicePc.GCBuffer; using GcDevicePc.GCBuffer;
using System.Diagnostics; using System.Diagnostics;
using GcDevicePc.CK_UI; using GcDevicePc.CK_UI;
using GcDevicePc.IniParam;
namespace GcDevicePc.ProThread namespace GcDevicePc.ProThread
{ {
...@@ -23,18 +24,23 @@ namespace GcDevicePc.ProThread ...@@ -23,18 +24,23 @@ namespace GcDevicePc.ProThread
{ {
double time = 0; double time = 0;
double value = 0; double value = 0;
UInt32 starttime = 0x7FFFFFFF;
//float dtime = 0.0f; //float dtime = 0.0f;
//float dvalue = 0.0f; //float dvalue = 0.0f;
List<double[]> listPoint = new List<double[]>();//临时数据区 List<double[]> listPoint = new List<double[]>();//临时数据区
List<double[]> listRaw = new List<double[]>();//原始数据
List<double[]> listRawTem = new List<double[]>();//原始数据缓存
bool drbool = false; bool drbool = false;
uint NowTimeOld = 0;//上一周期开始
UInt32 starttimer = 0x7FFFFFFF;
while (!datamre.WaitOne(500)) while (!datamre.WaitOne(500))
{ {
drbool = false; drbool = false;
listPoint.Clear(); listPoint.Clear();
listRaw.Clear();
if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) || globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue) //判断HMI工作模式 0-空闲 1-2 准备 3准备就绪 4-5 运行(分保持和程升) 6-7结束后处理 if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) || globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue) //判断HMI工作模式 0-空闲 1-2 准备 3准备就绪 4-5 运行(分保持和程升) 6-7结束后处理
// if(true)
{ {
#if(debug) #if(debug)
Stopwatch st = new Stopwatch(); //计时 Stopwatch st = new Stopwatch(); //计时
...@@ -43,109 +49,176 @@ namespace GcDevicePc.ProThread ...@@ -43,109 +49,176 @@ namespace GcDevicePc.ProThread
lock (globaldata.m_signalbuffer.Draw_Port2) lock (globaldata.m_signalbuffer.Draw_Port2)
{ {
if (globaldata.m_signalbuffer.Draw_Port2.Count > 1) if (globaldata.m_signalbuffer.Draw_Port2.Count > 1)
{ {
if (globaldata.startclear) if (globaldata.startclear2)
{ {
CurveDisPlay2.curdisp2.cleardata(); CurveDisPlay2.curdisp2.cleardata();
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[0]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[0]).ctimer;
time = 0; time = 0;
// globaldata.startclear = false; globaldata.startclear2 = false;
} }
else else
{ {
if (globaldata.startimerIsSet) if (globaldata.startimerIsSet2)
{ {
CurveDisPlay2.curdisp2.cleardata(); CurveDisPlay2.curdisp2.cleardata();
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[0]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[0]).ctimer;
time = 0; time = 0;
// globaldata.startimerIsSet = false; globaldata.startimerIsSet2 = false;
} }
ushort timeend = globaldata.m_dpbuffer.ShowList.showtime.alltime; ushort timeend = globaldata.m_dpbuffer.ShowList.showtime.alltime;
timeend -= 5; timeend -= 5;
if (starttime == 0) if (starttimer == 0)
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[0]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[0]).ctimer;
#if(debug) #if(debug)
st.Start(); //计时开始 st.Start(); //计时开始
#endif #endif
for (int i = 0; i < globaldata.m_signalbuffer.Draw_Port2.Count; i++) for (int i = 0; i < globaldata.m_signalbuffer.Draw_Port2.Count; i++)
{ {
if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5) if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5)
// if (true)
{ {
//方法启停判断方法:使用获取HMI时间判断,判断时间会延迟0.03分钟左右
if (globaldata.m_dpbuffer.ShowList.showtime.runtimenow > 0 && isstart == 0 && globaldata.m_dpbuffer.ShowList.showtime.runtimenow < 3) if ((globaldata.m_hmibuffer.gcinfo.NowStartTime <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[0]).ctimer) && isstart == 0 && (NowTimeOld != globaldata.m_hmibuffer.gcinfo.NowStartTime))
{ {
Console.WriteLine("方法开始");
if (CKVocAnalyzer.GlobalCKV.debugwork == 5) if (CKVocAnalyzer.GlobalCKV.debugwork == 5)
{ {
CKVocAnalyzer.GlobalCKV.debugwork = 4; CKVocAnalyzer.GlobalCKV.debugwork = 4;
isstart = 2; isstart = 2;
time = 0; time = 0;
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[0]).ctimer; drbool = false;
starttimer = globaldata.m_hmibuffer.gcinfo.NowStartTime;
NowTimeOld = globaldata.m_hmibuffer.gcinfo.NowStartTime;
CurveDisPlay2.curdisp2.cleardata();
} }
else else
{ {
isstart = 2; isstart = 2;
CurveDisPlay2.curdisp2.cleardata();
CurveDisPlay2.curdisp2.SetAxisX((double)globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0); CurveDisPlay2.curdisp2.SetAxisX((double)globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0);
time = 0; time = 0;
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[0]).ctimer; drbool = false;
starttimer = globaldata.m_hmibuffer.gcinfo.NowStartTime;
NowTimeOld = globaldata.m_hmibuffer.gcinfo.NowStartTime;
CurveDisPlay2.curdisp2.cleardata();
Trace.WriteLine(globaldata.m_hmibuffer.gcinfo.NowStartTime.ToString(), "sys");
}
CKVocAnalyzer.GlobalCKV.dataFtime.FTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
listPoint.Clear(); //清除记录
listRaw.Clear();
}
}
//数据回填
if (isstart == 0) //方法结束,缓存原始数据
{
if (listRawTem.Count < 3000)
{
listRawTem.Add(new double[] { ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer, Math.Round((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).cdata * 1000.0f), 6) });
}
else
{
listRawTem.Clear();//缓存3000点,大于3000,重新开始
}
//TCP数据回传
lock (globaldata.m_signalbuffer.TCP_Port)
{
if (globaldata.m_signalbuffer.TCP_Port.Count > 0)
{
Trace.WriteLine("TCP数据回传", "sys");
List<double[]> tcpraw = new List<double[]>();
for (int tcpi = 0; tcpi < globaldata.m_signalbuffer.TCP_Port.Count; tcpi++)
{
tcpraw.Add(new double[] { ((SignalBuffer.TCP_Channel)globaldata.m_signalbuffer.TCP_Port[tcpi]).dettimer, Math.Round(((SignalBuffer.TCP_Channel)globaldata.m_signalbuffer.TCP_Port[tcpi]).detdata1 * 1000.0f, 6) });
}
if (tcpraw.Count > 0)
{
CurveDisPlay2.curdisp2.WriteTcp(tcpraw);
}
} }
// CKVocAnalyzer.GlobalCKV.dataFtime.FTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); globaldata.m_signalbuffer.TCP_Port.Clear();
}
}
if (isstart == 2 && listRawTem.Count > 0) //回填数据
{
int rami = listRawTem.FindIndex(s => s[0] >= starttimer);
if (rami > -1) //有需要回填数据
{
for (; rami < listRawTem.Count; rami++)
{
time += (((UInt32)listRawTem[rami][0] - starttimer) / 1000.0f / 60.0f);
starttimer = (UInt32)listRawTem[rami][0];
value = listRawTem[rami][1];
listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) });
listRaw.Add(new double[] { listRawTem[rami][0], Math.Round(value, 6) });
}
} }
listRawTem.Clear();
} }
if (starttime <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer && (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer - starttime) < 3000) if (starttimer <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer && (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer - starttimer) > 0)
{ {
time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer - starttime) / 1000.0f / 60.0f);
time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer - starttimer) / 1000.0f / 60.0f);
//time += 0.00083; //time += 0.00083;
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer;
value = (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).cdata * 1000.0f); value = (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).cdata * 1000.0f);
// value = 2.0f;
if (time < 600) if (time < 600)
{ {
listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 4) }); listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) });
listRaw.Add(new double[] { ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer, Math.Round(value, 6) });
} }
#if(data)
Trace.WriteLine("FID2:" + time.ToString() + "," + value.ToString(), "data");
#endif
//时间判断终点 //时间判断终点
if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5) // if ((globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5))
//if(isstart==2) if (globaldata.m_hmibuffer.gcinfo.methodstatus < 4 || globaldata.m_hmibuffer.gcinfo.methodstatus > 5)
{ {
if ((globaldata.m_dpbuffer.ShowList.showtime.runtimenow > timeend && globaldata.m_dpbuffer.ShowList.showtime.runtimenow < globaldata.m_dpbuffer.ShowList.showtime.alltime && isstart == 2))
if ((globaldata.m_hmibuffer.gcinfo.NowStartTime < globaldata.m_hmibuffer.gcinfo.NowEndTime) && (globaldata.m_hmibuffer.gcinfo.NowEndTime <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer) && isstart == 2)
{ {
// CurveDisPlay.curdisp.addPoint(listPoint, true);
// Thread.Sleep(500);
drbool = true; drbool = true;
// time = 0;
isstart = 0; isstart = 0;
//Console.WriteLine("方法结束");
// break;
break;
} }
} }
else if (isstart == 2 && globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue == 2)
{
// CurveDisPlay.curdisp.addPoint(listPoint, true);
drbool = true;
// time = 0;
isstart = 0;
//break;
}
} }
else else
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port2[i]).ctimer;
} }
...@@ -156,23 +229,41 @@ namespace GcDevicePc.ProThread ...@@ -156,23 +229,41 @@ namespace GcDevicePc.ProThread
} }
} }
} }
#if(debug) #if (debug)
st.Stop(); //计时终止 st.Stop(); //计时终止
Trace.WriteLine("后处理更新时间:" + st.Elapsed.ToString(), "sys"); Trace.WriteLine("后处理更新时间:" + st.Elapsed.ToString(), "sys");
#endif #endif
//if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
//{
// for (int i = listRaw.Count / CProfileDevice.m_DevParam.syspara.u16DetNum; i < (listRaw.Count / CProfileDevice.m_DevParam.syspara.u16DetNum)*2; i++)
// {
// lr.Add(listRaw[i]);
// }
// for (int i = listPoint.Count / CProfileDevice.m_DevParam.syspara.u16DetNum; i < (listPoint.Count / CProfileDevice.m_DevParam.syspara.u16DetNum) * 2; i++)
// {
// lp.Add(listPoint[i]);
// }
//}
//CurveDisPlay2.curdisp2.BgWorkerSave
CurveDisPlay2.curdisp2.addDataRaw(listRaw); //记录原始数据
CurveDisPlay2.curdisp2.addPoint(listPoint, drbool); //更新绘画区域 CurveDisPlay2.curdisp2.addPoint(listPoint, drbool); //更新绘画区域
//lp.Clear();
//lr.Clear();
if (drbool)
{
time = 0;
CurveDisPlay2.curdisp2.cleardata();
}
// Console.WriteLine(string.Format("【{0}】读取个数结束 {1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), globaldata.m_signalbuffer.Draw_Port2.Count));
// Console.WriteLine(string.Format("【{0}】读取个数结束 {1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), globaldata.m_signalbuffer.Draw_Port.Count));
} }
if (globaldata.cancelflag) if (globaldata.cancelflag2)
{ {
globaldata.cancelflag = false; globaldata.cancelflag2 = false;
} }
// Thread.Sleep(500); // Thread.Sleep(500);
...@@ -186,13 +277,14 @@ namespace GcDevicePc.ProThread ...@@ -186,13 +277,14 @@ namespace GcDevicePc.ProThread
} }
} }
//List<double[]> lr = new List<double[]>();
//List<double[]> lp = new List<double[]>();
public void CKvocUpdataStart() public void CKvocUpdataStart()
{ {
if (datamre != null) if (datamre != null)
{ {
datamre.Reset(); datamre.Reset();
} }
// t_DataSave = new Thread(Monitor_Data);
t_DataSave = new Thread(Monitor_DataList); t_DataSave = new Thread(Monitor_DataList);
t_DataSave.IsBackground = true; t_DataSave.IsBackground = true;
t_DataSave.Start(); t_DataSave.Start();
......
...@@ -6,6 +6,7 @@ using System.Threading; ...@@ -6,6 +6,7 @@ using System.Threading;
using GcDevicePc.GCBuffer; using GcDevicePc.GCBuffer;
using System.Diagnostics; using System.Diagnostics;
using GcDevicePc.CK_UI; using GcDevicePc.CK_UI;
using GcDevicePc.IniParam;
//using GcDevicePc.CK_UI; //using GcDevicePc.CK_UI;
namespace GcDevicePc.ProThread namespace GcDevicePc.ProThread
...@@ -24,18 +25,23 @@ namespace GcDevicePc.ProThread ...@@ -24,18 +25,23 @@ namespace GcDevicePc.ProThread
{ {
double time = 0; double time = 0;
double value = 0; double value = 0;
UInt32 starttime = 0x7FFFFFFF;
//float dtime = 0.0f; //float dtime = 0.0f;
//float dvalue = 0.0f; //float dvalue = 0.0f;
List<double[]> listPoint = new List<double[]>();//临时数据区 List<double[]> listPoint = new List<double[]>();//临时数据区
List<double[]> listRaw = new List<double[]>();//原始数据
List<double[]> listRawTem = new List<double[]>();//原始数据缓存
bool drbool = false; bool drbool = false;
uint NowTimeOld = 0;//上一周期开始
UInt32 starttimer = 0x7FFFFFFF;
while (!datamre.WaitOne(500)) while (!datamre.WaitOne(500))
{ {
drbool = false; drbool = false;
listPoint.Clear(); listPoint.Clear();
listRaw.Clear();
if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) || globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue) //判断HMI工作模式 0-空闲 1-2 准备 3准备就绪 4-5 运行(分保持和程升) 6-7结束后处理 if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) || globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue) //判断HMI工作模式 0-空闲 1-2 准备 3准备就绪 4-5 运行(分保持和程升) 6-7结束后处理
// if(true)
{ {
#if(debug) #if(debug)
Stopwatch st = new Stopwatch(); //计时 Stopwatch st = new Stopwatch(); //计时
...@@ -45,110 +51,169 @@ namespace GcDevicePc.ProThread ...@@ -45,110 +51,169 @@ namespace GcDevicePc.ProThread
lock (globaldata.m_signalbuffer.Draw_Port3) lock (globaldata.m_signalbuffer.Draw_Port3)
{ {
if (globaldata.m_signalbuffer.Draw_Port3.Count > 1) if (globaldata.m_signalbuffer.Draw_Port3.Count > 1)
{ {
if (globaldata.startclear) if (globaldata.startclear3)
{ {
CurveDisPlay3.curdisp3.cleardata(); CurveDisPlay3.curdisp3.cleardata();
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[0]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[0]).ctimer;
time = 0;
// globaldata.startclear = false;
}
time = 0;
globaldata.startclear3 = false;
}
else else
{ {
if (globaldata.startimerIsSet) if (globaldata.startimerIsSet3)
{ {
CurveDisPlay3.curdisp3.cleardata(); CurveDisPlay3.curdisp3.cleardata();
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[0]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[0]).ctimer;
time = 0; time = 0;
// globaldata.startimerIsSet = false; globaldata.startimerIsSet3 = false;
} }
ushort timeend = globaldata.m_dpbuffer.ShowList.showtime.alltime; ushort timeend = globaldata.m_dpbuffer.ShowList.showtime.alltime;
timeend -= 5; timeend -= 5;
if (starttime == 0) if (starttimer == 0)
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[0]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[0]).ctimer;
#if(debug) #if(debug)
st.Start(); //计时开始 st.Start(); //计时开始
#endif #endif
for (int i = 0; i < globaldata.m_signalbuffer.Draw_Port3.Count; i++) for (int i = 0; i < globaldata.m_signalbuffer.Draw_Port3.Count; i++)
{ {
if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5) if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5)
// if (true)
{ {
//方法启停判断方法:使用获取HMI时间判断,判断时间会延迟0.03分钟左右
if (globaldata.m_dpbuffer.ShowList.showtime.runtimenow > 0 && isstart == 0 && globaldata.m_dpbuffer.ShowList.showtime.runtimenow < 3) if ((globaldata.m_hmibuffer.gcinfo.NowStartTime <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[0]).ctimer) && isstart == 0 && (NowTimeOld != globaldata.m_hmibuffer.gcinfo.NowStartTime))
{ {
Console.WriteLine("方法开始");
if (CKVocAnalyzer.GlobalCKV.debugwork == 5) if (CKVocAnalyzer.GlobalCKV.debugwork == 5)
{ {
CKVocAnalyzer.GlobalCKV.debugwork = 4; CKVocAnalyzer.GlobalCKV.debugwork = 4;
isstart = 2; isstart = 2;
time = 0; time = 0;
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[0]).ctimer; drbool = false;
starttimer = globaldata.m_hmibuffer.gcinfo.NowStartTime;
NowTimeOld = globaldata.m_hmibuffer.gcinfo.NowStartTime;
CurveDisPlay3.curdisp3.cleardata();
} }
else else
{ {
isstart = 2; isstart = 2;
CurveDisPlay3.curdisp3.cleardata();
CurveDisPlay3.curdisp3.SetAxisX((double)globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0); CurveDisPlay3.curdisp3.SetAxisX((double)globaldata.m_dpbuffer.ShowList.showtime.alltime / 60.0);
time = 0; time = 0;
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[0]).ctimer; drbool = false;
starttimer = globaldata.m_hmibuffer.gcinfo.NowStartTime;
NowTimeOld = globaldata.m_hmibuffer.gcinfo.NowStartTime;
CurveDisPlay3.curdisp3.cleardata();
Trace.WriteLine(globaldata.m_hmibuffer.gcinfo.NowStartTime.ToString(), "sys");
} }
CKVocAnalyzer.GlobalCKV.dataFtime.FTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CKVocAnalyzer.GlobalCKV.dataFtime.FTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
listPoint.Clear(); //清除记录
listRaw.Clear();
} }
} }
if (starttime <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer && (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer - starttime) < 3000) //数据回填
if (isstart == 0) //方法结束,缓存原始数据
{ {
time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer - starttime) / 1000.0f / 60.0f); if (listRawTem.Count < 3000)
{
listRawTem.Add(new double[] { ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer, Math.Round((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).cdata * 1000.0f), 6) });
}
else
{
listRawTem.Clear();//缓存3000点,大于3000,重新开始
}
//TCP数据回传
lock (globaldata.m_signalbuffer.TCP_Port)
{
if (globaldata.m_signalbuffer.TCP_Port.Count > 0)
{
Trace.WriteLine("TCP数据回传", "sys");
List<double[]> tcpraw = new List<double[]>();
for (int tcpi = 0; tcpi < globaldata.m_signalbuffer.TCP_Port.Count; tcpi++)
{
tcpraw.Add(new double[] { ((SignalBuffer.TCP_Channel)globaldata.m_signalbuffer.TCP_Port[tcpi]).dettimer, Math.Round(((SignalBuffer.TCP_Channel)globaldata.m_signalbuffer.TCP_Port[tcpi]).detdata1 * 1000.0f, 6) });
}
if (tcpraw.Count > 0)
{
CurveDisPlay3.curdisp3.WriteTcp(tcpraw);
}
}
globaldata.m_signalbuffer.TCP_Port.Clear();
}
}
if (isstart == 2 && listRawTem.Count > 0) //回填数据
{
int rami = listRawTem.FindIndex(s => s[0] >= starttimer);
if (rami > -1) //有需要回填数据
{
for (; rami < listRawTem.Count; rami++)
{
time += (((UInt32)listRawTem[rami][0] - starttimer) / 1000.0f / 60.0f);
starttimer = (UInt32)listRawTem[rami][0];
value = listRawTem[rami][1];
listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) });
listRaw.Add(new double[] { listRawTem[rami][0], Math.Round(value, 6) });
}
}
listRawTem.Clear();
}
if (starttimer <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer && (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer - starttimer) > 0)
{
time += ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer - starttimer) / 1000.0f / 60.0f);
//time += 0.00083; //time += 0.00083;
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer;
value = (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).cdata * 1000.0f); value = (((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).cdata * 1000.0f);
if (time < 600) if (time < 600)
{ {
listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 4) }); listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) });
listRaw.Add(new double[] { ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer, Math.Round(value, 6) });
} }
//时间判断终点 //时间判断终点
if (globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5) // if ((globaldata.MethodRun_Statue == 4 || globaldata.MethodRun_Statue == 5))
//if(isstart==2) if (globaldata.m_hmibuffer.gcinfo.methodstatus < 4 || globaldata.m_hmibuffer.gcinfo.methodstatus > 5)
{ {
if ((globaldata.m_dpbuffer.ShowList.showtime.runtimenow > timeend && globaldata.m_dpbuffer.ShowList.showtime.runtimenow < globaldata.m_dpbuffer.ShowList.showtime.alltime && isstart == 2))
if ((globaldata.m_hmibuffer.gcinfo.NowStartTime < globaldata.m_hmibuffer.gcinfo.NowEndTime) && (globaldata.m_hmibuffer.gcinfo.NowEndTime <= ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer) && isstart == 2)
{ {
// CurveDisPlay.curdisp.addPoint(listPoint, true);
// Thread.Sleep(500);
drbool = true; drbool = true;
// time = 0;
isstart = 0; isstart = 0;
//Console.WriteLine("方法结束"); break;
// break;
} }
} }
else if (isstart == 2 && globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue == 2)
{
// CurveDisPlay.curdisp.addPoint(listPoint, true);
drbool = true;
// time = 0;
isstart = 0;
//break;
}
} }
else else
starttime = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer; starttimer = ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port3[i]).ctimer;
} }
...@@ -159,23 +224,40 @@ namespace GcDevicePc.ProThread ...@@ -159,23 +224,40 @@ namespace GcDevicePc.ProThread
} }
} }
} }
#if(debug) #if (debug)
st.Stop(); //计时终止 st.Stop(); //计时终止
Trace.WriteLine("后处理更新时间:" + st.Elapsed.ToString(), "sys"); Trace.WriteLine("后处理更新时间:" + st.Elapsed.ToString(), "sys");
#endif #endif
//if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
//{
// for (int i = (listRaw.Count / CProfileDevice.m_DevParam.syspara.u16DetNum)*2; i < listRaw.Count; i++)
// {
// lr.Add(listRaw[i]);
// }
// for (int i = (listPoint.Count / CProfileDevice.m_DevParam.syspara.u16DetNum)*2; i < listPoint.Count; i++)
// {
// lp.Add(listPoint[i]);
// }
//}
CurveDisPlay3.curdisp3.addDataRaw(listRaw); //记录原始数据
CurveDisPlay3.curdisp3.addPoint(listPoint, drbool); //更新绘画区域 CurveDisPlay3.curdisp3.addPoint(listPoint, drbool); //更新绘画区域
//lr.Clear();
//lp.Clear();
if (drbool)
{
time = 0;
CurveDisPlay3.curdisp3.cleardata();
}
// Console.WriteLine(string.Format("【{0}】读取个数结束 {1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), globaldata.m_signalbuffer.Draw_Port3.Count));
// Console.WriteLine(string.Format("【{0}】读取个数结束 {1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), globaldata.m_signalbuffer.Draw_Port.Count));
} }
if (globaldata.cancelflag) if (globaldata.cancelflag3)
{ {
globaldata.cancelflag = false; globaldata.cancelflag3 = false;
} }
// Thread.Sleep(500); // Thread.Sleep(500);
...@@ -189,6 +271,8 @@ namespace GcDevicePc.ProThread ...@@ -189,6 +271,8 @@ namespace GcDevicePc.ProThread
} }
} }
//List<double[]> lr = new List<double[]>();
//List<double[]> lp = new List<double[]>();
public void CKvocUpdataStart() public void CKvocUpdataStart()
{ {
if (datamre != null) if (datamre != null)
......
...@@ -236,17 +236,17 @@ namespace GcDevicePc.ProThread ...@@ -236,17 +236,17 @@ namespace GcDevicePc.ProThread
globaldata.m_signalbuffer.Draw_Port.Add(globaldata.m_signalbuffer.Channel1_Port); globaldata.m_signalbuffer.Draw_Port.Add(globaldata.m_signalbuffer.Channel1_Port);
globaldata.m_signalbuffer.Save_Port.Add(globaldata.m_signalbuffer.Channel1_Port); globaldata.m_signalbuffer.Save_Port.Add(globaldata.m_signalbuffer.Channel1_Port);
//if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw)
//{ {
// lock (globaldata.channelA_A) lock (globaldata.channelA_A)
// { {
// globaldata.channelA_A.Add((long)(fidv[i] * 1000000)); globaldata.channelA_A.Add((long)(fidv[i] * 1000000));
// } }
// lock (globaldata.channelB_A) lock (globaldata.channelB_A)
// { {
// globaldata.channelB_A.Add((long)(fidv[i] * 1000000)); globaldata.channelB_A.Add((long)(fidv[i] * 1000000));
// } }
//} }
} }
} }
} }
...@@ -299,18 +299,18 @@ namespace GcDevicePc.ProThread ...@@ -299,18 +299,18 @@ namespace GcDevicePc.ProThread
globaldata.m_signalbuffer.Draw_Port2.Add(globaldata.m_signalbuffer.Channel2_Port); globaldata.m_signalbuffer.Draw_Port2.Add(globaldata.m_signalbuffer.Channel2_Port);
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) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw)
//{ {
// lock (globaldata.channelA_B) lock (globaldata.channelA_B)
// { {
// globaldata.channelA_B.Add((long)(fidv[i] * 1000000)); globaldata.channelA_B.Add((long)(fidv[i] * 1000000));
// } }
// lock (globaldata.channelB_B) lock (globaldata.channelB_B)
// { {
// globaldata.channelB_B.Add((long)(fidv[i] * 1000000)); globaldata.channelB_B.Add((long)(fidv[i] * 1000000));
// } }
//} }
} }
} }
} }
...@@ -363,17 +363,17 @@ namespace GcDevicePc.ProThread ...@@ -363,17 +363,17 @@ namespace GcDevicePc.ProThread
globaldata.m_signalbuffer.Draw_Port3.Add(globaldata.m_signalbuffer.Channel3_Port); globaldata.m_signalbuffer.Draw_Port3.Add(globaldata.m_signalbuffer.Channel3_Port);
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) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw)
//{ {
// lock (globaldata.channelA_C) lock (globaldata.channelA_C)
// { {
// globaldata.channelA_C.Add((long)(fidv[i] * 1000000)); globaldata.channelA_C.Add((long)(fidv[i] * 1000000));
// } }
// lock (globaldata.channelB_C) lock (globaldata.channelB_C)
// { {
// globaldata.channelB_C.Add((long)(fidv[i] * 1000000)); globaldata.channelB_C.Add((long)(fidv[i] * 1000000));
// } }
//} }
} }
} }
} }
......
...@@ -4,6 +4,7 @@ using System.Linq; ...@@ -4,6 +4,7 @@ using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using GcDevicePc.GCBuffer;
using GcDevicePc.IniParam; using GcDevicePc.IniParam;
namespace GcDevicePc.ProThread namespace GcDevicePc.ProThread
...@@ -12,7 +13,6 @@ namespace GcDevicePc.ProThread ...@@ -12,7 +13,6 @@ namespace GcDevicePc.ProThread
{ {
[DllImport(@"HWSendData.dll", EntryPoint = "SendDataToHW")] [DllImport(@"HWSendData.dll", EntryPoint = "SendDataToHW")]
public static extern void GCSendDataToHW(Int32 data1, Int32 data2, Int32 data3); public static extern void GCSendDataToHW(Int32 data1, Int32 data2, Int32 data3);
#region 私有变量 #region 私有变量
ManualResetEvent datamre = new ManualResetEvent(false); ManualResetEvent datamre = new ManualResetEvent(false);
...@@ -113,7 +113,7 @@ namespace GcDevicePc.ProThread ...@@ -113,7 +113,7 @@ namespace GcDevicePc.ProThread
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
switch (CProfileDevice.m_DevParam.signal.uDetA[0]) switch (methodconfig.signal.uDetA[0])
{ {
case 1: case 1:
if (globaldata.channelA_A.Count >= 1) if (globaldata.channelA_A.Count >= 1)
...@@ -138,7 +138,7 @@ namespace GcDevicePc.ProThread ...@@ -138,7 +138,7 @@ namespace GcDevicePc.ProThread
break; break;
} }
switch (CProfileDevice.m_DevParam.signal.uDetB[0]) switch (methodconfig.signal.uDetB[0])
{ {
case 1: case 1:
if (globaldata.channelB_A.Count >= 1) if (globaldata.channelB_A.Count >= 1)
...@@ -163,21 +163,21 @@ namespace GcDevicePc.ProThread ...@@ -163,21 +163,21 @@ namespace GcDevicePc.ProThread
break; break;
} }
if (CProfileDevice.m_DevParam.signal.u16ChannelA == 1 && CProfileDevice.m_DevParam.signal.u16ChannelB == 1) if (methodconfig.signal.u16ChannelA == 1 && methodconfig.signal.u16ChannelB == 1)
{ {
SendDataToHW_AB(mydataA, mydataB); SendDataToHW_AB(mydataA, mydataB);
Thread.Sleep(50); Thread.Sleep(50);
} }
//写入A //写入A
if (CProfileDevice.m_DevParam.signal.u16ChannelA == 1 && CProfileDevice.m_DevParam.signal.u16ChannelB != 1) if (methodconfig.signal.u16ChannelA == 1 && methodconfig.signal.u16ChannelB != 1)
{ {
SendDataToHW_A(mydataA); SendDataToHW_A(mydataA);
Thread.Sleep(50); Thread.Sleep(50);
} }
//写入B //写入B
if (CProfileDevice.m_DevParam.signal.u16ChannelA != 1 && CProfileDevice.m_DevParam.signal.u16ChannelB == 1) if (methodconfig.signal.u16ChannelA != 1 && methodconfig.signal.u16ChannelB == 1)
{ {
SendDataToHW_B(mydataB); SendDataToHW_B(mydataB);
Thread.Sleep(50); Thread.Sleep(50);
...@@ -194,7 +194,7 @@ namespace GcDevicePc.ProThread ...@@ -194,7 +194,7 @@ namespace GcDevicePc.ProThread
int i = 0; int i = 0;
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
switch (CProfileDevice.m_DevParam.signal.uDetA[lastA]) switch (methodconfig.signal.uDetA[lastA])
{ {
case 1: case 1:
if (globaldata.channelA_A.Count >= 1) if (globaldata.channelA_A.Count >= 1)
...@@ -219,7 +219,7 @@ namespace GcDevicePc.ProThread ...@@ -219,7 +219,7 @@ namespace GcDevicePc.ProThread
break; break;
} }
switch (CProfileDevice.m_DevParam.signal.uDetB[lastB]) switch (methodconfig.signal.uDetB[lastB])
{ {
case 1: case 1:
if (globaldata.channelB_A.Count >= 1) if (globaldata.channelB_A.Count >= 1)
...@@ -244,21 +244,21 @@ namespace GcDevicePc.ProThread ...@@ -244,21 +244,21 @@ namespace GcDevicePc.ProThread
break; break;
} }
if (CProfileDevice.m_DevParam.signal.u16ChannelA == 1 && CProfileDevice.m_DevParam.signal.u16ChannelB == 1) if (methodconfig.signal.u16ChannelA == 1 && methodconfig.signal.u16ChannelB == 1)
{ {
SendDataToHW_AB(mydataA, mydataB); SendDataToHW_AB(mydataA, mydataB);
Thread.Sleep(50); Thread.Sleep(50);
} }
//写入A //写入A
if (CProfileDevice.m_DevParam.signal.u16ChannelA == 1 && CProfileDevice.m_DevParam.signal.u16ChannelB != 1) if (methodconfig.signal.u16ChannelA == 1 && methodconfig.signal.u16ChannelB != 1)
{ {
SendDataToHW_A(mydataA); SendDataToHW_A(mydataA);
Thread.Sleep(50); Thread.Sleep(50);
} }
//写入B //写入B
if (CProfileDevice.m_DevParam.signal.u16ChannelA != 1 && CProfileDevice.m_DevParam.signal.u16ChannelB == 1) if (methodconfig.signal.u16ChannelA != 1 && methodconfig.signal.u16ChannelB == 1)
{ {
SendDataToHW_B(mydataB); SendDataToHW_B(mydataB);
Thread.Sleep(50); Thread.Sleep(50);
...@@ -266,7 +266,7 @@ namespace GcDevicePc.ProThread ...@@ -266,7 +266,7 @@ namespace GcDevicePc.ProThread
} }
} }
public static GCMethodConfig methodconfig { get; set; }
private void SendToHW_Draw() private void SendToHW_Draw()
{ {
DateTime StartTimeA; DateTime StartTimeA;
...@@ -289,23 +289,48 @@ namespace GcDevicePc.ProThread ...@@ -289,23 +289,48 @@ namespace GcDevicePc.ProThread
//bool StepA_flag = false; //bool StepA_flag = false;
// bool StepB_flag = false; // bool StepB_flag = false;
bool changeA_flag = false; bool changeA_flag = false;
bool changeB_flag = false; bool changeB_flag = false;
bool run_stop = 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 SendNumA = 0;
ushort SendNumB = 0; ushort SendNumB = 0;
ushort MAXNum = 0; ushort MAXNum = 0;
//int i = 0; //int i = 0;
bool runflag = false; bool runflag = false;
while (true) while (true)
{ {
if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) && globaldata.m_hmibuffer.gcinfo.hmistatus == 4 && run_stop != true) if ((globaldata.m_hmibuffer.gcinfo.methodstatus == 4 || globaldata.m_hmibuffer.gcinfo.methodstatus == 5) && 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;
mydataA_old = 0;
mydataB_old = 0;
InitSendToHWData(); InitSendToHWData();
//清除所有数据,准备传输 //清除所有数据,准备传输
CleanAllToHWData(); CleanAllToHWData();
...@@ -314,27 +339,25 @@ namespace GcDevicePc.ProThread ...@@ -314,27 +339,25 @@ namespace GcDevicePc.ProThread
StartSendDataToHW(); StartSendDataToHW();
//绘图通知开启flag //绘图通知开启flag
runflag = true; runflag = true;
if (methodconfig.signal.u16ChannelA == 1)
if (CProfileDevice.m_DevParam.signal.u16ChannelA == 1)
{ {
SendNumA = CheckNumandTime(0, CProfileDevice.m_DevParam.signal.uDetA, CProfileDevice.m_DevParam.signal.u16DetTimeLengthA); SendNumA = CheckNumandTime(0, methodconfig.signal.uDetA, methodconfig.signal.u16DetTimeLengthA);
} }
if (CProfileDevice.m_DevParam.signal.u16ChannelB == 1) if (methodconfig.signal.u16ChannelB == 1)
{ {
SendNumB = CheckNumandTime(0, CProfileDevice.m_DevParam.signal.uDetB, CProfileDevice.m_DevParam.signal.u16DetTimeLengthB); 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; MAXNum = SendNumA > SendNumB ? SendNumA : SendNumB;
if (CProfileDevice.m_DevParam.signal.u16ChannelA == 1 || CProfileDevice.m_DevParam.signal.u16ChannelB == 1) if (methodconfig.signal.u16ChannelA == 1 || methodconfig.signal.u16ChannelB == 1)
{ {
StepA = 0; StepA = 0;
StepB = 0; StepB = 0;
{ {
StartTimeA = DateTime.Now; StartTimeA = DateTime.Now;
StartTimeB = DateTime.Now; StartTimeB = DateTime.Now;
...@@ -357,21 +380,39 @@ namespace GcDevicePc.ProThread ...@@ -357,21 +380,39 @@ namespace GcDevicePc.ProThread
if (StepA < SendNumA) if (StepA < SendNumA)
{ {
if (secA <= CProfileDevice.m_DevParam.signal.u16DetTimeLengthA[StepA]) if (secA <= methodconfig.signal.u16DetTimeLengthA[StepA])
{ {
//Console.WriteLine("总共:" + SendNumA.ToString() + " 阶段,现在是第" + StepA.ToString() + "个阶段:" + secA.ToString() + "/" + CProfileDevice.m_DevParam.signal.u16DetTimeLengthA[i].ToString()); //Console.WriteLine("总共:" + SendNumA.ToString() + " 阶段,现在是第" + StepA.ToString() + "个阶段:" + secA.ToString() + "/" + methodconfig.signal.u16DetTimeLengthA[StepA].ToString());
switch (CProfileDevice.m_DevParam.signal.uDetA[StepA]) switch (methodconfig.signal.uDetA[StepA])
{ {
case 1: case 1:
if (globaldata.channelA_A.Count >= 1) if (globaldata.channelA_A.Count >= 1)
{ {
if (changeA_flag) //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)
{ {
offetA = Int32.Parse(globaldata.channelA_A[0].ToString()) - mydataA_old; onea = mydataA;
changeA_flag = false; ackoneA = false;
} }
mydataA = Int32.Parse(globaldata.channelA_A[0].ToString()) - offetA;
if (onea > saveA)
{
mydataA = mydataA - (onea - saveA);
}
else if (onea < saveA)
{
mydataA = mydataA + (saveA - onea);
}
mydataA_old = mydataA; mydataA_old = mydataA;
} }
...@@ -379,12 +420,29 @@ namespace GcDevicePc.ProThread ...@@ -379,12 +420,29 @@ namespace GcDevicePc.ProThread
case 2: case 2:
if (globaldata.channelA_B.Count >= 1) if (globaldata.channelA_B.Count >= 1)
{ {
if (changeA_flag) //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)
{ {
offetA = Int32.Parse(globaldata.channelA_B[0].ToString()) - mydataA_old; onea = mydataA;
changeA_flag = false; ackoneA = false;
}
if (onea > saveA)
{
mydataA = mydataA - (onea - saveA);
}
else if (onea < saveA)
{
mydataA = mydataA + (saveA - onea);
} }
mydataA = Int32.Parse(globaldata.channelA_B[0].ToString()) - offetA;
mydataA_old = mydataA; mydataA_old = mydataA;
} }
...@@ -392,12 +450,30 @@ namespace GcDevicePc.ProThread ...@@ -392,12 +450,30 @@ namespace GcDevicePc.ProThread
case 3: case 3:
if (globaldata.channelA_C.Count >= 1) if (globaldata.channelA_C.Count >= 1)
{ {
if (changeA_flag) //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)
{ {
offetA = Int32.Parse(globaldata.channelA_C[0].ToString()) - mydataA_old; onea = mydataA;
changeA_flag = false; ackoneA = false;
} }
mydataA = Int32.Parse(globaldata.channelA_C[0].ToString()) - offetA;
if (onea > saveA)
{
mydataA = mydataA - (onea - saveA);
}
else if (onea < saveA)
{
mydataA = mydataA + (saveA - onea);
}
mydataA_old = mydataA; mydataA_old = mydataA;
} }
...@@ -419,11 +495,13 @@ namespace GcDevicePc.ProThread ...@@ -419,11 +495,13 @@ namespace GcDevicePc.ProThread
globaldata.channelA_C.RemoveAt(0); globaldata.channelA_C.RemoveAt(0);
} }
recordA = mydataA;
} }
else else
{ {
// LogHelper.I("StepA++ ", StepA.ToString() + " " + SendNumA.ToString()); // LogHelper.I("StepA++ ", StepA.ToString() + " " + SendNumA.ToString());
saveA = recordA;
ackoneA = true;
StepA++; StepA++;
StartTimeA = DateTime.Now; StartTimeA = DateTime.Now;
changeA_flag = true; changeA_flag = true;
...@@ -433,21 +511,36 @@ namespace GcDevicePc.ProThread ...@@ -433,21 +511,36 @@ namespace GcDevicePc.ProThread
if (StepB < SendNumB) if (StepB < SendNumB)
{ {
if (secB <= CProfileDevice.m_DevParam.signal.u16DetTimeLengthB[StepB]) if (secB <= methodconfig.signal.u16DetTimeLengthB[StepB])
{ {
//Console.WriteLine("总共:" + SendNumB.ToString() + " 阶段,现在是第" + StepB.ToString() + "个阶段:" + secB.ToString() + "/" + CProfileDevice.m_DevParam.signal.u16DetTimeLengthB[i].ToString()); //Console.WriteLine("总共:" + SendNumB.ToString() + " 阶段,现在是第" + StepB.ToString() + "个阶段:" + secB.ToString() + "/" + methodconfig.signal.u16DetTimeLengthB[i].ToString());
switch (CProfileDevice.m_DevParam.signal.uDetB[StepB]) switch (methodconfig.signal.uDetB[StepB])
{ {
case 1: case 1:
if (globaldata.channelB_A.Count >= 1) if (globaldata.channelB_A.Count >= 1)
{ {
if (changeB_flag) //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)
{ {
offetB = Int32.Parse(globaldata.channelB_A[0].ToString()) - mydataB_old; oneb = mydataB;
changeB_flag = false; ackoneB = false;
}
if (oneb > saveB)
{
mydataB = mydataB - (oneb - saveB);
}
else if(oneb < saveB)
{
mydataB = mydataB + (saveB - oneb);
} }
mydataB = Int32.Parse(globaldata.channelB_A[0].ToString()) - offetB;
mydataB_old = mydataB; mydataB_old = mydataB;
} }
...@@ -455,12 +548,29 @@ namespace GcDevicePc.ProThread ...@@ -455,12 +548,29 @@ namespace GcDevicePc.ProThread
case 2: case 2:
if (globaldata.channelB_B.Count >= 1) if (globaldata.channelB_B.Count >= 1)
{ {
if (changeB_flag) //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)
{ {
offetB = Int32.Parse(globaldata.channelB_B[0].ToString()) - mydataB_old; oneb = mydataB;
changeB_flag = false; ackoneB = false;
} }
mydataB = Int32.Parse(globaldata.channelB_B[0].ToString()) - offetB;
if (oneb > saveB)
{
mydataB = mydataB - (oneb - saveB);
}
else if (oneb < saveB)
{
mydataB = mydataB + (saveB - oneb);
}
mydataB_old = mydataB; mydataB_old = mydataB;
} }
...@@ -468,12 +578,29 @@ namespace GcDevicePc.ProThread ...@@ -468,12 +578,29 @@ namespace GcDevicePc.ProThread
case 3: case 3:
if (globaldata.channelB_C.Count >= 1) if (globaldata.channelB_C.Count >= 1)
{ {
if (changeB_flag) //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)
{ {
offetB = Int32.Parse(globaldata.channelB_C[0].ToString()) - mydataB_old; oneb = mydataB;
changeB_flag = false; ackoneB = false;
} }
mydataB = Int32.Parse(globaldata.channelB_C[0].ToString()) - offetB;
if (oneb > saveB)
{
mydataB = mydataB - (oneb - saveB);
}
else if (oneb < saveB)
{
mydataB = mydataB + (saveB - oneb);
}
mydataB_old = mydataB; mydataB_old = mydataB;
} }
...@@ -491,11 +618,13 @@ namespace GcDevicePc.ProThread ...@@ -491,11 +618,13 @@ namespace GcDevicePc.ProThread
{ {
globaldata.channelB_C.RemoveAt(0); globaldata.channelB_C.RemoveAt(0);
} }
recordB = mydataB;
} }
else else
{ {
// LogHelper.I("StepB ", StepB.ToString() + " " + SendNumB.ToString()); // LogHelper.I("StepB ", StepB.ToString() + " " + SendNumB.ToString());
saveB = recordB;
ackoneB = true;
StepB++; StepB++;
StartTimeB = DateTime.Now; StartTimeB = DateTime.Now;
changeB_flag = true; changeB_flag = true;
...@@ -505,7 +634,7 @@ namespace GcDevicePc.ProThread ...@@ -505,7 +634,7 @@ namespace GcDevicePc.ProThread
//写入AB //写入AB
if (StepA < SendNumA && StepB < SendNumB) if (StepA < SendNumA && StepB < SendNumB)
{ {
//LogHelper.I("SendDataToHW A B", secA.ToString() + " "+ secB.ToString()); //Console.WriteLine("SendDataToHW A B", secA.ToString() + " "+ secB.ToString());
SendDataToHW_AB(mydataA, mydataB); SendDataToHW_AB(mydataA, mydataB);
Thread.Sleep(50); Thread.Sleep(50);
......
...@@ -39,7 +39,7 @@ namespace GcDevicePc ...@@ -39,7 +39,7 @@ namespace GcDevicePc
loadingCtl.Hide(); loadingCtl.Hide();
} }
Form1 form1; Form1 form1;
private void btnShow_Click(object sender, EventArgs e) private void btnShow_Click(object sender, EventArgs e)
{ {
......
...@@ -61,7 +61,7 @@ namespace GcDevicePc ...@@ -61,7 +61,7 @@ namespace GcDevicePc
test.INIWriteValue(file, "StartUp", "运行类型", "0"); test.INIWriteValue(file, "StartUp", "运行类型", "0");
} }
} }
foreach (CheckBox chk in this.groupBox3.Controls) foreach (CheckBox chk in this.groupBox3.Controls)
{ {
if (chk.Checked == false) if (chk.Checked == false)
...@@ -168,8 +168,6 @@ namespace GcDevicePc ...@@ -168,8 +168,6 @@ namespace GcDevicePc
string err_log = test.INIGetStringValue("Logs", "ErrLog", null); string err_log = test.INIGetStringValue("Logs", "ErrLog", null);
string hmi_log = test.INIGetStringValue("Logs", "HmiLog", null); string hmi_log = test.INIGetStringValue("Logs", "HmiLog", null);
try try
{ {
NetworkInterface[] port = NetworkInterface.GetAllNetworkInterfaces(); NetworkInterface[] port = NetworkInterface.GetAllNetworkInterfaces();
...@@ -277,8 +275,6 @@ namespace GcDevicePc ...@@ -277,8 +275,6 @@ namespace GcDevicePc
} }
//string AddressIP = string.Empty; //string AddressIP = string.Empty;
//string IPGateWay = string.Empty; //string IPGateWay = string.Empty;
//string IPSubNet = string.Empty; //string IPSubNet = string.Empty;
...@@ -298,7 +294,6 @@ namespace GcDevicePc ...@@ -298,7 +294,6 @@ namespace GcDevicePc
// { // {
// IPGateWay = _IPAddress.ToString(); // IPGateWay = _IPAddress.ToString();
// } // }
//} //}
} }
...@@ -324,9 +319,8 @@ namespace GcDevicePc ...@@ -324,9 +319,8 @@ namespace GcDevicePc
else e.Handled = true; else e.Handled = true;
} }
} }
} }
private void CaseNo_TextBoxChange(object sender, EventArgs e) private void CaseNo_TextBoxChange(object sender, EventArgs e)
{ {
TextBox text = sender as TextBox; TextBox text = sender as TextBox;
...@@ -341,6 +335,7 @@ namespace GcDevicePc ...@@ -341,6 +335,7 @@ namespace GcDevicePc
TextBox text = sender as TextBox; TextBox text = sender as TextBox;
text.SelectAll(); text.SelectAll();
} }
private void changemac_Click(object sender, EventArgs e) private void changemac_Click(object sender, EventArgs e)
{ {
//bool ret = false; //bool ret = false;
...@@ -467,8 +462,7 @@ namespace GcDevicePc ...@@ -467,8 +462,7 @@ namespace GcDevicePc
} }
} }
} }
public static bool IsIPAddress(string ip) public static bool IsIPAddress(string ip)
{ {
return Regex.IsMatch(ip, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$"); return Regex.IsMatch(ip, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$");
...@@ -519,9 +513,7 @@ namespace GcDevicePc ...@@ -519,9 +513,7 @@ namespace GcDevicePc
} }
Thread th_changeip; Thread th_changeip;
private void changelocal_Click(object sender, EventArgs e) private void changelocal_Click(object sender, EventArgs e)
{ {
try try
......
...@@ -34,7 +34,7 @@ namespace GcDevicePc ...@@ -34,7 +34,7 @@ namespace GcDevicePc
InitializeComponent(); InitializeComponent();
} }
public auxtool(ushort time1, ushort time2,ushort time3) public auxtool(ushort time1, ushort time2, ushort time3)
{ {
InitializeComponent(); InitializeComponent();
...@@ -62,21 +62,21 @@ namespace GcDevicePc ...@@ -62,21 +62,21 @@ namespace GcDevicePc
else else
{ {
this.label4.Text = ipos.ToString() + "/100"; this.label4.Text = ipos.ToString() + "/100";
this.progressBar1.Value = Convert.ToInt32(ipos); this.progressBar1.Value = Convert.ToInt32(ipos);
if(ipos == 100 || send_ok) if (ipos == 100 || send_ok)
{ {
this.label4.Text = "传输完成"; this.label4.Text = "传输完成";
this.runbtn.Enabled = true; this.runbtn.Enabled = true;
this.chosenbtn.Enabled = true; this.chosenbtn.Enabled = true;
this.updatebtn.Enabled = true; this.updatebtn.Enabled = true;
} }
} }
} }
private void hvalvetime_KeyPress(object sender, KeyPressEventArgs e) private void hvalvetime_KeyPress(object sender, KeyPressEventArgs e)
{ {
if(!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8)
{ {
e.Handled = true; e.Handled = true;
} }
...@@ -150,30 +150,31 @@ namespace GcDevicePc ...@@ -150,30 +150,31 @@ namespace GcDevicePc
{ {
if (HmiIP != null) if (HmiIP != null)
{ {
if(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue == false) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue == false)
{ {
this.CHmibtn.Enabled = false; this.CHmibtn.Enabled = false;
int ret = 0; int ret = 0;
FileServerClient singlesend = new FileServerClient(); FileServerClient singlesend = new FileServerClient();
singlesend.WtClientInit(HmiIP, HmiPort); singlesend.WtClientInit(HmiIP, HmiPort);
ret = singlesend.WtHMICloseRro("WtMainProc"); ret = singlesend.WtHMICloseRro("WtMainProc");
if(ret == 1) if (ret == 1)
{ {
MessageBox.Show("停止系统成功!"); MessageBox.Show("停止系统成功!");
} }
singlesend.WtClientClose(); singlesend.WtClientClose();
// this.runbtn.Enabled = true; // this.runbtn.Enabled = true;
this.chosenbtn.Enabled = true; this.chosenbtn.Enabled = true;
this.updatebtn.Enabled = true; this.updatebtn.Enabled = true;
}else }
else
{ {
MessageBox.Show("请停止系统,再关闭!"); MessageBox.Show("请停止系统,再关闭!");
} }
} }
} }
private void runbtn_Click(object sender, EventArgs e) private void runbtn_Click(object sender, EventArgs e)
...@@ -246,21 +247,21 @@ namespace GcDevicePc ...@@ -246,21 +247,21 @@ namespace GcDevicePc
for (int i = 0; i < 100; i++) for (int i = 0; i < 100; i++)
{ {
if(send_ok) if (send_ok)
{ {
SetTextMesssage(100, i.ToString() + "\r\n"); SetTextMesssage(100, i.ToString() + "\r\n");
}else }
else
{ {
Thread.Sleep(200); Thread.Sleep(200);
SetTextMesssage(i, i.ToString() + "\r\n"); SetTextMesssage(i, i.ToString() + "\r\n");
if(i == 95) if (i == 95)
{ {
i--; i--;
} }
}
} }
}
} }
private void sendnewhmi() private void sendnewhmi()
...@@ -285,23 +286,23 @@ namespace GcDevicePc ...@@ -285,23 +286,23 @@ namespace GcDevicePc
private void searchHMI_Click(object sender, EventArgs e) private void searchHMI_Click(object sender, EventArgs e)
{ {
ArrayList DeviceList = new ArrayList(); ArrayList DeviceList = new ArrayList();
if(!hmisearch) if (!hmisearch)
{ {
if(mre != null) if (mre != null)
mre.Reset(); mre.Reset();
addhmi = new Thread(searchhmi); addhmi = new Thread(searchhmi);
addhmi.IsBackground = true; addhmi.IsBackground = true;
addhmi.Start(); addhmi.Start();
this.searchHMI.Text = "停止"; this.searchHMI.Text = "停止";
hmisearch = !hmisearch; hmisearch = !hmisearch;
} }
else else
{ {
this.searchHMI.Text = "搜索"; this.searchHMI.Text = "搜索";
this.hmilist.Text = "请选择..."; this.hmilist.Text = "请选择...";
mre.Set(); mre.Set();
hmisearch = !hmisearch; hmisearch = !hmisearch;
} }
} }
private void searchhmi() private void searchhmi()
...@@ -409,55 +410,55 @@ namespace GcDevicePc ...@@ -409,55 +410,55 @@ namespace GcDevicePc
//try //try
//{ //{
FileServerClient singlesend = new FileServerClient(); FileServerClient singlesend = new FileServerClient();
DirectoryInfo theFolder = new DirectoryInfo(firmDire); DirectoryInfo theFolder = new DirectoryInfo(firmDire);
DirectoryInfo[] dirInfo = theFolder.GetDirectories(); DirectoryInfo[] dirInfo = theFolder.GetDirectories();
singlesend.WtClientInit(HmiIP, HmiPort); singlesend.WtClientInit(HmiIP, HmiPort);
foreach (FileInfo NextFile in theFolder.GetFiles()) foreach (FileInfo NextFile in theFolder.GetFiles())
{ {
fullfilename = NextFile.FullName; fullfilename = NextFile.FullName;
singlesend.WtClientCopytoServerNoDelay(NextFile.Name, fullfilename, globaldata.updateremoteFolder); singlesend.WtClientCopytoServerNoDelay(NextFile.Name, fullfilename, globaldata.updateremoteFolder);
Thread.Sleep(500); Thread.Sleep(500);
} }
sendfirm_ok = true;
singlesend.WtClientClose();
if (sendfirm_ok) sendfirm_ok = true;
{ singlesend.WtClientClose();
updatefirm();
while(true) if (sendfirm_ok)
{
updatefirm();
while (true)
{
if (globaldata.m_hmibuffer.gcinfo.hmistatus == 5)
{ {
if (globaldata.m_hmibuffer.gcinfo.hmistatus == 5)
this.Invoke(new Action(() =>
{ {
this.label7.Text = "更新中...";
}));
updatestart = true;
}
if (updatestart)
{
if (globaldata.m_hmibuffer.gcinfo.hmistatus == 0)
{
this.Invoke(new Action(() => this.Invoke(new Action(() =>
{ {
this.label7.Text = "更新..."; this.label7.Text = "更新完成...";
})); }));
updatestart = true;
}
if( updatestart) updatefirm_ok = true;
{ sendfirm_ok = false;
if (globaldata.m_hmibuffer.gcinfo.hmistatus == 0) break;
{
this.Invoke(new Action(() =>
{
this.label7.Text = "更新完成...";
}));
updatefirm_ok = true;
sendfirm_ok = false;
break;
}
} }
Thread.Sleep(500);
} }
}
Thread.Sleep(500);
}
}
} }
private void SetTextMesssage2(int ipos, string vinfo) private void SetTextMesssage2(int ipos, string vinfo)
......
...@@ -70,6 +70,7 @@ namespace GcDevicePc ...@@ -70,6 +70,7 @@ namespace GcDevicePc
//public static string cur_RunTab; //当前运行表名 //public static string cur_RunTab; //当前运行表名
//public static string cur_DataName; //保存数据文件名 //public static string cur_DataName; //保存数据文件名
public static string show_MethodName; //显示方法名 public static string show_MethodName; //显示方法名
public static string CurrentVersion; //当前版本
//public static bool system_Statue; //系统开启状态 //public static bool system_Statue; //系统开启状态
//public static ushort work_Statue; //系统工作状态 //public static ushort work_Statue; //系统工作状态
...@@ -126,10 +127,14 @@ namespace GcDevicePc ...@@ -126,10 +127,14 @@ namespace GcDevicePc
// public static Modbus m_modbus = new Modbus(); // public static Modbus m_modbus = new Modbus();
//public static UInt32 starttimer = 0x7FFFFFFF; //开始时间
//public static bool startimerIsSet = false;
// public static int savetimer; //开始时间
public static UInt32 starttimer = 0x7FFFFFFF; //开始时间 public static UInt32 starttimer = 0x7FFFFFFF; //开始时间
public static bool startimerIsSet = false; public static bool startimerIsSet = false;
// public static int savetimer; //开始时间 public static bool startimerIsSet1 = false;
public static bool startimerIsSet2 = false;
public static bool startimerIsSet3 = false;
//public static int[] channel1_timer = new int[30]; //public static int[] channel1_timer = new int[30];
//public static float[] channel1_data = new float[30]; //public static float[] channel1_data = new float[30];
...@@ -141,7 +146,7 @@ namespace GcDevicePc ...@@ -141,7 +146,7 @@ namespace GcDevicePc
//public static Channel_XY Channel1_Port; //public static Channel_XY Channel1_Port;
//public static ArrayList Draw_Port = new ArrayList(); //public static ArrayList Draw_Port = new ArrayList();
//Flag //Flag
//public static bool startflag = false; //public static bool startflag = false;
//public static bool startclear = false; //public static bool startclear = false;
......
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