From 10f48622c553729352dce9a4484def4bfeaa1083 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 02 七月 2025 14:51:33 +0800
Subject: [PATCH] 1.将OnPanelDataReport相关功能由EFEM移到Aligner; 2.Glass增加最初来源Port和Slot,以便在Aligner检测NG时加退; 3.物流调度增加一个参数,是否检测OK作为调度依据。 4.Alginer检测NG,送回原处;
---
SourceCode/Bond/Servo/Model.cpp | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 064a164..c2acb85 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -190,8 +190,16 @@
}
// 任务描述与 ID 用于日志
+ SERVO::CGlass* pGlass = (SERVO::CGlass*)pTask->getContext();
const std::string& strDesc = pTask->getDescription();
- const std::string& strClassID = pTask->getId();
+ std::string strClassID;
+ if (pGlass != nullptr) {
+ strClassID = pGlass->getID();
+ if (pGlass->getBuddy() != nullptr) {
+ strClassID += "/";
+ strClassID += pGlass->getBuddy()->getID();
+ }
+ }
// 日志输出与状态处理
switch (code) {
@@ -245,23 +253,26 @@
// 状态映射
static const char* STATUS_STR[] = {
- "Unknown", "Ready", "Running", "Picking", "Placing", "Restoring", "Error", "Abort", "Completed"
+ "Ready", "Running", "Picking", "Picked", "Placing", "Restoring", "Error", "Abort", "Restored", "Completed"
};
auto state = pTask->getState();
int index = static_cast<int>(state);
- if (index > 0 && index < static_cast<int>(std::size(STATUS_STR))) {
+ if (index >= 0 && index < static_cast<int>(std::size(STATUS_STR))) {
data.strStatus = STATUS_STR[index];
}
else {
- data.strStatus = STATUS_STR[0];
+ data.strStatus = "Unknown";
}
// 写入数据库
- int nRecordId = 0;
- TransferManager::getInstance().addTransferRecord(data, nRecordId);
-
+ if (code == ROBOT_EVENT_FINISH || code == ROBOT_EVENT_ERROR
+ || code == ROBOT_EVENT_ABORT || code == ROBOT_EVENT_RESTORE) {
+ int nRecordId = 0;
+ TransferManager::getInstance().addTransferRecord(data, nRecordId);
+ LOGI("<CModel>onRobotTaskEvent: 任务记录已保存,RecordID=%d", nRecordId);
+ }
notifyPtrAndInt(RX_CODE_EQ_ROBOT_TASK, pTask, nullptr, code);
- LOGI("<CModel>onRobotTaskEvent: 任务记录已保存,RecordID=%d", nRecordId);
+
};
m_master.setListener(masterListener);
--
Gitblit v1.9.3