From 3cb4638bcb93a8fdf4cfea140025bbc299d35d47 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 18 十一月 2025 17:02:07 +0800
Subject: [PATCH] 1.权限完善。操作日志等

---
 SourceCode/Bond/Servo/CProcessData.cpp |   60 +++++++++++++++++++++++++++++++++---------------------------
 1 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/SourceCode/Bond/Servo/CProcessData.cpp b/SourceCode/Bond/Servo/CProcessData.cpp
index ed5a5aa..3f97b41 100644
--- a/SourceCode/Bond/Servo/CProcessData.cpp
+++ b/SourceCode/Bond/Servo/CProcessData.cpp
@@ -15,6 +15,16 @@
 
 	}
 
+	short CProcessData::getCassetteSequenceNo()
+	{
+		return m_nCassetteSequenceNo;
+	}
+
+	short CProcessData::getJobSequenceNo()
+	{
+		return m_nJobSequenceNo;
+	}
+
 	std::string& CProcessData::getGlassId()
 	{
 		return m_strGlassId;
@@ -40,14 +50,9 @@
 		return m_nTotalParameter;
 	}
 
-	const std::list<std::string>& CProcessData::getParameters()
+	std::vector<uint8_t>& CProcessData::getParamsRawData()
 	{
-		return m_params;
-	}
-
-	void CProcessData::getParameters(std::list<std::string>& list)
-	{
-		std::copy(m_params.begin(), m_params.end(), std::back_inserter(list));
+		return m_paramsRawData;
 	}
 
 	int CProcessData::serialize(char* pszBuffer, int nBufferSize)
@@ -57,6 +62,12 @@
 		// 解释数据
 		// Glass ID
 		int index = 0;
+		memcpy(&pszBuffer[index], &m_nCassetteSequenceNo, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nJobSequenceNo, sizeof(short));
+		index += sizeof(short);
+
 		CToolUnits::convertString(&pszBuffer[index], 10 * 2, m_strGlassId);
 		index += 10 * 2;
 
@@ -80,17 +91,9 @@
 		m_nCurrentGroup = (unsigned int)CToolUnits::toInt16(&pszBuffer[index]);
 		index += 2;
 
-		// param list(0x1881~0x1a74), 共1000 bytes, 20个字符为一个参数, 50组
-		// 最后一group可能不满足50, 以m_nTotalParameter为依据
-		int size = (m_nCurrentGroup == m_nTotalGroup) ? m_nTotalParameter % 50 : 50;
-		for (int i = 0; i < size; i++) {
-			std::string strParam;
-			CToolUnits::convertString(&pszBuffer[index], 20, strParam);
-			if (!strParam.empty()) {
-				m_params.push_back(strParam);
-			}
-			index += 20;
-		}
+		// 解释数据
+
+
 
 		return 538 * 2;
 	}
@@ -100,6 +103,12 @@
 		if (nBufferSize < 538 * 2) return -1;
 
 		int index = 0;
+		memcpy(&m_nCassetteSequenceNo, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nJobSequenceNo, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
 		CToolUnits::convertString(&pszBuffer[index], 10 * 2, m_strGlassId);
 		index += 10 * 2;
 
@@ -118,7 +127,12 @@
 		memcpy(&m_nCurrentGroup, &pszBuffer[index], sizeof(short));
 		index += sizeof(short);
 
-		// 多分组如何处理?待考虑
+		// 参数原始数据
+		m_paramsRawData.clear();
+		m_paramsRawData.insert(
+			m_paramsRawData.end(),
+			reinterpret_cast<const uint8_t*>(&pszBuffer[index]),
+			reinterpret_cast<const uint8_t*>(&pszBuffer[index]) + 500);
 
 
 		return 538 * 2;
@@ -139,13 +153,5 @@
 			std::to_string(m_nTotalGroup).c_str(), "", weight++));
 		attrubutes.addAttribute(new CAttribute("Current Group",
 			std::to_string(m_nCurrentGroup).c_str(), "", weight++));
-
-		char szName[256];
-		int index = 0;
-		for (auto item : m_params) {
-			sprintf_s(szName, 256, "Parameter %d", ++index);
-			attrubutes.addAttribute(new CAttribute(szName,
-				item.c_str(), "", weight++));
-		}
 	}
 }
\ No newline at end of file

--
Gitblit v1.9.3