From 83922105a8e09cd8c1fbb5833e370518513121f7 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 14 三月 2025 10:15:29 +0800
Subject: [PATCH] 1.Equipment在面板中显示机器信息(Alive, Name, CIM State, Upstream, Downstream等)

---
 SourceCode/Bond/Servo/CEquipment.cpp |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 3fa85bb..c66619b 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -137,6 +137,39 @@
 		return m_station;
 	}
 
+	void CEquipment::getAttributeVector(CAttributeVector& attrubutes)
+	{
+		attrubutes.clear();
+		attrubutes.addAttribute(new CAttribute("Network",
+			std::to_string(m_station.nNetNo).c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("Station",
+			std::to_string(m_station.nStNo).c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("ID",
+			std::to_string(m_nID).c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("Name",
+			m_strName.c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("Description",
+			m_strDescription.c_str(), ""));
+		attrubutes.addAttribute(new CAttribute("Alive",
+			this->isAlive() ? _T("TRUE") : _T("FALSE"), ""));
+		attrubutes.addAttribute(new CAttribute("CIM State",
+			m_bCimState ? _T("ON") : _T("OFF"), ""));
+		attrubutes.addAttribute(new CAttribute("Upstream",
+			m_bUpstreamInline ? _T("Inline") : _T("Offline"), ""));
+		attrubutes.addAttribute(new CAttribute("Downstream",
+			m_bDownstreamInline ? _T("Inline") : _T("Offline"), ""));
+		attrubutes.addAttribute(new CAttribute("Local Alarm",
+			m_bLocalAlarm ? _T("TRUE") : _T("FALSE"), ""));
+		attrubutes.addAttribute(new CAttribute("Auto Recipe Change",
+			m_bAutoRecipeChange ? _T("TRUE") : _T("FALSE"), ""));
+		char szTemp[256];
+		for (int i = 0; i < VCR_MAX; i++) {
+			sprintf_s(szTemp, 256, "VCR-%d", i + 1);
+			attrubutes.addAttribute(new CAttribute(szTemp,
+				m_bVCREnable[i] ? _T("Enable") : _T("Disable"), ""));
+		}
+	}
+
 	void CEquipment::setReadBitBlock(unsigned int start, unsigned int end)
 	{
 		m_blockReadBit.type = (unsigned int)DeviceType::B;

--
Gitblit v1.9.3