| | |
| | | #include "MsgDlg.h" |
| | | #include "InputDialog.h" |
| | | #include "RecipeDeviceBindDlg.h" |
| | | #include "DeviceRecipeParamDlg.h" |
| | | |
| | | |
| | | // CPageRecipe 对话框 |
| | |
| | | } |
| | | |
| | | m_listPPID.InsertColumn(0, _T(""), LVCFMT_RIGHT, 0); // 隐藏列 |
| | | m_listPPID.InsertColumn(1, _T("No."), LVCFMT_LEFT, width[1]); |
| | | m_listPPID.InsertColumn(1, _T("No."), LVCFMT_CENTER, width[1]); |
| | | m_listPPID.InsertColumn(2, _T("PPID"), LVCFMT_LEFT, width[2]); |
| | | m_listPPID.InsertColumn(3, _T("真空烘烤"), LVCFMT_LEFT, width[6]); |
| | | m_listPPID.InsertColumn(4, _T("Bonder1"), LVCFMT_LEFT, width[4]); |
| | |
| | | |
| | | m_listPPID.InsertColumn(0, _T(""), LVCFMT_RIGHT, width[0]); |
| | | m_listPPID.InsertColumn(1, _T("No."), LVCFMT_CENTER, width[1]); |
| | | m_listPPID.InsertColumn(2, _T("Recipe ID"), LVCFMT_CENTER, width[2]); |
| | | m_listPPID.InsertColumn(3, _T("Recipe 名称"), LVCFMT_CENTER, width[3]); |
| | | m_listPPID.InsertColumn(4, _T("Recipe 参数"), LVCFMT_CENTER, width[4]); |
| | | m_listPPID.InsertColumn(2, _T("Recipe ID"), LVCFMT_LEFT, width[2]); |
| | | m_listPPID.InsertColumn(3, _T("Recipe 名称"), LVCFMT_LEFT, width[3]); |
| | | m_listPPID.InsertColumn(4, _T("Recipe 参数"), LVCFMT_LEFT, width[4]); |
| | | } |
| | | |
| | | void CPageRecipe::UpdateRecipeByPPID(const CString& strPPID) |
| | |
| | | // 遍历数据并插入到CListCtrl中 |
| | | for (int i = 0; i < static_cast<int>(vecRecipe.size()); ++i) { |
| | | const RecipeInfo& recipe = vecRecipe[i]; |
| | | // 原程序要求PPID有子配方,先注释 |
| | | /* |
| | | if (recipe.vecDeviceList.empty() || recipe.vecDeviceList.size() > 6){ |
| | | continue; |
| | | } |
| | | */ |
| | | |
| | | m_listPPID.InsertItem(i, _T("")); // 第0列空白 |
| | | |
| | |
| | | str.Format(_T("%d"), recipe.vecDeviceList.at(j).nRecipeID); |
| | | } |
| | | else { |
| | | str.Format(_T("%s"), CA2T(strRecipeName.c_str())); |
| | | str.Format(_T("%s"), strRecipeName.c_str()); |
| | | } |
| | | |
| | | m_listPPID.SetItemText(i, j + 3, str); |
| | |
| | | |
| | | void CPageRecipe::OnBnClickedButtonNew() |
| | | { |
| | | // TODO: 在此添加控件通知处理程序代码 |
| | | //CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT); |
| | | //int nSel = pComboBox->GetCurSel(); |
| | | //SERVO::CEquipment* pEq = (SERVO::CEquipment*)pComboBox->GetItemDataPtr(nSel); |
| | | //if (pEq == nullptr) { |
| | | // return; |
| | | //} |
| | | int rc = UX_CanExecute(L"recipe"); |
| | | if (rc != 1) { |
| | | AfxMessageBox("操作权限不足,请联系管理人员!"); |
| | | return; |
| | | } |
| | | UX_RecordAction(L"recipe"); |
| | | |
| | | CRecipeDeviceBindDlg dlg(this); |
| | | if (dlg.DoModal() == IDOK) { |
| | |
| | | |
| | | void CPageRecipe::OnBnClickedButtonModify() |
| | | { |
| | | int rc = UX_CanExecute(L"recipe"); |
| | | if (rc != 1) { |
| | | AfxMessageBox("操作权限不足,请联系管理人员!"); |
| | | return; |
| | | } |
| | | UX_RecordAction(L"recipe"); |
| | | |
| | | // TODO: 在此添加控件通知处理程序代码 |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT); |
| | | if (pComboBox == nullptr || !::IsWindow(pComboBox->m_hWnd)) { |
| | |
| | | |
| | | void CPageRecipe::OnBnClickedButtonDelete() |
| | | { |
| | | int rc = UX_CanExecute(L"recipe"); |
| | | if (rc != 1) { |
| | | AfxMessageBox("操作权限不足,请联系管理人员!"); |
| | | return; |
| | | } |
| | | UX_RecordAction(L"recipe"); |
| | | |
| | | // TODO: 在此添加控件通知处理程序代码 |
| | | POSITION pos = m_listPPID.GetFirstSelectedItemPosition(); |
| | | if (!pos) { |
| | |
| | | |
| | | void CPageRecipe::OnBnClickedButtonDeleteAll() |
| | | { |
| | | int rc = UX_CanExecute(L"recipe"); |
| | | if (rc != 1) { |
| | | AfxMessageBox("操作权限不足,请联系管理人员!"); |
| | | return; |
| | | } |
| | | UX_RecordAction(L"recipe"); |
| | | |
| | | // TODO: 在此添加控件通知处理程序代码 |
| | | if (IDYES != AfxMessageBox(_T("确定要删除全部配方记录吗?"), MB_YESNO | MB_ICONWARNING)) { |
| | | return; |
| | |
| | | return; |
| | | } |
| | | |
| | | CString strText = m_listPPID.GetItemText(nItem, 2); |
| | | CString strRecipeID = m_listPPID.GetItemText(nItem, 2); |
| | | CString strRecipeName = m_listPPID.GetItemText(nItem, 3); |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT); |
| | | int nEqSel = pComboBox->GetCurSel(); |
| | | if (nEqSel == CB_ERR) { |
| | | return; |
| | | } |
| | | |
| | | int nRecipeID = _ttoi(strRecipeID); |
| | | SERVO::CEquipment* pEq = (SERVO::CEquipment*)pComboBox->GetItemDataPtr(nEqSel); |
| | | if (pEq == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | CDeviceRecipeParamDlg dlg(this); |
| | | dlg.setDeviceRecipeID(nRecipeID); |
| | | dlg.setDeviceRecipeName(strRecipeName); |
| | | dlg.setEquipment(pEq); |
| | | dlg.DoModal(); |
| | | } |
| | | |
| | | void CPageRecipe::OnCbnSelchangeComboEquipment() |
| | |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | BOOL CPageRecipe::PreTranslateMessage(MSG* pMsg) |
| | | { |
| | | if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) { |
| | | return TRUE; |
| | | } |
| | | |
| | | return CDialogEx::PreTranslateMessage(pMsg); |
| | | } |