// ViewRecipeInspectionView.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù. // #include "stdafx.h" #include "ENRIT.h" #include "ViewRecipeInspectionView.h" #include "afxdialogex.h" #include "Global_Define.h" #include "FrameImg.h" // CViewRecipeInspectionView ´ëÈ­ »óÀÚÀÔ´Ï´Ù. IMPLEMENT_DYNAMIC(CViewRecipeInspectionView, CDialogEx) CViewRecipeInspectionView::CViewRecipeInspectionView(CWnd* pParent /*=NULL*/) : CDialogEx(CViewRecipeInspectionView::IDD, pParent) { m_nCndRDSide = 0; m_nCndMarkSel = 0; m_nCndMarkPos = 0; m_pDlgRecipe = NULL; m_pHardware = NULL; m_pI2M = NULL; m_pViewSettingSpline = NULL; m_pViewSettingNotch = NULL; m_pViewHoleRecipeSetting = NULL; m_pH2V = NULL; m_pBmInfo = NULL; } CViewRecipeInspectionView::~CViewRecipeInspectionView() { if(m_pViewSettingSpline != NULL) { delete m_pViewSettingSpline; m_pViewSettingSpline = NULL; } if(m_pViewSettingNotch != NULL) { delete m_pViewSettingNotch; m_pViewSettingNotch = NULL; } if(m_pViewHoleRecipeSetting != NULL) { delete m_pViewHoleRecipeSetting; m_pViewHoleRecipeSetting = NULL; } if(m_pBmInfo) { delete[] m_pBmInfo,m_pBmInfo = NULL; } } void CViewRecipeInspectionView::DoDataExchange(CDataExchange* pDX) { int i; UINT nIDCmdCorner[] = { IDC_CHECK_USE_CORNER}; for (i = 0; i < eRcp_Corner_End; i++) { DDX_Control(pDX, nIDCmdCorner[i], m_ctrlCmdCorner[i]); } UINT nIDCmdSide[] = { IDC_RDO_SIDE_A,IDC_RDO_SIDE_B,IDC_RDO_SIDE_C,IDC_RDO_SIDE_D,IDC_RDO_SIDE_A_DN,IDC_RDO_SIDE_B_DN,IDC_RDO_SIDE_C_DN,IDC_RDO_SIDE_D_DN}; for (i = 0; i < eRcp_SideRD_End; i++) { DDX_Control(pDX, nIDCmdSide[i], m_ctrlCmdSideBtn[i]); } UINT nIDMarkSel[] = { IDC_RDO_IS_MARK_UP,IDC_RDO_IS_MARK_DN}; for (i = 0; i < eRcp_MarkSel_End; i++) { DDX_Control(pDX, nIDMarkSel[i], m_ctrlRDMarkBtn[i]); } UINT nIDMarkPos[] = { IDC_RDO_MARK_POS_1,IDC_RDO_MARK_POS_2,IDC_RDO_MARK_POS_3}; for (i = 0; i < eRcp_MarkPos_End; i++) { DDX_Control(pDX, nIDMarkPos[i], m_ctrlRDMarkPos[i]); } UINT nIDMarkEn[] = { IDC_CHK_MARK_A1,IDC_CHK_MARK_B1,IDC_CHK_MARK_C1,IDC_CHK_MARK_D1,IDC_CHK_MARK_A2,IDC_CHK_MARK_B2,IDC_CHK_MARK_C2,IDC_CHK_MARK_D2 ,IDC_CHK_MARK_A3,IDC_CHK_MARK_B3,IDC_CHK_MARK_C3,IDC_CHK_MARK_D3}; for (i = 0; i < eRcp_MarkEN_End; i++) { DDX_Control(pDX, nIDMarkEn[i], m_ctrlMarkEnBtn[i]); } UINT nIDJudgeAnd[] = { IDC_CHECK_SIDE_CHIP_AND,IDC_CHECK_SIDE_BURR_AND,IDC_CHECK_SIDE_BROKEN_AND,IDC_CHECK_CF_CHIP_AND,IDC_CHECK_CF_BURR_AND,IDC_CHECK_CRACK_AND}; for (i = 0; i < eRcp_JudgeAnd_End; i++) { DDX_Control(pDX, nIDJudgeAnd[i], m_ctrlJudgeAnd[i]); } UINT nIDJudgeUse[] = { IDC_CHECK_SIDE_CHIP_USE,IDC_CHECK_SIDE_BURR_USE,IDC_CHECK_SIDE_BROKEN_USE,IDC_CHECK_CF_CHIP_USE,IDC_CHECK_CF_BURR_USE,IDC_CHECK_CRACK_USE}; for (i = 0; i < eRcp_JudgeUse_End; i++) { DDX_Control(pDX, nIDJudgeUse[i], m_ctrlJudgeUse[i]); } DDX_Control(pDX,IDC_CHECK_MARK_MODIFY,m_ctrlMarkModify); if(m_pDlgRecipe == NULL) return; CProfileInspect_Prm *pProfilePrm = m_pDlgRecipe->GetProfileParm(); DDX_Text(pDX,IDC_EDIT_CAD_OFFSET_X,pProfilePrm->m_nCADOffsetX[m_nCndRDSide]); DDX_Text(pDX,IDC_EDIT_CAD_OFFSET_Y,pProfilePrm->m_nCADOffsetY[m_nCndRDSide]); DDX_Check(pDX,IDC_CHK_USE_ORIGINPT_ALIGNKEY,pProfilePrm->m_bUseOriginAlignKey[m_nCndRDSide]); DDX_Text(pDX,IDC_EDIT_ORIGINPT_OFFSET_X,pProfilePrm->m_nOriginAlignKeyOffsetX[m_nCndRDSide]); DDX_Text(pDX,IDC_EDIT_ORIGINPT_OFFSET_Y,pProfilePrm->m_nOriginAlignKeyOffsetY[m_nCndRDSide]); DDX_Text(pDX,IDC_EDIT_ORIGINPT_OFFSET_X2,pProfilePrm->m_nOriginAlignKeyOffsetDwX[m_nCndRDSide]); DDX_Text(pDX,IDC_EDIT_ORIGINPT_OFFSET_Y2,pProfilePrm->m_nOriginAlignKeyOffsetDwY[m_nCndRDSide]); CALIGNMARK_PARM *pAlignPrm = NULL; CINSPECT_JUDGEMENT_PARM *pJudge = m_pDlgRecipe->GetJudgePrm(); DDX_Text(pDX,IDC_EDIT_UP_REF_A,pJudge->ptAlign[0][DIMENSION_A].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_A,pJudge->ptAlign[0][DIMENSION_A].y); DDX_Text(pDX,IDC_EDIT_DN_REF_A,pJudge->ptAlign[1][DIMENSION_A].x); DDX_Text(pDX,IDC_EDIT_DN_PLUS_TOL_A,pJudge->ptAlign[1][DIMENSION_A].y); DDX_Text(pDX,IDC_EDIT_UP_REF_A3,pJudge->ptAlign[2][DIMENSION_A].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_A3,pJudge->ptAlign[2][DIMENSION_A].y); DDX_Text(pDX,IDC_EDIT_UP_REF_B,pJudge->ptAlign[0][DIMENSION_B].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_B,pJudge->ptAlign[0][DIMENSION_B].y); DDX_Text(pDX,IDC_EDIT_DN_REF_B,pJudge->ptAlign[1][DIMENSION_B].x); DDX_Text(pDX,IDC_EDIT_DN_PLUS_TOL_B,pJudge->ptAlign[1][DIMENSION_B].y); DDX_Text(pDX,IDC_EDIT_UP_REF_B3,pJudge->ptAlign[2][DIMENSION_B].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_B3,pJudge->ptAlign[2][DIMENSION_B].y); DDX_Text(pDX,IDC_EDIT_UP_REF_C,pJudge->ptAlign[0][DIMENSION_C].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_C,pJudge->ptAlign[0][DIMENSION_C].y); DDX_Text(pDX,IDC_EDIT_DN_REF_C,pJudge->ptAlign[1][DIMENSION_C].x); DDX_Text(pDX,IDC_EDIT_DN_PLUS_TOL_C,pJudge->ptAlign[1][DIMENSION_C].y); DDX_Text(pDX,IDC_EDIT_UP_REF_C3,pJudge->ptAlign[2][DIMENSION_C].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_C3,pJudge->ptAlign[2][DIMENSION_C].y); DDX_Text(pDX,IDC_EDIT_UP_REF_D,pJudge->ptAlign[0][DIMENSION_D].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_D,pJudge->ptAlign[0][DIMENSION_D].y); DDX_Text(pDX,IDC_EDIT_DN_REF_D,pJudge->ptAlign[1][DIMENSION_D].x); DDX_Text(pDX,IDC_EDIT_DN_PLUS_TOL_D,pJudge->ptAlign[1][DIMENSION_D].y); DDX_Text(pDX,IDC_EDIT_UP_REF_D3,pJudge->ptAlign[2][DIMENSION_D].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_D3,pJudge->ptAlign[2][DIMENSION_D].y); DDX_Text(pDX,IDC_EDIT_UP_REF_A2,pJudge->ptAlign[0][DIMENSION_A_DN].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_A2,pJudge->ptAlign[0][DIMENSION_A_DN].y); DDX_Text(pDX,IDC_EDIT_DN_REF_A2,pJudge->ptAlign[1][DIMENSION_A_DN].x); DDX_Text(pDX,IDC_EDIT_DN_PLUS_TOL_A2,pJudge->ptAlign[1][DIMENSION_A_DN].y); DDX_Text(pDX,IDC_EDIT_UP_REF_B2,pJudge->ptAlign[0][DIMENSION_B_DN].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_B2,pJudge->ptAlign[0][DIMENSION_B_DN].y); DDX_Text(pDX,IDC_EDIT_DN_REF_B2,pJudge->ptAlign[1][DIMENSION_B_DN].x); DDX_Text(pDX,IDC_EDIT_DN_PLUS_TOL_B2,pJudge->ptAlign[1][DIMENSION_B_DN].y); DDX_Text(pDX,IDC_EDIT_UP_REF_C2,pJudge->ptAlign[0][DIMENSION_C_DN].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_C2,pJudge->ptAlign[0][DIMENSION_C_DN].y); DDX_Text(pDX,IDC_EDIT_DN_REF_C2,pJudge->ptAlign[1][DIMENSION_C_DN].x); DDX_Text(pDX,IDC_EDIT_DN_PLUS_TOL_C2,pJudge->ptAlign[1][DIMENSION_C_DN].y); DDX_Text(pDX,IDC_EDIT_UP_REF_D2,pJudge->ptAlign[0][DIMENSION_D_DN].x); DDX_Text(pDX,IDC_EDIT_UP_PLUS_TOL_D2,pJudge->ptAlign[0][DIMENSION_D_DN].y); DDX_Text(pDX,IDC_EDIT_DN_REF_D2,pJudge->ptAlign[1][DIMENSION_D_DN].x); DDX_Text(pDX,IDC_EDIT_DN_PLUS_TOL_D2,pJudge->ptAlign[1][DIMENSION_D_DN].y); DDX_Text(pDX,IDC_EDIT_CORNER1_X,pJudge->corner_X[DIMENSION_A].nRefernce); DDX_Text(pDX,IDC_EDIT_CORNER1_Y,pJudge->corner_Y[DIMENSION_A].nRefernce); DDX_Text(pDX,IDC_EDIT_CORNER1_PLUS_TOL,pJudge->corner_X[DIMENSION_A].nTolPlus); DDX_Text(pDX,IDC_EDIT_CORNER1_MINUS_TOL,pJudge->corner_X[DIMENSION_A].nTolMinus); DDX_Text(pDX,IDC_EDIT_CORNER2_X,pJudge->corner_X[DIMENSION_B].nRefernce); DDX_Text(pDX,IDC_EDIT_CORNER2_Y,pJudge->corner_Y[DIMENSION_B].nRefernce); DDX_Text(pDX,IDC_EDIT_CORNER2_PLUS_TOL,pJudge->corner_X[DIMENSION_B].nTolPlus); DDX_Text(pDX,IDC_EDIT_CORNER2_MINUS_TOL,pJudge->corner_X[DIMENSION_B].nTolMinus); DDX_Text(pDX,IDC_EDIT_CORNER3_X,pJudge->corner_X[DIMENSION_C].nRefernce); DDX_Text(pDX,IDC_EDIT_CORNER3_Y,pJudge->corner_Y[DIMENSION_C].nRefernce); DDX_Text(pDX,IDC_EDIT_CORNER3_PLUS_TOL,pJudge->corner_X[DIMENSION_C].nTolPlus); DDX_Text(pDX,IDC_EDIT_CORNER3_MINUS_TOL,pJudge->corner_X[DIMENSION_C].nTolMinus); DDX_Text(pDX,IDC_EDIT_CORNER4_X,pJudge->corner_X[DIMENSION_D].nRefernce); DDX_Text(pDX,IDC_EDIT_CORNER4_Y,pJudge->corner_Y[DIMENSION_D].nRefernce); DDX_Text(pDX,IDC_EDIT_CORNER4_PLUS_TOL,pJudge->corner_X[DIMENSION_D].nTolPlus); DDX_Text(pDX,IDC_EDIT_CORNER4_MINUS_TOL,pJudge->corner_X[DIMENSION_D].nTolMinus); DDX_Check(pDX,IDC_CHK_USE_AVG_PROFILE_JUDGEMENT,pJudge->AvgProfile[m_nCndRDSide].bUse); DDX_Text(pDX,IDC_EDIT_AVG_PROFILE_DIFF,pJudge->AvgProfile[m_nCndRDSide].nDiff); DDX_Check(pDX,IDC_CHK_USE_AVG_CHAMFER_JUDGEMENT,pJudge->AvgChamfer[m_nCndRDSide].bUse); DDX_Text(pDX,IDC_EDIT_AVG_CHAMFER_DIFF,pJudge->AvgChamfer[m_nCndRDSide].nDiff); DDX_Text(pDX,IDC_EDIT_PROFILE_NG_COUNT,pJudge->nMinProfileNgCount[m_nCndRDSide]); DDX_Text(pDX,IDC_EDIT_PROFILE_NG_COUNT_MIN_DIFF,pJudge->nMinProfileNgCount_MinDiff[m_nCndRDSide]); CCORNER_PARM *pCornerPrm = m_pDlgRecipe->GetCornerParm(); DDX_Text(pDX,IDC_EDIT_TH_CONOR,pCornerPrm->m_Thres[(DimensionDir)m_nCndRDSide]); pSTU_CUTAREA_PARM pCutPrm; pCutPrm = m_pDlgRecipe->GetCutAreaPrm((DimensionDir)m_nCndRDSide); DDX_Text(pDX,IDC_EDIT_TH_EDGE_LINE,pCutPrm->m_nThresT); DDX_Text(pDX,IDC_EDIT_TH_EDGE_LINE2,pCutPrm->m_nThresB); pSTU_CHIP_PARM pChipPrm = m_pDlgRecipe->GetInspectInfo()->GetChipParm((DimensionDir)m_nCndRDSide); DDX_Text(pDX,IDC_EDIT_TH_SIDE_CHIP,pChipPrm->m_nChippingThres_T); DDX_Text(pDX,IDC_EDIT_TH_SIDE_CHIP_WHITE,pChipPrm->m_nChippingThres_T_White); DDX_Text(pDX,IDC_EDIT_TH_IN_CHIP2,pChipPrm->m_nChippingThres_B); DDX_Text(pDX,IDC_EDIT_TH_SIDE_BURR2,pChipPrm->m_nChippingThres_T_L); DDX_Text(pDX,IDC_EDIT_TH_SIDE_CRACK,pChipPrm->m_nCrackThres); DDX_Text(pDX,IDC_EDIT_TH_SIDE_BROKEN,pChipPrm->m_nBrokenThres); DDX_Text(pDX,IDC_EDIT_TH_SIDE_CHIPDIFFTHRES,pChipPrm->m_nChipDiffThres); CINSPECT_INFO_PARM *pInsPrm = m_pDlgRecipe->GetInspectInfo(); DDX_Text(pDX,IDC_EDIT_TH_SIDE_RCUT_TOP_GLASS,pInsPrm->m_nRCutThresGlass[m_nCndRDSide][0]); DDX_Text(pDX,IDC_EDIT_TH_SIDE_RCUT_BOT_GLASS,pInsPrm->m_nRCutThresGlass[m_nCndRDSide][1]); DDX_Text(pDX,IDC_EDIT_TH_SIDE_RCUT_TOP_CHAMFER,pInsPrm->m_nRCutThresChamfer[m_nCndRDSide][0]); DDX_Text(pDX,IDC_EDIT_TH_SIDE_RCUT_BOT_CHAMFER,pInsPrm->m_nRCutThresChamfer[m_nCndRDSide][1]); CETC_PARM *pEtcPrm = m_pDlgRecipe->GetEtcPrm((DimensionDir)m_nCndRDSide); DDX_Text(pDX,IDC_EDIT_TH_LINE,pEtcPrm->m_nGlassFindthres_Top); DDX_Text(pDX,IDC_EDIT_LONG_LENGTH,m_pDlgRecipe->m_GlassParm.m_nGlassSizeX); DDX_Text(pDX,IDC_EDIT_SHORT_LENGTH,m_pDlgRecipe->m_GlassParm.m_nGlassSizeY); DDX_Check(pDX,IDC_CHECK_PANEL_REVERSE, m_pDlgRecipe->m_GlassParm.m_bPanelReverse); DDX_Text(pDX,IDC_EDIT_SCAN_TIME,m_pDlgRecipe->m_GlassParm.m_dOneScanTime); DDX_Text(pDX,IDC_EDIT_START_LINE_CHK,m_pDlgRecipe->m_GlassParm.m_nGlassFindHorPos[m_nCndRDSide]); DDX_Text(pDX,IDC_EDIT_SKIP_LINE,m_pDlgRecipe->m_GlassParm.m_nFindGlassStartOffset[m_nCndRDSide]); DDX_Text(pDX, IDC_EDIT_SIDE_DX_CHIP , pJudge->defect[m_nCndRDSide][0].Chip_Side.szDefect.cx); DDX_Text(pDX, IDC_EDIT_SIDE_DY_CHIP , pJudge->defect[m_nCndRDSide][0].Chip_Side.szDefect.cy); DDX_Text(pDX, IDC_EDIT_SIDE_DX_BURR , pJudge->defect[m_nCndRDSide][0].Burr_Side.szDefect.cx); DDX_Text(pDX, IDC_EDIT_SIDE_DY_BURR , pJudge->defect[m_nCndRDSide][0].Burr_Side.szDefect.cy); DDX_Text(pDX, IDC_EDIT_CRACK_DX , pJudge->defect[m_nCndRDSide][0].Crack.szDefect.cx); DDX_Text(pDX, IDC_EDIT_CRACK_DY , pJudge->defect[m_nCndRDSide][0].Crack.szDefect.cy); //kss-> add cfchip,burr DDX_Text(pDX, IDC_EDIT_CF_DX_CHIP , pJudge->defect[m_nCndRDSide][0].Chip_CF.szDefect.cx); DDX_Text(pDX, IDC_EDIT_CF_DY_CHIP , pJudge->defect[m_nCndRDSide][0].Chip_CF.szDefect.cy); DDX_Text(pDX, IDC_EDIT_CF_DX_BURR , pJudge->defect[m_nCndRDSide][0].Burr_CF.szDefect.cx); DDX_Text(pDX, IDC_EDIT_CF_DY_BURR , pJudge->defect[m_nCndRDSide][0].Burr_CF.szDefect.cy); DDX_Text(pDX, IDC_EDIT_SIDE_DX_BROKEN , pJudge->defect[m_nCndRDSide][0].Broken.szDefect.cx); DDX_Text(pDX, IDC_EDIT_SIDE_DY_BROKEN , pJudge->defect[m_nCndRDSide][0].Broken.szDefect.cy); pAlignPrm = m_pDlgRecipe->GetAlignMarkPrm((DimensionDir)m_nCndRDSide); DDX_Text(pDX, IDC_EDIT_MARK_RATE1, pAlignPrm->m_dMarkMatchingRate[0][m_nCndMarkPos]); DDX_Text(pDX, IDC_EDIT_MARK_RATE2, pAlignPrm->m_dMarkMatchingRate[1][m_nCndMarkPos]); DDX_Text(pDX, IDC_EDIT_MARK_RATE3, pAlignPrm->m_dMarkMatchingRate[2][m_nCndMarkPos]); DDX_Radio(pDX,IDC_RDO_BRIGHT_MARK,pAlignPrm->m_nMarkType[0]); CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CViewRecipeInspectionView, CDialogEx) ON_WM_SHOWWINDOW() ON_WM_PAINT() ON_CONTROL_RANGE(BN_CLICKED,IDC_RDO_BRIGHT_MARK,IDC_RDO_USER_MARK,&CViewRecipeInspectionView::OnClickAlignMarkType) ON_MESSAGE(UM_SPLINE_APPLY_RECIPE ,&CViewRecipeInspectionView::OnSplineApplyRecipe) ON_MESSAGE(UM_NOTCH_APPLY_RECIPE ,&CViewRecipeInspectionView::OnNotchApplyRecipe) END_MESSAGE_MAP() // CViewRecipeInspectionView ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù. BEGIN_EVENTSINK_MAP(CViewRecipeInspectionView, CDialogEx) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_USE_CORNER, DISPID_CLICK, CViewRecipeInspectionView::ClickChkUseCornerButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_SIDE_A, DISPID_CLICK, CViewRecipeInspectionView::ClickChkSideSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_SIDE_B, DISPID_CLICK, CViewRecipeInspectionView::ClickChkSideSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_SIDE_C, DISPID_CLICK, CViewRecipeInspectionView::ClickChkSideSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_SIDE_D, DISPID_CLICK, CViewRecipeInspectionView::ClickChkSideSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_SIDE_A_DN, DISPID_CLICK, CViewRecipeInspectionView::ClickChkSideSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_SIDE_B_DN, DISPID_CLICK, CViewRecipeInspectionView::ClickChkSideSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_SIDE_C_DN, DISPID_CLICK, CViewRecipeInspectionView::ClickChkSideSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_SIDE_D_DN, DISPID_CLICK, CViewRecipeInspectionView::ClickChkSideSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_IS_MARK_UP, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_IS_MARK_DN, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkSelButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_MARK_POS_1, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkPosButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_MARK_POS_2, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkPosButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_RDO_MARK_POS_3, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkPosButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_A1, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_A2, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_B1, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_B2, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_C1, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_C2, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_D1, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_D2, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_A3, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_B3, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_C3, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHK_MARK_D3, DISPID_CLICK, CViewRecipeInspectionView::ClickChkMarkEnableButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_SIDE_CHIP_AND, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeAndButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_SIDE_BURR_AND, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeAndButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_SIDE_BROKEN_AND, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeAndButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_CF_CHIP_AND, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeAndButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_CF_BURR_AND, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeAndButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_CRACK_AND, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeAndButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_SIDE_CHIP_USE, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeUSEButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_SIDE_BURR_USE, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeUSEButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_SIDE_BROKEN_USE, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeUSEButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_CF_CHIP_USE, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeUSEButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_CF_BURR_USE, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeUSEButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_CRACK_USE, DISPID_CLICK, CViewRecipeInspectionView::ClickChkJudgeUSEButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_CHECK_MARK_MODIFY, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedCheckMarkModify, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK1_UPDATE, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedMarkUpdate_1, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK1_DEL, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedMarkDelete_1, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK2_UPDATE, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedMarkUpdate_2, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK2_DEL, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedMarkDelete_2, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK3_UPDATE, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedMarkUpdate_3, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK3_DEL, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedMarkDelete_3, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK_LEFT, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedBtnMarkLeft, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK_UP, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedBtnMarkUp, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK_DN, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedBtnMarkDn, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BTN_MARK_RIGHT, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedBtnMarkRight, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BUTTON_HOLE_SETTING, DISPID_CLICK, CViewRecipeInspectionView::ClickHoleSettingButton, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BUTTON_RCUT_SETTING, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedBtnRCutSettins, VTS_NONE) ON_EVENT(CViewRecipeInspectionView, IDC_BUTTON_NOTCH_SETTING, DISPID_CLICK, CViewRecipeInspectionView::OnBnClickedBtnNotchSettins, VTS_NONE) END_EVENTSINK_MAP() BOOL CViewRecipeInspectionView::OnInitDialog() { UpdateData(FALSE); SetFontControl(); Init_BitmapInfo(); m_pViewSettingSpline = new CViewSettingSpline; m_pViewSettingSpline->Create(CViewSettingSpline::IDD,this); m_pViewSettingSpline->SetParent(this); m_pViewSettingSpline->ShowWindow(SW_HIDE); m_pViewSettingNotch = new CViewSettingNotch; m_pViewSettingNotch->Create(CViewSettingNotch::IDD,this); m_pViewSettingNotch->SetParent(this); m_pViewSettingNotch->ShowWindow(SW_HIDE); m_pViewHoleRecipeSetting = new CViewHoleRecipeSetting; m_pViewHoleRecipeSetting->Create(CViewHoleRecipeSetting::IDD,this); m_pViewHoleRecipeSetting->ShowWindow(SW_HIDE); return TRUE; } void CViewRecipeInspectionView::OnShowWindow(BOOL bShow, UINT nStatus) { if(bShow == TRUE) { UpdateData(FALSE); ChangViewCdmSide(IDC_RDO_SIDE_A+m_nCndRDSide); ChangeViewMarkSel(IDC_RDO_IS_MARK_UP+m_nCndMarkSel); ChangeViewMarkPos(IDC_RDO_MARK_POS_1+m_nCndMarkPos); } } BOOL CViewRecipeInspectionView::PreTranslateMessage(MSG* pMsg) { if( pMsg->message == WM_KEYDOWN ) { if(pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE ) { ::TranslateMessage(pMsg); ::DispatchMessage(pMsg); return TRUE; // DO NOT process further } } return CDialog::PreTranslateMessage(pMsg); } // CViewRecipeInspectionView ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù. void CViewRecipeInspectionView::SetRecipe(CHardwareSettings *pHW,CGlassRecipe *pRecipe) { m_pHardware = pHW; m_pDlgRecipe = pRecipe; //UpdateData(FALSE); } void CViewRecipeInspectionView::OnClickAlignMarkType(UINT nID) { UpdateData(TRUE); } void CViewRecipeInspectionView::OnBnClickedBtnRCutSettins() { if(m_pViewSettingSpline != NULL) { m_pViewSettingSpline->SetIndex(m_nCndRDSide); m_pViewSettingSpline->SetRecipe(m_pHardware,m_pDlgRecipe); m_pViewSettingSpline->ShowWindow(SW_SHOW); } } void CViewRecipeInspectionView::OnBnClickedBtnNotchSettins() { if(m_pViewSettingNotch != NULL) { m_pViewSettingNotch->SetIndex(m_nCndRDSide); m_pViewSettingNotch->SetRecipe(m_pHardware,m_pDlgRecipe); m_pViewSettingNotch->ShowWindow(SW_SHOW); } } void CViewRecipeInspectionView::ClickHoleSettingButton() { if(m_pViewHoleRecipeSetting == NULL) return; m_pViewHoleRecipeSetting->SetRecipe(m_pDlgRecipe); m_pViewHoleRecipeSetting->SetInterface(m_pH2V); m_pViewHoleRecipeSetting->ShowWindow(SW_SHOW); } void CViewRecipeInspectionView::SetFontControl() { const int nFontCnt = 110; UINT nIDFont[nFontCnt] = { IDC_EDIT_UP_REF_A,IDC_EDIT_UP_PLUS_TOL_A,IDC_EDIT_UP_MINUS_TOL_A,IDC_EDIT_DN_REF_A,IDC_EDIT_DN_PLUS_TOL_A,IDC_EDIT_DN_MINUS_TOL_A ,IDC_EDIT_UP_REF_B,IDC_EDIT_UP_PLUS_TOL_B,IDC_EDIT_UP_MINUS_TOL_B,IDC_EDIT_DN_REF_B,IDC_EDIT_DN_PLUS_TOL_B,IDC_EDIT_DN_MINUS_TOL_B ,IDC_EDIT_UP_REF_C,IDC_EDIT_UP_PLUS_TOL_C,IDC_EDIT_UP_MINUS_TOL_C,IDC_EDIT_DN_REF_C,IDC_EDIT_DN_PLUS_TOL_C,IDC_EDIT_DN_MINUS_TOL_C ,IDC_EDIT_UP_REF_D,IDC_EDIT_UP_PLUS_TOL_D,IDC_EDIT_UP_MINUS_TOL_D,IDC_EDIT_DN_REF_D,IDC_EDIT_DN_PLUS_TOL_D,IDC_EDIT_DN_MINUS_TOL_D ,IDC_EDIT_UP_REF_A2,IDC_EDIT_UP_PLUS_TOL_A2,IDC_EDIT_DN_REF_A2,IDC_EDIT_DN_PLUS_TOL_A2 ,IDC_EDIT_UP_REF_B2,IDC_EDIT_UP_PLUS_TOL_B2,IDC_EDIT_DN_REF_B2,IDC_EDIT_DN_PLUS_TOL_B2 ,IDC_EDIT_UP_REF_C2,IDC_EDIT_UP_PLUS_TOL_C2,IDC_EDIT_DN_REF_C2,IDC_EDIT_DN_PLUS_TOL_C2 ,IDC_EDIT_UP_REF_D2,IDC_EDIT_UP_PLUS_TOL_D2,IDC_EDIT_DN_REF_D2,IDC_EDIT_DN_PLUS_TOL_D2 ,IDC_EDIT_UP_REF_A3,IDC_EDIT_UP_PLUS_TOL_A3,IDC_EDIT_UP_REF_B3,IDC_EDIT_UP_PLUS_TOL_B3 ,IDC_EDIT_UP_REF_C3,IDC_EDIT_UP_PLUS_TOL_C3,IDC_EDIT_UP_REF_D3,IDC_EDIT_UP_PLUS_TOL_D3 ,IDC_EDIT_CORNER1_X,IDC_EDIT_CORNER1_Y,IDC_EDIT_CORNER1_PLUS_TOL,IDC_EDIT_CORNER1_MINUS_TOL ,IDC_EDIT_CORNER2_X,IDC_EDIT_CORNER2_Y,IDC_EDIT_CORNER2_PLUS_TOL,IDC_EDIT_CORNER2_MINUS_TOL ,IDC_EDIT_CORNER3_X,IDC_EDIT_CORNER3_Y,IDC_EDIT_CORNER3_PLUS_TOL,IDC_EDIT_CORNER3_MINUS_TOL ,IDC_EDIT_CORNER4_X,IDC_EDIT_CORNER4_Y,IDC_EDIT_CORNER4_PLUS_TOL,IDC_EDIT_CORNER4_MINUS_TOL ,IDC_EDIT_LONG_LENGTH,IDC_EDIT_SHORT_LENGTH, IDC_EDIT_SCAN_TIME ,IDC_EDIT_START_LINE_CHK,IDC_EDIT_SKIP_LINE ,IDC_EDIT_TH_CONOR,IDC_EDIT_TH_EDGE_LINE,IDC_EDIT_TH_EDGE_LINE2,IDC_EDIT_TH_SIDE_CHIP,IDC_EDIT_TH_IN_CHIP2,IDC_EDIT_TH_SIDE_BURR2,IDC_EDIT_TH_IN_BURR2,IDC_EDIT_TH_LINE ,IDC_EDIT_SIDE_DX_CHIP,IDC_EDIT_SIDE_DY_CHIP,IDC_EDIT_SIDE_DX_BURR,IDC_EDIT_SIDE_DY_BURR,IDC_EDIT_SIDE_DX_BROKEN,IDC_EDIT_SIDE_DY_BROKEN ,IDC_EDIT_CF_DX_CHIP,IDC_EDIT_CF_DY_CHIP,IDC_EDIT_CF_DX_BURR,IDC_EDIT_CF_DY_BURR,IDC_EDIT_CRACK_DX,IDC_EDIT_CRACK_DY ,IDC_EDIT_MARK_RATE1,IDC_EDIT_MARK_RATE2,IDC_EDIT_MARK_RATE3,IDC_EDIT_CAD_OFFSET_X,IDC_EDIT_CAD_OFFSET_Y ,IDC_EDIT_TH_SIDE_RCUT_BOT_CHAMFER,IDC_EDIT_TH_SIDE_RCUT_BOT_GLASS,IDC_EDIT_TH_SIDE_RCUT_TOP_CHAMFER,IDC_EDIT_TH_SIDE_RCUT_TOP_GLASS ,IDC_EDIT_TH_SIDE_CRACK,IDC_EDIT_TH_SIDE_BROKEN,IDC_EDIT_TH_SIDE_CHIPDIFFTHRES,IDC_EDIT_TH_SIDE_CHIP_WHITE ,IDC_EDIT_AVG_PROFILE_DIFF,IDC_EDIT_AVG_CHAMFER_DIFF,IDC_EDIT_ORIGINPT_OFFSET_X,IDC_EDIT_ORIGINPT_OFFSET_Y,IDC_EDIT_ORIGINPT_OFFSET_X2,IDC_EDIT_ORIGINPT_OFFSET_Y2, IDC_EDIT_PROFILE_NG_COUNT,IDC_EDIT_PROFILE_NG_COUNT_MIN_DIFF}; for(int i=0;iGetJudgePrm(); m_ctrlJudgeAnd[eRcp_JudgeAnd_Chip].SetValue(!pJudge->defect[m_nCndRDSide][0].Chip_Side.bConditionAND); m_ctrlJudgeAnd[eRcp_JudgeAnd_Burr].SetValue(!pJudge->defect[m_nCndRDSide][0].Burr_Side.bConditionAND); m_ctrlJudgeAnd[eRcp_JudgeAnd_Broken].SetValue(!pJudge->defect[m_nCndRDSide][0].Broken.bConditionAND); m_ctrlJudgeAnd[eRcp_JudgeAnd_CFChip].SetValue(!pJudge->defect[m_nCndRDSide][0].Chip_CF.bConditionAND); m_ctrlJudgeAnd[eRcp_JudgeAnd_CFBurr].SetValue(!pJudge->defect[m_nCndRDSide][0].Burr_CF.bConditionAND); m_ctrlJudgeAnd[eRcp_JudgeAnd_Crack].SetValue(!pJudge->defect[m_nCndRDSide][0].Crack.bConditionAND); m_ctrlJudgeUse[eRcp_JudgeUse_Chip].SetValue(!pJudge->defect[m_nCndRDSide][0].Chip_Side.bError); m_ctrlJudgeUse[eRcp_JudgeUse_Burr].SetValue(!pJudge->defect[m_nCndRDSide][0].Burr_Side.bError); m_ctrlJudgeUse[eRcp_JudgeUse_Broken].SetValue(!pJudge->defect[m_nCndRDSide][0].Broken.bError); m_ctrlJudgeUse[eRcp_JudgeUse_CFChip].SetValue(!pJudge->defect[m_nCndRDSide][0].Chip_CF.bError); m_ctrlJudgeUse[eRcp_JudgeUse_CFBurr].SetValue(!pJudge->defect[m_nCndRDSide][0].Burr_CF.bError); m_ctrlJudgeUse[eRcp_JudgeUse_Crack].SetValue(!pJudge->defect[m_nCndRDSide][0].Crack.bError); CCORNER_PARM *pCornerPrm = m_pDlgRecipe->GetCornerParm(); m_ctrlCmdCorner[eRcp_Corner_Use].SetValue(!pCornerPrm->m_bUse); ChangeMarkEnable(FALSE); } void CViewRecipeInspectionView::ClickChkUseCornerButton() { UINT nID = GetFocus()->GetDlgCtrlID(); SetButtonEnable(FALSE); CCORNER_PARM *pCornerPrm; switch(nID) { case IDC_CHECK_USE_CORNER: pCornerPrm = m_pDlgRecipe->GetCornerParm(); pCornerPrm->m_bUse = !m_ctrlCmdCorner[eRcp_Corner_Use].GetValue(); break; } SetButtonEnable(TRUE); } void CViewRecipeInspectionView::ClickChkJudgeUSEButton() { UINT nID = GetFocus()->GetDlgCtrlID(); SetButtonJudgeUseEnable(FALSE); CINSPECT_JUDGEMENT_PARM *pJudge = m_pDlgRecipe->GetJudgePrm(); switch(nID) { case IDC_CHECK_SIDE_CHIP_USE: pJudge->defect[m_nCndRDSide][0].Chip_Side.bError = !m_ctrlJudgeUse[eRcp_JudgeUse_Chip].GetValue(); break; case IDC_CHECK_SIDE_BURR_USE: pJudge->defect[m_nCndRDSide][0].Burr_Side.bError = !m_ctrlJudgeUse[eRcp_JudgeUse_Burr].GetValue(); break; case IDC_CHECK_SIDE_BROKEN_USE: pJudge->defect[m_nCndRDSide][0].Broken.bError = !m_ctrlJudgeUse[eRcp_JudgeUse_Broken].GetValue(); break; case IDC_CHECK_CF_CHIP_USE: pJudge->defect[m_nCndRDSide][0].Chip_CF.bError = !m_ctrlJudgeUse[eRcp_JudgeUse_CFChip].GetValue(); break; case IDC_CHECK_CF_BURR_USE: pJudge->defect[m_nCndRDSide][0].Burr_CF.bError = !m_ctrlJudgeUse[eRcp_JudgeUse_CFBurr].GetValue(); break; case IDC_CHECK_CRACK_USE: pJudge->defect[m_nCndRDSide][0].Crack.bError = !m_ctrlJudgeUse[eRcp_JudgeUse_Crack].GetValue(); break; } SetButtonJudgeUseEnable(TRUE); } void CViewRecipeInspectionView::ClickChkJudgeAndButton() { UINT nID = GetFocus()->GetDlgCtrlID(); SetButtonJudgeAndEnable(FALSE); CINSPECT_JUDGEMENT_PARM *pJudge = m_pDlgRecipe->GetJudgePrm(); switch(nID) { case IDC_CHECK_SIDE_CHIP_AND: pJudge->defect[m_nCndRDSide][0].Chip_Side.bConditionAND = !m_ctrlJudgeAnd[eRcp_JudgeAnd_Chip].GetValue(); break; case IDC_CHECK_SIDE_BURR_AND: pJudge->defect[m_nCndRDSide][0].Burr_Side.bConditionAND = !m_ctrlJudgeAnd[eRcp_JudgeAnd_Burr].GetValue(); break; case IDC_CHECK_SIDE_BROKEN_AND: pJudge->defect[m_nCndRDSide][0].Broken.bConditionAND = !m_ctrlJudgeAnd[eRcp_JudgeAnd_Broken].GetValue(); break; case IDC_CHECK_CF_CHIP_AND: pJudge->defect[m_nCndRDSide][0].Chip_CF.bConditionAND = !m_ctrlJudgeAnd[eRcp_JudgeAnd_CFChip].GetValue(); break; case IDC_CHECK_CF_BURR_AND: pJudge->defect[m_nCndRDSide][0].Burr_CF.bConditionAND = !m_ctrlJudgeAnd[eRcp_JudgeAnd_CFBurr].GetValue(); break; case IDC_CHECK_CRACK_AND: pJudge->defect[m_nCndRDSide][0].Crack.bConditionAND = !m_ctrlJudgeAnd[eRcp_JudgeAnd_Crack].GetValue(); break; } SetButtonJudgeAndEnable(TRUE); } void CViewRecipeInspectionView::SetButtonMarkSelTB(eViewMarkSel eSelView, BOOL bEnable) { if(eSelView >= eRcp_MarkSel_End) return; if(m_ctrlRDMarkBtn[eSelView].GetEnabled() != bEnable){ m_ctrlRDMarkBtn[eSelView].SetEnabled(bEnable); } } void CViewRecipeInspectionView::SetButtonMarkPos(eViewMarkPos eSelView, BOOL bEnable) { if(eSelView >= eRcp_MarkPos_End) return; if(m_ctrlRDMarkPos[eSelView].GetEnabled() != bEnable){ m_ctrlRDMarkPos[eSelView].SetEnabled(bEnable); } } void CViewRecipeInspectionView::SetButtonEnableCmdSide(const BOOL& bEnable) { int i; for (i = 0; i < eRcp_SideRD_End; i++) { if (m_ctrlCmdSideBtn[i].GetEnabled() != bEnable) { m_ctrlCmdSideBtn[i].SetEnabled(bEnable); } } } void CViewRecipeInspectionView::ChangeMarkEnable(BOOL bWrite) { UINT nTopID[] = { DIMENSION_A,DIMENSION_B,DIMENSION_C,DIMENSION_D}; UINT nBotID[] = { DIMENSION_A_DN,DIMENSION_B_DN,DIMENSION_C_DN,DIMENSION_D_DN}; int i; CALIGNMARK_PARM *pAlignPrm; if(bWrite == TRUE) { for(i=0;iGetAlignMarkPrm((DimensionDir)nTopID[i]); pAlignPrm->m_bIsMark[0] = !m_ctrlMarkEnBtn[i].GetValue(); pAlignPrm->m_bIsMark[1] = !m_ctrlMarkEnBtn[i+eRcp_MarkEN_A_DN].GetValue(); pAlignPrm->m_bIsMark[2] = !m_ctrlMarkEnBtn[i+eRcp_MarkEN_Sub_A].GetValue(); } else { pAlignPrm = m_pDlgRecipe->GetAlignMarkPrm((DimensionDir)nBotID[i]); pAlignPrm->m_bIsMark[0] = !m_ctrlMarkEnBtn[i].GetValue(); pAlignPrm->m_bIsMark[1] = !m_ctrlMarkEnBtn[i+eRcp_MarkEN_A_DN].GetValue(); pAlignPrm->m_bIsMark[2] = !m_ctrlMarkEnBtn[i+eRcp_MarkEN_Sub_A].GetValue(); } } } else { for(i=0;iGetAlignMarkPrm((DimensionDir)nTopID[i]); m_ctrlMarkEnBtn[i].SetValue(!pAlignPrm->m_bIsMark[0]); m_ctrlMarkEnBtn[i+eRcp_MarkEN_A_DN].SetValue(!pAlignPrm->m_bIsMark[1]); m_ctrlMarkEnBtn[i+eRcp_MarkEN_Sub_A].SetValue(!pAlignPrm->m_bIsMark[2]); } else { pAlignPrm = m_pDlgRecipe->GetAlignMarkPrm((DimensionDir)nBotID[i]); m_ctrlMarkEnBtn[i].SetValue(!pAlignPrm->m_bIsMark[0]); m_ctrlMarkEnBtn[i+eRcp_MarkEN_A_DN].SetValue(!pAlignPrm->m_bIsMark[1]); m_ctrlMarkEnBtn[i+eRcp_MarkEN_Sub_A].SetValue(!pAlignPrm->m_bIsMark[2]); } } } } void CViewRecipeInspectionView::ChangeViewMarkPos(UINT nID) { SetButtonMarkPosEnableAll(TRUE); switch(nID) { case IDC_RDO_MARK_POS_1: m_nCndMarkPos = 0; SetButtonMarkPos(eRcp_MarkPos_1,FALSE); break; case IDC_RDO_MARK_POS_2: m_nCndMarkPos = 1; SetButtonMarkPos(eRcp_MarkPos_2,FALSE); break; case IDC_RDO_MARK_POS_3: m_nCndMarkPos = 2; SetButtonMarkPos(eRcp_MarkPos_3,FALSE); break; } DrawMarkImage(); } void CViewRecipeInspectionView::ChangeViewMarkSel(UINT nID) { SetButtonMarkEnableAll(TRUE); switch(nID) { case IDC_RDO_IS_MARK_UP: m_nCndMarkSel = 0; SetButtonMarkSelTB(eRcp_MarkSel_T,FALSE); break; case IDC_RDO_IS_MARK_DN: m_nCndMarkSel = 1; SetButtonMarkSelTB(eRcp_MarkSel_B,FALSE); break; } ChangeMarkEnable(FALSE); } void CViewRecipeInspectionView::ClickChkMarkEnableButton() { UINT nID = GetFocus()->GetDlgCtrlID(); SetButtonMarkEnAllEnable(FALSE); ChangeMarkEnable(TRUE); SetButtonMarkEnAllEnable(TRUE); } void CViewRecipeInspectionView::ClickChkMarkSelButton() { UINT nID = GetFocus()->GetDlgCtrlID(); ChangeViewMarkSel(nID); } void CViewRecipeInspectionView::ClickChkMarkPosButton() { UINT nID = GetFocus()->GetDlgCtrlID(); ChangeViewMarkPos(nID); UpdateData(FALSE); } void CViewRecipeInspectionView::ClickChkSideSelButton() { UINT nID = GetFocus()->GetDlgCtrlID(); UpdateData(TRUE); ChangViewCdmSide(nID); } void CViewRecipeInspectionView::SetEnableCmdSide(eViewCmdSide eSelView, BOOL bEnable) { if(eSelView >= eRcp_SideRD_End) return; if(m_ctrlCmdSideBtn[eSelView].GetEnabled() != bEnable){ m_ctrlCmdSideBtn[eSelView].SetEnabled(bEnable); } } void CViewRecipeInspectionView::ChangViewCdmSide(UINT nID) { SetButtonEnableCmdSide(TRUE); //UpdateData(TRUE); eViewCmdSide eSelView; switch(nID) { case IDC_RDO_SIDE_A: m_nCndRDSide = 0; eSelView = eRcp_SideRD_A; break; case IDC_RDO_SIDE_B: m_nCndRDSide = 1; eSelView = eRcp_SideRD_B; break; case IDC_RDO_SIDE_C: m_nCndRDSide = 2; eSelView = eRcp_SideRD_C; break; case IDC_RDO_SIDE_D: m_nCndRDSide = 3; eSelView = eRcp_SideRD_D; break; case IDC_RDO_SIDE_A_DN: m_nCndRDSide = 4; eSelView = eRcp_SideRD_A_DN; break; case IDC_RDO_SIDE_B_DN: m_nCndRDSide = 5; eSelView = eRcp_SideRD_B_DN; break; case IDC_RDO_SIDE_C_DN: m_nCndRDSide = 6; eSelView = eRcp_SideRD_C_DN; break; case IDC_RDO_SIDE_D_DN: m_nCndRDSide = 7; eSelView = eRcp_SideRD_D_DN; break; default: return; } SetEnableCmdSide(eSelView,FALSE); ChangeSideSelect(eSelView); UpdateData(FALSE); } void CViewRecipeInspectionView::OnPaint() { CPaintDC dc(this); // device context for painting DrawMarkImage(); } void CViewRecipeInspectionView::ChangeSideSelect(eViewCmdSide eSelView) { SetControlButton(); if(m_pI2M != NULL) { m_pI2M->IInspectRecipe2RecipeView_ChangeSide(m_nCndRDSide); } ChangeViewMarkPos(IDC_RDO_MARK_POS_1+m_nCndMarkPos); } void CViewRecipeInspectionView::SetButtonMarkEnableAll(const BOOL& bEnable) { int i; for (i = 0; i < eRcp_MarkSel_End; i++) { if (m_ctrlRDMarkBtn[i].GetEnabled() != bEnable) { m_ctrlRDMarkBtn[i].SetEnabled(bEnable); } } } void CViewRecipeInspectionView::SetButtonMarkPosEnableAll(const BOOL& bEnable) { int i; for (i = 0; i < eRcp_MarkPos_End; i++) { if (m_ctrlRDMarkPos[i].GetEnabled() != bEnable) { m_ctrlRDMarkPos[i].SetEnabled(bEnable); } } } void CViewRecipeInspectionView::SetButtonMarkEnAllEnable(const BOOL& bEnable) { int i; for (i = 0; i < eRcp_MarkEN_End; i++) { if (m_ctrlMarkEnBtn[i].GetEnabled() != bEnable) { m_ctrlMarkEnBtn[i].SetEnabled(bEnable); } } } void CViewRecipeInspectionView::SetButtonEnable(const BOOL& bEnable) { int i; for (i = 0; i < eRcp_Corner_End; i++) { if (m_ctrlCmdCorner[i].GetEnabled() != bEnable) { m_ctrlCmdCorner[i].SetEnabled(bEnable); } } } void CViewRecipeInspectionView::SetButtonJudgeAndEnable(const BOOL& bEnable) { int i; for (i = 0; i < eRcp_JudgeAnd_End; i++) { if (m_ctrlJudgeAnd[i].GetEnabled() != bEnable) { m_ctrlJudgeAnd[i].SetEnabled(bEnable); } } } void CViewRecipeInspectionView::SetButtonJudgeUseEnable(const BOOL& bEnable) { int i; for (i = 0; i < eRcp_JudgeUse_End; i++) { if (m_ctrlJudgeUse[i].GetEnabled() != bEnable) { m_ctrlJudgeUse[i].SetEnabled(bEnable); } } } void CViewRecipeInspectionView::Refresh() { UpdateData(FALSE); } void CViewRecipeInspectionView::Init_BitmapInfo() { SIZE sz; sz.cx = 100;sz.cy = 100; m_pBmInfo = (BITMAPINFO*)malloc(sizeof(BITMAPINFO)+256*sizeof(RGBQUAD)); m_pBmInfo->bmiHeader.biBitCount = 8; m_pBmInfo->bmiHeader.biClrImportant = 256; m_pBmInfo->bmiHeader.biClrUsed = 256; m_pBmInfo->bmiHeader.biCompression = BI_RGB; m_pBmInfo->bmiHeader.biHeight = -sz.cy; m_pBmInfo->bmiHeader.biPlanes = 1; m_pBmInfo->bmiHeader.biSize = sizeof( BITMAPINFOHEADER ); m_pBmInfo->bmiHeader.biSizeImage = sz.cx * sz.cy; m_pBmInfo->bmiHeader.biWidth = sz.cx; m_pBmInfo->bmiHeader.biXPelsPerMeter=0; m_pBmInfo->bmiHeader.biYPelsPerMeter=0; for(int i=0; i<256; i++) // Palette number is 256 { m_pBmInfo->bmiColors[i].rgbRed= m_pBmInfo->bmiColors[i].rgbGreen = m_pBmInfo->bmiColors[i].rgbBlue = i; m_pBmInfo->bmiColors[i].rgbReserved = 0; } } void CViewRecipeInspectionView::DrawMarkImage() { if(m_pDlgRecipe == NULL) return; CALIGNMARK_PARM *pAlignPrm = m_pDlgRecipe->GetAlignMarkPrm((DimensionDir)m_nCndRDSide); if(pAlignPrm == NULL) return; CRect rc; CDC *pStaticDC; CWnd *pWnd[MAX_MARKER_COUNT]; pWnd[0] = GetDlgItem(IDC_STATIC_MARK1); pWnd[1] = GetDlgItem(IDC_STATIC_MARK2); pWnd[2] = GetDlgItem(IDC_STATIC_MARK3); CPen pen(PS_SOLID, 1, RGB(255,0,0)), *pOldPen; for(int i = 0; i < MAX_MARKER_COUNT ; i++) { pWnd[i]->GetClientRect(&rc); pStaticDC = pWnd[i]->GetDC(); if(pAlignPrm->IpMarkImg[i][m_nCndMarkPos]) { m_pBmInfo->bmiHeader.biWidth = pAlignPrm->IpMarkImg[i][m_nCndMarkPos]->width; m_pBmInfo->bmiHeader.biHeight = -pAlignPrm->IpMarkImg[i][m_nCndMarkPos]->height; m_pBmInfo->bmiHeader.biSizeImage = pAlignPrm->IpMarkImg[i][m_nCndMarkPos]->width * pAlignPrm->IpMarkImg[i][m_nCndMarkPos]->height; pStaticDC->SetStretchBltMode(COLORONCOLOR); StretchDIBits(pStaticDC->GetSafeHdc(), 0 , 0, rc.Width(),rc.Height(), 0,0,pAlignPrm->IpMarkImg[i][m_nCndMarkPos]->width,pAlignPrm->IpMarkImg[i][m_nCndMarkPos]->height ,pAlignPrm->IpMarkImg[i][m_nCndMarkPos]->imageData,(BITMAPINFO*)m_pBmInfo,DIB_RGB_COLORS,SRCCOPY); } else { pStaticDC->FillRect(rc,&CBrush(RGB(0,0,0))); } pOldPen = pStaticDC->SelectObject(&pen); pStaticDC->MoveTo(CPoint(0,rc.Height()/2)); pStaticDC->LineTo(CPoint(rc.Width(),rc.Height()/2)); pStaticDC->MoveTo(CPoint(rc.Width()/2,0)); pStaticDC->LineTo(CPoint(rc.Width()/2,rc.Height())); pStaticDC->SelectObject(&pOldPen); pWnd[i]->ReleaseDC(pStaticDC); } } void CViewRecipeInspectionView::OnBnClickedCheckMarkModify() { if(m_pI2M == NULL) return; m_pI2M->IInspectRecipe2RecipeView_ModifyMarker(m_ctrlMarkModify.GetValue()); } void CViewRecipeInspectionView::OnBnClickedMarkUpdate_1() {SetRefMark(0);} void CViewRecipeInspectionView::OnBnClickedMarkUpdate_2() {SetRefMark(1);} void CViewRecipeInspectionView::OnBnClickedMarkUpdate_3() {SetRefMark(2);} void CViewRecipeInspectionView::OnBnClickedMarkDelete_1() {Del_Mark(0);} void CViewRecipeInspectionView::OnBnClickedMarkDelete_2() {Del_Mark(1);} void CViewRecipeInspectionView::OnBnClickedMarkDelete_3() {Del_Mark(2);} void CViewRecipeInspectionView::Del_Mark(int nMark) { if(m_pDlgRecipe == NULL) return; CALIGNMARK_PARM *pAlignPrm = m_pDlgRecipe->GetAlignMarkPrm((DimensionDir)m_nCndRDSide); if(pAlignPrm == NULL) return; if(AfxMessageBox(_T("Do you want delete?"),MB_YESNO) != IDYES) return; if(pAlignPrm->IpMarkImg[nMark][m_nCndMarkPos]) cvReleaseImage(&pAlignPrm->IpMarkImg[nMark][m_nCndMarkPos]); pAlignPrm->IpMarkImg[nMark][m_nCndMarkPos] = NULL; CString strPath; strPath.Format(_T("%s\\%s\\Align_%d_%d.bmp"),RECIPE_ALIGN_PATH,m_pDlgRecipe->GetRecipeName(),m_nCndRDSide,nMark); ::DeleteFile(strPath); DrawMarkImage(); } void CViewRecipeInspectionView::SetRefMark(int nPos) { if(m_pI2M == NULL || m_pDlgRecipe == NULL) return; if(m_pI2M->IInspectRecipe2RecipeView_SetMarker(nPos,m_nCndMarkPos) == FALSE) return; DrawMarkImage(); } void CViewRecipeInspectionView::SetMarkPos(int nOff_X,int nOff_Y) { if(m_ctrlMarkModify.GetValue() == 0) return; if(m_pI2M == NULL) return; m_pI2M->IInspectRecipe2RecipeView_SetMarkerPos(nOff_X,nOff_Y); } void CViewRecipeInspectionView::OnBnClickedBtnMarkUp() {SetMarkPos(0,-1);} void CViewRecipeInspectionView::OnBnClickedBtnMarkDn() {SetMarkPos(0,1);} void CViewRecipeInspectionView::OnBnClickedBtnMarkLeft() {SetMarkPos(-1,0);} void CViewRecipeInspectionView::OnBnClickedBtnMarkRight() {SetMarkPos(1,0);} LRESULT CViewRecipeInspectionView::OnSplineApplyRecipe(WPARAM wParam, LPARAM lParam) { return 0; } LRESULT CViewRecipeInspectionView::OnNotchApplyRecipe(WPARAM wParam, LPARAM lParam) { return 0; }