Ongoing80 #3684 CF AOI Review 전설비 Review History Defect이미지 클릭시 Offset 자동 계산 기능 추가
- 계산된 Offset Apply Save 버튼 클릭시 Offset 파일에 반영
- 동일 겐트리 동일 카메라 동일 스캔에 Offset을 두번 적용시도시 경고 팝업 생성 및 미적용
| | |
| | | #include "akGridCtrl/GridCellCheck.h" |
| | | #include "akImageView.h" |
| | | #include <algorithm> |
| | | #include "MacroFile.h" |
| | | |
| | | #ifdef _DEBUG |
| | | #define new DEBUG_NEW |
| | |
| | | ON_BN_CLICKED(IDC_CHK_SINGLE, &CReveiwHistoryDlg::OnClickedChkSingle) |
| | | ON_EN_CHANGE(IDC_EDIT_FILE_COUNT, &CReveiwHistoryDlg::OnChangeEditFileCount) |
| | | ON_WM_KEYDOWN() |
| | | ON_BN_CLICKED(IDC_BUTTON_OFFSET_APPLY, &CReveiwHistoryDlg::OnBnClickedButtonOffsetApply) |
| | | ON_BN_CLICKED(IDC_BUTTON_OFFSET_SAVE, &CReveiwHistoryDlg::OnBnClickedButtonOffsetSave) |
| | | END_MESSAGE_MAP() |
| | | |
| | | // CReveiwHistoryDlg ë©ìì§ ì²ë¦¬ê¸° |
| | |
| | | InitGridReviewLIst(&m_gridReviewList, IDC_STATIC_GRID_GLASS); |
| | | InitGridDefectLIst(&m_gridDefectInfo, IDC_STATIC_GRID_DEFECT); |
| | | InitGridGlassLIst(&m_gridGlassInfo, IDC_STATIC_GRID_GLASS_INFO); |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | CString strPath = _T(""); |
| | | InitDataInfo(); |
| | | strPath.Format(_T("%s%s"), REVIEW_OFFSET_CONFIGFILE_PATH, REVIEW_OFFSET_CONFIGFILE_NAME); |
| | | LoadOffset(strPath); |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | | |
| | | OnViewReviewdefect(); |
| | | |
| | |
| | | _akDefect* pDefectInfo = &m_Formation.m_vecDefects[pDispInfo->item.row - 1]; |
| | | |
| | | m_FormationMap.setSelectDefect(pDefectInfo->m_nDefectID); |
| | | |
| | | //ImageShow(pDefectInfo->m_nDefectID); |
| | | if (!m_bDefectAll) |
| | | { |
| | |
| | | { |
| | | m_nEditCamIdx = pDefect->m_nCameraID; |
| | | m_nEditScanIdx = pDefect->m_nScanIdx; |
| | | if (pDefect->m_nModelIdx == 0) |
| | | m_nCurModelIdx = pDefect->m_nModelIdx; |
| | | if (m_nCurModelIdx == 0) |
| | | { |
| | | m_strGantryIdx = _T("Left"); |
| | | m_dEditOffsetX = (double)(dOffsetDrectionX * (Point.x / 5)) / 1000; |
| | | m_dEditOffsetY = (double)-(dOffsetDrectionY * (Point.y / 5)) / 1000; |
| | | } |
| | | else if (pDefect->m_nModelIdx == 1) |
| | | else if (m_nCurModelIdx == 1) |
| | | { |
| | | m_strGantryIdx = _T("Right"); |
| | | m_dEditOffsetX = (double)-(dOffsetDrectionX * (Point.x / 5)) / 1000; |
| | |
| | | |
| | | CDialogEx::OnKeyDown(nChar, nRepCnt, nFlags); |
| | | } |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | void CReveiwHistoryDlg::OnBnClickedButtonOffsetApply() |
| | | { |
| | | // TODO: ì¬ê¸°ì 컨í¸ë¡¤ ì림 ì²ë¦¬ê¸° ì½ë를 ì¶ê°í©ëë¤. |
| | | ApplyOffset(m_nCurModelIdx, m_nEditCamIdx, m_nEditScanIdx, m_dEditOffsetX, m_dEditOffsetY); |
| | | } |
| | | |
| | | |
| | | void CReveiwHistoryDlg::OnBnClickedButtonOffsetSave() |
| | | { |
| | | // TODO: ì¬ê¸°ì 컨í¸ë¡¤ ì림 ì²ë¦¬ê¸° ì½ë를 ì¶ê°í©ëë¤. |
| | | SaveOffset(); |
| | | } |
| | | |
| | | BOOL CReveiwHistoryDlg::LoadOffset(CString strFilePath) |
| | | { |
| | | //dBarValue = 0; |
| | | CMacroFile macroFile; |
| | | |
| | | if (!macroFile.Read(strFilePath)) |
| | | return FALSE; |
| | | |
| | | macroFile.GetItem(_T("CAMERA_COUNT"), m_nCameraCount, 0); |
| | | macroFile.GetItem(_T("SCAN_COUNT"), m_nScanCount, 0); |
| | | macroFile.GetItem(_T("XPOS_COUNT"), m_XposCount, 0); |
| | | CString strItem = _T(""); |
| | | double dXoffset = 0; |
| | | double dYoffset = 0; |
| | | double dXMin = 0; |
| | | double dXMAX = 0; |
| | | |
| | | double dValue = 0; |
| | | dValue = 2 * CAM_MAX_COUNT*SCAN_MAX_COUNT; |
| | | dValue = 1600 / dValue; |
| | | |
| | | for (int nModuleidx = 0; nModuleidx < 2; nModuleidx++) |
| | | { |
| | | for (int nCamidx = 0; nCamidx < CAM_MAX_COUNT; nCamidx++) |
| | | { |
| | | for (int nScanidx = 0; nScanidx < SCAN_MAX_COUNT; nScanidx++) |
| | | { |
| | | |
| | | for (int nXposIndex = 0; nXposIndex < XPOS_MAX_COUNT; nXposIndex++) |
| | | { |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_OFFSET_X"), nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | macroFile.GetItem(strItem, dXoffset); |
| | | |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_OFFSET_Y"), nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | macroFile.GetItem(strItem, dYoffset); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_XPOS_X_MIN"), nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | macroFile.GetItem(strItem, dXMin); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_XPOS_X_MAN"), nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | macroFile.GetItem(strItem, dXMAX); |
| | | |
| | | SetInputOffSet(nModuleidx, nCamidx, nScanidx, nXposIndex, dXoffset, dYoffset, dXMin, dXMAX); |
| | | |
| | | } |
| | | //IncressProcessBar(dValue); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return TRUE; |
| | | |
| | | } |
| | | |
| | | BOOL CReveiwHistoryDlg::SaveOffset() |
| | | { |
| | | //dBarValue = 0; |
| | | |
| | | CString strForderPath; |
| | | CString strFileName; |
| | | CTime time = CTime::GetCurrentTime(); |
| | | strFileName.Format(_T("ReviewOffSet_%04d%02d%02d%02d%02d%02d.cfg"), time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond()); |
| | | strForderPath.Format(_T("%s%s"), REVIEW_OFFSET_BACKUP_FORDER_PATH, strFileName); |
| | | |
| | | CopyFile(REVIEW_OFFSET_CONFIGFILE_FULL_PATHNAME, strForderPath, FALSE); |
| | | |
| | | BOOL bReturn = FALSE; |
| | | CString strTemp; |
| | | int nTemp; |
| | | double dTemp; |
| | | |
| | | CMacroFile macroFile; |
| | | macroFile.Clear(); |
| | | |
| | | CString strItem = _T(""); |
| | | |
| | | |
| | | strItem.Format(_T("CAMERA_COUNT")); |
| | | macroFile.SetItem(strItem, m_nCameraCount); |
| | | |
| | | strItem.Format(_T("SCAN_COUNT")); |
| | | macroFile.SetItem(strItem, m_nScanCount); |
| | | |
| | | strItem.Format(_T("XPOS_COUNT")); |
| | | macroFile.SetItem(strItem, m_XposCount); |
| | | |
| | | |
| | | CString strData; |
| | | double dData = 0; |
| | | for (int nModuleidx = 0; nModuleidx < 2; nModuleidx++) |
| | | { |
| | | for (int nCamidx = 0; nCamidx < CAM_MAX_COUNT; nCamidx++) |
| | | { |
| | | for (int nScanidx = 0; nScanidx < SCAN_MAX_COUNT; nScanidx++) |
| | | { |
| | | |
| | | for (int nXposIndex = 0; nXposIndex < XPOS_MAX_COUNT; nXposIndex++) |
| | | { |
| | | |
| | | OffSetInfo pOffSet = GetOffSetInfo(nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_OFFSET_X"), nModuleidx, nCamidx, nScanidx); |
| | | dData = pOffSet.dXoffSetValue; |
| | | macroFile.SetItem(strItem, dData); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_OFFSET_Y"), nModuleidx, nCamidx, nScanidx); |
| | | dData = pOffSet.dYoffSetValue; |
| | | macroFile.SetItem(strItem, dData); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_XPOS_X_MIN"), nModuleidx, nCamidx, nScanidx); |
| | | dData = pOffSet.dXposMin; |
| | | macroFile.SetItem(strItem, dData); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_XPOS_X_MAN"), nModuleidx, nCamidx, nScanidx); |
| | | dData = pOffSet.dXposMax; |
| | | macroFile.SetItem(strItem, dData); |
| | | } |
| | | //IncressProcessBar(5); |
| | | } |
| | | } |
| | | } |
| | | |
| | | CString strFilePath; |
| | | strFilePath.Format(_T("%s%s"), REVIEW_OFFSET_CONFIGFILE_PATH, REVIEW_OFFSET_CONFIGFILE_NAME); |
| | | |
| | | bReturn = macroFile.Write(strFilePath); |
| | | |
| | | if (bReturn) AfxMessageBox(_T("OFFSET SAVE SUCCESS"), MB_OK | MB_ICONASTERISK); |
| | | else AfxMessageBox(_T("OFFSET SAVE FAIL"), MB_OK | MB_ICONASTERISK); |
| | | |
| | | return bReturn; |
| | | } |
| | | |
| | | BOOL CReveiwHistoryDlg::ApplyOffset(int nModuleidx, int nCamIndex, int ScanIndex, double dXOffsetValue, double dYOffsetValue) |
| | | { |
| | | if (nCamIndex > CAM_MAX_COUNT || nCamIndex < 0) |
| | | { |
| | | return FALSE; |
| | | } |
| | | |
| | | if (ScanIndex > SCAN_MAX_COUNT || ScanIndex < 0) |
| | | { |
| | | return FALSE; |
| | | } |
| | | |
| | | |
| | | if (nModuleidx == 0) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(0); |
| | | if (pOffSetData->bCheckSave == TRUE) |
| | | { |
| | | AfxMessageBox(_T("ì´ë¯¸ ì ì¥í OFFSET ì
ëë¤. ë¤ì ì
í
ì ìíìë©´ íë¡ê·¸ë¨ì ì¬ìì í´ì£¼ì¸ì"), MB_OK | MB_ICONWARNING); |
| | | return FALSE; |
| | | } |
| | | else |
| | | { |
| | | pOffSetData->dXoffSetValue += dXOffsetValue; |
| | | pOffSetData->dYoffSetValue += dYOffsetValue; |
| | | pOffSetData->bCheckSave = TRUE; |
| | | } |
| | | } |
| | | else if (nModuleidx == 1) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo2[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(0); |
| | | if (pOffSetData->bCheckSave == TRUE) |
| | | { |
| | | AfxMessageBox(_T("ì´ë¯¸ ì ì¥í OFFSET ì
ëë¤. ë¤ì ì
í
ì ìíìë©´ íë¡ê·¸ë¨ì ì¬ìì í´ì£¼ì¸ì"), MB_OK | MB_ICONWARNING); |
| | | return FALSE; |
| | | } |
| | | else |
| | | { |
| | | pOffSetData->dXoffSetValue += dXOffsetValue; |
| | | pOffSetData->dYoffSetValue += dYOffsetValue; |
| | | pOffSetData->bCheckSave = TRUE; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return FALSE; |
| | | } |
| | | } |
| | | |
| | | BOOL CReveiwHistoryDlg::SetInputOffSet(int nModuleidx, int nCamIndex, int ScanIndex, int nXposIndex, double dXOffsetValue, double dYOffsetValue, double dXposMin, double dXposMax, BOOL bCheckSave/* = 0*/) |
| | | { |
| | | if (nCamIndex > CAM_MAX_COUNT || nCamIndex < 0) |
| | | { |
| | | return FALSE; |
| | | } |
| | | |
| | | if (ScanIndex > SCAN_MAX_COUNT || ScanIndex < 0) |
| | | { |
| | | return FALSE; |
| | | } |
| | | |
| | | |
| | | if (nModuleidx == 0) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(nXposIndex); |
| | | pOffSetData->dXoffSetValue = dXOffsetValue; |
| | | pOffSetData->dYoffSetValue = dYOffsetValue; |
| | | pOffSetData->dXposMin = dXposMin; |
| | | pOffSetData->dXposMax = dXposMax; |
| | | pOffSetData->bCheckSave = bCheckSave; |
| | | |
| | | } |
| | | else if (nModuleidx == 1) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo2[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(nXposIndex); |
| | | pOffSetData->dXoffSetValue = dXOffsetValue; |
| | | pOffSetData->dYoffSetValue = dYOffsetValue; |
| | | pOffSetData->dXposMin = dXposMin; |
| | | pOffSetData->dXposMax = dXposMax; |
| | | pOffSetData->bCheckSave = bCheckSave; |
| | | } |
| | | else |
| | | { |
| | | return FALSE; |
| | | } |
| | | } |
| | | |
| | | void CReveiwHistoryDlg::InitDataInfo() |
| | | { |
| | | //미리 ê³µê° í ë¹ |
| | | for (int nCamidx = 0; nCamidx < CAM_MAX_COUNT; nCamidx++) |
| | | { |
| | | |
| | | VecOffSetScanData pVecScanData; |
| | | for (int nScanidx = 0; nScanidx < SCAN_MAX_COUNT; nScanidx++) |
| | | { |
| | | VecOffSetData pVecData; |
| | | for (int nXposIndex = 0; nXposIndex < XPOS_MAX_COUNT; nXposIndex++) |
| | | { |
| | | |
| | | OffSetInfo pInfo; |
| | | pInfo.nXposIndex = nXposIndex; |
| | | pInfo.nScanIndex = nScanidx; |
| | | pInfo.nCamIndex = nCamidx; |
| | | pVecData.push_back(pInfo); |
| | | |
| | | } |
| | | pVecScanData.push_back(pVecData); |
| | | |
| | | } |
| | | |
| | | m_vecOffSetCameraInfo.push_back(pVecScanData); |
| | | } |
| | | |
| | | for (int nCamidx = 0; nCamidx < CAM_MAX_COUNT; nCamidx++) |
| | | { |
| | | |
| | | VecOffSetScanData pVecScanData; |
| | | for (int nScanidx = 0; nScanidx < SCAN_MAX_COUNT; nScanidx++) |
| | | { |
| | | VecOffSetData pVecData; |
| | | for (int nXposIndex = 0; nXposIndex < XPOS_MAX_COUNT; nXposIndex++) |
| | | { |
| | | |
| | | OffSetInfo pInfo; |
| | | pInfo.nXposIndex = nXposIndex; |
| | | pInfo.nScanIndex = nScanidx; |
| | | pInfo.nCamIndex = nCamidx; |
| | | pVecData.push_back(pInfo); |
| | | |
| | | } |
| | | pVecScanData.push_back(pVecData); |
| | | |
| | | } |
| | | |
| | | m_vecOffSetCameraInfo2.push_back(pVecScanData); |
| | | } |
| | | |
| | | } |
| | | |
| | | OffSetInfo CReveiwHistoryDlg::GetOffSetInfo(int nModuleidx, int nCamIndex, int ScanIndex, int nXposIndex) |
| | | { |
| | | OffSetInfo pOFF; |
| | | if (nCamIndex > CAM_MAX_COUNT || nCamIndex < 0) |
| | | { |
| | | return pOFF; |
| | | } |
| | | |
| | | if (ScanIndex > SCAN_MAX_COUNT || ScanIndex < 0) |
| | | { |
| | | return pOFF; |
| | | } |
| | | |
| | | |
| | | if (nModuleidx == 0) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(nXposIndex); |
| | | |
| | | return *pOffSetData; |
| | | } |
| | | else if (nModuleidx == 1) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo2[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(nXposIndex); |
| | | return *pOffSetData; |
| | | } |
| | | else |
| | | { |
| | | return pOFF; |
| | | } |
| | | } |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | |
| | | |
| | | |
| | | #define MAX_COUNT 100 |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | enum OFFSETCOUNT { |
| | | CAM_MAX_COUNT = 20, XPOS_MAX_COUNT = 10, SCAN_MAX_COUNT = 10, PROGRESS_BAR_MAX = 2000 |
| | | }; |
| | | |
| | | #define REVIEW_OFFSET_CONFIGFILE_PATH _T("D:\\DIT_Review\\ReviewServerConfig\\") //210805 |
| | | #define REVIEW_OFFSET_CONFIGFILE_NAME _T("ReviewOffSet.cfg") |
| | | #define REVIEW_OFFSET_CONFIGFILE_FULL_PATHNAME _T("D:\\DIT_Review\\ReviewServerConfig\\ReviewOffSet.cfg") |
| | | #define REVIEW_OFFSET_BACKUP_FORDER_NAME _T("OffsetBackup") |
| | | #define REVIEW_OFFSET_BACKUP_FORDER_PATH _T("D:\\DIT_Review\\ReviewServerConfig\\OffsetBackup\\") |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | | |
| | | struct _DefectList |
| | | { |
| | |
| | | int m_nAllCount; |
| | | CString m_strJudge; |
| | | }; |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | struct OffSetInfo |
| | | { |
| | | int nXposIndex; |
| | | int nScanIndex; |
| | | int nCamIndex; |
| | | double dXposMax; |
| | | double dXposMin; |
| | | double dYposMax; |
| | | double dYposMin; |
| | | double dXoffSetValue; |
| | | double dYoffSetValue; |
| | | BOOL bCheckSave; |
| | | |
| | | }; |
| | | typedef std::vector<OffSetInfo> VecOffSetData; |
| | | typedef std::vector<VecOffSetData> VecOffSetScanData; |
| | | typedef std::vector<VecOffSetScanData> VecOffSetCameraInfo; |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | | |
| | | // CReveiwHistoryDlg ëí ìì |
| | | class CReveiwHistoryDlg : public CDialogEx |
| | |
| | | void BinFileOpen(int nCount); |
| | | void OnCbnSelchangeComboRawtype(); |
| | | |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | afx_msg void OnBnClickedButtonOffsetApply(); |
| | | afx_msg void OnBnClickedButtonOffsetSave(); |
| | | BOOL LoadOffset(CString strFilePath); |
| | | BOOL SaveOffset(); |
| | | BOOL ApplyOffset(int nModuleidx, int nCamIndex, int ScanIndex, double dXOffsetValue, double dYOffsetValue); |
| | | BOOL SetInputOffSet(int nModuleidx, int nCamIndex, int ScanIndex, int nXposIndex, double dXOffsetValue, double dYOffsetValue, double dXposMin, double dXposMax, BOOL bCheckSave = 0); |
| | | void InitDataInfo(); |
| | | OffSetInfo GetOffSetInfo(int nMoudleidx, int nCamIndex, int ScanIndex, int nXposIndex); |
| | | |
| | | int m_nCameraCount; |
| | | int m_nScanCount; |
| | | int m_XposCount; |
| | | int m_nCurModelIdx; |
| | | |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | | |
| | | //Xpos ìì¹ë³ ì¤ì Offset Data 를 ê°ì§ê³ ìë Vector |
| | | VecOffSetData m_vecOffSetData; |
| | | //Scan Index를 íµí OffSet Data 를 ê´ë¦¬í기ìí Vector |
| | | VecOffSetScanData m_vecOffSetScanData; |
| | | //CamIndex를 íµí ê´ë¦¬ë¥¼ ìí Vector module 0 |
| | | VecOffSetCameraInfo m_vecOffSetCameraInfo; |
| | | //CamIndex를 íµí ê´ë¦¬ë¥¼ ìí Vector module 1 |
| | | VecOffSetCameraInfo m_vecOffSetCameraInfo2; |
| | | |
| | | void ShowProgressBar(); |
| | | void setDefectShow(int nDefectID, BOOL bEnsureVisible); |
| | | void ImageShow(int nDefectID); |
| | |
| | | #define IDC_COMBO_OFFSET_DIRECTION_Y 1056 |
| | | #define IDC_EDIT_OFFSET_X 1057 |
| | | #define IDC_EDIT_OFFSET_Y 1058 |
| | | #define IDC_BUTTON_OFFSET_SAVE 1059 |
| | | #define IDC_BUTTON_OFFSET_APPLY 1060 |
| | | #define ID_OPTION_PATHSETTING 32771 |
| | | #define ID_VIEW_ALLDEFECT 32772 |
| | | #define ID_VIEW_REVIEWDEFECT 32773 |
| | |
| | | #ifndef APSTUDIO_READONLY_SYMBOLS |
| | | #define _APS_NEXT_RESOURCE_VALUE 150 |
| | | #define _APS_NEXT_COMMAND_VALUE 32776 |
| | | #define _APS_NEXT_CONTROL_VALUE 1057 |
| | | #define _APS_NEXT_CONTROL_VALUE 1061 |
| | | #define _APS_NEXT_SYMED_VALUE 104 |
| | | #endif |
| | | #endif |
| | |
| | | [Path] |
| | | Align=D:\ResultData\Align\ |
| | | Bin=D:\DIT_ResultData\RawBin\ |
| | | Inspector=\\126.100.100.1\d\Image\Defect |
| | | Inspector=D:\Defect |
| | | Review=D:\ResultData\UploadImage\ |
| | | DirectionX=0 |
| | | DirectionY=0 |
»õ ÆÄÀÏ |
| | |
| | | #pragma once |
| | | #include "stdafx.h" |
| | | |
| | | class CMacroFile |
| | | { |
| | | public: |
| | | CMacroFile() { Clear(); } |
| | | ~CMacroFile() { Clear(); } |
| | | |
| | | void Clear() |
| | | { |
| | | m_arTiltleLine.RemoveAll(); |
| | | m_arValueLine.RemoveAll(); |
| | | } |
| | | |
| | | BOOL Read(const TCHAR* lpstrFilePath) |
| | | { |
| | | CStdioFile file; |
| | | CFileException ex; |
| | | |
| | | if ( !file.Open(lpstrFilePath, CFile::modeRead, &ex)) |
| | | { |
| | | |
| | | #ifdef _DEBUG |
| | | TCHAR szCause[255] = {0}; |
| | | ex.GetErrorMessage(szCause, 255); |
| | | TRACE(szCause); |
| | | #endif |
| | | return FALSE; |
| | | } |
| | | |
| | | CString strLine; |
| | | CString strTiltle, strValue; |
| | | int p = 0; |
| | | |
| | | while(file.ReadString(strLine)) |
| | | { |
| | | strTiltle = _T(""); |
| | | strValue = _T(""); |
| | | |
| | | |
| | | if ( -1 == (p = strLine.Find(_T('='), 0))) continue; |
| | | |
| | | strTiltle = strLine.Left(p); |
| | | strValue = strLine.Right(strLine.GetLength() - p - 1); |
| | | |
| | | m_arTiltleLine.Add(strTiltle); |
| | | m_arValueLine.Add(strValue); |
| | | |
| | | |
| | | } |
| | | |
| | | file.Close(); |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL Write(const TCHAR* lpstrFilePath) |
| | | { |
| | | CStdioFile file; |
| | | CFileException ex; |
| | | |
| | | if ( !file.Open(lpstrFilePath, CFile::modeCreate | CFile::modeWrite, &ex)) |
| | | { |
| | | #ifdef _DEBUG |
| | | TCHAR szCause[255] = {0}; |
| | | ex.GetErrorMessage(szCause, 255); |
| | | TRACE(szCause); |
| | | #endif |
| | | return FALSE; |
| | | } |
| | | |
| | | CString strLine = _T(""); |
| | | CString strTiltle, strValue; |
| | | |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strTiltle = _T(""); |
| | | strValue = _T(""); |
| | | |
| | | strTiltle = m_arTiltleLine.GetAt(nIndex); |
| | | strValue = m_arValueLine.GetAt(nIndex); |
| | | |
| | | strLine.Format(_T("%s=%s"), strTiltle, strValue); |
| | | |
| | | file.WriteString(CString(strLine)+_T("\n")); |
| | | |
| | | } |
| | | |
| | | file.Close(); |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, short& sValue, short sDefault=0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle)==0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | sValue = ::_ttoi((LPCTSTR)strText); |
| | | return; |
| | | } |
| | | } |
| | | sValue = sDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, int& nValue, int nDefault=0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle)==0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | strText.Remove('`'); |
| | | nValue = ::_ttoi((LPCTSTR)strText); |
| | | return; |
| | | } |
| | | } |
| | | nValue = nDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, UINT& unValue, UINT unDefault=0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle)==0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | unValue = ::_ttoi((LPCTSTR)strText); |
| | | return; |
| | | } |
| | | } |
| | | unValue = unDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, long& lValue, long lDefault=0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | lValue = ::_ttoi((LPCTSTR)strText); |
| | | return; |
| | | } |
| | | } |
| | | lValue = lDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, float& fValue, float fDefault=0.0f) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | //strText.Replace('\'',''); |
| | | strText.Remove('`'); |
| | | fValue = float(_tstof((LPCTSTR)strText)); |
| | | return; |
| | | } |
| | | } |
| | | fValue = fDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, double& dValue, double dDefault=0.0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | dValue = _tcstod((LPCTSTR)strText, NULL); |
| | | return; |
| | | } |
| | | } |
| | | dValue = dDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, TCHAR &cValue, TCHAR cDefault=_T(' ')) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | cValue = (m_arValueLine.GetAt(nIndex)).GetAt(0); |
| | | return; |
| | | } |
| | | } |
| | | cValue = cDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, CString& strValue, CString strDefault=_T("")) |
| | | { |
| | | CString strText = _T(""); |
| | | |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strValue = m_arValueLine.GetAt(nIndex); |
| | | return; |
| | | } |
| | | } |
| | | strValue = strDefault; |
| | | } |
| | | |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const short& sValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%d"), sValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle,const int& nValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%d"), nValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const UINT& unValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%d"), unValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const long& lValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%d"), lValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const float& fValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%.8f"), fValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const double& dValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%.8lf"), dValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const TCHAR &cValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%c"), cValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const CString& strValue) |
| | | { |
| | | SetItem(lpstrTitle, (LPCTSTR)strValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const TCHAR* lpstrValue) |
| | | { |
| | | BOOL bNewItem = TRUE; |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | m_arValueLine.SetAt(nIndex, lpstrValue); |
| | | bNewItem = FALSE; |
| | | } |
| | | } |
| | | |
| | | if(bNewItem) |
| | | { |
| | | m_arTiltleLine.Add(lpstrTitle); |
| | | m_arValueLine.Add(lpstrValue); |
| | | } |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, TCHAR* lpBuffer, const int nMaxLength) |
| | | { |
| | | ASSERT(lpBuffer); |
| | | ASSERT(nMaxLength > 0); |
| | | |
| | | ZeroMemory(lpBuffer, sizeof(char)*nMaxLength); |
| | | |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | _tcscpy_s(lpBuffer, strText.GetLength(), (LPCTSTR)strText); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | void GetItem(const TCHAR* lpstrStartChar, const TCHAR* lpstrEndChar, TCHAR* lpBuffer, const int nMaxLength) |
| | | { |
| | | ASSERT(lpBuffer); |
| | | ASSERT(nMaxLength > 0); |
| | | |
| | | ZeroMemory(lpBuffer, sizeof(char)*nMaxLength); |
| | | |
| | | CString strTitle , strValue ; |
| | | |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strTitle = _T(""); |
| | | strValue = _T(""); |
| | | |
| | | strTitle = m_arTiltleLine.GetAt(nIndex); |
| | | strValue = m_arValueLine.GetAt(nIndex); |
| | | |
| | | if (strTitle.IsEmpty()) continue; |
| | | |
| | | if( strTitle.GetAt(0) == _T('!') && strValue.Compare(lpstrStartChar) == 0) |
| | | { |
| | | for(int n2thIndex = nIndex+1; m_arTiltleLine.GetSize(); n2thIndex++) |
| | | { |
| | | strTitle = _T(""); |
| | | strValue = _T(""); |
| | | |
| | | strTitle = m_arTiltleLine.GetAt(n2thIndex); |
| | | strValue = m_arValueLine.GetAt(n2thIndex); |
| | | |
| | | if (strTitle.IsEmpty()) continue; |
| | | |
| | | if( strTitle.GetAt(0) == _T('!') && strValue.Compare(lpstrEndChar) == 0) |
| | | break; |
| | | |
| | | if ( int((_tcslen(lpBuffer) + strValue.GetLength()+1)) > nMaxLength) |
| | | break; |
| | | |
| | | _tcscat_s(lpBuffer, strValue.GetLength(), (LPCTSTR)strValue); |
| | | _tcscat_s(lpBuffer, 1, _T("\n")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrStartChar, const TCHAR* lpstrEndChar, const TCHAR* lpstrMacroFormat, ...) |
| | | { |
| | | va_list list; |
| | | TCHAR strText[2000] = {0}; |
| | | |
| | | va_start(list, lpstrMacroFormat); |
| | | _vstprintf_s(strText, lpstrMacroFormat, list); |
| | | va_end(list); |
| | | |
| | | CString strTitle , strValue ; |
| | | |
| | | BOOL bNewItem = TRUE; |
| | | |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strTitle = m_arTiltleLine.GetAt(nIndex); |
| | | strValue = m_arValueLine.GetAt(nIndex); |
| | | |
| | | if (strTitle.IsEmpty()) continue; |
| | | |
| | | if( strTitle.GetAt(0) == _T('!') && strValue.Compare(lpstrEndChar) == 0) |
| | | { |
| | | m_arTiltleLine.InsertAt(nIndex, _T("!"), 1); |
| | | m_arValueLine.InsertAt(nIndex, strText, 1); |
| | | bNewItem = FALSE; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (bNewItem) |
| | | { |
| | | m_arTiltleLine.Add(_T("!")); |
| | | m_arValueLine.Add(lpstrStartChar); |
| | | |
| | | m_arTiltleLine.Add(_T("!")); |
| | | m_arValueLine.Add(strText); |
| | | |
| | | m_arTiltleLine.Add(_T("!")); |
| | | m_arValueLine.Add(lpstrEndChar); |
| | | |
| | | } |
| | | } |
| | | |
| | | protected: |
| | | CStringArray m_arTiltleLine; |
| | | CStringArray m_arValueLine; |
| | | }; |
| | |
| | | ON_MESSAGE(WM_OFFSETTOOL_MESSAGE2, OnUpdatedata) |
| | | ON_BN_CLICKED(IDC_BUTTON_SAVE_SETTING_FILE, &DlgReviewOffSetTool::OnBnClickedButtonSaveSettingFile) |
| | | ON_BN_CLICKED(IDC_CHECK_OFFSET_MODE, &DlgReviewOffSetTool::OnBnClickedCheckOffsetMode) |
| | | ON_BN_CLICKED(IDC_OFFSET_LOAD, &DlgReviewOffSetTool::OnBnClickedOffsetLoad) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | void DlgReviewOffSetTool::OnBnClickedOffsetLoad() |
| | | { |
| | | |
| | | // TODO: ì¬ê¸°ì 컨í¸ë¡¤ ì림 ì²ë¦¬ê¸° ì½ë를 ì¶ê°í©ëë¤. |
| | | ReadConfigFile(); |
| | | UpdateGridcontrol(); |
| | | UpdateData(TRUE); |
| | | Invalidate(FALSE); |
| | | } |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | |
| | | double m_editGlassOffSetmodeXpos; |
| | | double m_editGlassOffSetmodeYpos; |
| | | afx_msg void OnBnClickedCheckOffsetMode(); |
| | | /*< LYW 20211025 - #index ADD Start >*/ |
| | | afx_msg void OnBnClickedOffsetLoad(); |
| | | /*< LYW 20211025 - #index ADD End >*/ |
| | | }; |
| | |
| | | EDITTEXT IDC_EDIT_SETTINGFILE_PATH,545,50,202,14,ES_AUTOHSCROLL | WS_DISABLED |
| | | LTEXT "X Pos Count",IDC_STATIC,621,32,40,8 |
| | | EDITTEXT IDC_EDIT_XPOS_COUNT,662,28,40,14,ES_AUTOHSCROLL |
| | | PUSHBUTTON "APPLY GRID DATA",IDC_BUTTON_APPLY_GRID_DATA,132,62,134,23 |
| | | PUSHBUTTON "APPLY GRID DATA",IDC_BUTTON_APPLY_GRID_DATA,209,62,65,23 |
| | | PUSHBUTTON "APPLY",IDC_BUTTON_APPLT_OFFSET_PARAM,704,14,43,23 |
| | | CONTROL "",IDC_PROGRESS_PROCESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,337,67,168,14 |
| | | PUSHBUTTON "SAVE",IDC_BUTTON_SAVE_SETTING_FILE,279,64,56,20 |
| | |
| | | EDITTEXT IDC_EDIT_SCAN_INDEX,621,67,19,14,ES_AUTOHSCROLL |
| | | EDITTEXT IDC_EDIT_CAM_INDEX,600,67,19,14,ES_AUTOHSCROLL |
| | | EDITTEXT IDC_EDIT_MOTOR_YPOS,694,67,54,14,ES_AUTOHSCROLL |
| | | PUSHBUTTON "Offset Load",IDC_OFFSET_LOAD,139,63,62,22 |
| | | END |
| | | |
| | | IDD_DLG_REVIEW_HISTORY_TOOL DIALOGEX 0, 0, 961, 455 |
| | |
| | | //{{NO_DEPENDENCIES}} |
| | | // Microsoft Visual C++ìì ìì±í í¬í¨ íì¼ì
ëë¤. |
| | | // ReviewSystem.rcìì ì¬ì©ëê³ ììµëë¤. |
| | | // Microsoft Visual C++ìì ìì±í í¬í¨ íì¼ì
ëë¤. |
| | | // ReviewSystem.rcìì ì¬ì©ëê³ ììµëë¤. |
| | | // |
| | | #define IDCANCEL 2 |
| | | #define IDD_ABOUTBOX 100 |
| | |
| | | #define IDC_EDIT_WSI_HEIGHT12 1182 |
| | | #define IDC_EDIT_WSI_HEIGHT13 1183 |
| | | #define IDC_LIST_WSI_DIAGNOSIS_RESULT 1184 |
| | | #define IDC_OFFSET_LOAD 1185 |
| | | #define ID_INS_HOOK 32772 |
| | | #define ID_UNINS_HOOK 32773 |
| | | |
| | |
| | | #ifndef APSTUDIO_READONLY_SYMBOLS |
| | | #define _APS_NEXT_RESOURCE_VALUE 381 |
| | | #define _APS_NEXT_COMMAND_VALUE 32775 |
| | | #define _APS_NEXT_CONTROL_VALUE 1185 |
| | | #define _APS_NEXT_CONTROL_VALUE 1186 |
| | | #define _APS_NEXT_SYMED_VALUE 346 |
| | | #endif |
| | | #endif |