From 80c5a369c116280921e8d5668e3fcde894668c7e Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期六, 07 十二月 2024 17:08:24 +0800
Subject: [PATCH] 1.轴定位按钮、回原点按钮根据PLC相关位状态闪烁;

---
 SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp |  110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 109 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp b/SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp
index b54b4b1..76c93ac 100644
--- a/SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp
+++ b/SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp
@@ -45,6 +45,8 @@
 	for (int i = 0; i < 6; i++) {
 		m_pBlLabels[i] = new CBLLabel();
 	}
+	m_nBtnsFlashState6 = 0;
+	m_nBtnsFlashState8 = 0;
 }
 
 CAxisSettingsDlg::~CAxisSettingsDlg()
@@ -735,6 +737,19 @@
 			m_bBusy = CToolUnits::getBit(pData[10 * 2 + 1], 0xB - 8);
 			m_bErr = CToolUnits::getBit(pData[10 * 2 + 1], 0xF - 8);
 
+			// 璁板綍鎸夐挳鍒锋柊鐘舵��
+			// 6,7,8,9涓哄師鐐瑰拰25涓偣浣嶇姸鎬佸拰瀹屾垚鐘舵��
+			// ZR 06.0 鍜� 08.0
+			// 鍥炲師鐐硅繍鍔ㄤ腑锛孼R06.0鍦�0鍜�1涓垏鎹紝鍥炲師鐐瑰畬鎴愶紝 08.0涓�1
+			// 瀹氫綅1
+			// ZR 06.1 鍜� 08.1
+			// ...
+			int b = 6 * 2;
+			m_nBtnsFlashState6 = ((BYTE)pData[b] | (BYTE)pData[b + 1] << 8);
+			m_nBtnsFlashState6 |= ((BYTE)pData[b + 2] << 16 | (BYTE)pData[b + 3] << 24);
+			m_nBtnsFlashState8 = ((BYTE)pData[b + 4] | (BYTE)pData[b + 5] << 8);
+			m_nBtnsFlashState8 |= ((BYTE)pData[b + 6] << 16 | (BYTE)pData[b + 7] << 24);
+
 			PostMessage(ID_MSG_UPDATA_DATA_TO_UI);
 		}
 	};
@@ -854,6 +869,18 @@
 	m_pBlBtns[BTN_JOG_OPR]->SetBkgndColor(BS_NORMAL, BTN_OPR_BKGND_NORMAL);
 	m_pBlBtns[BTN_JOG_OPR]->SetBkgndColor(BS_HOVER, BTN_OPR_BKGND_HOVER);
 	m_pBlBtns[BTN_JOG_OPR]->SetBkgndColor(BS_PRESS, BTN_OPR_BKGND_PRESS);
+	static UINT btnPointIds[] = { IDC_BUTTON_AXIS_ANCHOR_POINT1, IDC_BUTTON_AXIS_ANCHOR_POINT2,
+		IDC_BUTTON_AXIS_ANCHOR_POINT3, IDC_BUTTON_AXIS_ANCHOR_POINT4, IDC_BUTTON_AXIS_ANCHOR_POINT5};
+	for (int i = 0; i < 5; i++) {
+		m_pBlBtns[BTN_POINT1 + i]->SubclassDlgItem(btnPointIds[i], this);
+		m_pBlBtns[BTN_POINT1 + i]->SetFrameColor(BS_NORMAL, BTN_POINT_FRAME_NORMAL);
+		m_pBlBtns[BTN_POINT1 + i]->SetFrameColor(BS_HOVER, BTN_POINT_FRAME_HOVER);
+		m_pBlBtns[BTN_POINT1 + i]->SetFrameColor(BS_PRESS, BTN_POINT_FRAME_PRESS);
+		m_pBlBtns[BTN_POINT1 + i]->SetBkgndColor(BS_NORMAL, BTN_POINT_BKGND_NORMAL);
+		m_pBlBtns[BTN_POINT1 + i]->SetBkgndColor(BS_HOVER, BTN_POINT_BKGND_HOVER);
+		m_pBlBtns[BTN_POINT1 + i]->SetBkgndColor(BS_PRESS, BTN_POINT_BKGND_PRESS);
+	}
+
 
 	// 鍒濆鍖栧綋鍓嶉〉闈负绗竴椤�
 	m_currentPage = 1;
@@ -1143,6 +1170,7 @@
 	handleAxisOperation(AxisOperationType::POSITION_1, true);
 	Sleep(200);
 	handleAxisOperation(AxisOperationType::POSITION_1, false);
+	m_pBlBtns[BTN_POINT1]->Flash(1000);
 }
 
 void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint2()
@@ -1183,7 +1211,6 @@
 	handleAxisOperation(AxisOperationType::OPR, true);
 	Sleep(200);
 	handleAxisOperation(AxisOperationType::OPR, false);
-	m_pBlBtns[BTN_JOG_OPR]->Flash(1000);
 }
 
 void CAxisSettingsDlg::OnBnClickedButtonAxisTestStop()
@@ -1193,6 +1220,11 @@
 	Sleep(200);
 	handleAxisOperation(AxisOperationType::STOP, false);
 	m_pBlBtns[BTN_JOG_OPR]->StopFlash();
+	m_pBlBtns[BTN_POINT1]->StopFlash();
+	m_pBlBtns[BTN_POINT2]->StopFlash();
+	m_pBlBtns[BTN_POINT3]->StopFlash();
+	m_pBlBtns[BTN_POINT3]->StopFlash();
+	m_pBlBtns[BTN_POINT4]->StopFlash();
 }
 
 void CAxisSettingsDlg::OnBnClickedButtonAxisSev()
@@ -1298,6 +1330,82 @@
 		SetLabelColor(*m_pBlLabels[5], RGB(0, 180, 0));
 	}
 
+
+	// OPR鎸夐挳鏄惁瑕侀棯鐑佹垨鍋滄闂儊
+	// 06.0鍜�08.0
+	TRACE("m_nBtnsFlashState6  %x %x\n", m_nBtnsFlashState6, m_nBtnsFlashState8);
+	if (m_nBtnsFlashState6 & 0x01) {
+		// 06.0
+		if (!m_pBlBtns[BTN_JOG_OPR]->IsFlash()) {
+			m_pBlBtns[BTN_JOG_OPR]->Flash(1000);
+		}
+	}
+	else if (m_nBtnsFlashState8 & 0x01) {
+		if (m_pBlBtns[BTN_JOG_OPR]->IsFlash()) {
+			m_pBlBtns[BTN_JOG_OPR]->StopFlash();
+		}
+	}
+
+	int v = 0x02;
+	if (m_currentPage > 1) {
+		v = v << (5 * (m_currentPage - 1));
+	}
+
+	if (m_nBtnsFlashState6 & v) {
+		if (!m_pBlBtns[BTN_POINT1]->IsFlash()) {
+			m_pBlBtns[BTN_POINT1]->Flash(1000);
+		}
+	}
+	else if (m_nBtnsFlashState8 & v) {
+		if (m_pBlBtns[BTN_POINT1]->IsFlash()) {
+			m_pBlBtns[BTN_POINT1]->StopFlash();
+		}
+	}
+
+	if (m_nBtnsFlashState6 & (v << 1)) {
+		if (!m_pBlBtns[BTN_POINT2]->IsFlash()) {
+			m_pBlBtns[BTN_POINT2]->Flash(1000);
+		}
+	}
+	else if (m_nBtnsFlashState8 & (v << 1)) {
+		if (m_pBlBtns[BTN_POINT2]->IsFlash()) {
+			m_pBlBtns[BTN_POINT2]->StopFlash();
+		}
+	}
+
+	if (m_nBtnsFlashState6 & (v << 2)) {
+		if (!m_pBlBtns[BTN_POINT3]->IsFlash()) {
+			m_pBlBtns[BTN_POINT3]->Flash(1000);
+		}
+	}
+	else if (m_nBtnsFlashState8 & (v << 2)) {
+		if (m_pBlBtns[BTN_POINT3]->IsFlash()) {
+			m_pBlBtns[BTN_POINT3]->StopFlash();
+		}
+	}
+
+	if (m_nBtnsFlashState6 & (v << 3)) {
+		if (!m_pBlBtns[BTN_POINT4]->IsFlash()) {
+			m_pBlBtns[BTN_POINT4]->Flash(1000);
+		}
+	}
+	else if (m_nBtnsFlashState8 & (v << 3)) {
+		if (m_pBlBtns[BTN_POINT4]->IsFlash()) {
+			m_pBlBtns[BTN_POINT4]->StopFlash();
+		}
+	}
+
+	if (m_nBtnsFlashState6 & (v << 4)) {
+		if (!m_pBlBtns[BTN_POINT5]->IsFlash()) {
+			m_pBlBtns[BTN_POINT5]->Flash(1000);
+		}
+	}
+	else if (m_nBtnsFlashState8 & (v << 4)) {
+		if (m_pBlBtns[BTN_POINT5]->IsFlash()) {
+			m_pBlBtns[BTN_POINT5]->StopFlash();
+		}
+	}
+
 	return 0;
 }
 

--
Gitblit v1.9.3