From 1e8e3473cb124f9e51dfc1ca35e5cb13b1668bdc Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期六, 10 五月 2025 10:46:19 +0800
Subject: [PATCH] 1.重命名类名称和文件名;

---
 SourceCode/Bond/Servo/CJobDataS.cpp |  218 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 217 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/CJobDataS.cpp b/SourceCode/Bond/Servo/CJobDataS.cpp
index f474931..0b2b4f7 100644
--- a/SourceCode/Bond/Servo/CJobDataS.cpp
+++ b/SourceCode/Bond/Servo/CJobDataS.cpp
@@ -1,5 +1,6 @@
 #include "stdafx.h"
 #include "CJobDataS.h"
+#include "ToolUnits.h"
 
 
 namespace SERVO {
@@ -94,7 +95,7 @@
 
 	std::string& CJobDataS::getGlass2Id()
 	{
-		return m_strGlass1Id;
+		return m_strGlass2Id;
 	}
 
 	void CJobDataS::setGlass2Id(const char* pszId)
@@ -327,4 +328,219 @@
 	{
 		m_nTargetSlotNo = no;
 	}
+
+	int CJobDataS::serialize(char* pszBuffer, int nBufferSize)
+	{
+		if (nBufferSize < 256 * 2) return -1;
+
+		int index = 0;
+		memcpy(&pszBuffer[index], &m_nCassetteSequenceNo, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nJobSequenceNo, sizeof(short));
+		index += sizeof(short);
+
+		int strLen = min(40, m_strLotId.size());
+		memcpy(&pszBuffer[index], m_strLotId.c_str(), strLen);
+		index += 40;
+
+		strLen = min(20, m_strProductId.size());
+		memcpy(&pszBuffer[index], m_strProductId.c_str(), strLen);
+		index += 20;
+
+		strLen = min(20, m_strOperationId.size());
+		memcpy(&pszBuffer[index], m_strOperationId.c_str(), strLen);
+		index += 20;
+
+		strLen = min(20, m_strGlass1Id.size());
+		memcpy(&pszBuffer[index], m_strGlass1Id.c_str(), strLen);
+		index += 20;
+
+		strLen = min(20, m_strGlass2Id.size());
+		memcpy(&pszBuffer[index], m_strGlass2Id.c_str(), strLen);
+		index += 20;
+
+		memcpy(&pszBuffer[index], &m_nJobType, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nMaterialsType, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nProductType, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nDummyType, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nSkipFlag, sizeof(int));
+		index += sizeof(int);
+		
+		memcpy(&pszBuffer[index], &m_nProcessFlag, sizeof(int));
+		index += sizeof(int);
+
+		memcpy(&pszBuffer[index], &m_nProcessResonCode, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nLastGlassFlag, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nFirstGlassFlag, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nLastGlassFlag, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nQTime[0], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nQTime[1], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nQTime[2], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nQTimeOverFlag, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nMasterRecipe, sizeof(short));
+		index += sizeof(short);
+
+		strLen = min(10, m_strProductRecipeId.size());
+		memcpy(&pszBuffer[index], m_strProductRecipeId.c_str(), strLen);
+		index += 10;
+
+		strLen = min(10, m_strPCode.size());
+		memcpy(&pszBuffer[index], m_strPCode.c_str(), strLen);
+		index += 10;
+
+		strLen = min(10, m_strUseType.size());
+		memcpy(&pszBuffer[index], m_strUseType.c_str(), strLen);
+		index += 10;
+
+		strLen = min(80, m_strPanelMeasure.size());
+		memcpy(&pszBuffer[index], m_strPanelMeasure.c_str(), strLen);
+		index += 80;
+
+		memcpy(&pszBuffer[index], &m_nMode, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nSlotUnitSelectFlag, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nSourcePortNo, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nSourceSlotNo, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nTargetPortNo, sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&pszBuffer[index], &m_nTargetSlotNo, sizeof(short));
+		index += sizeof(short);
+
+		return 256 * 2;
+	}
+
+	int CJobDataS::unserialize(const char* pszBuffer, int nBufferSize)
+	{
+		if (nBufferSize < 256 * 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], 40, m_strLotId);
+		index += 40;
+
+		CToolUnits::convertString(&pszBuffer[index], 20, m_strProductId);
+		index += 20;
+
+		CToolUnits::convertString(&pszBuffer[index], 20, m_strOperationId);
+		index += 20;
+
+		CToolUnits::convertString(&pszBuffer[index], 20, m_strGlass1Id);
+		index += 20;
+
+		CToolUnits::convertString(&pszBuffer[index], 20, m_strGlass2Id);
+		index += 20;
+
+		memcpy(&m_nJobType, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nMaterialsType, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nProductType, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nDummyType, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nSkipFlag, &pszBuffer[index], sizeof(int));
+		index += sizeof(int);
+
+		memcpy(&m_nProcessFlag, &pszBuffer[index], sizeof(int));
+		index += sizeof(int);
+
+		memcpy(&m_nProcessResonCode, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nLastGlassFlag, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nFirstGlassFlag, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nQTime[0], &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nQTime[1], &pszBuffer[index], sizeof(short));
+		index += sizeof(int);
+
+		memcpy(&m_nQTime[2], &pszBuffer[index], sizeof(int));
+		index += sizeof(short);
+
+		memcpy(&m_nQTimeOverFlag, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nMasterRecipe, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		CToolUnits::convertString(&pszBuffer[index], 10, m_strProductRecipeId);
+		index += 10;
+
+		CToolUnits::convertString(&pszBuffer[index], 10, m_strProductRecipeId);
+		index += 10;
+
+		CToolUnits::convertString(&pszBuffer[index], 10, m_strProductRecipeId);
+		index += 10;
+
+		CToolUnits::convertString(&pszBuffer[index], 80, m_strProductRecipeId);
+		index += 80;
+
+		memcpy(&m_nMode, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nSlotUnitSelectFlag, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nSourcePortNo, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nSourceSlotNo, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nTargetPortNo, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+		memcpy(&m_nTargetSlotNo, &pszBuffer[index], sizeof(short));
+		index += sizeof(short);
+
+
+		return 256 * 2;
+	}
 }

--
Gitblit v1.9.3