From d68541dce155a682f65b7c3fbfbfbeef17ea5b8f Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 12 五月 2025 12:00:41 +0800
Subject: [PATCH] 1.StoredJob, Fetched out Job实现; 2.CStep增加定制的Attribute, 以便通过的Step不使用getAttributeVector也能添加不一样的Attribute;

---
 SourceCode/Bond/Servo/ToolUnits.cpp |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/ToolUnits.cpp b/SourceCode/Bond/Servo/ToolUnits.cpp
index 664f802..f3a88bc 100644
--- a/SourceCode/Bond/Servo/ToolUnits.cpp
+++ b/SourceCode/Bond/Servo/ToolUnits.cpp
@@ -2,6 +2,7 @@
 #include "ToolUnits.h"
 #include <chrono>
 #include <memory>
+#include <sstream>
 
 
 CToolUnits::CToolUnits()
@@ -301,4 +302,31 @@
 		ltm.tm_hour, ltm.tm_min, ltm.tm_sec);
 
 	return std::string(buffer);
+}
+
+bool CToolUnits::startsWith(const std::string& str, const std::string& prefix)
+{
+	return str.size() >= prefix.size() && str.compare(0, prefix.size(), prefix) == 0;
+}
+
+std::string& CToolUnits::toHexString(int value, std::string& strOut)
+{
+	std::stringstream ss;
+	ss << std::hex << value;
+	strOut = ss.str();
+
+	return strOut;
+}
+
+void CToolUnits::convertString(const char* pszBuffer, int size, std::string& strOut)
+{
+	strOut.clear();
+	int nLength = 0;
+	for (int i = 0; i < size; i++) {
+		if (pszBuffer[i] == '\0') break;
+		nLength++;
+	}
+	if (nLength > 0) {
+		strOut = std::string(pszBuffer, nLength);
+	}
 }
\ No newline at end of file

--
Gitblit v1.9.3