From 2070871df480a664c9c4e38bc4e4e324682a64c6 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期四, 03 四月 2025 16:12:28 +0800
Subject: [PATCH] 1. 解决 WebView2 控制器创建失败时闪退的问题 2. 解决连接图销毁时保存设备图形数据闪退的问题

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

diff --git a/SourceCode/Bond/Servo/ToolUnits.cpp b/SourceCode/Bond/Servo/ToolUnits.cpp
index 664f802..b32362a 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,18 @@
 		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;
 }
\ No newline at end of file

--
Gitblit v1.9.3