From d6fabead748c80e2dd5e2ec55b55e01daed1f3c3 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 09 九月 2025 11:37:50 +0800
Subject: [PATCH] 1.修改Bonder的SVData数据解释,其中一项压力有符号,增加一个加热剩余时间; 2.SVData解释偏移错误修复
---
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