From be5a6792464eb0722a387b0ab74722d19c9a4a17 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 09 九月 2025 09:37:16 +0800
Subject: [PATCH] 1.Glass增加对应数据库字段的接口;
---
SourceCode/Bond/Servo/CGlass.cpp | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index ac69f80..493ba8d 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -107,6 +107,25 @@
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)
{
CPath* pTemp = m_pPath;
@@ -379,4 +398,23 @@
{
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