From 83f2a98df3e60f7408f68fae7a1be8278968ee55 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期一, 10 十一月 2025 11:24:12 +0800
Subject: [PATCH] 1.绑定玻璃SV数据修正;
---
SourceCode/Bond/Servo/CJobDataB.cpp | 32 ++++++++++++++++++++++++++++----
1 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/SourceCode/Bond/Servo/CJobDataB.cpp b/SourceCode/Bond/Servo/CJobDataB.cpp
index c269779..7622790 100644
--- a/SourceCode/Bond/Servo/CJobDataB.cpp
+++ b/SourceCode/Bond/Servo/CJobDataB.cpp
@@ -8,11 +8,35 @@
{
m_nCassetteSequenceNo = 0;
m_nJobSequenceNo = 0;
+ m_pOwner = nullptr;
+ }
+
+ CJobDataB::CJobDataB(CJobDataB&& other) noexcept
+ {
+ copy(&other);
}
CJobDataB::~CJobDataB()
{
+ }
+
+ void CJobDataB::copy(CJobDataB* pScr)
+ {
+ m_nCassetteSequenceNo = pScr->m_nCassetteSequenceNo;
+ m_nJobSequenceNo = pScr->m_nJobSequenceNo;
+ m_strGlassId = pScr->m_strGlassId;
+ m_pOwner = pScr->m_pOwner;
+ }
+
+ void* CJobDataB::getOwner()
+ {
+ return m_pOwner;
+ }
+
+ void CJobDataB::setOwner(void* pOwner)
+ {
+ m_pOwner = pOwner;
}
int CJobDataB::getCassetteSequenceNo()
@@ -47,7 +71,7 @@
int CJobDataB::serialize(char* pszBuffer, int nBufferSize)
{
- if (nBufferSize < 28) return -1;
+ if (nBufferSize < JOBDATAB_SIZE) return -1;
int index = 0;
memcpy(&pszBuffer[index], &m_nCassetteSequenceNo, sizeof(short));
@@ -60,12 +84,12 @@
memcpy(&pszBuffer[index], m_strGlassId.c_str(), strLen);
index += 20;
- return 14 * 2;
+ return JOBDATAB_SIZE;
}
- int CJobDataB::unserialize(char* pszBuffer, int nBufferSize)
+ int CJobDataB::unserialize(const char* pszBuffer, int nBufferSize)
{
- if (nBufferSize < 14) return -1;
+ if (nBufferSize < 14 * 2) return -1;
int index = 0;
memcpy(&m_nCassetteSequenceNo, &pszBuffer[index], sizeof(short));
--
Gitblit v1.9.3