From 74401edd0fb47294538d7253ad15e6a8d3d1fc5a Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 27 六月 2025 09:00:43 +0800
Subject: [PATCH] 1. 防止定时器重复刷新手臂的状态 2. 手臂显示的位置通过配置文件读取

---
 SourceCode/Bond/Servo/CMaster.cpp |   40 ++++++++++++----------------------------
 1 files changed, 12 insertions(+), 28 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 6498901..9cbcbd7 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -540,8 +540,10 @@
 
 
 				// Measurement -> LoadPort
-				LOGI("Arm1 %s, Arm2 %s.", rmd.armState[0] ? _T("不可用") : _T("可用"), 
-					rmd.armState[1] ? _T("不可用") : _T("可用"));
+				if (rmd.armState[0] || rmd.armState[1]) {
+					LOGI("Arm1 %s, Arm2 %s.", rmd.armState[0] ? _T("不可用") : _T("可用"),
+						rmd.armState[1] ? _T("不可用") : _T("可用"));
+				}
 				CLoadPort* pEqLoadPort[] = { pLoadPort1, pLoadPort2, pLoadPort3, pLoadPort4 };
 				CEquipment* pEqTar[] = { pVacuumBake, pFliper };
 				if (primaryType == MaterialsType::G2) {
@@ -777,11 +779,12 @@
 			for (auto item : m_listEquipment) {
 				const StationIdentifier& station = item->getStation();
 				MemoryBlock& block = item->getReadBitBlock();
-
-				int nRet = m_cclink.ReadData2(station, (DeviceType)block.type,
-					block.start, block.size, block.buffer);
-				if (0 == nRet) {
-					item->onReceiveLBData(block.buffer, block.size);
+				if (block.end > block.start) {
+					int nRet = m_cclink.ReadData2(station, (DeviceType)block.type,
+						block.start, block.size, block.buffer);
+					if (0 == nRet) {
+						item->onReceiveLBData(block.buffer, block.size);
+					}
 				}
 			}
 		}
@@ -1026,7 +1029,7 @@
 		pEquipment->setBaseAlarmId(BASE_ALARM_EFEM);
 		pEquipment->setName("Fliper(G2)");
 		pEquipment->setDescription("Fliper(G2).");
-		pEquipment->setReadBitBlock(0x4000, 0x45ff);
+		pEquipment->setReadBitBlock(0x0, 0x0);
 		pEquipment->setStation(0, 255);
 		addToEquipmentList(pEquipment);
 
@@ -1061,7 +1064,7 @@
 		pEquipment->setBaseAlarmId(BASE_ALARM_EFEM);
 		pEquipment->setName("Aligner");
 		pEquipment->setDescription("Aligner.");
-		pEquipment->setReadBitBlock(0x4000, 0x45ff);
+		pEquipment->setReadBitBlock(0x0, 0x0);
 		pEquipment->setStation(0, 255);
 		addToEquipmentList(pEquipment);
 
@@ -1188,27 +1191,8 @@
 		}
 
 
-		// 按一定频率扫描LB数据
 		static int i = 0;
 		i++;
-		/*
-		if (i % (4 * 1) == 0) {
-
-			for (auto item : m_listEquipment) {
-				if (item->getID() == EQ_ID_Bonder1) {
-					const StationIdentifier& station = item->getStation();
-					MemoryBlock& block = item->getReadBitBlock();
-
-					int nRet = m_cclink.ReadData2(station, (DeviceType)block.type,
-						block.start, block.size, block.buffer);
-					if (0 == nRet) {
-						item->onReceiveLBData(block.buffer, block.size);
-					}
-				}
-			}
-		}
-		*/
-
 
 		// 自动保存缓存
 		if (i % (4 * 2) == 0) {

--
Gitblit v1.9.3