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 |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index 922f768..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,11 +169,27 @@
 					}
 				}
 			}
+			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);
@@ -318,10 +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);
-	// m_pPanelAttributes->ShowWindow(SW_SHOW);
-
+	
 
 
 	// 调整初始窗口位置
@@ -575,6 +594,12 @@
 		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;
@@ -786,6 +811,12 @@
 		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());

--
Gitblit v1.9.3