From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点

---
 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