From 3d9feed39f341c7af94cffc813c569ad478a5823 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 26 八月 2025 17:47:50 +0800
Subject: [PATCH] 1.PJEnd事件上报功能实现,EAP模拟器接收数据并验证;
---
SourceCode/Bond/Servo/HsmsPassive.h | 1
SourceCode/Bond/x64/Debug/CollectionEventList.txt | 1
SourceCode/Bond/Servo/HsmsPassive.cpp | 5 ++
SourceCode/Bond/Servo/CMaster.cpp | 102 +++++++++++++++++++++++++++++++++++++++++++++++---
SourceCode/Bond/Servo/CMaster.h | 5 ++
SourceCode/Bond/Servo/Model.cpp | 4 ++
Document/Panel Bonder八零联合 SecsTest CheckList_v3.0.xlsx | 0
7 files changed, 110 insertions(+), 8 deletions(-)
diff --git "a/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx" "b/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx"
index 71de426..59056de 100644
--- "a/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx"
+++ "b/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx"
Binary files differ
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index e6ed125..baf3806 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -939,15 +939,17 @@
&& pLoadPorts[s]->getPortStatus() == PORT_INUSE) {
m_pActiveRobotTask = createTransferTask(pLoadPorts[s], pAligner, primaryType, secondaryType, m_bJobMode);
if (m_pActiveRobotTask != nullptr) {
- pEFEM->setContext(m_pActiveRobotTask->getContext());
- bool bMoved = glassFromQueueToInPorcess((CGlass*)m_pActiveRobotTask->getContext());
+ CGlass* pGlass = (CGlass*)m_pActiveRobotTask->getContext();
+ pEFEM->setContext(pGlass);
+ pGlass->start();
+ bool bMoved = glassFromQueueToInPorcess(pGlass);
if (bMoved) {
LOGI("<Master>Glass(%s)从等待列队到工艺列队转移成功.",
- ((CGlass*)m_pActiveRobotTask->getContext())->getID().c_str());
+ pGlass->getID().c_str());
}
else {
LOGE("<Master>Glass(%s)从等待列队到工艺列队转移失败.",
- ((CGlass*)m_pActiveRobotTask->getContext())->getID().c_str());
+ pGlass->getID().c_str());
}
goto BATCH_PORT_GET;
@@ -1258,6 +1260,15 @@
bOk = TRUE;
LOGI("<CMaster>onPreFethedOutJob, 已校验数据一致性.");
}
+ LOGI("<CMaster>onPreFethedOutJob 0004.");
+ if (pJobDataS != nullptr) {
+ LOGI("<CMaster>onPreFethedOutJob 0005. %d,%d,%d,%d",
+ pJobDataS->getCassetteSequenceNo(),
+ pJobDataB->getCassetteSequenceNo(),
+ pJobDataS->getJobSequenceNo(),
+ pJobDataB->getJobSequenceNo()
+ );
+ }
}
}
else if (p->getID() == EQ_ID_ARM_TRAY1 || p->getID() == EQ_ID_ARM_TRAY2) {
@@ -1371,16 +1382,29 @@
// 如果是搬送回从AOI搬送回Port, 则glass工艺完成
if (m_pActiveRobotTask->getSrcPosition() == EQ_ID_MEASUREMENT) {
- bool bMoved = glassFromInPorcessToComplete((CGlass*)m_pActiveRobotTask->getContext());
+ CGlass* pGlass = (CGlass*)m_pActiveRobotTask->getContext();
+ pGlass->complete();
+ bool bMoved = glassFromInPorcessToComplete(pGlass);
if (bMoved) {
LOGI("<Master>Glass(%s)从工艺列队到完成列队转移成功.",
- ((CGlass*)m_pActiveRobotTask->getContext())->getID().c_str());
+ pGlass->getID().c_str());
}
else {
LOGE("<Master>Glass(%s)从工艺列队到完成列队转移失败.",
- ((CGlass*)m_pActiveRobotTask->getContext())->getID().c_str());
+ pGlass->getID().c_str());
+ }
+
+ // 检查PJ是否已经完成
+ CProcessJob* pJob = getGlassProcessJob((CGlass*)m_pActiveRobotTask->getContext());
+ if (pJob != nullptr && checkAndUpdatePjComplete(pJob)) {
+ LOGE("<Master>ProcessJob(%s)完成.",
+ pJob->id().c_str());
+ if (m_listener.onPjEnd != nullptr) {
+ m_listener.onPjEnd(this, pJob);
+ }
}
}
+
unlock();
@@ -1684,6 +1708,38 @@
}
}
+
+
+ // 模拟测试
+ /*
+ static int aaa = 0;
+ aaa++;
+ if (aaa % 30 == 0) {
+ if (!m_queueGlasses.empty()) {
+ CGlass* pGlass = m_queueGlasses.front();
+ pGlass->start();
+ glassFromQueueToInPorcess(pGlass);
+ }
+ }
+
+ if (aaa % 45 == 0) {
+ if (!m_inProcesGlasses.empty()) {
+ CGlass* pGlass = m_inProcesGlasses.front();
+ pGlass->complete();
+ glassFromInPorcessToComplete(pGlass);
+
+
+ CProcessJob* pJob = getGlassProcessJob(pGlass);
+ if (pJob != nullptr && checkAndUpdatePjComplete(pJob)) {
+ LOGE("<Master>ProcessJob(%s)完成.",
+ pJob->id().c_str());
+ if (m_listener.onPjEnd != nullptr) {
+ m_listener.onPjEnd(this, pJob);
+ }
+ }
+ }
+ }
+ */
}
void CMaster::connectEquipments()
@@ -2456,4 +2512,36 @@
}
return false;
}
+
+ bool CMaster::checkAndUpdatePjComplete(CProcessJob* pJob)
+ {
+ ASSERT(pJob);
+ auto state = pJob->state();
+ if (state != PJState::InProcess && state != PJState::Paused) return false;
+
+ for (auto c : pJob->carriers()) {
+ for (auto g : c.contexts) {
+ CGlass* pGlass = (CGlass*)g;
+ if (pGlass->state() != GlsState::Aborted
+ && pGlass->state() != GlsState::Completed
+ && pGlass->state() != GlsState::Failed) return false;
+ }
+ }
+
+ return pJob->complete();
+ }
+
+ CProcessJob* CMaster::getGlassProcessJob(CGlass* pGlass)
+ {
+ if (m_pControlJob == nullptr) return nullptr;
+ for (auto pj : m_pControlJob->getPjs()) {
+ for (auto c : pj->carriers()) {
+ for (auto g : c.contexts) {
+ if (g == pGlass) return pj;
+ }
+ }
+ }
+
+ return nullptr;
+ }
}
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index 3c3d79a..631ff24 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -66,7 +66,7 @@
ONLOADPORTSTATUSCHANGED onLoadPortStatusChanged;
ONCTROUNDEND onCTRoundEnd;
ONPJSTART onPjStart;
-
+ ONPJSTART onPjEnd;
} MasterListener;
class CMaster : public IResourceView
@@ -167,6 +167,9 @@
bool addGlassToQueue(CGlass* pGlass);
bool glassFromQueueToInPorcess(CGlass* pGlass);
bool glassFromInPorcessToComplete(CGlass* pGlass);
+ bool checkAndUpdatePjComplete(CProcessJob* pJob);
+ CProcessJob* getGlassProcessJob(CGlass* pGlass);
+
private:
CRITICAL_SECTION m_criticalSection;
diff --git a/SourceCode/Bond/Servo/HsmsPassive.cpp b/SourceCode/Bond/Servo/HsmsPassive.cpp
index 6c1ff1f..e96e8a8 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.cpp
+++ b/SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -1884,6 +1884,11 @@
return requestEventReportSend("PJ_Start");
}
+int CHsmsPassive::requestEventReportSend_PJ_End()
+{
+ return requestEventReportSend("PJ_End");
+}
+
diff --git a/SourceCode/Bond/Servo/HsmsPassive.h b/SourceCode/Bond/Servo/HsmsPassive.h
index 3196888..f423b9e 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.h
+++ b/SourceCode/Bond/Servo/HsmsPassive.h
@@ -193,6 +193,7 @@
int requestEventReportSend_CarrierID_Readed();
int requestEventReportSend_PJ_Queued();
int requestEventReportSend_PJ_Start();
+ int requestEventReportSend_PJ_End();
private:
void replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName);
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 1d2705e..b71d072 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -391,6 +391,10 @@
m_hsmsPassive.setVariableValue("PJStartID", ((SERVO::CProcessJob*)pj)->id().c_str());
m_hsmsPassive.requestEventReportSend_PJ_Start();
};
+ masterListener.onPjEnd = [&](void* pMaster, void* pj) {
+ m_hsmsPassive.setVariableValue("PJEndID", ((SERVO::CProcessJob*)pj)->id().c_str());
+ m_hsmsPassive.requestEventReportSend_PJ_End();
+ };
m_master.setListener(masterListener);
m_master.setContinuousTransferCount(m_configuration.getContinuousTransferCount());
diff --git a/SourceCode/Bond/x64/Debug/CollectionEventList.txt b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
index 258f82f..7d2dd32 100644
--- a/SourceCode/Bond/x64/Debug/CollectionEventList.txt
+++ b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
@@ -40,3 +40,4 @@
50000,CarrierID_Readed,,(50000)
50001,PJ_Queued,,(50001)
50002,PJ_Start,,(50002)
+50002,PJ_End,,(50003)
--
Gitblit v1.9.3