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 |   34 ++++++++--------------------------
 1 files changed, 8 insertions(+), 26 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 5023f98..9cbcbd7 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -779,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);
+					}
 				}
 			}
 		}
@@ -1028,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);
 
@@ -1063,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);
 
@@ -1190,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