| | |
| | | UpdatePjData(); |
| | | } |
| | | |
| | | void CCjPage2::SetExclusionNames(std::vector<std::string>& names) |
| | | void CCjPage2::SetPjWarps(std::vector<PJWarp>& pjs) |
| | | { |
| | | m_exclusionNames = names; |
| | | m_pjWarps = pjs; |
| | | } |
| | | |
| | | BOOL CCjPage2::OnInitDialog() |
| | |
| | | { |
| | | //SERVO::CProcessJob* |
| | | if (m_pContext == nullptr) return; |
| | | SERVO::CProcessJob* pProcessJob = (SERVO::CProcessJob*)m_pContext; |
| | | PJWarp* pPjWarp = (PJWarp*)m_pContext; |
| | | SERVO::CProcessJob* pProcessJob = (SERVO::CProcessJob*)pPjWarp->pj; |
| | | |
| | | // 更新名称 |
| | | BOOL bOkName = TRUE; |
| | | char szBuffer[256]; |
| | | GetDlgItemText(IDC_EDIT_PJ_ID, szBuffer, 256); |
| | | for (auto item : m_exclusionNames) { |
| | | if (item.compare(std::string(szBuffer)) == 0) { |
| | | bOkName = FALSE; |
| | | break; |
| | | for (auto item : m_pjWarps) { |
| | | if (item.pj != m_pContext) { |
| | | SERVO::CProcessJob* temp = (SERVO::CProcessJob*)item.pj; |
| | | if (temp->id().compare(std::string(szBuffer)) == 0) { |
| | | bOkName = FALSE; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (!bOkName) { |
| | |
| | | } |
| | | |
| | | if (m_pContext) { |
| | | SERVO::CProcessJob* pProcessJob = (SERVO::CProcessJob*)m_pContext; |
| | | 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); |