From d256f84735b75529a640ca61384c3c55b557fce9 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期一, 12 五月 2025 16:22:57 +0800
Subject: [PATCH] 1. 修复日志时顺问题 2. 解决远程路径不存在编译报错的问题

---
 SourceCode/Bond/Servo/LogDlg.cpp |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/Servo/LogDlg.cpp b/SourceCode/Bond/Servo/LogDlg.cpp
index 560b5cc..74fe0f2 100644
--- a/SourceCode/Bond/Servo/LogDlg.cpp
+++ b/SourceCode/Bond/Servo/LogDlg.cpp
@@ -154,11 +154,29 @@
 
 
 	// 内容
-	m_logEdit.SetMaxLineCount(20);
+	m_logEdit.SetMaxLineCount(500);
 	m_logEdit.SetLimitText(-1);
 
 
-	InitRxWindow();
+	std::thread([this]() {
+		constexpr int nMaxWaitMs = 3000;  // 最多等待 3 秒
+		constexpr int nStepMs = 1;		  // 每次等待 1ms
+		int nElapsed = 0;
+
+		while (nElapsed < nMaxWaitMs) {
+			if (theApp.m_model.getObservable() != nullptr) {
+				InitRxWindow();
+				return;
+			}
+			std::this_thread::sleep_for(std::chrono::milliseconds(nStepMs));
+			nElapsed += nStepMs;
+		}
+
+		// 超时也可以发消息记录下日志
+		TRACE(_T("InitRxWindow 超时,未执行\n"));
+	}).detach();
+
+
 	Resize();
 
 

--
Gitblit v1.9.3