From aabaff9cdcf9bb279b762891aedda5a03571fbb5 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 01 七月 2025 08:55:07 +0800
Subject: [PATCH] 1.修改Glass的JobDataS的更新逻辑,在收到OnReceiveJob时,机器内未保存和管理Glass, 此时Glass在Arm上,应通过Arm来更新JobDataS;
---
SourceCode/Bond/Servo/CRobotTaskDlg.cpp | 40 +++++++++++++++++++++++++++++++---------
1 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/SourceCode/Bond/Servo/CRobotTaskDlg.cpp b/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
index ab90d5b..58b6010 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,7 +52,10 @@
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;
@@ -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,14 @@
}
theApp.m_model.getMaster().abortCurrentTask();
+}
+
+void CRobotTaskDlg::OnBnClickedRestore()
+{
+ int ret = AfxMessageBox(_T("鐗╂枡灏嗕細琚惉杩愬洖鍘熶綅缃紝纭瑕佸洖鎾ゅ綋鍓嶄换鍔″悧锛熼櫎闈炲彂鐢熶簡寮傚父锛屽惁鍒欒涓嶈鍥炴挙浠诲姟锛�"), MB_OKCANCEL | MB_ICONEXCLAMATION);
+ if (ret != IDOK) {
+ return;
+ }
+
+ theApp.m_model.getMaster().restoreCurrentTask();
}
\ No newline at end of file
--
Gitblit v1.9.3