From 5e6c63c80e146e9f0800afc39ec33f0c7eb7a572 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 21 七月 2025 14:09:58 +0800
Subject: [PATCH] 1.回撤任务修改为重发任务;
---
SourceCode/Bond/Servo/CRobotTask.h | 1 +
SourceCode/Bond/Servo/CRobotTask.cpp | 11 +++++++++++
SourceCode/Bond/Servo/CMaster.cpp | 12 ++++++++++++
SourceCode/Bond/Servo/CMaster.h | 1 +
SourceCode/Bond/Servo/CRobotTaskDlg.cpp | 7 ++++---
5 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 7ef3579..efe5e91 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -1584,6 +1584,18 @@
return 0;
}
+ int CMaster::resendCurrentTask()
+ {
+ lock();
+ if (m_pActiveRobotTask != nullptr) {
+ m_pActiveRobotTask->resend();
+ }
+ unlock();
+
+
+ return 0;
+ }
+
void CMaster::setPortType(unsigned int index, BOOL enable, int type, int mode,
int cassetteType, int transferMode, BOOL autoChangeEnable)
{
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index 37ff05b..786f644 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -67,6 +67,7 @@
void setCacheFilepath(const char* pszFilepath);
int abortCurrentTask();
int restoreCurrentTask();
+ int resendCurrentTask();
void setPortType(unsigned int index, BOOL enable, int type, int mode,
int cassetteType, int transferMode, BOOL autoChangeEnable);
diff --git a/SourceCode/Bond/Servo/CRobotTask.cpp b/SourceCode/Bond/Servo/CRobotTask.cpp
index 7a9625e..1c9f61d 100644
--- a/SourceCode/Bond/Servo/CRobotTask.cpp
+++ b/SourceCode/Bond/Servo/CRobotTask.cpp
@@ -286,6 +286,17 @@
});
}
+ void CRobotTask::resend()
+ {
+ // 重新下发命令,无非是下发取料或下发放料的命令,根据当前状态来
+ if (ROBOT_TASK_STATE::Picking == m_state || ROBOT_TASK_STATE::Picked == m_state) {
+ pick();
+ }
+ else if (ROBOT_TASK_STATE::Placing == m_state) {
+ place();
+ }
+ }
+
void CRobotTask::completed()
{
m_state = ROBOT_TASK_STATE::Completed;
diff --git a/SourceCode/Bond/Servo/CRobotTask.h b/SourceCode/Bond/Servo/CRobotTask.h
index 324b6cc..e20fd4a 100644
--- a/SourceCode/Bond/Servo/CRobotTask.h
+++ b/SourceCode/Bond/Servo/CRobotTask.h
@@ -41,6 +41,7 @@
void place();
void restore();
void restored();
+ void resend();
void completed();
void error();
void abort();
diff --git a/SourceCode/Bond/Servo/CRobotTaskDlg.cpp b/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
index 58b6010..2b2d50e 100644
--- a/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
+++ b/SourceCode/Bond/Servo/CRobotTaskDlg.cpp
@@ -103,7 +103,7 @@
// 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);
+ m_btnRestore.Create(_T("閲嶅彂鎸囦护"), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, CRect(0, 0, 100, 30), this, IDC_BUTTON_RESTORE);
// 鍔ㄦ�佹寜閽垱寤哄悗璁剧疆瀛椾綋
if (m_fontButton.GetSafeHandle() == nullptr) {
@@ -216,10 +216,11 @@
void CRobotTaskDlg::OnBnClickedRestore()
{
- int ret = AfxMessageBox(_T("鐗╂枡灏嗕細琚惉杩愬洖鍘熶綅缃紝纭瑕佸洖鎾ゅ綋鍓嶄换鍔″悧锛熼櫎闈炲彂鐢熶簡寮傚父锛屽惁鍒欒涓嶈鍥炴挙浠诲姟锛�"), MB_OKCANCEL | MB_ICONEXCLAMATION);
+ // 鍥炴挙浠诲姟淇敼涓洪噸鍙戜换鍔�
+ int ret = AfxMessageBox(_T("纭瑕侀噸鏂颁笅鍙戜换鍔″悧锛�"), MB_OKCANCEL | MB_ICONEXCLAMATION);
if (ret != IDOK) {
return;
}
- theApp.m_model.getMaster().restoreCurrentTask();
+ theApp.m_model.getMaster().resendCurrentTask();
}
\ No newline at end of file
--
Gitblit v1.9.3