From 7aa252390ad86a90312bee95cef7b7d9d536837e Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周六, 14 9月 2024 05:45:16 +0800
Subject: [PATCH] 监控点位OP1004
---
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormMain.cs | 540 ++++++++++++++++++++++++++++++++---------------------------
1 files changed, 296 insertions(+), 244 deletions(-)
diff --git a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormMain.cs b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormMain.cs
index b6e683c..46a51a3 100644
--- a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormMain.cs
+++ b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_DataCaptureV3/FormMain.cs
@@ -912,22 +912,22 @@
private void button9_Click(object sender, EventArgs e)
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP3001.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP3001.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
private void button11_Click(object sender, EventArgs e)
@@ -955,85 +955,85 @@
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP3003.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP3003.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
private void button15_Click(object sender, EventArgs e)
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP3007.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP3007.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
private void button13_Click(object sender, EventArgs e)
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP3004.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP3004.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
private void button14_Click(object sender, EventArgs e)
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP3005.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP3005.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
private void button16_Click(object sender, EventArgs e)
@@ -1124,22 +1124,22 @@
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP8001.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP8001.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
private void button21_Click(object sender, EventArgs e)
@@ -1168,88 +1168,88 @@
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP8003.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP8003.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
private void button19_Click(object sender, EventArgs e)
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP8004.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP8004.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
private void button18_Click(object sender, EventArgs e)
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP8005.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP8005.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
private void button17_Click(object sender, EventArgs e)
{
- try
- {
- if (!SystemValue.isStartedImitateModel)
- {
- MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
- return;
- }
- DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
- DataCaptureHandler_OP8007.Instance.DataCaptureStart();
+ //try
+ //{
+ // if (!SystemValue.isStartedImitateModel)
+ // {
+ // MessageBox.Show("璇风偣鍑昏皟璇曟ā寮忔寜閽�");
+ // return;
+ // }
+ // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim();
+ // DataCaptureHandler_OP8007.Instance.DataCaptureStart();
- }
- catch (Exception ex)
- {
- MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
- Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
- }
+ //}
+ //catch (Exception ex)
+ //{
+ // MessageBox.Show($"妯℃嫙寮傚父锛歿ex.Message}");
+ // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all鎶ラ敊锛�", ex);
+ //}
}
/// <summary>
@@ -1560,6 +1560,9 @@
DeleteDataHandler _deleteDataHandler = new DeleteDataHandler();
_dataCaptureHandler.Add(_deleteDataHandler);
+ DeleteDataOtherHandler _deleteDataOtherHandler = new DeleteDataOtherHandler();
+ _dataCaptureHandler.Add(_deleteDataOtherHandler);
+
#endregion
try
@@ -1850,6 +1853,11 @@
}
+ /// <summary>
+ /// 娴嬭瘯璋冭瘯
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
private void button26_Click(object sender, EventArgs e)
{
try
@@ -1868,10 +1876,56 @@
{
switch (config.DataCapturePointCode)
{
- case "OP7009"://娓呮礂鏈鸿幏鍙栭噰闆嗘暟鎹�
- DataCaptureHandler_OP7009.Instance._dataCaptureConfig = config;
- _dataCaptureHandler.Add(DataCaptureHandler_OP7009.Instance);
+ //娴嬭瘯璋冭瘯
+ //case "OP1002":
+ // DataCaptureHandler_OP1002.Instance._dataCaptureConfig = config;
+ // _dataCaptureHandler.Add(DataCaptureHandler_OP1002.Instance);
+ // break;
+ //case "OP1003":
+ // DataCaptureHandler_OP1003.Instance._dataCaptureConfig = config;
+ // _dataCaptureHandler.Add(DataCaptureHandler_OP1003.Instance);
+ // break;
+ //#region 02 娴嬮噺瀹屾垚鏍囪
+ //case "OP2002A":
+ //case "OP2002B":
+ case "OP2002C":
+ //case "OP3002CH3":
+ //case "OP3002CH4":
+ //case "OP3002CH5":
+ //case "OP3002CH6":
+ //case "OP3502A":
+ //case "OP3502B":
+ //case "OP6002A":
+ //case "OP6002B":
+ //case "OP6002C":
+ //case "OP6002D":
+ //case "OP3502":
+ DataCaptureHandler_02 dc02 = new DataCaptureHandler_02();
+ dc02._dataCaptureConfig = config;
+ _dataCaptureHandler.Add(dc02);
break;
+ //#region 01 浜岀淮鐮佽鍙�
+
+ //case "OP3001":
+ //case "OP3501":
+ //case "OP5001A":
+ //case "OP5001B":
+ //case "OP6001":
+ //case "OP7001":
+ //case "OP8001":
+ //DataCaptureHandler_01 dc01 = new DataCaptureHandler_01();
+ //dc01._dataCaptureConfig = config;
+ //_dataCaptureHandler.Add(dc01);
+ //break;
+ //case "OP0501":
+ //DataCaptureHandler_OP0501.Instance._dataCaptureConfig = config;
+ //_dataCaptureHandler.Add(DataCaptureHandler_OP0501.Instance);
+ //break;
+ #endregion
+ //case "OP7009"://娓呮礂鏈鸿幏鍙栭噰闆嗘暟鎹�
+ // DataCaptureHandler_OP7009.Instance._dataCaptureConfig = config;
+ // _dataCaptureHandler.Add(DataCaptureHandler_OP7009.Instance);
+ // break;
//case "OP3002CH3":
// //case "OP3002CH4":
// //case "OP3002CH5":
@@ -1898,8 +1952,6 @@
//鍛婅鐩戞帶
//AlertMonitor alert = new AlertMonitor();
//_dataCaptureHandler.Add(alert);
- #endregion
-
try
{
DataCaptureHandler.RefreshDataCommonStatic();
@@ -1991,98 +2043,98 @@
}
- public WorkPieceLogMiddle GetCH5Info(string FullName, WorkPieceLogMiddle wplog)
- {
- try
- {
- string fileContent = File.ReadAllText(FullName);
- string[] lines2 = fileContent.Split('\n');
- bool IDCodeIndex = false;
- int Mcount = 0;
- int i = 0;
- int count = 0;
- foreach (string line in lines2)
- {
- count++;
- if (count == 4)
- {//鑾峰彇璐ㄩ噺缁撴灉
- var list = line.Split(' ');
- if (list.Count() > 0)
- {
- var str = list[list.Count() - 1].ToString().Trim();
- wplog.QualityStateStr = str.Equals("OK") ? "OK" : "NG";
- }
- }
- // 澶勭悊姣忎竴琛岀殑閫昏緫
- if (line.Contains("ID-Code"))//涓や釜鎷х揣锛屾瘡涓墠闈㈤兘鏈塈D-Code
- {
- i++;
- IDCodeIndex = true;
- Mcount = 0;
- }
- if (IDCodeIndex)
- {
- if (line.Contains(" M "))//绗笁涓狹琛屾槸鎷х揣鏁版嵁
- {//鏈�缁堝姏鐭�
- Mcount++;
- if (Mcount == 3)
- {
- var str = line.Replace("+", "").Replace("-", "");
- var list = str.Split('M');
- if (list.Count() == 4)
- {
- if (i == 1)
- {//CH3
- wplog.QualityOP30To3 = list[2].ToString().Trim();
- }
- else
- {//CH4
- wplog.QualityOP30To9 = list[2].ToString().Trim();
- }
- }
- IDCodeIndex = false;
- }
- }
+ //public WorkPieceLogMiddle GetCH5Info(string FullName, WorkPieceLogMiddle wplog)
+ //{
+ // try
+ // {
+ // string fileContent = File.ReadAllText(FullName);
+ // string[] lines2 = fileContent.Split('\n');
+ // bool IDCodeIndex = false;
+ // int Mcount = 0;
+ // int i = 0;
+ // int count = 0;
+ // foreach (string line in lines2)
+ // {
+ // count++;
+ // if (count == 4)
+ // {//鑾峰彇璐ㄩ噺缁撴灉
+ // var list = line.Split(' ');
+ // if (list.Count() > 0)
+ // {
+ // var str = list[list.Count() - 1].ToString().Trim();
+ // wplog.QualityStateStr = str.Equals("OK") ? "OK" : "NG";
+ // }
+ // }
+ // // 澶勭悊姣忎竴琛岀殑閫昏緫
+ // if (line.Contains("ID-Code"))//涓や釜鎷х揣锛屾瘡涓墠闈㈤兘鏈塈D-Code
+ // {
+ // i++;
+ // IDCodeIndex = true;
+ // Mcount = 0;
+ // }
+ // if (IDCodeIndex)
+ // {
+ // if (line.Contains(" M "))//绗笁涓狹琛屾槸鎷х揣鏁版嵁
+ // {//鏈�缁堝姏鐭�
+ // Mcount++;
+ // if (Mcount == 3)
+ // {
+ // var str = line.Replace("+", "").Replace("-", "");
+ // var list = str.Split('M');
+ // if (list.Count() == 4)
+ // {
+ // if (i == 1)
+ // {//CH3
+ // wplog.QualityOP30To3 = list[2].ToString().Trim();
+ // }
+ // else
+ // {//CH4
+ // wplog.QualityOP30To9 = list[2].ToString().Trim();
+ // }
+ // }
+ // IDCodeIndex = false;
+ // }
+ // }
- }
- if (line.Contains(" MWSP "))
- {//缁堟嫥绱у姏鐭� 缁堟嫥绱ц搴�
- var list = line.Split(new String[] { " MWS " }, StringSplitOptions.None);
- if (list.Count() == 2)
- {
- if (i == 1)
- {//CH3
- wplog.QualityOP30To4 = list[1].ToString().Trim();
- }
- else
- {//CH4
- wplog.QualityOP30To10 = list[1].ToString().Trim();
- }
- var list2 = list[0].Split(new String[] { " W " }, StringSplitOptions.None);
- if (list2.Count() == 2)
- {
- var str = list2[1].ToString();
- if (i == 1)
- {//CH3
- wplog.QualityOP30To5 = str.Substring(0, str.IndexOf("MWSP")).Trim();
- }
- else
- {//CH4
- wplog.QualityOP30To11 = str.Substring(0, str.IndexOf("MWSP")).Trim();
- }
- }
- }
+ // }
+ // if (line.Contains(" MWSP "))
+ // {//缁堟嫥绱у姏鐭� 缁堟嫥绱ц搴�
+ // var list = line.Split(new String[] { " MWS " }, StringSplitOptions.None);
+ // if (list.Count() == 2)
+ // {
+ // if (i == 1)
+ // {//CH3
+ // wplog.QualityOP30To4 = list[1].ToString().Trim();
+ // }
+ // else
+ // {//CH4
+ // wplog.QualityOP30To10 = list[1].ToString().Trim();
+ // }
+ // var list2 = list[0].Split(new String[] { " W " }, StringSplitOptions.None);
+ // if (list2.Count() == 2)
+ // {
+ // var str = list2[1].ToString();
+ // if (i == 1)
+ // {//CH3
+ // wplog.QualityOP30To5 = str.Substring(0, str.IndexOf("MWSP")).Trim();
+ // }
+ // else
+ // {//CH4
+ // wplog.QualityOP30To11 = str.Substring(0, str.IndexOf("MWSP")).Trim();
+ // }
+ // }
+ // }
- }
- }
- }
- catch (Exception ex)
- {
- //Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"璇诲彇 {DataCapturePointCode}CH5宸ヤ綅璐ㄩ噺鏁版嵁寮傚父宸ヤ欢鍙凤細{(wplog.WorkPieceID == null ? "" : wplog.WorkPieceID)} 鏂囦欢鍚嶏細{FullName}锛�", ex);
- }
- return wplog;
+ // }
+ // }
+ // }
+ // catch (Exception ex)
+ // {
+ // //Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"璇诲彇 {DataCapturePointCode}CH5宸ヤ綅璐ㄩ噺鏁版嵁寮傚父宸ヤ欢鍙凤細{(wplog.WorkPieceID == null ? "" : wplog.WorkPieceID)} 鏂囦欢鍚嶏細{FullName}锛�", ex);
+ // }
+ // return wplog;
- }
+ //}
private void button27_Click(object sender, EventArgs e)
{
try
--
Gitblit v1.9.3