From 6d71f1d8264b929ca71bf133246b894ed955c079 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期四, 12 六月 2025 15:17:50 +0800
Subject: [PATCH] Merge branch 'master' into liuyang

---
 SourceCode/Bond/Servo/CRobotCmdTestDlg.cpp |  103 +++++++++++++++++++++++++++++----------------------
 1 files changed, 59 insertions(+), 44 deletions(-)

diff --git a/SourceCode/Bond/Servo/CRobotCmdTestDlg.cpp b/SourceCode/Bond/Servo/CRobotCmdTestDlg.cpp
index 0a41147..7859139 100644
--- a/SourceCode/Bond/Servo/CRobotCmdTestDlg.cpp
+++ b/SourceCode/Bond/Servo/CRobotCmdTestDlg.cpp
@@ -93,19 +93,25 @@
 
 	// 绀轰緥璁惧鍚嶇О鍒楄〃
 	CStringList eqNameList;
-	eqNameList.AddTail(_T("PORT 1"));				// 1 1 UNIT
-	eqNameList.AddTail(_T("PORT 2"));				// 2 1 UNIT
-	eqNameList.AddTail(_T("PORT 3"));				// 3 1 UNIT
-	eqNameList.AddTail(_T("PORT 4"));				// 4 1 UNIT
-	eqNameList.AddTail(_T("RB1"));					// 5 1 UNIT
-	eqNameList.AddTail(_T("RB2"));					// 6 1 UNIT
-	eqNameList.AddTail(_T("ALIGN"));				// 7 1 UNIT
-	eqNameList.AddTail(_T("FLIP"));					// 8 1 UNIT
-	eqNameList.AddTail(_T("VAC BAKE"));				// 9 2 UNIT
-	eqNameList.AddTail(_T("BONDER1"));				// 10 2 UNIT
-	eqNameList.AddTail(_T("BONDER2"));				// 11 2 UNIT
-	eqNameList.AddTail(_T("POST BAKE(COOLING)"));	// 12 4 UNIT
-	eqNameList.AddTail(_T("MEASUREMENT"));			// 13 1 UNIT
+	eqNameList.AddTail(_T("Port1"));
+	eqNameList.AddTail(_T("Port2"));
+	eqNameList.AddTail(_T("Port3"));
+	eqNameList.AddTail(_T("Port4"));
+	eqNameList.AddTail(_T("RB1"));	
+	eqNameList.AddTail(_T("RB2"));
+	eqNameList.AddTail(_T("AL"));
+	eqNameList.AddTail(_T("FLIP"));
+	eqNameList.AddTail(_T("Bonder1-涓婁骇鍝�"));
+	eqNameList.AddTail(_T("Bonder1-涓嬩骇鍝�"));
+	eqNameList.AddTail(_T("Bonder2-涓婁骇鍝�"));
+	eqNameList.AddTail(_T("Bonder2-涓嬩骇鍝�"));
+	eqNameList.AddTail(_T("VacBakeA鑵�"));
+	eqNameList.AddTail(_T("VacBakeB鑵�"));
+	eqNameList.AddTail(_T("BakecCoolingA鐑樼儰"));
+	eqNameList.AddTail(_T("BakecCoolingA鍐峰嵈"));
+	eqNameList.AddTail(_T("BakecCoolingB鐑樼儰"));
+	eqNameList.AddTail(_T("BakecCoolingB鍐峰嵈"));
+	eqNameList.AddTail(_T("Measurement"));	
 
 	for (POSITION pos = eqNameList.GetHeadPosition(); pos != NULL;) {
 		CString item = eqNameList.GetNext(pos);
@@ -127,64 +133,64 @@
 
 	// 蹇嵎鍛戒护鎵ц鏄犲皠琛�
 	m_mapCmdExec = {
-		{_T("SendHome"), [this](int seq, int, int, int, int, int) {
-			return m_pEFEM->SendHome(seq);
+		{_T("SendHome"), [this](int seq, int, int, int, int, int, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendHome(seq, onWritedBlock);
 		}},
 
-		{_T("SendTransfer"), [this](int seq, int armNo, int getPos, int putPos, int getSlot, int putSlot) {
-			return m_pEFEM->SendTransfer(seq, armNo, getPos, putPos, getSlot, putSlot);
+		{_T("SendTransfer"), [this](int seq, int armNo, int getPos, int putPos, int getSlot, int putSlot, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendTransfer(seq, armNo, getPos, putPos, getSlot, putSlot, onWritedBlock);
 		}},
 
-		{_T("SendMoveToGet"), [this](int seq, int armNo, int pos, int, int slot, int) {
-			return m_pEFEM->SendMoveToGet(seq, armNo, pos, slot);
+		{_T("SendMoveToGet"), [this](int seq, int armNo, int pos, int, int slot, int, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendMoveToGet(seq, armNo, pos, slot, onWritedBlock);
 		}},
 
-		{_T("SendMoveToPut"), [this](int seq, int armNo, int, int pos, int, int slot) {
-			return m_pEFEM->SendMoveToPut(seq, armNo, pos, slot);
+		{_T("SendMoveToPut"), [this](int seq, int armNo, int, int pos, int, int slot, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendMoveToPut(seq, armNo, pos, slot, onWritedBlock);
 		}},
 
-		{_T("SendGet"), [this](int seq, int armNo, int pos, int, int slot, int) {
-			return m_pEFEM->SendGet(seq, armNo, pos, slot);
+		{_T("SendGet"), [this](int seq, int armNo, int pos, int, int slot, int, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendGet(seq, armNo, pos, slot, onWritedBlock);
 		}},
 
-		{_T("SendPut"), [this](int seq, int armNo, int, int pos, int, int slot) {
-			return m_pEFEM->SendPut(seq, armNo, pos, slot);
+		{_T("SendPut"), [this](int seq, int armNo, int, int pos, int, int slot, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendPut(seq, armNo, pos, slot, onWritedBlock);
 		}},
 
-		{_T("SendExchange"), [this](int seq, int armNo, int pos, int, int getSlot, int putSlot) {
-			return m_pEFEM->SendExchange(seq, armNo, pos, getSlot, putSlot);
+		{_T("SendExchange"), [this](int seq, int armNo, int pos, int, int getSlot, int putSlot, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendExchange(seq, armNo, pos, getSlot, putSlot, onWritedBlock);
 		}},
 
-		{_T("SendCommandClear"), [this](int seq, int, int, int, int, int) {
-			return m_pEFEM->SendCommandClear(seq);
+		{_T("SendCommandClear"), [this](int seq, int, int, int, int, int, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendCommandClear(seq, onWritedBlock);
 		}},
 
-		{_T("SendBatchGet"), [this](int seq, int armNo, int pos, int, int slot, int) {
-			return m_pEFEM->SendBatchGet(seq, pos, slot);
+		{_T("SendBatchGet"), [this](int seq, int armNo, int pos, int, int slot, int, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendBatchGet(seq, pos, slot, onWritedBlock);
 		}},
 
-		{_T("SendBatchPut"), [this](int seq, int armNo, int, int pos, int, int slot) {
-			return m_pEFEM->SendBatchPut(seq, pos, slot);
+		{_T("SendBatchPut"), [this](int seq, int armNo, int, int pos, int, int slot, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendBatchPut(seq, pos, slot, onWritedBlock);
 		}},
 
-		{_T("SendMoveToGetAndHome"), [this](int seq, int armNo, int pos, int, int slot, int) {
-			return m_pEFEM->SendMoveToGetAndHome(seq, armNo, pos, slot);
+		{_T("SendMoveToGetAndHome"), [this](int seq, int armNo, int pos, int, int slot, int, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendMoveToGetAndHome(seq, armNo, pos, slot, onWritedBlock);
 		}},
 
-		{_T("SendMoveToPutAndHome"), [this](int seq, int armNo, int, int pos, int, int slot) {
-			return m_pEFEM->SendMoveToPutAndHome(seq, armNo, pos, slot);
+		{_T("SendMoveToPutAndHome"), [this](int seq, int armNo, int, int pos, int, int slot, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendMoveToPutAndHome(seq, armNo, pos, slot, onWritedBlock);
 		}},
 
-		{_T("SendTransferAndHome"), [this](int seq, int armNo, int getPos, int putPos, int getSlot, int putSlot) {
-			return m_pEFEM->SendTransferAndHome(seq, armNo, getPos, putPos, getSlot, putSlot);
+		{_T("SendTransferAndHome"), [this](int seq, int armNo, int getPos, int putPos, int getSlot, int putSlot, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendTransferAndHome(seq, armNo, getPos, putPos, getSlot, putSlot, onWritedBlock);
 		}},
 
-		{_T("SendGetAndPut"), [this](int seq, int armNo, int getPos, int putPos, int getSlot, int putSlot) {
-			return m_pEFEM->SendGetAndPut(seq, armNo, getPos, putPos, getSlot, putSlot);
+		{_T("SendGetAndPut"), [this](int seq, int armNo, int getPos, int putPos, int getSlot, int putSlot, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendGetAndPut(seq, armNo, getPos, putPos, getSlot, putSlot, onWritedBlock);
 		}},
 
-		{_T("SendPutAndHome"), [this](int seq, int armNo, int, int pos, int, int slot) {
-			return m_pEFEM->SendPutAndHome(seq, armNo, pos, slot);
+		{_T("SendPutAndHome"), [this](int seq, int armNo, int, int pos, int, int slot, SERVO::ONWRITED onWritedBlock) {
+			return m_pEFEM->robotSendPutAndHome(seq, armNo, pos, slot, onWritedBlock);
 		}}
 	};
 
@@ -333,7 +339,16 @@
 	// 鏌ユ壘鍑芥暟骞舵墽琛�
 	auto it = m_mapCmdExec.find(cmdName);
 	if (it != m_mapCmdExec.end() && nullptr != m_pEFEM) {
-		int ret = it->second(1, armNo, getPos, getSlot, putPos, putSlot);
+		int ret = it->second(1, armNo, getPos, getSlot, putPos, putSlot, [&](int code) -> int {
+			if (code == WOK) {
+				AppendLogLineRichStyled(_T("宸叉敹鍒癛obot鍥炲簲锛�"), LOG_COLOR_SUCCESS);
+			}
+			else {
+				AppendLogLineRichStyled(_T("鏈敹鍒癛obot鍥炲簲锛�"), LOG_COLOR_ERROR);
+			}
+
+			return 0;
+		});
 
 		CString log;
 		if (ret == 0) {

--
Gitblit v1.9.3