From 6c92ade0aeb6a505f2ab8108dcbdab20e37a9fac Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 28 一月 2026 21:29:47 +0800
Subject: [PATCH] 1.EQStatusChange事件上报
---
SourceCode/Bond/Servo/Model.cpp | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index e5afc98..2c1b261 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -813,11 +813,6 @@
// SubEqp events (per equipment, ignore slot distinction except payload)
static std::map<int, SERVO::PROCESS_STATE> s_prevSubEqpState;
- const auto prevEqState = s_prevSubEqpState[eqId];
- if (prevEqState != state) {
- // state change
- m_hsmsPassive.requestEventReportSend("SubEqpStateChange");
- }
if (state == SERVO::PROCESS_STATE::Processing) {
m_hsmsPassive.requestEventReportSend_SubEqpStart();
}
@@ -841,6 +836,16 @@
}
});
};
+ masterListener.onEqStatusChanged = [&](void* pMaster, SERVO::CEquipment* pEquipment, int unitId, int status, int reason) {
+ (void)pMaster;
+ if (pEquipment == nullptr) return;
+ m_hsmsPassive.withVariableLock([&] {
+ m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str());
+ m_hsmsPassive.setVariableValue("SubEqpSlot", unitId);
+ m_hsmsPassive.setVariableValue("EquipmentStatus", (__int64)status);
+ m_hsmsPassive.requestEventReportSend("SubEqpStateChange");
+ });
+ };
masterListener.onSVDataReport = [&](void* pMaster, SERVO::CEquipment* pEquipment, const std::vector<CParam>& params) {
(void)pMaster;
const int eqId = pEquipment ? pEquipment->getID() : 0;
--
Gitblit v1.9.3