| | |
| | | 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) |
| | |
| | | |
| | | 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; |
| | | |
| | | // 更新名称 |
| | |
| | | return -1; |
| | | } |
| | | |
| | | |
| | | pProcessJob->setId(std::string(szBuffer)); |
| | | |
| | | // 更新配方 |
| | |
| | | #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; |
| | |
| | | |
| | | 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(); |
| | |
| | | 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个checkbox |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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); |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | | |