From 4d64ab743909caa1860253e6054da8d249aad814 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 09 九月 2025 10:04:20 +0800
Subject: [PATCH] 1.VCR事件更新GlassID
---
SourceCode/Bond/Servo/CGlass.cpp | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 49 insertions(+), 1 deletions(-)
diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index 974859c..493ba8d 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -16,7 +16,7 @@
CGlass::~CGlass()
{
-
+ reset();
}
void CGlass::reset()
@@ -105,6 +105,25 @@
CPath* CGlass::getPath()
{
return m_pPath;
+ }
+
+ std::string CGlass::getPathDescription()
+ {
+ std::string strOut, strPath;
+ char szBuffer[256];
+
+ CPath* pTemp = m_pPath;
+ while (pTemp != nullptr) {
+ pTemp->getSimpleDescription(strPath);
+ strOut.append(strPath);
+
+ pTemp = pTemp->getNext();
+ if (pTemp != nullptr) {
+ strOut.append(" -> ");
+ }
+ }
+
+ return strOut;
}
CPath* CGlass::getPathWithEq(unsigned int nEqId, unsigned int nUnit)
@@ -369,4 +388,33 @@
{
m_tEnd = std::chrono::system_clock::now();
}
+
+ void CGlass::addParams(std::vector<CParam>& params)
+ {
+ m_params.insert(m_params.end(), params.begin(), params.end());
+ }
+
+ std::vector<CParam>& CGlass::getParams()
+ {
+ return m_params;
+ }
+
+ std::string CGlass::getParamsDescription()
+ {
+ std::string strOut;
+
+ char szBuffer[256];
+ for (auto p : m_params) {
+ if (!strOut.empty()) strOut.append(",");
+ if (p.getValueType() == PVT_INT) {
+ sprintf_s(szBuffer, 256, "%s:%d", p.getName().c_str(), p.getIntValue());
+ }
+ else if (p.getValueType() == PVT_DOUBLE) {
+ sprintf_s(szBuffer, 256, "%s:%f", p.getName().c_str(), p.getDoubleValue());
+ }
+ strOut.append(szBuffer);
+ }
+
+ return strOut;
+ }
}
--
Gitblit v1.9.3