From 421c49432b4fec542d1ac941490dac867281237a Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 08 八月 2025 11:49:53 +0800
Subject: [PATCH] 1. 修复添加侧面检以后按钮显示异常问题

---
 EdgeInspector_App/ViewMain_Recipe.cpp |   20 +++++++++++++++++++-
 EdgeInspector_App/ViewMain_Recipe.h   |    3 ++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/EdgeInspector_App/ViewMain_Recipe.cpp b/EdgeInspector_App/ViewMain_Recipe.cpp
index 36a26f5..6cd32ce 100644
--- a/EdgeInspector_App/ViewMain_Recipe.cpp
+++ b/EdgeInspector_App/ViewMain_Recipe.cpp
@@ -1138,8 +1138,9 @@
 		return;
 	}
 
-	if(m_eSelectSide == eSelView)
+	if (m_eSelectSide == eSelView) {
 		return;
+	}
 
 	m_eSelectSide = eSelView;
 
@@ -2938,6 +2939,8 @@
 {
 	UINT nID = GetFocus()->GetDlgCtrlID();
 
+	SetSideRadioExclusive(nID);
+
 	UpdateRecipe(TRUE);
 
 	ChangViewCdmSide(nID);
@@ -3256,3 +3259,18 @@
 	pApp->ChangeDimension(m_pVisionSetDlg, nDir);
 #endif // HALCON_VISION_KEY
 }
+
+void CViewMain_Recipe::SetSideRadioExclusive(UINT nSelId)
+{
+	static const UINT kIds[] = {
+		IDC_RDO_SIDE_A_TOP, IDC_RDO_SIDE_B_TOP, IDC_RDO_SIDE_C_TOP, IDC_RDO_SIDE_D_TOP,
+		IDC_RDO_SIDE_A_BOT, IDC_RDO_SIDE_B_BOT, IDC_RDO_SIDE_C_BOT, IDC_RDO_SIDE_D_BOT,
+		IDC_RDO_SIDE_A_RIP, IDC_RDO_SIDE_B_RIP, IDC_RDO_SIDE_C_RIP, IDC_RDO_SIDE_D_RIP
+	};
+
+	for (UINT id : kIds) {
+		if (CButton* p = (CButton*)GetDlgItem(id)) {
+			p->SetCheck(id == nSelId ? 1 : 0);
+		}
+	}
+}
\ No newline at end of file
diff --git a/EdgeInspector_App/ViewMain_Recipe.h b/EdgeInspector_App/ViewMain_Recipe.h
index 446919e..a48ae7a 100644
--- a/EdgeInspector_App/ViewMain_Recipe.h
+++ b/EdgeInspector_App/ViewMain_Recipe.h
@@ -80,7 +80,8 @@
 	void			DeleteVectorList();
 	BOOL			WriteLinkFile(CString strFilePath);
 	void			ChangeRecipe();
-	BOOL			ReadRecipe(CString strRecipe);	
+	BOOL			ReadRecipe(CString strRecipe);
+	void			SetSideRadioExclusive(UINT nSelId);
 
 public:
 	void			UpdateRecipe(BOOL bGetData, int type = 0);

--
Gitblit v1.9.3