From 6c9115d3ae53708dc40507104c8043748f3d2845 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 06 三月 2025 16:05:22 +0800
Subject: [PATCH] 1.添加Eq面板。

---
 SourceCode/Bond/Servo/ServoDlg.cpp |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index 4217090..233e749 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -91,6 +91,8 @@
 	m_pTerminalDisplayDlg = nullptr;
 	m_pObserver = nullptr;
 	m_pPanelMaster = nullptr;
+	m_pPanelEquipment = nullptr;
+	m_pPanelAttributes = nullptr;
 }
 
 void CServoDlg::DoDataExchange(CDataExchange* pDX)
@@ -167,6 +169,35 @@
 					}
 				}
 			}
+			else if (RX_CODE_SELECT_EQUIPMENT == code) {
+				SERVO::CEquipment* pEquipment = nullptr;
+				if (pAny->getPtrValue("ptr", (void*&)pEquipment)) {
+					ASSERT(pEquipment);
+					ASSERT(m_pPanelEquipment);
+					ASSERT(m_pPanelAttributes);
+					m_pPanelEquipment->SetEquipment(pEquipment);
+					m_pPanelAttributes->ShowWindow(SW_HIDE);
+					if (!m_pPanelEquipment->IsWindowVisible()) {
+						m_pPanelEquipment->ShowWindow(SW_SHOW);
+						Resize();
+					}
+				}
+			}
+			else if (RX_CODE_SELECT_STEP == code) {
+				SERVO::CStep* pStep = nullptr;
+				if (pAny->getPtrValue("ptr", (void*&)pStep)) {
+					ASSERT(pStep);
+					ASSERT(m_pPanelEquipment);
+					ASSERT(m_pPanelAttributes);
+					m_pPanelEquipment->ShowWindow(SW_HIDE);
+					m_pPanelAttributes->loadDataFromStep(pStep);
+					if (!m_pPanelAttributes->IsWindowVisible()) {
+						m_pPanelAttributes->ShowWindow(SW_SHOW);
+						Resize();
+					}
+				}
+			}
+
 			pAny->release();
 		}, [&]() -> void {
 			// onComplete
@@ -305,6 +336,11 @@
 	m_pPanelMaster = new CPanelMaster();
 	m_pPanelMaster->Create(IDD_PANEL_MASTER, this);
 	m_pPanelMaster->ShowWindow(SW_SHOW);
+	m_pPanelEquipment = new CPanelEquipment();
+	m_pPanelEquipment->Create(IDD_PANEL_EQUIPMENT, this);
+	m_pPanelAttributes = new CPanelAttributes();
+	m_pPanelAttributes->Create(IDD_PANEL_ATTRIBUTES, this);
+	
 
 
 	// 调整初始窗口位置
@@ -558,6 +594,18 @@
 		m_pPanelMaster = nullptr;
 	}
 
+	if (m_pPanelEquipment != nullptr) {
+		m_pPanelEquipment->DestroyWindow();
+		delete m_pPanelEquipment;
+		m_pPanelEquipment = nullptr;
+	}
+
+	if (m_pPanelAttributes != nullptr) {
+		m_pPanelAttributes->DestroyWindow();
+		delete m_pPanelAttributes;
+		m_pPanelAttributes = nullptr;
+	}
+	
 	if (m_hbrBkgnd != nullptr) {
 		::DeleteObject(m_hbrBkgnd);
 	}
@@ -763,6 +811,17 @@
 		x += nPanelWidth;
 	}
 
+	if (m_pPanelEquipment != nullptr && m_pPanelEquipment->IsWindowVisible()) {
+		nPanelWidth = m_pPanelEquipment->getPanelWidth();
+		m_pPanelEquipment->MoveWindow(x, y, nPanelWidth, rcClient.Height());
+		x += nPanelWidth;
+	}
+
+	if (m_pPanelAttributes != nullptr && m_pPanelAttributes->IsWindowVisible()) {
+		nPanelWidth = m_pPanelAttributes->getPanelWidth();
+		m_pPanelAttributes->MoveWindow(x, y, nPanelWidth, rcClient.Height());
+		x += nPanelWidth;
+	}
 
 	pItem = GetDlgItem(IDC_SERVO_GRAPH1);
 	pItem->GetClientRect(&rcItem);

--
Gitblit v1.9.3