From 2e889843b4c171f2d6ad8e0d53084040703d11f6 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 09 十一月 2026 13:18:21 +0800
Subject: [PATCH] docs: CAN 总线级应答器 + 硬件调试页多标签多会话 设计规格
---
Plugin.BurnIn/ManualDebug/ManualDebug.xaml.cs | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/Plugin.BurnIn/ManualDebug/ManualDebug.xaml.cs b/Plugin.BurnIn/ManualDebug/ManualDebug.xaml.cs
index 93c2289..b518c73 100644
--- a/Plugin.BurnIn/ManualDebug/ManualDebug.xaml.cs
+++ b/Plugin.BurnIn/ManualDebug/ManualDebug.xaml.cs
@@ -6,14 +6,18 @@
using Plugin.BurnIn.Model;
using Plugin.TsSupport;
using SuperSocket.SocketBase.Config;
+using System.Collections;
using System.Collections.ObjectModel;
using System.ComponentModel;
+using System.Configuration;
using System.Globalization;
+using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
+using System.Xml.Linq;
namespace Plugin.BurnIn
{
@@ -219,16 +223,39 @@
});
}
+ private int GetConfigPort()
+ {
+ try
+ {
+ var customConfig = (Hashtable)ConfigurationManager.GetSection("TestResultConfig");
+ if (customConfig.ContainsKey("PortStart"))
+ {
+ int port = int.Parse(customConfig["PortStart"].ToString()) - 1;
+ return port;
+ }
+ else
+ {
+ return 6659;
+ }
+ }
+ catch (Exception ex)
+ {
+ AppendLog(LogLevel.Error, $"读取起始端口错误: {ex.Message} {ex.StackTrace} 使用默认端口6659");
+ return 6659;
+ }
+ }
+
/// <summary>
/// 启动Tcp服务器
/// </summary>
[RelayCommand]
private void StartTcpServer()
{
+ int port = GetConfigPort();
var serverConfig = new ServerConfig()
{
MaxRequestLength = 1024 * 1024,
- Port = 7777
+ Port = port
};
try
{
@@ -247,6 +274,7 @@
return;
}
ChangeTcpServerStatus("RUNNING", this.lang("Tr.TcpServer.Running"));
+ AppendLog(LogLevel.Debug, $"数据接收服务器启动,端口:{port}");
}
else if (tcpServer.State != SuperSocket.SocketBase.ServerState.Running)
{
@@ -261,11 +289,13 @@
return;
}
ChangeTcpServerStatus("RUNNING", this.lang("Tr.TcpServer.Running"));
+ AppendLog(LogLevel.Debug, $"数据接收服务器启动,端口:{port}");
}
}
catch (Exception ex)
{
ChangeTcpServerStatus("ERROR", $"{ex.Message}");
+ AppendLog(LogLevel.Error, $"数据接收服务器启动错误: {ex.Message} {ex.StackTrace}");
tcpServer?.Stop();
tcpServer = null;
}
@@ -613,6 +643,7 @@
{
executionWrapper?.SetFileGlobalValue("Running.StopTest", 1, true);
executionWrapper?.WaitForExit();
+ executionWrapper?.Dispose();
tcpServer?.Stop();
}
catch (Exception ex)
--
Gitblit v1.9.1