From 9d3e2ee8831bdd443bce96590fc023b8af5c790a Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 25 三月 2025 16:51:02 +0800
Subject: [PATCH] 1.为Glass增加移动路线记录,便于物料生产追踪,数据保存分析等;
---
SourceCode/Bond/Servo/CGlass.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index e9847f9..a21bd7b 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -5,12 +5,18 @@
namespace SERVO {
CGlass::CGlass()
{
-
+ m_pPath = nullptr;
}
CGlass::~CGlass()
{
-
+ CPath* pPath = m_pPath;
+ while (pPath != nullptr) {
+ CPath* pTemp = pPath->getNext();
+ delete pPath;
+ pPath = pTemp;
+ }
+ m_pPath = nullptr;
}
std::string& CGlass::getClassName()
@@ -39,18 +45,58 @@
return m_strID;
}
+ CPath* CGlass::getPathWithSiteID(unsigned int nSiteId)
+ {
+ CPath* pPath = m_pPath;
+ while (pPath != nullptr) {
+ if (nSiteId == pPath->getSiteID()) {
+ return pPath;
+ }
+ pPath = pPath->getNext();
+ }
+
+ return nullptr;
+ }
+
+ CPath* CGlass::getPath()
+ {
+ return m_pPath;
+ }
+
+ void CGlass::addPath(unsigned int nSiteId)
+ {
+ CPath* pPath = new CPath(nSiteId);
+ if (m_pPath == nullptr) {
+ m_pPath = pPath;
+ }
+ else {
+ m_pPath->addPath(pPath);
+ }
+ }
+
void CGlass::serialize(CArchive& ar)
{
if (ar.IsStoring())
{
Lock();
WriteString(ar, m_strID);
+ ar << (ULONGLONG)m_pPath;
+ if (m_pPath != nullptr) {
+ m_pPath->serialize(ar);
+ }
Unlock();
}
else
{
Lock();
ReadString(ar, m_strID);
+ ULONGLONG ullPath;
+ ar >> ullPath;
+ if (ullPath != 0) {
+ m_pPath = new CPath();
+ m_pPath->serialize(ar);
+ }
+
Unlock();
}
}
--
Gitblit v1.9.3