| | |
| | | if (contextType == 1) { |
| | | UpProcessJobId((PJWarp*)pContext); |
| | | } |
| | | else if (contextType == 2) { |
| | | UpControlJobId((SERVO::CControlJob*)pContext); |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | SERVO::CControlJob* cj = (SERVO::CControlJob*)m_tree.GetItemData(hSel); |
| | | ASSERT(m_pages.size() == 3); |
| | | if (0 == ShowPage(2)) { |
| | | |
| | | SERVO::CControlJob* pControlJob = (SERVO::CControlJob*)m_tree.GetItemData(hSel); |
| | | m_pages[2]->SetContext(pControlJob, 2); |
| | | } |
| | | } |
| | | else if (m_tree.GetParentItem(hParent) == nullptr) { |
| | |
| | | } |
| | | } |
| | | |
| | | void CControlJobManagerDlg::UpControlJobId(SERVO::CControlJob* pControlJob) |
| | | { |
| | | // 更新树控件 |
| | | // 遍历根节点 |
| | | HTREEITEM hRoot = m_tree.GetRootItem(); |
| | | if (hRoot != nullptr) { |
| | | DWORD_PTR data = m_tree.GetItemData(hRoot); |
| | | if ((void*)data == pControlJob) { |
| | | m_tree.SetItemText(hRoot, pControlJob->id().c_str()); |
| | | return; // 找到就返回 |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CControlJobManagerDlg::LoadState() |
| | | { |
| | | if (!m_bHasState) return; |
| | |
| | | } |
| | | |
| | | |
| | | SERVO::CLoadPort* pPorts[4]; |
| | | pPorts[0] = (SERVO::CLoadPort*)master.getEquipment(EQ_ID_LOADPORT1); |
| | | pPorts[1] = (SERVO::CLoadPort*)master.getEquipment(EQ_ID_LOADPORT2); |
| | | pPorts[2] = (SERVO::CLoadPort*)master.getEquipment(EQ_ID_LOADPORT3); |
| | | pPorts[3] = (SERVO::CLoadPort*)master.getEquipment(EQ_ID_LOADPORT4); |
| | | |
| | | |
| | | int EQID[] = { EQ_ID_LOADPORT1, EQ_ID_LOADPORT2, EQ_ID_LOADPORT3, EQ_ID_LOADPORT4 }; |
| | | bool bProcessStart[] = {false, false, false, false}; |
| | | std::vector<SERVO::CProcessJob*> pjs; |
| | | for (auto item : m_pjWarps) { |
| | | if (!item.addToCj) continue; |
| | |
| | | } |
| | | if (!bCheck) continue; |
| | | |
| | | SERVO::CLoadPort* pPort = (SERVO::CLoadPort*)master.getEquipment(EQID[item.port]); |
| | | SERVO::CProcessJob* pScr = (SERVO::CProcessJob*)item.pj; |
| | | pScr->setPjWarp(item); |
| | | pScr->setLotId("LotID1"); |
| | | pScr->setProductId("ProductId1"); |
| | | pScr->setOperationId("OperationId"); |
| | | pScr->setRecipe(SERVO::RecipeMethod::NoTuning, pScr->recipeSpec()); |
| | | |
| | | SERVO::CProcessJob * pj = new SERVO::CProcessJob(pScr->id()); |
| | | pj->setPjWarp(item); |
| | | pj->setLotId("LotID1"); |
| | | pj->setProductId("ProductId1"); |
| | | pj->setOperationId("OperationId"); |
| | | pj->setRecipe(SERVO::RecipeMethod::NoTuning, pScr->recipeSpec()); |
| | | |
| | | std::vector<SERVO::CarrierSlotInfo> carriers; |
| | | SERVO::CarrierSlotInfo csi; |
| | | csi.carrierId = pPort->getCassetteId(); |
| | | csi.carrierId = pPorts[item.port]->getCassetteId(); |
| | | for (int i = 0; i < 8; i++) { |
| | | if (item.checkSlot[i]) { |
| | | csi.slots.push_back(i); |
| | | SERVO::CGlass* pGlass = pPorts[item.port]->getGlassFromSlot(i+1); |
| | | if (pGlass != nullptr) { |
| | | csi.slots.push_back(i + 1); |
| | | } |
| | | } |
| | | } |
| | | carriers.push_back(csi); |
| | | pj->setCarriers(carriers); |
| | | pjs.push_back(pj); |
| | | bProcessStart[item.port] = true; |
| | | |
| | | m_pControlJob->addPJ(pScr->id()); |
| | | } |
| | |
| | | m_pControlJob->setPJs(pjs); |
| | | m_pControlJob->clearIssues(); |
| | | int nRet = master.setProcessJobs(pjs); |
| | | |
| | | // 没有问题的pj要释放 |
| | | for (auto pj : pjs) { |
| | | if (!pj->issues().empty()) { |
| | | delete pj; |
| | | } |
| | | } |
| | | pjs.clear(); |
| | | |
| | | if (nRet <= 0) { |
| | | std::string msg("同步Process Job失败!"); |
| | | for (auto pj : pjs) { |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | nRet = master.setControlJob(*m_pControlJob); |
| | | if (nRet != 0) { |
| | | std::string msg("同步ControlJob失败!"); |
| | |
| | | } |
| | | |
| | | |
| | | // 假设成功,要判断,同步到slot的glass中,类型等 |
| | | if (true) { |
| | | 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++) { |
| | | SERVO::CLoadPort* pPort = (SERVO::CLoadPort*)master.getEquipment(EQID[p]); |
| | | for (int i = 0; i < SLOT_MAX; ++i) { |
| | | SERVO::CSlot* pSlot = pPort->getSlot(i); |
| | | if (!pSlot) { |
| | | continue; |
| | | } |
| | | // 成功,要判断,同步到slot的glass中,类型等 |
| | | for (int p = 0; p < 4; p++) { |
| | | if (m_pjWarps[p].port == -1) continue; |
| | | ASSERT(0 <= m_pjWarps[p].port && m_pjWarps[p].port <= 3); |
| | | |
| | | // 设置 Panel ID 和勾选框 |
| | | SERVO::CProcessJob* pj = (SERVO::CProcessJob*)m_pjWarps[p].pj; |
| | | int nRecipeID = RecipeManager::getInstance().getIdByPPID(pj->recipeSpec()); |
| | | RecipeInfo stRecipeInfo = RecipeManager::getInstance().getRecipeByPPID(pj->recipeSpec()); |
| | | std::vector<DeviceRecipe> vecRecipeInfo = stRecipeInfo.vecDeviceList; |
| | | SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext()); |
| | | SERVO::CLoadPort* pLoadPort = pPorts[m_pjWarps[p].port]; |
| | | for (int i = 0; i < SLOT_MAX; ++i) { |
| | | SERVO::CSlot* pSlot = pLoadPort->getSlot(i); |
| | | if (!pSlot) { |
| | | continue; |
| | | } |
| | | |
| | | // 设置 Panel ID 和勾选框 |
| | | SERVO::CProcessJob* pj = (SERVO::CProcessJob*)m_pjWarps[p].pj; |
| | | int nRecipeID = RecipeManager::getInstance().getIdByPPID(pj->recipeSpec()); |
| | | RecipeInfo stRecipeInfo = RecipeManager::getInstance().getRecipeByPPID(pj->recipeSpec()); |
| | | std::vector<DeviceRecipe> vecRecipeInfo = stRecipeInfo.vecDeviceList; |
| | | SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext()); |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | if (pGlass != nullptr && pJobDataS != nullptr) { |
| | | pGlass->setScheduledForProcessing(m_pjWarps[p].checkSlot[i]); |
| | | pGlass->setType(static_cast<SERVO::MaterialsType>(m_pjWarps[p].material[i])); |
| | | |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | if (pGlass != nullptr && pJobDataS != nullptr) { |
| | | pGlass->setScheduledForProcessing(m_pjWarps[p].checkSlot[i]); |
| | | pGlass->setType(static_cast<SERVO::MaterialsType>(m_pjWarps[p].material[i])); |
| | | pJobDataS->setLotId(pj->getLotId().c_str()); |
| | | pJobDataS->setProductId(pj->getProductId().c_str()); |
| | | pJobDataS->setOperationId(pj->getOperationId().c_str()); |
| | | pJobDataS->setMaterialsType(m_pjWarps[p].material[i]); |
| | | pJobDataS->setMasterRecipe(nRecipeID); |
| | | |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | pJobDataS->setLotId("LotID1"); |
| | | pJobDataS->setProductId("ProductId1"); |
| | | pJobDataS->setOperationId("OPerationId"); |
| | | pJobDataS->setMaterialsType(m_pjWarps[p].material[i]); |
| | | pJobDataS->setMasterRecipe(nRecipeID); |
| | | |
| | | for (const auto& info : vecRecipeInfo) { |
| | | const std::string& name = info.strDeviceName; |
| | | short nRecipeID = (short)info.nRecipeID; |
| | | |
| | | if (name == EQ_NAME_EFEM) { |
| | | pJobDataS->setDeviceRecipeId(0, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_BONDER1) { |
| | | pJobDataS->setDeviceRecipeId(1, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_BONDER2) { |
| | | pJobDataS->setDeviceRecipeId(2, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_BAKE_COOLING) { |
| | | pJobDataS->setDeviceRecipeId(3, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_VACUUMBAKE) { |
| | | pJobDataS->setDeviceRecipeId(4, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_MEASUREMENT) { |
| | | pJobDataS->setDeviceRecipeId(5, nRecipeID); |
| | | } |
| | | for (const auto& info : vecRecipeInfo) { |
| | | const std::string& name = info.strDeviceName; |
| | | short nRecipeID = (short)info.nRecipeID; |
| | | |
| | | if (name == EQ_NAME_EFEM) { |
| | | pJobDataS->setDeviceRecipeId(0, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_BONDER1) { |
| | | pJobDataS->setDeviceRecipeId(1, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_BONDER2) { |
| | | pJobDataS->setDeviceRecipeId(2, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_BAKE_COOLING) { |
| | | pJobDataS->setDeviceRecipeId(3, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_VACUUMBAKE) { |
| | | pJobDataS->setDeviceRecipeId(4, nRecipeID); |
| | | } |
| | | else if (name == EQ_NAME_MEASUREMENT) { |
| | | pJobDataS->setDeviceRecipeId(5, nRecipeID); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | AfxMessageBox("断点检查一下数据"); |
| | | |
| | | // process start |
| | | for (int p = 0; p < 4; p++) { |
| | | if (bProcessStart[p]) { |
| | | pPorts[p]->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr); |
| | | Sleep(100); |
| | | } |
| | | } |
| | | } |