#include "stdafx.h" #include "LaiPuLaser.h" #include "afxdialogex.h" #include "DlgChildRecipe.h" #include "LogMgr.h" #include "AuthorityMgr.h" #include "WaferRecipeDataMgr.h" #include "RecipeMgr.h" #include "ProgramLaserTuiHuo.h" #include "CStringFuc.h" #include "MsgBox.h" #include "LogMgr.h" #include "GlobalFunction.h" #include "WaferRecipeDataMgr.h" #include "TimingProgressMgr.h" #include "Layer.h" #include "GlobalFunction.h" #include "Laser.h" #include "WorkFileMgr.h" #include "WorkRecord.h" #include "LanguageMgr.h" #include "DlgLayerViewShow.h" #include "GlobalDrawMgr.h" #include "DlgRecipeCompare.h" #include "DlgDeviceMain.h" #include "DlgChildParaHistory.h" #include "FileMgr.h" #include "DlgOffsetTable.h" IMPLEMENT_DYNAMIC(CDlgChildRecipe, CMyDlgView) BEGIN_MESSAGE_MAP(CDlgChildRecipe, CMyDlgView) ON_WM_TIMER() ON_BN_CLICKED(IDC_RECIPE_NAME_BTN, &CDlgChildRecipe::OnBnClickedRecipeNameBtn) ON_BN_CLICKED(IDC_GROUP_NAME_BTN, &CDlgChildRecipe::OnBnClickedGroupNameBtn) ON_BN_CLICKED(IDC_RECIPE_COPY_BTN, &CDlgChildRecipe::OnBnClickedRecipeCopyBtn) ON_BN_CLICKED(IDC_RECIPE_PASTE_BTN, &CDlgChildRecipe::OnBnClickedRecipeMoveBtn) ON_BN_CLICKED(IDC_OPEN_VIEW_DLG_BTN, &CDlgChildRecipe::OnBnClickedOpenViewDlgBtn) ON_BN_CLICKED(NEW_ADD_GROUP_BTN, &CDlgChildRecipe::OnBnClickedAddGroupBtn) ON_BN_CLICKED(NEW_DEL_GROUP_BTN, &CDlgChildRecipe::OnBnClickedDelGroupBtn) ON_BN_CLICKED(NEW_ADD_RECIPE_BTN, &CDlgChildRecipe::OnBnClickedAddRecipeBtn) ON_BN_CLICKED(NEW_DEL_RECIPE_BTN, &CDlgChildRecipe::OnBnClickedDelRecipeBtn) ON_BN_CLICKED(NEW_RECIPE_TO_EDIT_BTN, &CDlgChildRecipe::OnBnClickedRecipeToEditBtn) ON_CBN_SELCHANGE(NEW_RECIPE_GROUP_COMBO, &CDlgChildRecipe::OnCbnSelchangeNewRecipeGroupCombo) ON_NOTIFY(NM_CLICK, NEW_GROUP_RECIPE_LIST, &CDlgChildRecipe::OnNMClickGroupRecipeList) ON_NOTIFY(NM_CLICK, NEW_EDIT_RECIPE_LIST, &CDlgChildRecipe::OnNMClickEditRecipeList) ON_NOTIFY(NM_CLICK, NEW_SUB_RECIPE_LIST, &CDlgChildRecipe::OnNMClickEditSubRecipeList) ON_BN_CLICKED(IDC_EDIT_PAR_SAVE_BTN, &CDlgChildRecipe::OnBnClickedEditParSaveBtn) ON_BN_CLICKED(NEW_ADD_SUB_RECIPE_BTN, &CDlgChildRecipe::OnBnClickedAddSubRecipeBtn) ON_BN_CLICKED(NEW_DEL_SUB_RECIPE_BTN, &CDlgChildRecipe::OnBnClickedDelSubRecipeBtn) ON_BN_CLICKED(NEW_SUB_RECIPE_MOVE_UP, &CDlgChildRecipe::OnBnClickedSubRecipeMoveUp) ON_BN_CLICKED(NEW_SUB_RECIPE_MOVE_DOWN, &CDlgChildRecipe::OnBnClickedSubRecipeMoveDown) ON_BN_CLICKED(NEW_RENAME_SUB_RECIPE_BTN, &CDlgChildRecipe::OnBnClickedRenameSubRecipeBtn) ON_BN_CLICKED(IDC_RCP_COMPARE_BTN, &CDlgChildRecipe::OnBnClickedRcpCompareBtn) ON_EN_KILLFOCUS(IDC_EDIT_PAR_DOUBLE, &CDlgChildRecipe::OnEnKillfocusDoubleEdit) ON_CBN_SELCHANGE(IDC_SEL_SCAN_AREA_COMBO, &CDlgChildRecipe::OnCbnSelchangeSelScanAreaCombo) ON_CBN_SELCHANGE(IDC_SEL_AREA_IDX_COMBO, &CDlgChildRecipe::OnCbnSelchangeSelAreaIdxCombo) ON_CBN_SELCHANGE(IDC_SEL_BOOL_VAL_COMBO, &CDlgChildRecipe::OnCbnSelchangeSelBoolValCombo) ON_CBN_SELCHANGE(IDC_SEL_OFFSET_TAB_COMBO, &CDlgChildRecipe::OnCbnSelchangeSelOffsetTableCombo) ON_NOTIFY(NM_CUSTOMDRAW, NEW_EDIT_RECIPE_LIST, &CDlgChildRecipe::OnDrawEditRecipeList) ON_NOTIFY(NM_CUSTOMDRAW, NEW_EDIT_RECIPE_INFO_LIST, &CDlgChildRecipe::OnDrawEditRecipeInfoList) ON_BN_CLICKED(IDC_RCP_HISTORY_BTN, &CDlgChildRecipe::OnBnClickedRcpHistoryBtn) ON_BN_CLICKED(IDC_RCP_OFFSET_TAB, &CDlgChildRecipe::OnBnClickedRcpOffsetTab) ON_BN_CLICKED(NEW_UPDATE_RECIPE_BTN, &CDlgChildRecipe::OnBnClickedUpdateRecipeBtn) END_MESSAGE_MAP() CDlgChildRecipe::CDlgChildRecipe(CWnd* pParent /*=NULL*/) : CMyDlgView(CDlgChildRecipe::IDD, pParent) { InitParIDVec(); m_EditRecipeParVal = 0; } CDlgChildRecipe::~CDlgChildRecipe() { } void CDlgChildRecipe::DoDataExchange(CDataExchange* pDX) { CMyDlgView::DoDataExchange(pDX); DDX_Control(pDX, NEW_RECIPE_GROUP_COMBO, m_NewRecipeGroupComb); DDX_Control(pDX, NEW_GROUP_RECIPE_LIST, m_GroupRecipeList); DDX_Control(pDX, NEW_EDIT_RECIPE_LIST, m_EditRecipeList); DDX_Control(pDX, NEW_SUB_RECIPE_LIST, m_EditSubRecipeList); DDX_Control(pDX, NEW_EDIT_RECIPE_INFO_LIST, m_EditRecipeInfoList); DDX_Control(pDX, IDC_SEL_SCAN_AREA_COMBO, m_SelScanAreaComb); DDX_Control(pDX, IDC_SEL_AREA_IDX_COMBO, m_SelScanAreaIdxComb); DDX_Control(pDX, IDC_SEL_BOOL_VAL_COMBO, m_SelBoolValComb); DDX_Control(pDX, IDC_SEL_OFFSET_TAB_COMBO, m_SelOffsetTableComb); DDX_Text(pDX,IDC_EDIT_PAR_DOUBLE,m_EditRecipeParVal); DDX_Control(pDX, IDC_EDIT_PAR_DOUBLE, m_DoubleParEdit); } void CDlgChildRecipe::OnTimer(UINT nIDEvent) { CDialog::OnTimer(nIDEvent); } BOOL CDlgChildRecipe::OnInitDialog() { CMyDlgView::OnInitDialog(); #ifdef __OFFSET_TABLE__ GetDlgItem(IDC_RCP_OFFSET_TAB)->ShowWindow(SW_SHOW); #endif UpdateData(FALSE); return TRUE; } void CDlgChildRecipe::UpdateLanguageTxt() { } void CDlgChildRecipe::SetTextCtrlItemID() { } void CDlgChildRecipe::ChangeItemState() { bool bEnable = true; } void CDlgChildRecipe::OnDrawEditRecipeList( NMHDR* pNMHDR, LRESULT* pResult ) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast( pNMHDR ); *pResult = CDRF_DODEFAULT; if( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage ) { *pResult = CDRF_NOTIFYITEMDRAW; } else if( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage ) { *pResult = CDRF_NOTIFYSUBITEMDRAW; } else if((CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage ) { COLORREF crText, crBkgnd; crText = RGB_BLACK; crBkgnd = RGB_WHITE; int iRow = pLVCD->nmcd.dwItemSpec;//行号 int iCol = Rcp_List_Val_Col; if(iCol == pLVCD->iSubItem)//列号 { if(gRecipeMgr->IsErrRangeParIdx(iRow))//数据超范围 crBkgnd = RGB_RED; else if(gRecipeMgr->IsChangeParIdx(iRow))//改变的参数 crBkgnd = RGB_YELLOW; else if(gRecipeMgr->IsInvalidParIdx(iRow))//无效的参数 crBkgnd = RGB_GRAY1; } pLVCD->clrText = crText; pLVCD->clrTextBk = crBkgnd; *pResult = CDRF_DODEFAULT; } } void CDlgChildRecipe::OnDrawEditRecipeInfoList( NMHDR* pNMHDR, LRESULT* pResult ) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast( pNMHDR ); *pResult = CDRF_DODEFAULT; if( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage ) { *pResult = CDRF_NOTIFYITEMDRAW; } else if( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage ) { *pResult = CDRF_NOTIFYSUBITEMDRAW; } else if((CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage ) { COLORREF crText, crBkgnd; crText = RGB_BLACK; crBkgnd = RGB_WHITE; int iRow = pLVCD->nmcd.dwItemSpec;//行号 int iCol = Rcp_List_Val_Col; if(iCol == pLVCD->iSubItem)//列号 { if(gRecipeMgr->IsErrRangeParIdx(iRow+Rcp_CalInfo_Start_Idx)) crBkgnd = RGB_RED; } pLVCD->clrText = crText; pLVCD->clrTextBk = crBkgnd; *pResult = CDRF_DODEFAULT; } } #if 1 //初始化对话框控件 void CDlgChildRecipe::InitDialogItem() { gRecipeMgr->BindingRecipeGroupComb(&m_NewRecipeGroupComb); gRecipeMgr->InitGroupRecipeList(m_GroupRecipeList); gRecipeMgr->InitEditRecipeList(m_EditRecipeList,true); gRecipeMgr->InitEditRecipeList(m_EditRecipeInfoList,true); gRecipeMgr->InitEditSubRecipeList(m_EditSubRecipeList); UpdateData(FALSE); } void CDlgChildRecipe::InitParIDVec() { } //更新当前选择的recipe 信息 void CDlgChildRecipe::UpdateRecipeParInfo() { } //保存当前选择的recipe bool CDlgChildRecipe::SaveCurSelRecipe() { return true; } #endif #if 1 //更新区域索引值下拉列表 void CDlgChildRecipe::UpdateAreaIdxCombo() { CObjContainer &ObjContainer = gLayer.GetObjContainer(); int AreaCnt = ObjContainer.GetScanAreaCnt(); m_SelScanAreaIdxComb.ResetContent();//清空 int idx = 0; for(int k=0;kWriteDebugLog("Func---->OnBnClickedRecipeNameBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_RecipeName)) return; gRecipeMgr->UpdateGroupRecipeList(m_GroupRecipeList); GetDlgItem(IDC_CUR_EDIT_RCP_PATH)->SetWindowText(gRecipeMgr->GetCurEditRecipeInfo()); } //设置当前选择的gourp 名字 void CDlgChildRecipe::OnBnClickedGroupNameBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedGroupNameBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_GroupName)) return; gRecipeMgr->UpdateGroupRecipeList(m_GroupRecipeList); GetDlgItem(IDC_CUR_EDIT_RCP_PATH)->SetWindowText(gRecipeMgr->GetCurEditRecipeInfo()); } //复制当前选中的recipe void CDlgChildRecipe::OnBnClickedRecipeCopyBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedRecipeCopyBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_CopyRecipe)) return; gRecipeMgr->UpdateGroupRecipeList(m_GroupRecipeList); } //粘贴当前选中的recipe void CDlgChildRecipe::OnBnClickedRecipeMoveBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedRecipeMoveBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_MoveRecipe)) return; gRecipeMgr->UpdateGroupRecipeList(m_GroupRecipeList); ResetEditRecipeItem();//重置当前编辑的recipe 信息 } void CDlgChildRecipe::OnBnClickedOpenViewDlgBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedOpenViewDlgBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_CheckRecipe",true)) return; if(gDraw->IsbDlgLayerViewShow()) { gLogMgr->WriteDebugLog("Cannot Re-Open"); return; } CDlgLayerViewShow *dlg = new CDlgLayerViewShow; dlg->Create(IDD_LAYER_VIEW_SHOW_DLG, this); dlg->ShowWindow(SW_SHOW); } #endif #if 1 void CDlgChildRecipe::OnBnClickedAddGroupBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedAddGroupBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_AddGroup)) return; gRecipeMgr->UpdateGroupRecipeList(m_GroupRecipeList); } void CDlgChildRecipe::OnBnClickedDelGroupBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedDelGroupBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_DelRecipeGroup",true)) return; CMsgBox MsgBox; MsgBox.Show("注意:删除组会将整个组的recipe 都删除!"); if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_DelGroup)) return; gRecipeMgr->UpdateGroupRecipeList(m_GroupRecipeList); } void CDlgChildRecipe::OnBnClickedAddRecipeBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedAddRecipeBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_AddRecipe)) return; gRecipeMgr->UpdateGroupRecipeList(m_GroupRecipeList); } void CDlgChildRecipe::OnBnClickedDelRecipeBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedDelRecipeBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_DelRecipe)) return; gRecipeMgr->UpdateGroupRecipeList(m_GroupRecipeList); ResetEditRecipeItem();//重置当前编辑的recipe 信息 } void CDlgChildRecipe::OnBnClickedRecipeToEditBtn() { } void CDlgChildRecipe::OnCbnSelchangeNewRecipeGroupCombo() { if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_CheckRecipe",true)) return; int Idx = m_NewRecipeGroupComb.GetCurSel(); gRecipeMgr->SetCurSelGourpIdx(Idx); gRecipeMgr->UpdateGroupRecipeList(m_GroupRecipeList); ResetEditRecipeItem();//重置当前编辑的recipe 信息 } //点击recipe 列表 void CDlgChildRecipe::OnNMClickGroupRecipeList(NMHDR *pNMHDR, LRESULT *pResult) { if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_CheckRecipe",true)) return; *pResult = 0; int Idx = GetCurListIdx(m_GroupRecipeList); if(Idx>=0) { gRecipeMgr->OnSelRecipeIdxChange(Idx); //设置为当前编辑的recipe if(gRecipeMgr->ReadEditRecipeFromFile()) { gRecipeMgr->UpdateEditRecipeList(m_EditRecipeList,m_EditRecipeInfoList); gRecipeMgr->UpdateEditSubRecipeList(m_EditSubRecipeList); CString EditRecipePath = gRecipeMgr->GetCurEditRecipeInfo(); CFileMgr FileMgr; m_CurSelRecipeName = FileMgr.GetFileNameFromPath(EditRecipePath,true);//保存当前选择recipe 的名称 GetDlgItem(IDC_CUR_EDIT_RCP_PATH)->SetWindowText(EditRecipePath); GetDlgItem(IDC_CUR_EDIT_SUB_RCP_NAME)->SetWindowText(gRecipeMgr->GetCurEditSubRecipeInfo()); //更新组下拉列表 gWaferRecipeDataMgr->InitScanAreaComb(m_SelScanAreaComb); #ifdef __OFFSET_TABLE__ gWaferRecipeDataMgr->InitOffsetTableComb(m_SelOffsetTableComb); #endif gRecipeMgr->UpdatParBoolComb(m_SelBoolValComb); HideEditRecipeParItem(); gRecipeMgr->CreatCurEditRecipeScanPath(); } } } void CDlgChildRecipe::OnNMClickEditSubRecipeList(NMHDR *pNMHDR, LRESULT *pResult) { if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_CheckRecipe",true)) return; *pResult = 0; int Idx = GetCurListIdx(m_EditSubRecipeList); if(Idx>=0) { gRecipeMgr->SetSubRecipeIdx(Idx); gRecipeMgr->UpdateEditRecipeList(m_EditRecipeList,m_EditRecipeInfoList); GetDlgItem(IDC_CUR_EDIT_SUB_RCP_NAME)->SetWindowText(gRecipeMgr->GetCurEditSubRecipeInfo()); gRecipeMgr->CreatCurEditRecipeScanPath(); UpdateData(FALSE); } } #endif void CDlgChildRecipe::OnBnClickedAddSubRecipeBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedAddSubRecipeBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_AddSubRecipe)) return; gRecipeMgr->UpdateEditSubRecipeList(m_EditSubRecipeList); gRecipeMgr->UpdateEditRecipeList(m_EditRecipeList,m_EditRecipeInfoList); } void CDlgChildRecipe::OnBnClickedDelSubRecipeBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedDelSubRecipeBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_DelSubRecipe)) return; gRecipeMgr->UpdateEditSubRecipeList(m_EditSubRecipeList); GetDlgItem(IDC_CUR_EDIT_SUB_RCP_NAME)->SetWindowText(gRecipeMgr->GetCurEditSubRecipeInfo()); } void CDlgChildRecipe::OnBnClickedRenameSubRecipeBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedRenameSubRecipeBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!gRecipeMgr->EditRecipeByCtrlType(_RecipeCtrl_SubRecipeName)) return; gRecipeMgr->UpdateEditSubRecipeList(m_EditSubRecipeList); gRecipeMgr->UpdateEditRecipeList(m_EditRecipeList,m_EditRecipeInfoList); } //重置当前编辑的recipe 信息 void CDlgChildRecipe::ResetEditRecipeItem() { gRecipeMgr->SetCurSelRecipeName(""); gRecipeMgr->UpdateEditSubRecipeList(m_EditSubRecipeList); gRecipeMgr->UpdateEditRecipeList(m_EditRecipeList,m_EditRecipeInfoList); GetDlgItem(IDC_CUR_EDIT_SUB_RCP_NAME)->SetWindowText(gRecipeMgr->GetCurEditSubRecipeInfo()); GetDlgItem(IDC_CUR_EDIT_RCP_PATH)->SetWindowText(gRecipeMgr->GetCurEditRecipeInfo()); HideEditRecipeParItem(); } void CDlgChildRecipe::HideEditRecipeParItem() { GetDlgItem(IDC_EDIT_PAR_DOUBLE)->ShowWindow(SW_HIDE); GetDlgItem(IDC_SEL_BOOL_VAL_COMBO)->ShowWindow(SW_HIDE); GetDlgItem(IDC_SEL_SCAN_AREA_COMBO)->ShowWindow(SW_HIDE); GetDlgItem(IDC_SEL_AREA_IDX_COMBO)->ShowWindow(SW_HIDE); GetDlgItem(IDC_SEL_OFFSET_TAB_COMBO)->ShowWindow(SW_HIDE); } void CDlgChildRecipe::OnBnClickedSubRecipeMoveUp() { gLogMgr->WriteDebugLog("Func---->OnBnClickedSubRecipeMoveUp"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(gRecipeMgr->MoveSubRecipe(true)) { gRecipeMgr->UpdateEditSubRecipeList(m_EditSubRecipeList); GetDlgItem(IDC_CUR_EDIT_SUB_RCP_NAME)->SetWindowText(gRecipeMgr->GetCurEditSubRecipeInfo()); } } void CDlgChildRecipe::OnBnClickedSubRecipeMoveDown() { gLogMgr->WriteDebugLog("Func---->OnBnClickedSubRecipeMoveDown"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(gRecipeMgr->MoveSubRecipe(false)) { gRecipeMgr->UpdateEditSubRecipeList(m_EditSubRecipeList); GetDlgItem(IDC_CUR_EDIT_SUB_RCP_NAME)->SetWindowText(gRecipeMgr->GetCurEditSubRecipeInfo()); } } //recipe 比较 void CDlgChildRecipe::OnBnClickedRcpCompareBtn() { if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_CheckRecipe",true)) return; CDlgRecipeCompare dlg; dlg.DoModal(); } #if 1 //单击recipe 参数列表 void CDlgChildRecipe::OnNMClickEditRecipeList(NMHDR *pNMHDR, LRESULT *pResult) { if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",false)) return; HideEditRecipeParItem(); *pResult = 0; NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; int Row = pNMListView->iItem; if(Row >= 0)//行号 { CListCtrl &ListCtrl = m_EditRecipeList; int Col = pNMListView->iSubItem; if (Col == Rcp_List_Val_Col) { //记录当前的行列号 m_row = Row; m_col = Col; CRect rc; ListCtrl.GetSubItemRect(Row,Col, LVIR_LABEL, rc);//取得子项的矩形 ListCtrl.ClientToScreen(&rc); ScreenToClient(&rc); CString s = ListCtrl.GetItemText(Row,Col);//取得子项的内容 if((Row SetCurSel(Idx-1); } else if(Row ==Rcp_N2_Idx) { pComb = &m_SelBoolValComb; int Idx = (s==BOOL_STR_ON)?(0):(1); pComb->SetCurSel(Idx); } else if (Row == Rcp_UseCurN2Val_Idx) { pComb = &m_SelBoolValComb; int Idx = (s == BOOL_STR_ON) ? (0) : (1); pComb->SetCurSel(Idx); } #ifdef __OFFSET_TABLE__ else if(Row ==Rcp_OffsetTab_Idx) { pComb = &m_SelOffsetTableComb; } #endif if(pComb) { pComb->SetWindowText(s); pComb->MoveWindow(&rc);//将编辑框移动到子项上面,覆盖在子项上 pComb->ShowDropDown();//自动下拉 pComb->ShowWindow(SW_SHOW);//显示编辑框 pComb->SetFocus();//使编辑框取得焦点 } } } } } //Edit 离焦的时候更新为list 的值 void CDlgChildRecipe::OnEnKillfocusDoubleEdit() { m_DoubleParEdit.ShowWindow(SW_HIDE); if(m_col < 0 || m_row < 0) return; CString key; m_DoubleParEdit.GetWindowText(key); m_EditRecipeList.SetItemText(m_row, m_col, key); } //选择区域文件 void CDlgChildRecipe::OnCbnSelchangeSelScanAreaCombo() { gLogMgr->WriteDebugLog("Func---->OnCbnSelchangeSelScanAreaCombo"); int SelIdx = m_SelScanAreaComb.GetCurSel(); CString s; s.Format("SelIdx = %d",SelIdx); gLogMgr->WriteDebugLog(s); //打开SelIdx 对应的扫描区域 CString AreaName = gWaferRecipeDataMgr->SelScanArea(SelIdx); //默认选择第一个区域 m_EditRecipeList.SetItemText(Rcp_AreaIdx_Idx,Rcp_List_Val_Col,Int2CString(1)); //创建扫描路径(第一个) gRecipeMgr->CreatScanPath(AreaName,0); //将文件名设置为list 的item m_SelScanAreaComb.ShowWindow(SW_HIDE); if(m_col < 0 || m_row < 0) return; m_EditRecipeList.SetItemText(m_row, m_col, AreaName); } //选择OffsetTable 文件 void CDlgChildRecipe::OnCbnSelchangeSelOffsetTableCombo() { gLogMgr->WriteDebugLog("Func---->OnCbnSelchangeSelOffsetTableCombo"); int SelIdx = m_SelOffsetTableComb.GetCurSel(); CString s; s.Format("SelIdx = %d",SelIdx); gLogMgr->WriteDebugLog(s); CString OffsetTableName = gWaferRecipeDataMgr->SelOffsetTable(SelIdx); //将文件名设置为list 的item m_SelOffsetTableComb.ShowWindow(SW_HIDE); if(m_col < 0 || m_row < 0) return; m_EditRecipeList.SetItemText(m_row, m_col, OffsetTableName); } //选择区域索引 void CDlgChildRecipe::OnCbnSelchangeSelAreaIdxCombo() { int SelIdx = m_SelScanAreaIdxComb.GetCurSel(); CString AreaName = m_EditRecipeList.GetItemText(Rcp_AreaName_Idx,Rcp_List_Val_Col);//取得Area 的名称 gRecipeMgr->CreatScanPath(AreaName,SelIdx); //将文件名设置为list 的item m_SelScanAreaIdxComb.ShowWindow(SW_HIDE); if(m_col < 0 || m_row < 0) return; m_EditRecipeList.SetItemText(m_row, m_col, Int2CString(SelIdx+1)); } void CDlgChildRecipe::OnCbnSelchangeSelBoolValCombo() { int SelIdx = m_SelBoolValComb.GetCurSel(); //将文件名设置为list 的item m_SelBoolValComb.ShowWindow(SW_HIDE); if(m_col < 0 || m_row < 0) return; CString s = (SelIdx==0)?(BOOL_STR_ON):(BOOL_STR_OFF); m_EditRecipeList.SetItemText(m_row, m_col,s); } //保存参数 void CDlgChildRecipe::OnBnClickedEditParSaveBtn() { if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_EditRecipe",true)) return; if(!UpdateData(TRUE)) return; gRecipeMgr->SaveEditRecipePar(m_EditRecipeList,m_EditRecipeInfoList); } #endif //查询当前选择recipe 的history void CDlgChildRecipe::OnBnClickedRcpHistoryBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedRcpHistoryBtn"); CString RecipeName = m_CurSelRecipeName; if(RecipeName!="") { CDlgChildParaHistory *pDlg = dynamic_cast(gChildParaHistory); pDlg->SearchByName(RecipeName); gDlgDeviceMain->OnBnClickedRecordBtn(); gDlgDeviceMain->OnBnClickedModuleChildViewBtn4(); } } void CDlgChildRecipe::OnBnClickedRcpOffsetTab() { gLogMgr->WriteDebugLog("Func---->OnBnClickedRcpOffsetTab"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_CheckRecipe",true)) return; CDlgOffsetTable dlg; dlg.DoModal(); #ifdef __OFFSET_TABLE__ gWaferRecipeDataMgr->InitOffsetTableComb(m_SelOffsetTableComb); #endif } //强制刷新Recipe 信息 void CDlgChildRecipe::OnBnClickedUpdateRecipeBtn() { gLogMgr->WriteDebugLog("Func---->OnBnClickedUpdateRecipeBtn"); if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_CheckRecipe",true)) return; CMsgBox MsgBox; if(MsgBox.ConfirmOkCancel("刷新recipe 列表?")) { gRecipeMgr->UpdateRecipeGroupInfo(); m_NewRecipeGroupComb.SetCurSel(-1); OnCbnSelchangeNewRecipeGroupCombo(); } }