From 570e812442a64360239f558ae4b55c0d204a5523 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期五, 09 一月 2026 11:57:06 +0800
Subject: [PATCH] 1.继续完善通讯;
---
SourceCode/Bond/Servo/CMaster.cpp | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 0ab057f..0192312 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -1540,7 +1540,7 @@
unlock();
}
};
- listener.onProcessStateChanged = [&](void* pEquipment, int slotNo, PROCESS_STATE state) -> void {
+ listener.onProcessStateChanged = [&](void* pEquipment, int slotNo, PROCESS_STATE prevState, PROCESS_STATE state) -> void {
ASSERT(1 <= slotNo && slotNo <= 8);
int eqid = ((CEquipment*)pEquipment)->getID();
CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(slotNo);
@@ -1558,7 +1558,7 @@
}
if (m_listener.onProcessStateChanged != nullptr) {
- m_listener.onProcessStateChanged(this, (CEquipment*)pEquipment, slotNo, state);
+ m_listener.onProcessStateChanged(this, (CEquipment*)pEquipment, slotNo, prevState, state);
}
};
listener.onMapMismatch = [&](void* pEquipment, short scanMap, short downMap) {
@@ -2115,8 +2115,9 @@
}
};
auto fireProcessState = [&](SERVO::CEquipment* pEq, int slotNo, SERVO::PROCESS_STATE st) {
- if (m_listener.onProcessStateChanged != nullptr && pEq != nullptr) {
- m_listener.onProcessStateChanged(this, pEq, slotNo, st);
+ // Drive equipment state so listeners receive prev/current states consistently.
+ if (pEq != nullptr) {
+ pEq->fireSetProcessState(slotNo, st);
}
};
--
Gitblit v1.9.3