From 90c8673e4edaf2e68931470b4d480e02d4634fd0 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期六, 21 六月 2025 13:53:29 +0800
Subject: [PATCH] 1. 动态生成设备配方绑定界面的控件 2. 完善本地测试界面

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

diff --git a/SourceCode/Bond/Servo/RecipeDeviceBindDlg.cpp b/SourceCode/Bond/Servo/RecipeDeviceBindDlg.cpp
index fec07da..4098135 100644
--- a/SourceCode/Bond/Servo/RecipeDeviceBindDlg.cpp
+++ b/SourceCode/Bond/Servo/RecipeDeviceBindDlg.cpp
@@ -6,6 +6,9 @@
 #include "afxdialogex.h"
 #include "RecipeDeviceBindDlg.h"
 
+#define IDC_EDIT_DEVICEID_BASE     3000
+#define IDC_EDIT_DEVICENAME_BASE   3050
+#define IDC_COMBO_RECIPEID_BASE    3100
 
 // CRecipeDeviceBindDlg 瀵硅瘽妗�
 
@@ -32,3 +35,39 @@
 
 
 // CRecipeDeviceBindDlg 娑堟伅澶勭悊绋嬪簭
+
+BOOL CRecipeDeviceBindDlg::OnInitDialog()
+{
+	CDialogEx::OnInitDialog();
+
+	// TODO:  鍦ㄦ娣诲姞棰濆鐨勫垵濮嬪寲
+    // 璁剧疆鍥哄畾澶у皬锛堜緥濡� 600x400锛�
+    SetWindowPos(nullptr, 0, 0, 600, 400, SWP_NOMOVE | SWP_NOZORDER);
+
+	// 鍒涘缓鎺т欢
+    const int totalControlWidth = 340;
+    CRect clientRect;
+    GetClientRect(&clientRect);
+    int xStart = (clientRect.Width() - totalControlWidth) / 2;
+
+    const int nRowCount = 8;
+    const int nRowHeight = 30;
+    const int yStart = 30; // 椤堕儴璧峰楂樺害
+
+    for (int i = 0; i < nRowCount; ++i)
+    {
+        int y = yStart + i * nRowHeight;
+
+        CEdit* pEditID = new CEdit();
+        pEditID->Create(WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(xStart, y, xStart + 100, y + 25), this, IDC_EDIT_DEVICEID_BASE + i);
+
+        CEdit* pEditName = new CEdit();
+        pEditName->Create(WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(xStart + 110, y, xStart + 210, y + 25), this, IDC_EDIT_DEVICENAME_BASE + i);
+
+        CComboBox* pCombo = new CComboBox();
+        pCombo->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST, CRect(xStart + 220, y, xStart + 340, y + 300), this, IDC_COMBO_RECIPEID_BASE + i);
+    }
+
+	return TRUE;  // return TRUE unless you set the focus to a control
+	// 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
+}
\ No newline at end of file

--
Gitblit v1.9.3