From b78a202c2933d345e1983de26948dbdae5d72382 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 12 二月 2026 10:28:06 +0800
Subject: [PATCH] 1.加上限制条件,Port1必须配置Port2, Port3必须配Port4,且是同一ProcessJob
---
SourceCode/Bond/Servo/CCjPage2.cpp | 449 +++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 296 insertions(+), 153 deletions(-)
diff --git a/SourceCode/Bond/Servo/CCjPage2.cpp b/SourceCode/Bond/Servo/CCjPage2.cpp
index 2f4d559..7a79783 100644
--- a/SourceCode/Bond/Servo/CCjPage2.cpp
+++ b/SourceCode/Bond/Servo/CCjPage2.cpp
@@ -13,6 +13,98 @@
IDC_BUTTON_PORT3_PROCESS_START,
IDC_BUTTON_PORT4_PROCESS_START };
+namespace {
+ constexpr int kPortCount = 4;
+ constexpr int kSlotCount = 8;
+
+ int NormalizeMaterial(int material)
+ {
+ return (material == CCarrierSlotGrid::MAT_G2)
+ ? CCarrierSlotGrid::MAT_G2
+ : CCarrierSlotGrid::MAT_G1;
+ }
+
+ void EnsureWarpDefaults(PJWarp& warp)
+ {
+ bool hasSelectedPort = false;
+ for (int p = 0; p < kPortCount; ++p) {
+ if (warp.selectedPorts[p]) {
+ hasSelectedPort = true;
+ }
+ for (int s = 0; s < kSlotCount; ++s) {
+ warp.materialSlots[p][s] = NormalizeMaterial(warp.materialSlots[p][s]);
+ }
+ }
+
+ for (int s = 0; s < kSlotCount; ++s) {
+ warp.material[s] = NormalizeMaterial(warp.material[s]);
+ }
+
+ // Migrate legacy single-port data into multi-port fields.
+ if (!hasSelectedPort && 0 <= warp.port && warp.port < kPortCount) {
+ warp.selectedPorts[warp.port] = TRUE;
+ for (int s = 0; s < kSlotCount; ++s) {
+ warp.checkSlots[warp.port][s] = warp.checkSlot[s];
+ warp.materialSlots[warp.port][s] = NormalizeMaterial(warp.material[s]);
+ }
+ }
+
+ int firstSelectedPort = -1;
+ for (int p = 0; p < kPortCount; ++p) {
+ if (warp.selectedPorts[p]) {
+ firstSelectedPort = p;
+ break;
+ }
+ }
+
+ warp.port = firstSelectedPort;
+ if (firstSelectedPort >= 0) {
+ for (int s = 0; s < kSlotCount; ++s) {
+ warp.checkSlot[s] = warp.checkSlots[firstSelectedPort][s];
+ warp.material[s] = NormalizeMaterial(warp.materialSlots[firstSelectedPort][s]);
+ }
+ }
+ else {
+ for (int s = 0; s < kSlotCount; ++s) {
+ warp.checkSlot[s] = FALSE;
+ warp.material[s] = CCarrierSlotGrid::MAT_G1;
+ }
+ }
+ }
+
+ void BuildCassetteCtrlMaps(SERVO::CLoadPort* pPort, short (&jobExistence)[12], short& slotProcess)
+ {
+ slotProcess = 0;
+ bool anyScheduled = false;
+
+ // Prefer hardware scan map for job existence (first 16 slots).
+ const short scanMap = pPort->getScanCassetteMap();
+ if (scanMap != 0) {
+ jobExistence[0] = scanMap;
+ }
+
+ const int maxSlots = 12 * 16;
+ const int totalSlots = (SLOT_MAX < maxSlots) ? SLOT_MAX : maxSlots;
+ for (int slot = 1; slot <= totalSlots; ++slot) {
+ SERVO::CGlass* pGlass = pPort->getGlassFromSlot(slot);
+ if (pGlass == nullptr) continue;
+
+ const int wordIndex = (slot - 1) / 16;
+ const int bitIndex = (slot - 1) % 16;
+ jobExistence[wordIndex] = (short)(jobExistence[wordIndex] | (1 << bitIndex));
+
+ if (slot <= 16 && pGlass->isScheduledForProcessing()) {
+ slotProcess = (short)(slotProcess | (1 << bitIndex));
+ anyScheduled = true;
+ }
+ }
+
+ if (!anyScheduled) {
+ slotProcess = jobExistence[0];
+ }
+ }
+}
+
// CPjPage1 瀵硅瘽妗�
IMPLEMENT_DYNAMIC(CCjPage2, CCjPageBase)
@@ -151,9 +243,10 @@
int CCjPage2::OnApply()
{
- //SERVO::CProcessJob*
if (m_pContext == nullptr) return -1;
+
PJWarp* pPjWarp = (PJWarp*)m_pContext;
+ EnsureWarpDefaults(*pPjWarp);
SERVO::CProcessJob* pProcessJob = (SERVO::CProcessJob*)pPjWarp->pj;
// 鏇存柊鍚嶇О
@@ -174,7 +267,6 @@
return -1;
}
-
pProcessJob->setId(std::string(szBuffer));
// 鏇存柊閰嶆柟
@@ -189,27 +281,45 @@
#else
std::string recipe(strRecipe.GetString());
#endif
-
pProcessJob->setRecipe(SERVO::RecipeMethod::NoTuning, recipe);
}
-
- // 鏇存柊Port
- int port = -1;
static int ids[] = { IDC_RADIO1, IDC_RADIO2, IDC_RADIO3, IDC_RADIO4 };
- for (int i = 0; i < 4; i++) {
- int state = ((CButton*)GetDlgItem(ids[i]))->GetCheck();
- if (state == BST_CHECKED) port = i;
- }
- pPjWarp->port = port;
- if (pPjWarp->port != -1) {
- for (int i = 0; i < 8; i++) {
- pPjWarp->checkSlot[i] = m_grid.GetSlotChecked(pPjWarp->port, i);
- pPjWarp->material[i] = m_grid.GetSlotMaterialType(pPjWarp->port, i);
+ int firstSelectedPort = -1;
+ for (int p = 0; p < kPortCount; ++p) {
+ BOOL selected = (((CButton*)GetDlgItem(ids[p]))->GetCheck() == BST_CHECKED) ? TRUE : FALSE;
+ pPjWarp->selectedPorts[p] = selected;
+ if (selected && firstSelectedPort < 0) {
+ firstSelectedPort = p;
+ }
+
+ for (int s = 0; s < kSlotCount; ++s) {
+ if (selected) {
+ pPjWarp->checkSlots[p][s] = m_grid.GetSlotChecked(p, s);
+ pPjWarp->materialSlots[p][s] = NormalizeMaterial(m_grid.GetSlotMaterialType(p, s));
+ }
+ else {
+ pPjWarp->checkSlots[p][s] = FALSE;
+ pPjWarp->materialSlots[p][s] = CCarrierSlotGrid::MAT_G1;
+ }
}
}
+ // Keep legacy single-port fields in sync for compatibility.
+ pPjWarp->port = firstSelectedPort;
+ if (firstSelectedPort >= 0) {
+ for (int s = 0; s < kSlotCount; ++s) {
+ pPjWarp->checkSlot[s] = pPjWarp->checkSlots[firstSelectedPort][s];
+ pPjWarp->material[s] = NormalizeMaterial(pPjWarp->materialSlots[firstSelectedPort][s]);
+ }
+ }
+ else {
+ for (int s = 0; s < kSlotCount; ++s) {
+ pPjWarp->checkSlot[s] = FALSE;
+ pPjWarp->material[s] = CCarrierSlotGrid::MAT_G1;
+ }
+ }
ContentChanged(1);
return 0;
@@ -221,6 +331,13 @@
m_bContentChangedLock = TRUE;
+ PJWarp* pPjWarp = (PJWarp*)m_pContext;
+ EnsureWarpDefaults(*pPjWarp);
+
+ for (auto& item : m_pjWarps) {
+ EnsureWarpDefaults(item);
+ }
+
CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_RECIPE);
pComboBox->ResetContent();
std::vector<std::string> vecRecipe = RecipeManager::getInstance().getAllPPID();
@@ -228,82 +345,47 @@
pComboBox->AddString(CString(recipe.c_str()));
}
-
- // ComboBox
- PJWarp* pPjWarp = (PJWarp*)m_pContext;
SERVO::CProcessJob* pProcessJob = (SERVO::CProcessJob*)pPjWarp->pj;
SetDlgItemText(IDC_EDIT_PJ_ID, pProcessJob->id().c_str());
int idx = pComboBox->FindStringExact(-1, pProcessJob->recipeSpec().c_str());
if (idx != CB_ERR) pComboBox->SetCurSel(idx);
-
- // 4涓猚heckbox
- static int ids[] = { IDC_RADIO1, IDC_RADIO2, IDC_RADIO3, IDC_RADIO4};
- static char* pszUsed[] = { "Port1(宸插崰鐢�)", "Port2(宸插崰鐢�)", "Port3(宸插崰鐢�)", "Port4(宸插崰鐢�)" };
- static char* pszUnUsed[] = { "Port1(鍙敤)", "Port2(鍙敤)", "Port3(鍙敤)", "Port4(鍙敤)" };
-
- int portIndex = -1;
- bool enable[] = {true, true, true, true};
- bool checked[] = { false, false, false, false };
- for (auto item : m_pjWarps) {
- if (0 <= item.port && item.port <= 4 && item.pj != ((PJWarp*)m_pContext)->pj) {
- enable[item.port] = false;
- }
- }
- if (0 <= ((PJWarp*)m_pContext)->port && ((PJWarp*)m_pContext)->port <= 3) {
- checked[((PJWarp*)m_pContext)->port] = true;
- portIndex = ((PJWarp*)m_pContext)->port;
- m_nSelRadioId = ids[((PJWarp*)m_pContext)->port];
- }
-
- for (int i = 0; i < 4; i++) {
- CButton* pButton = (CButton*)GetDlgItem(ids[i]);
- pButton->SetCheck(checked[i] ? BST_CHECKED : BST_UNCHECKED);
- pButton->SetWindowText(enable[i] ? pszUnUsed[i] : pszUsed[i]);
- pButton->EnableWindow(enable[i]);
-
- m_grid.SetPortAllocated(i, !checked[i], _T(""));
- GetDlgItem(btnID[i])->EnableWindow(checked[i]);
- }
-
-
- // 璇诲彇鍑虹湡瀹炴暟鎹�
+ // 璇诲彇鐪熷疄鏁版嵁
auto& master = theApp.m_model.getMaster();
- int EQID[] = {EQ_ID_LOADPORT1, EQ_ID_LOADPORT2, EQ_ID_LOADPORT3, EQ_ID_LOADPORT4};
- for (int p = 0; p < 4; p++) {
+ int EQID[] = { EQ_ID_LOADPORT1, EQ_ID_LOADPORT2, EQ_ID_LOADPORT3, EQ_ID_LOADPORT4 };
+ for (int p = 0; p < kPortCount; p++) {
SERVO::CLoadPort* pPort = (SERVO::CLoadPort*)master.getEquipment(EQID[p]);
- m_grid.SetPortInfo(p,
- (std::string("Port ") + std::to_string(p+1)).c_str(),
- pPort->getCassetteId().c_str()
- );
- for (int i = 0; i < SLOT_MAX; ++i) {
- SERVO::CSlot* pSlot = pPort->getSlot(i);
- if (!pSlot) {
- continue;
- }
+ m_grid.SetPortInfo(p,
+ (std::string("Port ") + std::to_string(p + 1)).c_str(),
+ pPort->getCassetteId().c_str());
- // 璁剧疆 Panel ID
+ for (int s = 0; s < SLOT_MAX; ++s) {
+ SERVO::CSlot* pSlot = pPort->getSlot(s);
+ if (!pSlot) continue;
+
SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext());
- SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
+ SERVO::CJobDataS* pJobDataS = (pGlass != nullptr) ? pGlass->getJobDataS() : nullptr;
if (pGlass != nullptr && pJobDataS != nullptr) {
- m_grid.SetSlotGlass(p, i, TRUE,
- pGlass->getID().c_str(),
- m_pjWarps[p].material[i]);
+ const int mat = (s < kSlotCount)
+ ? NormalizeMaterial(pPjWarp->materialSlots[p][s])
+ : CCarrierSlotGrid::MAT_G1;
+ m_grid.SetSlotGlass(p, s, TRUE, pGlass->getID().c_str(), mat);
}
else {
- m_grid.SetSlotGlass(p, i, FALSE, nullptr, CCarrierSlotGrid::MAT_G1);
+ m_grid.SetSlotGlass(p, s, FALSE, nullptr, CCarrierSlotGrid::MAT_G1);
}
}
}
-
- // 璁剧疆鍕鹃�夋暟鎹�
- if (portIndex != -1) {
- for (int i = 0; i < 8; i++) {
- m_grid.SetSlotChecked(portIndex, i, ((PJWarp*)m_pContext)->checkSlot[i]);
+ static int ids[] = { IDC_RADIO1, IDC_RADIO2, IDC_RADIO3, IDC_RADIO4 };
+ for (int p = 0; p < kPortCount; ++p) {
+ ((CButton*)GetDlgItem(ids[p]))->SetCheck(pPjWarp->selectedPorts[p] ? BST_CHECKED : BST_UNCHECKED);
+ for (int s = 0; s < kSlotCount; ++s) {
+ m_grid.SetSlotChecked(p, s, pPjWarp->selectedPorts[p] ? pPjWarp->checkSlots[p][s] : FALSE);
}
}
+ RefreshPortLocksAndButtons();
m_bContentChangedLock = FALSE;
}
@@ -317,87 +399,108 @@
ContentChanged(0);
}
+void CCjPage2::RefreshPortLocksAndButtons()
+{
+ if (m_pContext == nullptr) return;
+
+ PJWarp* pCurrent = (PJWarp*)m_pContext;
+ EnsureWarpDefaults(*pCurrent);
+
+ bool usedByOthers[kPortCount] = { false, false, false, false };
+ for (auto& item : m_pjWarps) {
+ if (item.pj == pCurrent->pj) {
+ continue;
+ }
+ EnsureWarpDefaults(item);
+ for (int p = 0; p < kPortCount; ++p) {
+ if (item.selectedPorts[p]) {
+ usedByOthers[p] = true;
+ }
+ }
+ }
+
+ static int ids[] = { IDC_RADIO1, IDC_RADIO2, IDC_RADIO3, IDC_RADIO4 };
+ static const char* pszUsed[] = { "Port1(宸插崰鐢�)", "Port2(宸插崰鐢�)", "Port3(宸插崰鐢�)", "Port4(宸插崰鐢�)" };
+ static const char* pszUnUsed[] = { "Port1(鍙敤)", "Port2(鍙敤)", "Port3(鍙敤)", "Port4(鍙敤)" };
+
+ for (int p = 0; p < kPortCount; ++p) {
+ CButton* pButton = (CButton*)GetDlgItem(ids[p]);
+ BOOL checked = (pButton->GetCheck() == BST_CHECKED) ? TRUE : FALSE;
+ const bool enable = !usedByOthers[p] || checked;
+
+ pButton->EnableWindow(enable ? TRUE : FALSE);
+ pButton->SetWindowText((enable || checked) ? pszUnUsed[p] : pszUsed[p]);
+
+ if (!enable && !checked) {
+ pButton->SetCheck(BST_UNCHECKED);
+ }
+
+ checked = (pButton->GetCheck() == BST_CHECKED) ? TRUE : FALSE;
+ pCurrent->selectedPorts[p] = checked;
+ m_grid.SetPortAllocated(p, !checked, _T(""));
+ GetDlgItem(btnID[p])->EnableWindow(checked);
+ }
+ // Keep one material type across all selected ports.
+ int syncMat = CCarrierSlotGrid::MAT_G1;
+ bool hasSyncMat = false;
+ for (int p = 0; p < kPortCount && !hasSyncMat; ++p) {
+ if (!pCurrent->selectedPorts[p]) continue;
+ for (int s = 0; s < kSlotCount; ++s) {
+ if (m_grid.GetSlotChecked(p, s)) {
+ syncMat = m_grid.GetSlotMaterialType(p, s);
+ hasSyncMat = true;
+ break;
+ }
+ }
+ }
+ if (!hasSyncMat) {
+ for (int p = 0; p < kPortCount; ++p) {
+ if (!pCurrent->selectedPorts[p]) continue;
+ syncMat = m_grid.GetSlotMaterialType(p, 0);
+ hasSyncMat = true;
+ break;
+ }
+ }
+ SyncMaterialAcrossSelectedPorts(syncMat);
+
+ EnsureWarpDefaults(*pCurrent);
+}
+
+void CCjPage2::SyncMaterialAcrossSelectedPorts(int material)
+{
+ if (m_pContext == nullptr) return;
+
+ const int mat = NormalizeMaterial(material);
+ PJWarp* pCurrent = (PJWarp*)m_pContext;
+ for (int p = 0; p < kPortCount; ++p) {
+ if (!pCurrent->selectedPorts[p]) continue;
+ for (int s = 0; s < kSlotCount; ++s) {
+ m_grid.SetSlotMaterialType(p, s, mat, FALSE);
+ }
+ }
+}
+
void CCjPage2::OnBnClickedRadio1()
{
- BOOL lock[] = {TRUE, TRUE, TRUE, TRUE};
- if (IDC_RADIO1 == m_nSelRadioId) {
- CheckRadioButton(IDC_RADIO1, IDC_RADIO4, 0);
- m_nSelRadioId = 0;
- }
- else {
- CheckRadioButton(IDC_RADIO1, IDC_RADIO4, IDC_RADIO1);
- m_nSelRadioId = IDC_RADIO1;
- lock[0] = FALSE;
- }
-
- for (int i = 0; i < 4; i++) {
- m_grid.SetPortAllocated(i, lock[i], _T(""));
- GetDlgItem(btnID[i])->EnableWindow(!lock[i]);
- }
-
+ RefreshPortLocksAndButtons();
ContentChanged(0);
}
void CCjPage2::OnBnClickedRadio2()
{
- BOOL lock[] = { TRUE, TRUE, TRUE, TRUE };
- if (IDC_RADIO2 == m_nSelRadioId) {
- CheckRadioButton(IDC_RADIO1, IDC_RADIO4, 0);
- m_nSelRadioId = 0;
- }
- else {
- CheckRadioButton(IDC_RADIO1, IDC_RADIO4, IDC_RADIO2);
- m_nSelRadioId = IDC_RADIO2;
- lock[1] = FALSE;
- }
-
- for (int i = 0; i < 4; i++) {
- m_grid.SetPortAllocated(i, lock[i], _T(""));
- GetDlgItem(btnID[i])->EnableWindow(!lock[i]);
- }
-
+ RefreshPortLocksAndButtons();
ContentChanged(0);
}
void CCjPage2::OnBnClickedRadio3()
{
- BOOL lock[] = { TRUE, TRUE, TRUE, TRUE };
- if (IDC_RADIO3 == m_nSelRadioId) {
- CheckRadioButton(IDC_RADIO1, IDC_RADIO4, 0);
- m_nSelRadioId = 0;
- }
- else {
- CheckRadioButton(IDC_RADIO1, IDC_RADIO4, IDC_RADIO3);
- m_nSelRadioId = IDC_RADIO3;
- lock[2] = FALSE;
- }
-
- for (int i = 0; i < 4; i++) {
- m_grid.SetPortAllocated(i, lock[i], _T(""));
- GetDlgItem(btnID[i])->EnableWindow(!lock[i]);
- }
-
+ RefreshPortLocksAndButtons();
ContentChanged(0);
}
void CCjPage2::OnBnClickedRadio4()
{
- BOOL lock[] = { TRUE, TRUE, TRUE, TRUE };
- if (IDC_RADIO4 == m_nSelRadioId) {
- CheckRadioButton(IDC_RADIO1, IDC_RADIO4, 0);
- m_nSelRadioId = 0;
- }
- else {
- CheckRadioButton(IDC_RADIO1, IDC_RADIO4, IDC_RADIO4);
- m_nSelRadioId = IDC_RADIO4;
- lock[3] = FALSE;
- }
-
- for (int i = 0; i < 4; i++) {
- m_grid.SetPortAllocated(i, lock[i], _T(""));
- GetDlgItem(btnID[i])->EnableWindow(!lock[i]);
- }
-
+ RefreshPortLocksAndButtons();
ContentChanged(0);
}
@@ -428,22 +531,10 @@
void CCjPage2::OnGridMatChanged(NMHDR* pNMHDR, LRESULT* pResult)
{
auto* nm = reinterpret_cast<CSG_MAT_CHANGE*>(pNMHDR);
- const int port = nm->port;
- const int slot = nm->slot;
const int mat = nm->material; // 1/2
- // 渚嬪锛氬嵆鍒诲埛鏂板彸渚ч瑙�/璁板綍鏃ュ織绛�
+ SyncMaterialAcrossSelectedPorts(mat);
ContentChanged(0);
-
- /*
- if (m_pContext != nullptr) {
- PJWarp* pjWarp = (PJWarp*)m_pContext;
- for (int i = 0; i < 8; i++) {
- pjWarp->checkSlot[i] = m_grid.GetSlotChecked(port, i);
- pjWarp->material[i] = m_grid.GetSlotMaterialType(port, i);
- }
- }
- */
*pResult = 0;
}
@@ -452,7 +543,20 @@
{
auto& master = theApp.m_model.getMaster();
auto port = (SERVO::CLoadPort*)master.getEquipment(EQ_ID_LOADPORT1);
- port->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr);
+ if (port == nullptr) return;
+ short jobExistence[12] = { 0 };
+ short slotProcess = 0;
+ BuildCassetteCtrlMaps(port, jobExistence, slotProcess);
+ bool hasExistence = false;
+ for (short w : jobExistence) {
+ if (w != 0) { hasExistence = true; break; }
+ }
+ if (!hasExistence) {
+ LOGE("ProcessStart blocked (P1): no JobExistence map (portStatus=%d, scanMap=%d).",
+ port->getPortStatus(), port->getScanCassetteMap());
+ return;
+ }
+ port->sendCassetteCtrlCmd(CCC_PROCESS_START, jobExistence, 12, slotProcess, 0, nullptr, nullptr);
}
@@ -460,21 +564,60 @@
{
auto& master = theApp.m_model.getMaster();
auto port = (SERVO::CLoadPort*)master.getEquipment(EQ_ID_LOADPORT2);
- port->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr);
+ if (port == nullptr) return;
+ short jobExistence[12] = { 0 };
+ short slotProcess = 0;
+ BuildCassetteCtrlMaps(port, jobExistence, slotProcess);
+ bool hasExistence = false;
+ for (short w : jobExistence) {
+ if (w != 0) { hasExistence = true; break; }
+ }
+ if (!hasExistence) {
+ LOGE("ProcessStart blocked (P2): no JobExistence map (portStatus=%d, scanMap=%d).",
+ port->getPortStatus(), port->getScanCassetteMap());
+ return;
+ }
+ port->sendCassetteCtrlCmd(CCC_PROCESS_START, jobExistence, 12, slotProcess, 0, nullptr, nullptr);
}
void CCjPage2::OnBnClickedButtonPort3ProcessStart()
{
auto& master = theApp.m_model.getMaster();
auto port = (SERVO::CLoadPort*)master.getEquipment(EQ_ID_LOADPORT3);
- port->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr);
+ if (port == nullptr) return;
+ short jobExistence[12] = { 0 };
+ short slotProcess = 0;
+ BuildCassetteCtrlMaps(port, jobExistence, slotProcess);
+ bool hasExistence = false;
+ for (short w : jobExistence) {
+ if (w != 0) { hasExistence = true; break; }
+ }
+ if (!hasExistence) {
+ LOGE("ProcessStart blocked (P3): no JobExistence map (portStatus=%d, scanMap=%d).",
+ port->getPortStatus(), port->getScanCassetteMap());
+ return;
+ }
+ port->sendCassetteCtrlCmd(CCC_PROCESS_START, jobExistence, 12, slotProcess, 0, nullptr, nullptr);
}
void CCjPage2::OnBnClickedButtonPort4ProcessStart()
{
auto& master = theApp.m_model.getMaster();
auto port = (SERVO::CLoadPort*)master.getEquipment(EQ_ID_LOADPORT4);
- port->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr);
+ if (port == nullptr) return;
+ short jobExistence[12] = { 0 };
+ short slotProcess = 0;
+ BuildCassetteCtrlMaps(port, jobExistence, slotProcess);
+ bool hasExistence = false;
+ for (short w : jobExistence) {
+ if (w != 0) { hasExistence = true; break; }
+ }
+ if (!hasExistence) {
+ LOGE("ProcessStart blocked (P4): no JobExistence map (portStatus=%d, scanMap=%d).",
+ port->getPortStatus(), port->getScanCassetteMap());
+ return;
+ }
+ port->sendCassetteCtrlCmd(CCC_PROCESS_START, jobExistence, 12, slotProcess, 0, nullptr, nullptr);
}
--
Gitblit v1.9.3