From a79fcf6a937e1bfe57014d2c99f1bb9f98bfa892 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 10 二月 2026 10:20:17 +0800
Subject: [PATCH] 1.完善日志; 2.背景图表配置 3.更改EAP通讯端口和设备名;

---
 SourceCode/Bond/Servo/CPortStatusReport.cpp |   33 ++++++++++++++++++++++-----------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/SourceCode/Bond/Servo/CPortStatusReport.cpp b/SourceCode/Bond/Servo/CPortStatusReport.cpp
index e132f12..a3cafdd 100644
--- a/SourceCode/Bond/Servo/CPortStatusReport.cpp
+++ b/SourceCode/Bond/Servo/CPortStatusReport.cpp
@@ -10,6 +10,7 @@
 	{
 		m_nPortStatus = 0;
 		m_nCassetteSequenceNo = 0;
+		memset(m_nJobExistenceSlot, 0, sizeof(m_nJobExistenceSlot));
 		m_nLoadingCassetteType = 0;
 		m_nQTimeFlag = 0;
 		m_nCassetteMappingState = 0;
@@ -27,11 +28,9 @@
 		m_nCassetteSequenceNo = other.m_nCassetteSequenceNo;
 		m_strCassetteID = other.m_strCassetteID;
 
-		// Job Existence Slot
-		if (PORT_INUSE == m_nPortStatus) {
-			for (int i = 0; i < 12; i++) {
-				m_nJobExistenceSlot[i] = other.m_nJobExistenceSlot[i];
-			}
+		// Job Existence Slot: always copy to avoid stale/uninitialized map
+		for (int i = 0; i < 12; i++) {
+			m_nJobExistenceSlot[i] = other.m_nJobExistenceSlot[i];
 		}
 
 		if (!m_strCassetteID.empty()) {
@@ -49,6 +48,11 @@
 	short CPortStatusReport::getPortStatus()
 	{
 		return m_nPortStatus;
+	}
+
+	void CPortStatusReport::setPortStatus(short status)
+	{
+		m_nPortStatus = status;
 	}
 
 	short CPortStatusReport::getCassetteSequenceNo()
@@ -96,7 +100,7 @@
 		memcpy(&pszBuffer[index], m_strCassetteID.c_str(), strLen);
 		index += 20;
 
-		memcpy(&pszBuffer[index], &m_nJobExistenceSlot[0], sizeof(short));
+		memcpy(&pszBuffer[index], &m_nJobExistenceSlot[0], sizeof(short) * 12);
 		index += 12 * sizeof(short);
 
 		memcpy(&pszBuffer[index], &m_nLoadingCassetteType, sizeof(short));
@@ -128,11 +132,8 @@
 		CToolUnits::convertString(&pszBuffer[index], 20, m_strCassetteID);
 		index += 20;
 
-		memcpy(&m_nJobExistenceSlot[0], &pszBuffer[index], sizeof(short));
+		memcpy(&m_nJobExistenceSlot[0], &pszBuffer[index], sizeof(short) * 12);
 		index += 12 * sizeof(short);
-
-		memcpy(&m_nLoadingCassetteType, &pszBuffer[index], sizeof(short));
-		index += sizeof(short);
 
 		memcpy(&m_nLoadingCassetteType, &pszBuffer[index], sizeof(short));
 		index += sizeof(short);
@@ -146,7 +147,7 @@
 		memcpy(&m_nCassetteStatus, &pszBuffer[index], sizeof(short));
 		index += sizeof(short);
 
-		return 15 * 2;
+		return 32 * 2;
 	}
 
 	void CPortStatusReport::getAttributeVector(CAttributeVector& attrubutes, int beginWeight)
@@ -242,6 +243,16 @@
 		return m_nJobExistenceSlot[0];
 	}
 
+	void CPortStatusReport::setJobExistenceSlot(short map)
+	{
+		m_nJobExistenceSlot[0] = map;
+	}
+
+	void CPortStatusReport::setCassetteId(const char* pszId)
+	{
+		m_strCassetteID = pszId;
+	}
+
 	void CPortStatusReport::WriteString(CArchive& ar, std::string& string)
 	{
 		CString strTemp = string.c_str();

--
Gitblit v1.9.3