From 2d69213b1b41b5b039e5dc6f6b7c55d53fd03037 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 13 五月 2025 09:34:04 +0800
Subject: [PATCH] Merge branch 'clh'

---
 SourceCode/Bond/Servo/PageLog.cpp |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/SourceCode/Bond/Servo/PageLog.cpp b/SourceCode/Bond/Servo/PageLog.cpp
index 123a5a4..7af3e51 100644
--- a/SourceCode/Bond/Servo/PageLog.cpp
+++ b/SourceCode/Bond/Servo/PageLog.cpp
@@ -40,7 +40,6 @@
 BEGIN_MESSAGE_MAP(CPageLog, CDialogEx)
 	ON_WM_CTLCOLOR()
 	ON_WM_SIZE()
-	ON_WM_TIMER()
 	ON_WM_DESTROY()
 	ON_WM_CLOSE()
 	ON_NOTIFY(BLBUTTON_MENU_ITEM_CLICKED, IDC_BUTTON_LEVEL, &CPageLog::OnButtonLevelMenuClicked)
@@ -106,7 +105,7 @@
 BOOL CPageLog::OnInitDialog()
 {
 	CDialogEx::OnInitDialog();
-	SetTimer(1, 3000, nullptr);
+	InitRxWindow();
 
 
 	// 缓存
@@ -160,6 +159,28 @@
 	m_logEdit.SetLimitText(-1);
 
 
+<<<<<<< HEAD:SourceCode/Bond/Servo/LogDlg.cpp
+	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();
+
+
+=======
+>>>>>>> clh:SourceCode/Bond/Servo/PageLog.cpp
 	Resize();
 
 
@@ -172,14 +193,6 @@
 	CDialogEx::OnSize(nType, cx, cy);
 	if (GetDlgItem(IDC_EDIT_LOG) == nullptr) return;
 	Resize();
-}
-
-void CPageLog::OnTimer(UINT_PTR nIDEvent)
-{
-	if (1 == nIDEvent) {
-		KillTimer(1);
-		InitRxWindow();
-	}
 }
 
 void CPageLog::Resize()

--
Gitblit v1.9.3