From 0a0b065a898ea5d87ae82bf39a745e76337fc8f5 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 10 九月 2025 15:19:16 +0800
Subject: [PATCH] 1.一些输出日志信息,更新等级; 2.CPath增加Slot信息; 3.WIP数据显示到列表控件; 4.调整Glass的Path信息文本输出;
---
SourceCode/Bond/Servo/CProcessData.cpp | 65 +++++++++++++++++++-------------
1 files changed, 38 insertions(+), 27 deletions(-)
diff --git a/SourceCode/Bond/Servo/CProcessData.cpp b/SourceCode/Bond/Servo/CProcessData.cpp
index bf9a8de..3f97b41 100644
--- a/SourceCode/Bond/Servo/CProcessData.cpp
+++ b/SourceCode/Bond/Servo/CProcessData.cpp
@@ -15,9 +15,24 @@
}
+ short CProcessData::getCassetteSequenceNo()
+ {
+ return m_nCassetteSequenceNo;
+ }
+
+ short CProcessData::getJobSequenceNo()
+ {
+ return m_nJobSequenceNo;
+ }
+
std::string& CProcessData::getGlassId()
{
return m_strGlassId;
+ }
+
+ void CProcessData::setGlassId(const char* pszId)
+ {
+ m_strGlassId = pszId;
}
std::string& CProcessData::getStartTime()
@@ -35,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)
@@ -52,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;
@@ -75,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;
}
@@ -95,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;
@@ -113,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;
@@ -134,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