From 0239509af412b74083b33a6924ffd79007dfda5f Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 18 十一月 2024 10:41:13 +0800
Subject: [PATCH] 1.轴对话框,当前参数读取和显示;

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

diff --git a/SourceCode/Bond/BondEq/ToolUnits.cpp b/SourceCode/Bond/BondEq/ToolUnits.cpp
index fecc6c1..3c65c30 100644
--- a/SourceCode/Bond/BondEq/ToolUnits.cpp
+++ b/SourceCode/Bond/BondEq/ToolUnits.cpp
@@ -145,3 +145,20 @@
 	DWORD attributes = GetFileAttributes(path.c_str());
 	return (attributes != INVALID_FILE_ATTRIBUTES && (attributes & FILE_ATTRIBUTE_DIRECTORY));
 }
+
+double CToolUnits::toInt32(const char* pBuffer)
+{
+	return (pBuffer[0] & 0xff) | (pBuffer[1] & 0xff) << 8 | (pBuffer[2] & 0xff) << 16 | (pBuffer[3] & 0xff) << 24;
+}
+
+double CToolUnits::toInt16(const char* pBuffer)
+{
+	return (pBuffer[0] & 0xff) | (pBuffer[1] & 0xff) << 8;
+}
+
+void CToolUnits::setDlgItemDouble(CWnd* pWnd, int nCtrlId, double value)
+{
+	CString strText;
+	strText.Format(_T("%.03f"), value);
+	pWnd->SetDlgItemText(nCtrlId, strText);
+}

--
Gitblit v1.9.3