From f2ec2ff2640e8f02507e6fa44cd1ba1487a303ea Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 21 二月 2025 09:15:43 +0800
Subject: [PATCH] 1.定义派生于CStep的类CEqModeStep,用于处理设备模式改变的事件。

---
 SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h |   62 +++++++++++++++++--------------
 1 files changed, 34 insertions(+), 28 deletions(-)

diff --git a/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h b/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h
index 903ca41..07a4b32 100644
--- a/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h
+++ b/SourceCode/Bond/Servo/CCLinkPerformance/PerformanceMelsec.h
@@ -28,7 +28,7 @@
 #define CC_LINK_IE_FIELD_CHANNEL(x) (180 + (x))   // x 鑼冨洿锛�1~4
 #define CC_LINK_IE_TSN_CHANNEL(x) (280 + (x))     // x 鑼冨洿锛�1~4
 
-// 鑷畾涔夐敊璇爜
+ // 鑷畾涔夐敊璇爜
 #define ERROR_CODE_UNKNOWN				0x00010000 // 鏈煡
 #define ERROR_CODE_NOT_CONNECTED		0x00020000 // 鏈繛鎺�
 #define ERROR_CODE_INVALID_PARAM		0x00030000 // 鍙傛暟鏃犳晥
@@ -117,20 +117,20 @@
 	SPB = 0x0032,	 // 缂撳啿瀛樺偍鍣� (瀛�)
 	MAIL = 0x0065,   // 鐗规畩杞厓浠剁被鍨嬶細閭欢绫诲瀷 (10杩涘埗 101)
 	MAILMC = 0x0066, // 鐗规畩杞厓浠剁被鍨嬶細鏃犵‘璁ら偖浠� (10杩涘埗 102)
-	LX = 0x03E9,     // 閾炬帴鐩存帴杞厓浠� (閾炬帴杈撳叆) (0x03E9锝�0x04E7) (浣�)
-	LY = 0x07D1,     // 閾炬帴鐩存帴杞厓浠� (閾炬帴杈撳嚭) (0x07D1锝�0x08CF) (浣�)
-	LB = 0x59D9,     // 閾炬帴鐩存帴杞厓浠� (閾炬帴缁х數鍣�) (0x59D9锝�0x5AD7) (浣�)
-	LW = 0x5DC1,     // 閾炬帴鐩存帴杞厓浠� (閾炬帴瀵勫瓨鍣�) (0x5DC1锝�0x5EBF) (瀛�)
-	LSB = 0x61A9,    // 閾炬帴鐩存帴杞厓浠� (閾炬帴鐗规畩缁х數鍣�) (0x61A9锝�0x62A7) (浣�)
-	LSW = 0x6D61,    // 閾炬帴鐩存帴杞厓浠� (閾炬帴鐗规畩瀵勫瓨鍣�) (0x6D61锝�0x6E5F) (瀛�)
-	SPG = 0x7148,    // 鏅鸿兘鍔熻兘妯″潡杞厓浠� (0x7148锝�0x7247) (瀛�)
+	LX = 0x03E8,     // 閾炬帴鐩存帴杞厓浠� (閾炬帴杈撳叆) (0x03E9锝�0x04E7) (浣�)
+	LY = 0x07D0,     // 閾炬帴鐩存帴杞厓浠� (閾炬帴杈撳嚭) (0x07D1锝�0x08CF) (浣�)
+	LB = 0x59D8,     // 閾炬帴鐩存帴杞厓浠� (閾炬帴缁х數鍣�) (0x59D9锝�0x5AD7) (浣�)
+	LW = 0x5DC0,     // 閾炬帴鐩存帴杞厓浠� (閾炬帴瀵勫瓨鍣�) (0x5DC1锝�0x5EBF) (瀛�)
+	LSB = 0x61A8,    // 閾炬帴鐩存帴杞厓浠� (閾炬帴鐗规畩缁х數鍣�) (0x61A9锝�0x62A7) (浣�)
+	LSW = 0x6D60,    // 閾炬帴鐩存帴杞厓浠� (閾炬帴鐗规畩瀵勫瓨鍣�) (0x6D61锝�0x6E5F) (瀛�)
+	SPG = 0x7147,    // 鏅鸿兘鍔熻兘妯″潡杞厓浠� (0x7148锝�0x7247) (瀛�)
 };
 
 // 鏁版嵁绫诲瀷
 enum class DataType {
 	BIT = 1,   // 浣� (1浣�)
 	WORD = 2,  // 瀛� (16浣�)
-	DWORD =4   // 鍙屽瓧 (32浣�)
+	DWORD = 4  // 鍙屽瓧 (32浣�)
 };
 
 // 鎺у埗浠g爜
@@ -180,28 +180,34 @@
 	 * 1~239 琛ㄧず鏅�氱綉缁滃彿
 	 **/
 
-	/*
-	 * [Station No.]
-	 * MELSECNET/H锛�1~64 琛ㄧず鍏朵粬绔欑偣锛�255 琛ㄧず鏈珯
-	 * CC-Link 绯诲垪缃戠粶鐨勮寖鍥寸被浼硷紝鍖哄埆鍦ㄤ簬绔欏彿鐨勫彇鍊艰寖鍥�
-	 * MELSECNET/H             : 1~64(Other stations),255(Own station)
-	 * CC-Link                 : 0~63(Other stations),255(Own station)
-	 * CC-Link IE Controller   : 1~120(Other stations),255(Own station)
-	 * CC-Link IE Field        : 0~120(Other stations),255(Own station)
-	 * CC-Link IE TSN          : 0~120(Other stations),255(Own station)
-	 **/
+	 /*
+	  * [Station No.]
+	  * MELSECNET/H锛�1~64 琛ㄧず鍏朵粬绔欑偣锛�255 琛ㄧず鏈珯
+	  * CC-Link 绯诲垪缃戠粶鐨勮寖鍥寸被浼硷紝鍖哄埆鍦ㄤ簬绔欏彿鐨勫彇鍊艰寖鍥�
+	  * MELSECNET/H             : 1~64(Other stations),255(Own station)
+	  * CC-Link                 : 0~63(Other stations),255(Own station)
+	  * CC-Link IE Controller   : 1~120(Other stations),255(Own station)
+	  * CC-Link IE Field        : 0~120(Other stations),255(Own station)
+	  * CC-Link IE TSN          : 0~120(Other stations),255(Own station)
+	  **/
 
-	/*
-	 * 楂� 8 浣嶏紙缃戠粶鍙凤級锛� 鎸囧畾璁惧鎵�灞炵殑缃戠粶
-	 * 浣� 8 浣嶏紙绔欑偣鍙凤級锛� 鎸囧畾璁惧鍦ㄧ綉缁滀腑鐨勭紪鍙�
-	 * 鐢ㄤ竴涓弬鏁颁紶閫掕澶囩殑缃戠粶鍙峰拰绔欑偣鍙锋椂: nSt = station.nStNo | ((station.nNetNo << 8) & 0xFF00);
-	 **/
+	  /*
+	   * 楂� 8 浣嶏紙缃戠粶鍙凤級锛� 鎸囧畾璁惧鎵�灞炵殑缃戠粶
+	   * 浣� 8 浣嶏紙绔欑偣鍙凤級锛� 鎸囧畾璁惧鍦ㄧ綉缁滀腑鐨勭紪鍙�
+	   * 鐢ㄤ竴涓弬鏁颁紶閫掕澶囩殑缃戠粶鍙峰拰绔欑偣鍙锋椂: nSt = station.nStNo | ((station.nNetNo << 8) & 0xFF00);
+	   **/
 
 	short nNetNo = 0;    // 缃戠粶缂栧彿锛歅LC鎵�杩炴帴鐨勭綉缁滅紪鍙凤紝0琛ㄧず榛樿缃戠粶
 	short nStNo = 255;   // 绔欑偣缂栧彿锛氭寚瀹氫笌PLC杩炴帴鐨勭珯鐐圭紪鍙凤紝255閫氬父琛ㄧず骞挎挱鎴栨墍鏈夌珯鐐�
 
 	// 鑷畾涔夋瀯閫犲嚱鏁帮紝瑕嗙洊榛樿鍊�
 	explicit StationIdentifier(const short net, const short st) : nNetNo(net), nStNo(st) {}
+
+	StationIdentifier() 
+	{
+		nNetNo = 0;
+		nStNo = 255;
+	}
 
 	// 灏嗏�滅綉缁滃彿鈥濆拰鈥滅珯鐐瑰彿鈥濈粍鍚堟垚涓�涓渶缁堢紪鐮�
 	short StationIdentifier::toNetworkStationCode() const {
@@ -211,13 +217,13 @@
 	// 閲嶈浇 < 杩愮畻绗︼紙鐢ㄤ簬鎺掑簭鎴栨瘮杈冿紝閫氬父鐢ㄤ簬 map 鎴� set 涓綔涓� key锛�
 	bool operator<(const StationIdentifier& other) const {
 		return std::tie(nNetNo, nStNo) <
-			   std::tie(other.nNetNo, other.nStNo);
+			std::tie(other.nNetNo, other.nStNo);
 	}
 
 	// 閲嶈浇 == 杩愮畻绗︼紙鐢ㄤ簬鐩哥瓑姣旇緝锛�
 	bool operator==(const StationIdentifier& other) const {
 		return std::tie(nNetNo, nStNo) ==
-			   std::tie(other.nNetNo, other.nStNo);
+			std::tie(other.nNetNo, other.nStNo);
 	}
 
 	// 閲嶈浇 = 杩愮畻绗︼紙鐢ㄤ簬璧嬪�硷級
@@ -330,7 +336,7 @@
 	}
 };
 
-using BitContainer = std::vector<uint8_t>;		// 姣忎釜鍏冪礌瀛樺偍 8 涓綅
+using BitContainer = std::vector<bool>;			// 姣忎釜鍏冪礌瀛樺偍 1  浣�
 using WordContainer = std::vector<uint16_t>;	// 姣忎釜鍏冪礌瀛樺偍 16 浣�
 using DWordContainer = std::vector<uint32_t>;	// 姣忎釜鍏冪礌瀛樺偍 32 浣�
 
@@ -435,7 +441,7 @@
 
 	// 瀹瑰櫒杞崲
 	static void ConvertCharToShort(const std::vector<char>& vecChar, std::vector<short>& vecShort);
-	static void ConvertShortToChar(const std::vector<short>& vecShort, std::vector<char>&vecChar);
+	static void ConvertShortToChar(const std::vector<short>& vecShort, std::vector<char>& vecChar);
 	static void ConvertUint8ToShort(const std::vector<uint8_t>& vecUint8, std::vector<short>& vecShort);
 	static void ConvertShortToUint8(const std::vector<short>& vecShort, std::vector<uint8_t>& vecUint8);
 	static void ConvertUint32ToShort(const std::vector<uint32_t>& vecUint32, std::vector<short>& vecShort);

--
Gitblit v1.9.3