From 23c351be52a0567ac089b28e8f534c3ebf08b9a9 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 13 十一月 2025 16:33:57 +0800
Subject: [PATCH] 1.机器状态图由单个指示修改为多个指示器,代表是否有物料;

---
 SourceCode/Bond/Servo/CPageGraph2.cpp |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index cb4d449..d898004 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -64,10 +64,8 @@
 			if (RX_CODE_EQ_DATA_CHANGED == code) {
 				// 閫氱煡璁惧鐘舵��
 				SERVO::CEquipment* pEquipment = nullptr;
-				if (pAny->getPtrValue("ptr", (void*&)pEquipment)) {
-					if (pEquipment != nullptr) {
-						m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, pEquipment->hasGlass());
-					}
+				if (pAny->getPtrValue("ptr", (void*&)pEquipment) && pEquipment != nullptr) {
+					UpdateItemIndicators(pEquipment);
 				}
 			}
 
@@ -377,7 +375,20 @@
 		m_pEqsGraphWnd->AddPin(pItem, OUTPIN, outPin->getName().c_str(), (DWORD_PTR)outPin);
 	}
 
-	m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, pEquipment->hasGlass());
+	UpdateItemIndicators(pEquipment);
+}
+
+void CPageGraph2::UpdateItemIndicators(SERVO::CEquipment* pEquipment)
+{
+	for (int i = 0; i < SLOT_MAX; i++) {
+		auto pSlot = pEquipment->getSlot(i);
+
+		int state = 0;
+		if (pSlot->isEnable()) {
+			state = pSlot->getContext() != nullptr ? 1 : 2;
+		}
+		m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, state, i);
+	}
 }
 
 void CPageGraph2::OnTimer(UINT_PTR nIDEvent)

--
Gitblit v1.9.3