From 559890c482f5973f06aafdfec9550fee5ba3c7f2 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 09 十一月 2026 17:02:15 +0800
Subject: [PATCH] feat: CAN 模拟器 TCP 化 + 多设备并发调试 + 后台生命周期管理
---
Plugin.TsSupport/TeststandWrapper.cs | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/Plugin.TsSupport/TeststandWrapper.cs b/Plugin.TsSupport/TeststandWrapper.cs
index b3c7f07..1b7bfec 100644
--- a/Plugin.TsSupport/TeststandWrapper.cs
+++ b/Plugin.TsSupport/TeststandWrapper.cs
@@ -1,7 +1,7 @@
锘縰sing NationalInstruments.TestStand.Interop.API;
using NationalInstruments.TestStand.Interop.UI.Ax;
using System;
-using System.Diagnostics;
+using System.Runtime.InteropServices;
namespace Plugin.TsSupport
{
@@ -82,12 +82,17 @@
return this.AxApplicationMgr;
}
+ private SequenceFile GetFile(string path)
+ {
+ return null;
+ }
+
public object StartSequence(string filePath, string modelPath)
{
this.testSeqFile = filePath;
this.modeSeq = this.engine.GetSequenceFileEx(modelPath);
- this.testSeq = this.engine.GetSequenceFileEx(this.testSeqFile, 2, TypeConflictHandlerTypes.ConflictHandler_UseGlobalType);
+ this.testSeq = this.engine.GetSequenceFileEx(this.testSeqFile, 107, TypeConflictHandlerTypes.ConflictHandler_UseGlobalType);
this.execution = this.engine.NewExecution(this.testSeq, "Test UUTs", this.modeSeq, false, 0, null, null, null);
return execution;
}
@@ -213,16 +218,31 @@
public bool ReleaseSeqFile()
{
- if (testSeq != null)
+ if (this.testSeq != null && this.engine?.ReleaseSequenceFileEx(this.testSeq, 4) == true)
{
- return engine?.ReleaseSequenceFileEx(testSeq, 4) == true;
+ Marshal.ReleaseComObject(this.testSeq);
+ this.testSeq = null;
}
- return true;
+
+ if (this.modeSeq != null && this.engine?.ReleaseSequenceFileEx(this.modeSeq, 4) == true)
+ {
+ Marshal.ReleaseComObject(this.modeSeq);
+ this.modeSeq = null;
+ }
+ this.engine?.UnloadAllModules();
+ return this.testSeq == null && this.modeSeq == null;
}
public void SetContext(object context)
{
this.context = (SequenceContext)context;
}
+
+ public void Dispose()
+ {
+ AxApplicationMgr = null;
+ engine = null;
+ TestAppManager.Dispose();
+ }
}
}
--
Gitblit v1.9.1