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/CLoadPort.cpp | 63 +++++++++++++++++++++++++++----
1 files changed, 54 insertions(+), 9 deletions(-)
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index cee42a2..f23f005 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -12,6 +12,14 @@
} \
}
+#define CHECK_WRITE_STEP_SIGNAL2(addr, data, size) { \
+ BOOL bFlag = isBitOn(data, size, addr); \
+ SERVO::CStep* pStep = getStep(addr); \
+ if (pStep != nullptr) { \
+ ((CWriteStep*)pStep)->onRecvSignal(bFlag ? addr : 0); \
+ } \
+}
+
namespace SERVO {
CLoadPort::CLoadPort() : CEquipment()
{
@@ -337,6 +345,7 @@
[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
if (code == ROK && pszData != nullptr && size > 0) {
decodePortStatusReport((CStep*)pFrom, pszData, size);
+ return 0;
}
return -1;
});
@@ -867,12 +876,12 @@
static int cassetteTypeReply[] = { STEP_ID_PROT1_CASSETTE_TYPE_CHANGE_REPLY, STEP_ID_PROT2_CASSETTE_TYPE_CHANGE_REPLY,
STEP_ID_PROT3_CASSETTE_TYPE_CHANGE_REPLY, STEP_ID_PROT4_CASSETTE_TYPE_CHANGE_REPLY };
- CHECK_READ_STEP_SIGNAL2(typeReply[m_nIndex], pszData, size);
- CHECK_READ_STEP_SIGNAL2(modeReply[m_nIndex], pszData, size);
- CHECK_READ_STEP_SIGNAL2(transferModeReply[m_nIndex], pszData, size);
- CHECK_READ_STEP_SIGNAL2(enableModeReply[m_nIndex], pszData, size);
- CHECK_READ_STEP_SIGNAL2(typeAutoReply[m_nIndex], pszData, size);
- CHECK_READ_STEP_SIGNAL2(cassetteTypeReply[m_nIndex], pszData, size);
+ CHECK_WRITE_STEP_SIGNAL2(typeReply[m_nIndex], pszData, size);
+ CHECK_WRITE_STEP_SIGNAL2(modeReply[m_nIndex], pszData, size);
+ CHECK_WRITE_STEP_SIGNAL2(transferModeReply[m_nIndex], pszData, size);
+ CHECK_WRITE_STEP_SIGNAL2(enableModeReply[m_nIndex], pszData, size);
+ CHECK_WRITE_STEP_SIGNAL2(typeAutoReply[m_nIndex], pszData, size);
+ CHECK_WRITE_STEP_SIGNAL2(cassetteTypeReply[m_nIndex], pszData, size);
}
int CLoadPort::decodePortStatusReport(CStep* pStep, const char* pszData, size_t size)
@@ -885,10 +894,8 @@
// 缓存Attribute,用于调试时显示信息
unsigned int weight = 201;
- CAttributeVector attrubutes;
+ CAttributeVector& attrubutes = pStep->attributeVector();
m_portStatusReport.getAttributeVector(attrubutes, weight);
- pStep->addAttributeVector(attrubutes);
-
LOGI("<CCassetteTranserStateStep>decodePortStatusReport<Status:%d, CassetteSequenceNo:%d>",
m_portStatusReport.getPortStatus(), m_portStatusReport.getCassetteSequenceNo());
@@ -1140,4 +1147,42 @@
return 0;
}
+ int CLoadPort::testGenerateGlassListFromConfig(const SERVO::PortConfig& config)
+ {
+ char szBuffer[64];
+ for (const auto& slot : config.vecSlot) {
+ int nSlotIndex = slot.nSlotID - 1;
+ if (nSlotIndex < 0 || nSlotIndex >= SLOT_MAX) {
+ continue;
+ }
+ if (!slot.isEnabled) {
+ m_slot[nSlotIndex].setContext(nullptr);
+ continue;
+ }
+
+ CJobDataS js;
+ js.setCassetteSequenceNo(getNextCassetteSequenceNo());
+ js.setJobSequenceNo(m_slot[nSlotIndex].getNo());
+
+ sprintf_s(szBuffer, 64, "%05d%05d", js.getCassetteSequenceNo(), js.getJobSequenceNo());
+ js.setJobType(1);
+ js.setMaterialsType(config.nMaterialType);
+
+ js.setLotId(config.strLotID.c_str());
+ js.setProductId(config.strProductID.c_str());
+ js.setOperationId(config.strOperationID.c_str());
+ js.setGlass1Id(szBuffer);
+
+ CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass();
+ pGlass->addPath(m_nID, 0);
+ pGlass->processEnd(m_nID, 0);
+ pGlass->setID(szBuffer);
+ pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType));
+ pGlass->setJobDataS(&js);
+
+ m_slot[nSlotIndex].setContext(pGlass);
+ }
+
+ return 0;
+ }
}
--
Gitblit v1.9.3