From db9d120efcfe76bb73df089dca8986eca9ee0e6f Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 10 十二月 2025 10:11:37 +0800
Subject: [PATCH] 1.扫码上报,但未在配置中设置变量;

---
 SourceCode/Bond/Servo/CRobotTaskDlg.cpp |   43 +++++++++++++++++++++++++++++++++----------
 1 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/SourceCode/Bond/Servo/CRobotTaskDlg.cpp b/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
index cb39af5..2b2d50e 100644
--- a/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
+++ b/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
@@ -33,6 +33,7 @@
 	ON_WM_SIZE()
 	ON_WM_ACTIVATE()
 	ON_BN_CLICKED(IDC_BUTTON_ABORT_TASK, &CRobotTaskDlg::OnBnClickedAbortTask)
+	ON_BN_CLICKED(IDC_BUTTON_RESTORE, &CRobotTaskDlg::OnBnClickedRestore)
 END_MESSAGE_MAP()
 
 
@@ -51,14 +52,17 @@
 	if (m_btnAbortTask.m_hWnd) {
 		m_btnAbortTask.ShowWindow(m_pRobotTask ? SW_SHOW : SW_HIDE);
 	}
-
+	if (m_btnRestore.m_hWnd) {
+		m_btnRestore.ShowWindow(m_pRobotTask ? SW_SHOW : SW_HIDE);
+	}
+	
 	if (m_pRobotTask != nullptr) {
 		using namespace SERVO;
 
 		CEquipment* pSrcEq = theApp.m_model.getMaster().getEquipment(pRobotTask->getSrcPosition());
 		CEquipment* pDstEq = theApp.m_model.getMaster().getEquipment(pRobotTask->getTarPosition());
 
-		ROBOT_CMD_PARAM& param = pRobotTask->getRobotCmdParam();
+		ROBOT_CMD_PARAM& param = pRobotTask->getRobotCmdParam(ACTION_TRANSFER);
 
 		auto format_time = [](time_t t) -> CString {
 			if (t == 0) {
@@ -97,14 +101,16 @@
 	CDialogEx::OnInitDialog();
 
 	// TODO:  鍦ㄦ娣诲姞棰濆鐨勫垵濮嬪寲
-	// 鍒涘缓鈥滃仠姝换鍔♀�濇寜閽�
+	// 鍒涘缓鈥滃仠姝换鍔♀�濇寜閽拰鈥滄挙鍥炩�濇寜閽�
 	m_btnAbortTask.Create(_T("鍋滄浠诲姟"), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, CRect(0, 0, 100, 30), this, IDC_BUTTON_ABORT_TASK);
+	m_btnRestore.Create(_T("閲嶅彂鎸囦护"), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, CRect(0, 0, 100, 30), this, IDC_BUTTON_RESTORE);
 
 	// 鍔ㄦ�佹寜閽垱寤哄悗璁剧疆瀛椾綋
 	if (m_fontButton.GetSafeHandle() == nullptr) {
 		m_fontButton.CreatePointFont(110, _T("寰蒋闆呴粦")); // 鎴� "Segoe UI"
 	}
 	m_btnAbortTask.SetFont(&m_fontButton);
+	m_btnRestore.SetFont(&m_fontButton);
 
 	// 璁剧疆 LABEL 鎺т欢鐨勫瓧浣�
 	if (m_fontDetail.GetSafeHandle() == nullptr) {
@@ -180,15 +186,21 @@
 	}
 
 	// 璁剧疆鈥滃仠姝换鍔♀�濇寜閽綅缃紙鍙充笅瑙掞級
+	const int nBtnWidth = 100;
+	const int nBtnHeight = 28;
+	const int nMargin = 12;
+	const int nMargin2 = 8;
+	const int x = rcClient.right - nBtnWidth - nMargin;
+	int y = rcClient.bottom - nMargin;
 	if (m_btnAbortTask.m_hWnd != nullptr) {
-		const int nBtnWidth = 100;
-		const int nBtnHeight = 28;
-		const int nMargin = 12;
+		m_btnAbortTask.MoveWindow(x, y - nBtnHeight, nBtnWidth, nBtnHeight);
+		y -= nBtnHeight;
+		y -= nMargin2;
+	}
 
-		const int nPosX = rcClient.right - nBtnWidth - nMargin;
-		const int nPosY = rcClient.bottom - nBtnHeight - nMargin;
-
-		m_btnAbortTask.MoveWindow(nPosX, nPosY, nBtnWidth, nBtnHeight);
+	// 璁剧疆鈥滃仠姝换鍔♀�濇寜閽綅缃紙鍙充笅瑙掞級
+	if (m_btnRestore.m_hWnd != nullptr) {
+		m_btnRestore.MoveWindow(x, y - nBtnHeight, nBtnWidth, nBtnHeight);
 	}
 }
 
@@ -200,4 +212,15 @@
 	}
 
 	theApp.m_model.getMaster().abortCurrentTask();
+}
+
+void CRobotTaskDlg::OnBnClickedRestore()
+{
+	// 鍥炴挙浠诲姟淇敼涓洪噸鍙戜换鍔�
+	int ret = AfxMessageBox(_T("纭瑕侀噸鏂颁笅鍙戜换鍔″悧锛�"), MB_OKCANCEL | MB_ICONEXCLAMATION);
+	if (ret != IDOK) {
+		return;
+	}
+
+	theApp.m_model.getMaster().resendCurrentTask();
 }
\ No newline at end of file

--
Gitblit v1.9.3