From 35199ad4aaa3f35ff82da77d7108a4e9f136443e Mon Sep 17 00:00:00 2001
From: LAPTOP-T815PCOQ\25526 <mr.liuyang@126.com>
Date: 星期五, 06 十二月 2024 17:49:56 +0800
Subject: [PATCH] 1.修改配方管理模块,定位点等参数有最大值最小值 2.同步修改合并轴管理界面3.IO界面显示16个,16个为一组

---
 SourceCode/Bond/BondEq/ToolUnits.cpp |   50 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/BondEq/ToolUnits.cpp b/SourceCode/Bond/BondEq/ToolUnits.cpp
index 69be431..f9022f8 100644
--- a/SourceCode/Bond/BondEq/ToolUnits.cpp
+++ b/SourceCode/Bond/BondEq/ToolUnits.cpp
@@ -150,12 +150,12 @@
 	return (attributes != INVALID_FILE_ATTRIBUTES && (attributes & FILE_ATTRIBUTE_DIRECTORY));
 }
 
-double CToolUnits::toInt32(const char* pBuffer)
+int 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)
+int CToolUnits::toInt16(const char* pBuffer)
 {
 	return (pBuffer[0] & 0xff) | (pBuffer[1] & 0xff) << 8;
 }
@@ -195,6 +195,52 @@
 	return FALSE;
 }
 
+void CToolUnits::setBit(char* p, int index)
+{
+	int byteIndex = 0;
+	byte b = 0;
+	if (index >= 8) byteIndex = 1;
+	switch (index)
+	{
+	case 0:
+	case 8:
+		b = 0x1;
+		break;
+	case 1:
+	case 9:
+		b = 0x2;
+		break;
+	case 2:
+	case 0xA:
+		b = 0x4;
+		break;
+	case 3:
+	case 0xB:
+		b = 0x8;
+		break;
+	case 4:
+	case 0xC:
+		b = 0x10;
+		break;
+	case 5:
+	case 0xD:
+		b = 0x20;
+		break;
+	case 6:
+	case 0xE:
+		b = 0x40;
+		break;
+	case 7:
+	case 0xF:
+		b = 0x80;
+		break;
+	default:
+		break;
+	}
+
+	p[byteIndex] = b;
+}
+
 void CToolUnits::setDlgItemDouble(CWnd* pWnd, int nCtrlId, double value)
 {
 	CString strText;

--
Gitblit v1.9.3