From 3623c549eab25da1d8b74cd0557eb286192b75b1 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 23 六月 2025 10:45:35 +0800
Subject: [PATCH] 1.修复LoadPort设置不能减片的问题;
---
SourceCode/Bond/Servo/CLoadPort.cpp | 87 +++++++++++++++++++------------------------
1 files changed, 39 insertions(+), 48 deletions(-)
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index 54c0d85..e5aa69b 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -300,7 +300,7 @@
pStep->setName(pszName[m_nIndex]);
pStep->setWriteSignalDev(0x128 + m_nIndex);
pStep->setDataDev(dev[m_nIndex]);
- if (addStep(STEP_ID_PROT1_TYPE_AUTO_CHANGE_REPLY + m_nIndex, pStep) != 0) {
+ if (addStep(STEP_ID_PROT1_CASSETTE_TYPE_CHANGE_REPLY + m_nIndex, pStep) != 0) {
delete pStep;
}
}
@@ -348,53 +348,6 @@
}
}
}
-
- /*
-
- {
- // Fetched Out Job Report #1~15
- char szBuffer[256];
- CEqReadStep* pStep = new CEqReadStep(0x5c31 + 18 * m_nIndex, 18 * 2,
- [&](void* pFrom, int code, const char* pszData, size_t size) -> int {
- if (code == ROK && pszData != nullptr && size > 0) {
- int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port");
- if (port > 0) {
- decodeFetchedOutJobReport((CStep*)pFrom, port, pszData, size);
- }
- }
- return -1;
- });
- sprintf_s(szBuffer, "%s%d", STEP_EQ_FETCHED_OUT_JOBn, m_nIndex + 1);
- pStep->setName(szBuffer);
- pStep->setProp("Port", (void*)(__int64)(m_nIndex + 1));
- pStep->setWriteSignalDev(0x023 + m_nIndex);
- if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + m_nIndex, pStep) != 0) {
- delete pStep;
- }
- }
-
- {
- // Store Job Report #1~15
- char szBuffer[256];
- CEqReadStep* pStep = new CEqReadStep(0x5b23 + 18 * m_nIndex, 18 * 2,
- [&](void* pFrom, int code, const char* pszData, size_t size) -> int {
- if (code == ROK && pszData != nullptr && size > 0) {
- int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port");
- if (port > 0) {
- decodeStoredJobReport((CStep*)pFrom, port, pszData, size);
- }
- }
- return -1;
- });
- sprintf_s(szBuffer, "%s%d", STEP_EQ_STORED_JOBn, m_nIndex + 1);
- pStep->setName(szBuffer);
- pStep->setProp("Port", (void*)(__int64)(m_nIndex + 1));
- pStep->setWriteSignalDev(0x014 + m_nIndex);
- if (addStep(STEP_ID_STORE_JOB_REPORT1 + m_nIndex, pStep) != 0) {
- delete pStep;
- }
- }
- */
}
void CLoadPort::onTimer(UINT nTimerid)
@@ -1187,4 +1140,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