From e3729db9e5b77d253666d9c7287bf2ea84c05132 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 17 十二月 2025 16:48:10 +0800
Subject: [PATCH] 1.添加生产面板框架;

---
 SourceCode/Bond/Servo/ServoDlg.cpp |   44 ++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index c3d42da..34c48f1 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -96,6 +96,7 @@
 	m_pTerminalDisplayDlg = nullptr;
 	m_pObserver = nullptr;
 	m_pPanelMaster = nullptr;
+	m_pPanelProduction = nullptr;
 	m_pPanelEquipment = nullptr;
 	m_pPanelAttributes = nullptr;
 	m_pPageGraph1 = nullptr;
@@ -422,10 +423,19 @@
 	m_pTab->SetBkgndColor(RGB(222, 222, 222));
 	ShowChildPage(0);
 
+	// 璇诲彇闈㈡澘瀹�
+	CString strIniFile;
+	strIniFile.Format(_T("%s\\%s.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir, (LPTSTR)(LPCTSTR)theApp.m_strAppFile);
+	int nPanelWidth = GetPrivateProfileInt(_T("App"), _T("MasterPanelWidth"),
+		int((double)GetSystemMetrics(SM_CXSCREEN) * 0.25), (LPTSTR)(LPCTSTR)strIniFile);
 
 	m_pPanelMaster = new CPanelMaster();
+	m_pPanelMaster->setPanelWidth(nPanelWidth);
 	m_pPanelMaster->Create(IDD_PANEL_MASTER, this);
-	m_pPanelMaster->ShowWindow(SW_SHOW);
+	m_pPanelProduction = new CPanelProduction();
+	m_pPanelProduction->setPanelWidth(nPanelWidth);
+	m_pPanelProduction->Create(IDD_PANEL_PRODUCTION, this);
+	m_pPanelProduction->ShowWindow(SW_SHOW);
 	m_pPanelEquipment = new CPanelEquipment();
 	m_pPanelEquipment->Create(IDD_PANEL_EQUIPMENT, this);
 	m_pPanelAttributes = new CPanelAttributes();
@@ -756,6 +766,12 @@
 		m_pPanelMaster = nullptr;
 	}
 
+	if (m_pPanelProduction != nullptr) {
+		m_pPanelProduction->DestroyWindow();
+		delete m_pPanelProduction;
+		m_pPanelProduction = nullptr;
+	}
+
 	if (m_pPanelEquipment != nullptr) {
 		m_pPanelEquipment->DestroyWindow();
 		delete m_pPanelEquipment;
@@ -856,9 +872,16 @@
 	
 
 	int nPanelWidth = 0;
-	if (m_pPanelMaster != nullptr) {
+	if (m_pPanelMaster != nullptr && ::IsWindow(m_pPanelMaster->GetSafeHwnd())
+		&& m_pPanelMaster->IsWindowVisible()) {
 		nPanelWidth = m_pPanelMaster->getPanelWidth();
 		m_pPanelMaster->MoveWindow(x, y, nPanelWidth, y2 - y);
+		x += nPanelWidth;
+	}
+
+	if (m_pPanelProduction != nullptr && m_pPanelProduction->IsWindowVisible()) {
+		nPanelWidth = m_pPanelProduction->getPanelWidth();
+		m_pPanelProduction->MoveWindow(x, y, nPanelWidth, y2 - y);
 		x += nPanelWidth;
 	}
 
@@ -965,7 +988,20 @@
 LRESULT CServoDlg::OnPanelResize(WPARAM wParam, LPARAM lParam)
 {
 	int width = (int)wParam;
-	// m_pPanel->SetPanelWidth(width);
+
+	if (m_pPanelMaster != nullptr) {
+		m_pPanelMaster->setPanelWidth(width);
+	}
+	if (m_pPanelProduction != nullptr) {
+		m_pPanelProduction->setPanelWidth(width);
+	}
+
+	CString strIniFile, strValue;
+	strIniFile.Format(_T("%s\\%s.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir, (LPTSTR)(LPCTSTR)theApp.m_strAppFile);
+	strValue.Format(_T("%d"), width);
+	WritePrivateProfileString(_T("App"), _T("MasterPanelWidth"),
+		(LPTSTR)(LPCTSTR)strValue, (LPTSTR)(LPCTSTR)strIniFile);
+
 	Resize();
 
 	return 0;
@@ -1226,4 +1262,4 @@
 	}
 
 	return strText;
-}
\ No newline at end of file
+}

--
Gitblit v1.9.3