From fe2aa4880d5c9fd88088ad0ed81ebaca05629f5f Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 17:59:45 +0800
Subject: [PATCH] feat: 集成CAN驱动/模拟器 + 仪器仪表注册/硬件调试模块
---
Plugin.TestResult/ViewControl.xaml.cs | 127 +++++++++++++++++++-----------------------
1 files changed, 58 insertions(+), 69 deletions(-)
diff --git a/Plugin.TestResult/ViewControl.xaml.cs b/Plugin.TestResult/ViewControl.xaml.cs
index d7e2f96..ebff038 100644
--- a/Plugin.TestResult/ViewControl.xaml.cs
+++ b/Plugin.TestResult/ViewControl.xaml.cs
@@ -112,17 +112,62 @@
timer.Elapsed += Timer_Elapsed;
InitializeComponent();
- if (testResultView.executionWrapper is TsExecutionWrapper tsWrapper)
- {
- tsWrapper.AxApplicationMgr.ExitApplication += new EventHandler(this.axApplicationMgr_ExitApplication);
- tsWrapper.AxApplicationMgr.UIMessageEvent += new _ApplicationMgrEvents_UIMessageEventEventHandler(this.axApplicationMgr_UIMessageEvent);
- tsWrapper.AxApplicationMgr.ExecutionClosed += new _ApplicationMgrEvents_ExecutionClosedEventHandler(this.axApplicationMgr_ExecutionClosed);
- }
-
//testResultView.testApp.ExitApplication += new EventHandler(this.axApplicationMgr_ExitApplication);
//testResultView.testApp.UIMessageEvent += new _ApplicationMgrEvents_UIMessageEventEventHandler(this.axApplicationMgr_UIMessageEvent);
//testResultView.testApp.ExecutionClosed += new _ApplicationMgrEvents_ExecutionClosedEventHandler(this.axApplicationMgr_ExecutionClosed);
+ }
+
+ private void HandleUIMessage(int EventCase, int MethodCode, string strData, object xData)
+ {
+ try
+ {
+ try
+ {
+ log.Debug($"EventCase: {EventCase}, MethodCode: {MethodCode}, StrData: {strData}");
+ }
+ catch
+ {
+
+ }
+
+ if (EventCase == 8)
+ {
+ IsRunning = false;
+ return;
+ }
+
+ if (EventCase != 10014) return;
+
+ if (MethodCode == 0)
+ {
+ /// 璁剧疆鍙ユ焺
+ this.SequenceContext = (SequenceContext)xData;
+ return;
+ }
+
+
+ if (MethodCode == 8)
+ {
+ /// 鏇存柊MES鐘舵��
+ mesStatus = strData == "1";
+ return;
+ }
+
+ if (MethodCode == 9)
+ {
+ /// 鏇存柊鐢熶骇鐘舵��
+ produceStatus = strData;
+ return;
+ }
+ }
+ catch
+ { }
+ }
+
+ private void ExecutionWrapper_UIMessageEvent(object sender, UIMessageEvent e)
+ {
+ HandleUIMessage(e.EventCode, Convert.ToInt16(e.NumberData), e.StrData, e.Data);
}
private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
@@ -142,7 +187,6 @@
string path = Path.Combine(BaseFolder, "Count.ini");
testResultView.SetCountIniPath(path);
testResultView.InitMainGrid();
- testResultView.InitTestStandEngine();
path = Path.Combine(BaseFolder, "Scanner.ini");
if (!File.Exists(path))
@@ -174,6 +218,12 @@
testResultView.testSeqFile = string.Empty;
FileName = string.Empty;
}
+ string type = Path.GetExtension(FileName);
+ bool isTap = string.Equals(".tapplan", type, StringComparison.OrdinalIgnoreCase);
+
+ testResultView.InitTestStandEngine(isTap);
+ testResultView.executionWrapper.UIMessageEvent += ExecutionWrapper_UIMessageEvent;
+
RefreshUIConfig();
}
@@ -204,67 +254,6 @@
{
log.Error("RefreshUIConfig Error.", ex);
}
- }
-
- private void axApplicationMgr_ExitApplication(object sender, EventArgs e)
- {
- }
-
- private void axApplicationMgr_ExecutionClosed(object sender, _ApplicationMgrEvents_ExecutionClosedEvent e)
- {
- }
-
- private void axApplicationMgr_UIMessageEvent(object sender, _ApplicationMgrEvents_UIMessageEventEvent e)
- {
- try
- {
- int EventCase = Convert.ToInt32(e.uiMsg.Event);
- int MethodCode = Convert.ToInt16(e.uiMsg.NumericData);
- string strData;
-
- try
- {
- log.Debug($"EventCase: {EventCase}, MethodCode: {MethodCode}, StrData: {e.uiMsg.StringData}");
- }
- catch
- {
-
- }
-
- if (EventCase == 8)
- {
- IsRunning = false;
- return;
- }
-
- if (EventCase != 10014) return;
-
- if (MethodCode == 0)
- {
- /// 璁剧疆鍙ユ焺
- this.SequenceContext = (SequenceContext)e.uiMsg.ActiveXData;
- return;
- }
-
-
- if (MethodCode == 8)
- {
- /// 鏇存柊MES鐘舵��
- strData = e.uiMsg.StringData;
- mesStatus = strData == "1";
- return;
- }
-
- if (MethodCode == 9)
- {
- /// 鏇存柊鐢熶骇鐘舵��
- strData = e.uiMsg.StringData;
- produceStatus = strData;
- return;
- }
- }
- catch
- { }
}
private bool isLoaded;
--
Gitblit v1.9.1