SDC C-Project CF Review 프로그램
a6552335164ce062567b76aa7d097fd046129474..03152a241b9463c582b56896f5f5f73717497ab4
2021-08-25 LYW
Ongoing100 #3486 CF AOI Review Review History 프로그램 테스트 및 적용
03152a 비교 | 트리
2021-08-23 LYW
머지간 오류 수정
f9623a 비교 | 트리
2021-08-18 LYW
Merge branch 'feature/#3561_CF_AOI_Review_Align_카메라_끊김_현상_조치' into feature/...
6c4831 비교 | 트리
2021-08-17 LYW
Ongoing100 #3561 CF AOI Review Align 카메라 끊김 현상 조치
572aeb 비교 | 트리
2021-08-17 LYW
Ongoing50 #3584 CF AOI Review 시뮬레이션 기능 정상화
67bcde 비교 | 트리
2021-08-17 LYW
이전 머지간 누락된 코드 삽입
9aa3a8 비교 | 트리
2021-08-10 LYW
Ongoing50 #3562 CF AOI Review 실행 프로그램 경로 변경
8ac735 비교 | 트리
2021-08-10 LYW
1. Defect Picking 기능 OFF
ebfd7a 비교 | 트리
2021-08-09 LYW
Ongoing90 #3563 CF AOI Review Offset 파라미터 저장시 완료 팝업 추가
2ecc61 비교 | 트리
2021-08-09 LYW
Merge branch 'feature/#3477_CF_AOI_Review_FrameLost_현상_조치' into develop
5c62f2 비교 | 트리
2021-08-09 LYW
Ongoing70 #3477 CF AOI Review [BANK, OC, QD, Blue] FrameL...
a559b5 비교 | 트리
2021-08-09 LYW
Ongoing50 #3561 CF AOI Review Align 카메라 끊김 현상 조치
b354c1 비교 | 트리
2021-07-29 LYW
Ongoing70 #3477 CF AOI Review [BANK, OC, QD, Blue] FrameL...
4f526f 비교 | 트리
2021-07-29 LYW
Ongoing90 #3524 CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선
bd13fa 비교 | 트리
2021-07-27 LYW
주석 변경
281a73 비교 | 트리
2021-07-23 LYW
Ongoing60 #3524 CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선
55615e 비교 | 트리
43개 파일 변경됨
1897 ■■■■■ 파일 변경됨
Internal_Library/CHCameraControl_Sapera/CameraControl_Sapera.cpp 10 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewHistory/ReveiwHistory/ReveiwHistoryDlg.cpp 70 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewHistory/ReveiwHistory/ReveiwHistoryDlg.h 7 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewHistory/bin/ReviewHistroy.exe 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/CHDefectPicker/DefectPicker.cpp 8 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/CHReviewResult/GlassResult.cpp 12 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/CHReviewSetting/Sys_SignalManager.cpp 14 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/M_AutoDiagnosisManager/DiagnosisProcessor.cpp 21 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewRecipeEditor/DlgReview.cpp 3 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewRecipeEditor/ReviewRecipeEditorDlg.cpp 156 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewRecipeEditor/stdafx.h 49 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/CameraControlAlign.cpp 3 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/CameraControlReview.cpp 6 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/DisplayMessage.cpp 17 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/DitGlassRawClient.cpp 8 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/DlgControl.cpp 28 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/DlgControl.h 2 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/DlgReviewOffSetTool.cpp 11 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/DlgReviewOffSetTool.h 6 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/FileUploadControl.cpp 7 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/MainFrm.cpp 13 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/MainFrm.h 1 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewInterface.cpp 12 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewInterface.h 1 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewProcessor.h 1 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewProcessor_CPJT.cpp 353 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewSystem.rc 7 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewSystem.vcxproj 5 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/SequenceProcessor.cpp 4 ●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/SequenceProcessor.h 15 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp 789 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.h 1 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/resource.h 1 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/stdafx.h 63 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystemSetting/DlgSignal.cpp 13 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystemSetting/DlgSignal.h 2 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystemSetting/ReviewSystemSetting.rc 9 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystemSetting/ReviewSystemSettingDlg.cpp 77 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystemSetting/resource.h 10 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystemSetting/stdafx.h 39 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/include/CHReviewRecipe/RsRcpAlignInfo.h 8 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/include/CHSignalControls/SignalControlInfo.h 6 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/include/M_AutoDiagnosisManager/DiagnosisInfo.h 29 ●●●● 패치 | 보기 | raw | blame | 히스토리
Internal_Library/CHCameraControl_Sapera/CameraControl_Sapera.cpp
@@ -257,6 +257,16 @@
        if (!m_bGrabbing) return 1;
        nReturn = m_pXfer->Freeze();
        //#3477_210729_LYW_FrameLost_현상 초치_ADD_START
        if (m_pXfer->Wait(1000) == TRUE)
        {
        }
        else
        {
            m_pXfer->Abort();
        }
        //#3477_210729_LYW_FrameLost_현상 초치_ADD_END
        m_bGrabbing = m_pXfer->IsGrabbing();
    }
ReviewHistory/ReveiwHistory/ReveiwHistoryDlg.cpp
@@ -279,7 +279,15 @@
//             // 그림을 Picture Control 크기로 화면에 출력한다.
//             m_ReviewImage.Draw(dc, m_picture_rect);
//         }
        if (!m_DefectImage.IsNull())
        //LYW 20210825 #3486 ADD START
        if (!m_DefectRotateImage.IsNull())
        {
            dc.SetStretchBltMode(COLORONCOLOR);
            // 그림을 Picture Control 크기로 화면에 출력한다.
            m_DefectRotateImage.Draw(dc, m_picture_rect2);
        }
        //LYW 20210825 #3486 ADD END
        else if (!m_DefectImage.IsNull())
        {
            dc.SetStretchBltMode(COLORONCOLOR);
            // 그림을 Picture Control 크기로 화면에 출력한다.
@@ -1968,6 +1976,9 @@
    m_DefectImage.Destroy();
    m_ReviewImage.Destroy();
    //LYW 20210825 #3486 ADD START
    m_DefectRotateImage.Destroy();
    //LYW 20210825 #3486 ADD END
    m_AlignFirst.Destroy();
    m_AlignSecend.Destroy();
@@ -2055,7 +2066,7 @@
    DeftectPath.Format(_T("%s\\%s\\%s"), strReviewPath, strReviewImagePath, strReviewImageName);
    //DeftectPath2.Format(_T("%s\\%s"), strInspectorPath, strInspectorName);
    if (strInspectorName == "*" || strInspectorName == "**" || strInspectorName == "***") strInspectorName = "";
    DeftectPath2.Format(_T("%s\\%s\\%s"), strInspectorPath, pImageInfo->m_strGlassID, strReviewImageName);
    DeftectPath2.Format(_T("%s\\%s\\%s"), strInspectorPath, pImageInfo->m_strGlassID, strInspectorName);
    AlignPath.Format(_T("%s\\%s\\%s"), strAlignPath, pImageInfo->m_strGlassID, strAlignName);
    AlignPath2.Format(_T("%s\\%s\\%s"), strAlignPath, pImageInfo->m_strGlassID, strAlignName2);
@@ -2096,13 +2107,21 @@
    if (CFile::GetStatus(DeftectPath2, FileOn) && strInspectorName != "") //파일이 있을 때
    {
        m_DefectImage.Load(DeftectPath2);
        //LYW 20210825 #3486 ADD START
        m_DefectRotateImage.Create(m_DefectImage.GetWidth(), m_DefectImage.GetHeight(), m_DefectImage.GetBPP(), 0);
        ImageRotate(m_DefectImage, m_DefectRotateImage);
        //LYW 20210825 #3486 ADD END
        HBITMAP hBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), DeftectPath2,
            IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
        InvalidateRect(m_picture_rect2, FALSE);
        dc.SetStretchBltMode(COLORONCOLOR);
        m_DefectImage.Draw(dc, m_picture_rect2);
        //LYW 20210825 #3486 MOD START
        m_DefectRotateImage.Draw(dc, m_picture_rect2);
        //LYW 20210825 #3486 MOD END
        //original
        //m_DefectImage.Draw(dc, m_picture_rect2);
    }
    else
    {
@@ -2490,6 +2509,9 @@
//    m_ReviewImage.Destroy();
    m_DefectImage.Destroy();
    //LYW 20210825 #3486 ADD START
    m_DefectRotateImage.Destroy();
    //LYW 20210825 #3486 ADD END
    m_AlignFirst.Destroy();
    m_AlignSecend.Destroy();
@@ -2527,6 +2549,48 @@
    m_AlignSecend.Draw(dc, m_Align_rect2);
}
//LYW 20210825 #3486 ADD START
void CReveiwHistoryDlg::ImageRotate(CImage & SrcImage, CImage & DstImage, double degree/* = 180.0 */)
{
    int Height = SrcImage.GetHeight(); // 세로 길이 저장
    int Width = SrcImage.GetWidth(); // 가로 길이 저장
    int new_x, new_y;
    int R, G, B;
    int center_x = (SrcImage.GetWidth() / 2); // 회전 중심점
    int center_y = (SrcImage.GetHeight() / 2); // 회전 중심점
    double seta = 3.14 / (180.0 / degree); // 라디안
    double CosSeta = cos(seta);
    double SinSeta = sin(seta);
    for (int y = 0; y < Height; y++)
    {
        for (int x = 0; x < Width; x++)
        {
            new_x = (int)((x - center_x) * CosSeta - (y - center_y) * SinSeta + center_x);
            new_y = (int)((x - center_x) * SinSeta + (y - center_y) * CosSeta + center_y);
            if ((new_x < 0) || (new_x > Width) || (new_y < 0) || (new_y > Height))
                //이미지 범위를 벗어나면 0 값
            {
                R = 0;
                G = 0;
                B = 0;
            }
            else
            {
                R = GetRValue(SrcImage.GetPixel(new_x, new_y));
                G = GetGValue(SrcImage.GetPixel(new_x, new_y));
                B = GetBValue(SrcImage.GetPixel(new_x, new_y));
            }
            DstImage.SetPixel((int)x, (int)y, RGB(R, G, B));
            new_x = 0; new_y = 0;
        }
    }
}
//LYW 20210825 #3486 ADD END
void CReveiwHistoryDlg::OnChangeEditFileCount()
{
    // TODO:  RICHEDIT 컨트롤인 경우, 이 컨트롤은
ReviewHistory/ReveiwHistory/ReveiwHistoryDlg.h
@@ -83,6 +83,9 @@
    std::vector<_akDefect> m_vectest;
    CImage m_DefectImage;
    //LYW 20210825 #3486 ADD START
    CImage m_DefectRotateImage;
    //LYW 20210825 #3486 ADD END
    CImage m_ReviewImage;
    CRect m_picture_rect;
@@ -240,6 +243,10 @@
    void Imagenoload();
    //LYW 20210825 #3486 ADD START
    void ImageRotate(CImage& SrcImage, CImage& DstImage, double degree = 180.0);
    //LYW 20210825 #3486 ADD END
    BOOL GetCheckFileLoad(int nCount);
    void GlassInfoRest();
ReviewHistory/bin/ReviewHistroy.exe
Binary files differ
ReviewSystem/CHDefectPicker/DefectPicker.cpp
@@ -45,7 +45,9 @@
            SReviewResult dataResult = vecSorterResult->at(nIndx);    
            if(dataResult.nLocation != DefectLoc_ASG && dataResult.nLocation != DefectLoc_PAD && dataResult.nLocation != DefectLoc_C2C)    continue;
            //LYW 210810 DeleteStart
            //if(dataResult.nLocation != DefectLoc_ASG && dataResult.nLocation != DefectLoc_PAD && dataResult.nLocation != DefectLoc_C2C)    continue;
            //LYW 210810 DeleteEnd
            dataResult.nResultIdx = index;
            dataResult.nSequenceNo = index++;
@@ -69,7 +71,9 @@
            SReviewResult dataResult = vecSorterResult->at(nIndx);    
            if(dataResult.nLocation == DefectLoc_ASG || dataResult.nLocation == DefectLoc_PAD || dataResult.nLocation == DefectLoc_C2C)    continue;
            //LYW 210810 DeleteStart
            //if(dataResult.nLocation == DefectLoc_ASG || dataResult.nLocation == DefectLoc_PAD || dataResult.nLocation == DefectLoc_C2C)    continue;
            //LYW 210810 DeleteEnd
            dataResult.nResultIdx = index;
            dataResult.nSequenceNo = index++;
ReviewSystem/CHReviewResult/GlassResult.cpp
@@ -160,8 +160,10 @@
    m_vecWsiMultiShotScheduleResult.clear();
    //FDC보고용 Review Contrast
    nReview00ImageContrast = 0;
    nReview01ImageContrast = 0;
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD Start
    nReview00ImageContrast = 50;
    nReview01ImageContrast = 50;
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD End
    // defect result
    for (MapDefectResultIt it = m_mapDefectResult.begin(); it != m_mapDefectResult.end(); it++)
@@ -309,8 +311,10 @@
    m_vecWsiMultiShotScheduleResult.clear();
    //FDC보고용 Review Contrast
    nReview00ImageContrast = -1;
    nReview01ImageContrast = -1;
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD Start
    nReview00ImageContrast = 50;
    nReview01ImageContrast = 50;
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD End
    //// defect result
    //for (MapDefectResultIt it = m_mapDefectResult.begin(); it != m_mapDefectResult.end(); it++)
    //{
ReviewSystem/CHReviewSetting/Sys_SignalManager.cpp
@@ -38,6 +38,12 @@
    strItem.Format(_T("SYS_SIGNAL_PERIOD_TIME"));
    macroFile.SetItem(strItem, m_SignalInfo.GetMSPeriod());
    strItem.Format(_T("SYS_SIGNAL_DEFOCUS_VALUE_MIN"));
    macroFile.SetItem(strItem, m_SignalInfo.GetDefocusValueMin());
    strItem.Format(_T("SYS_SIGNAL_DEFOCUS_VALUE_MAX"));
    macroFile.SetItem(strItem, m_SignalInfo.GetDefocusValueMax());
    strItem.Format(_T("SYS_SIGNAL_LOADING_SIGNAL_DELAY"));
    macroFile.SetItem(strItem, m_SignalInfo.GetMSLoadingSignalDelay());
@@ -140,6 +146,14 @@
    macroFile.GetItem(strItem, nData);
    m_SignalInfo.SetMSPeriod(nData);
    strItem.Format(_T("SYS_SIGNAL_DEFOCUS_VALUE_MIN"));
    macroFile.GetItem(strItem, nData);
    m_SignalInfo.SetDefocusValueMin(nData);
    strItem.Format(_T("SYS_SIGNAL_DEFOCUS_VALUE_MAX"));
    macroFile.GetItem(strItem, nData);
    m_SignalInfo.SetDefocusValueMax(nData);
    strItem.Format(_T("SYS_SIGNAL_LOADING_SIGNAL_DELAY"));
    macroFile.GetItem(strItem, nData);
    m_SignalInfo.SetMSLodingSignalDelay(nData);
ReviewSystem/M_AutoDiagnosisManager/DiagnosisProcessor.cpp
@@ -303,7 +303,7 @@
            //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
            //if (11000 <= GetTickCount() - stTime)
            //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
            if (1000 <= GetTickCount() - stTime)
            if (1500 <= GetTickCount() - stTime)
            {
                break;
            }
@@ -313,7 +313,7 @@
        m_pDP2P->IDP2P_SetAFMTracking(nSelModuleIndex, TRUE);
        //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
        //Sleep(1000);
        Sleep(500);
        Sleep(1000);
        //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
        CString strimagename;
@@ -888,8 +888,21 @@
        for (int nIdx = 0; nIdx < nPanelCount; nIdx++)
        {
            const SPositionData* pSettingPos = pSettingResult->GetPositionData_Squareness(nIdx);
            const SPositionData* pDataPos = pProcessResult->GetPositionData_Squareness(nIdx);
            //LYW 210811
            const SPositionData* pSettingPos;
            const SPositionData* pDataPos;
            if (nSelModuleIndex == 1)
            {
                pSettingPos = pSettingResult->GetPositionData_Squareness(nIdx);
                pDataPos = pProcessResult->GetPositionData_Squareness(nIdx + 3);
            }
            else
            {
                pSettingPos = pSettingResult->GetPositionData_Squareness(nIdx);
                pDataPos = pProcessResult->GetPositionData_Squareness(nIdx);
            }
            //LYW 210811
            if (pSettingPos == NULL || pDataPos == NULL) continue;
            dMotorPosX[nIdx] = pSettingPos->dPosX;
ReviewSystem/ReviewRecipeEditor/DlgReview.cpp
@@ -290,7 +290,8 @@
                if(strArrayOption.GetSize() > 0)
                {
                    strItemText = strArrayOption.GetAt(pRcpPriorityInfo->GetPriorityStackData());
                    //LYW ERR수정
                    strItemText = strArrayOption.GetAt(pRcpPriorityInfo->GetPriorityGrayData());
                    m_ctrlGridFilterinfo.SetItemText(nRowIdx, nColIdx++, strItemText);
                }
            }
ReviewSystem/ReviewRecipeEditor/ReviewRecipeEditorDlg.cpp
@@ -1,5 +1,5 @@
// ReviewRecipeEditorDlg.cpp : 구현 파일
// ReviewRecipeEditorDlg.cpp : ���� ����
//
#include "stdafx.h"
@@ -17,7 +17,7 @@
#endif
// CReviewRecipeEditorDlg 대화 상자
// CReviewRecipeEditorDlg ��ȭ ����
CReviewRecipeEditorDlg::CReviewRecipeEditorDlg(CWnd* pParent /*=NULL*/)
    : CDialog(CReviewRecipeEditorDlg::IDD, pParent)
@@ -162,18 +162,18 @@
END_MESSAGE_MAP()
// CReviewRecipeEditorDlg 메시지 처리기
// CReviewRecipeEditorDlg �޽��� ó����
BOOL CReviewRecipeEditorDlg::OnInitDialog()
{
    CDialog::OnInitDialog();
    // 이 대화 상자의 아이콘을 설정합니다. 응용 프로그램의 주 창이 대화 상자가 아닐 경우에는
    //  프레임워크가 이 작업을 자동으로 수행합니다.
    SetIcon(m_hIcon, TRUE);            // 큰 아이콘을 설정합니다.
    SetIcon(m_hIcon, FALSE);        // 작은 아이콘을 설정합니다.
    // �� ��ȭ ������ �������� �����մϴ�. ���� ���α׷��� �� â�� ��ȭ ���ڰ� �ƴ� ��쿡��
    //  �����ӿ�ũ�� �� �۾��� �ڵ����� �����մϴ�.
    SetIcon(m_hIcon, TRUE);            // ū �������� �����մϴ�.
    SetIcon(m_hIcon, FALSE);        // ���� �������� �����մϴ�.
    // TODO: 여기에 추가 초기화 작업을 추가합니다.
    // TODO: ���⿡ �߰� �ʱ�ȭ �۾��� �߰��մϴ�.
    //m_bReviewSystemPC = IsReviewSystemPC();
    m_bReviewSystemPC = TRUE;
    pReviewRecipeEditor = this;
@@ -189,29 +189,29 @@
    InitRecipeListGridControl();
    RefreshRecipeList();
    return TRUE;  // 포커스를 컨트롤에 설정하지 않으면 TRUE를 반환합니다.
    return TRUE;  // ��Ŀ���� ��Ʈ�ѿ� �������� ������ TRUE�� ��ȯ�մϴ�.
}
// 대화 상자에 최소화 단추를 추가할 경우 아이콘을 그리려면
//  아래 코드가 필요합니다. 문서/뷰 모델을 사용하는 MFC 응용 프로그램의 경우에는
//  프레임워크에서 이 작업을 자동으로 수행합니다.
// ��ȭ ���ڿ� �ּ�ȭ ���߸� �߰��� ��� �������� �׸�����
//  �Ʒ� �ڵ尡 �ʿ��մϴ�. ����/�� ���� ����ϴ� MFC ���� ���α׷��� ��쿡��
//  �����ӿ�ũ���� �� �۾��� �ڵ����� �����մϴ�.
void CReviewRecipeEditorDlg::OnPaint()
{
    if (IsIconic())
    {
        CPaintDC dc(this); // 그리기를 위한 디바이스 컨텍스트
        CPaintDC dc(this); // �׸��⸦ ���� ����̽� ���ؽ�Ʈ
        SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
        // 클라이언트 사각형에서 아이콘을 가운데에 맞춥니다.
        // Ŭ���̾�Ʈ �簢������ �������� ����� ����ϴ�.
        int cxIcon = GetSystemMetrics(SM_CXICON);
        int cyIcon = GetSystemMetrics(SM_CYICON);
        CRect rect;
        GetClientRect(&rect);
        int x = (rect.Width() - cxIcon + 1) / 2;
        int y = (rect.Height() - cyIcon + 1) / 2;    
        // 아이콘을 그립니다.
        // �������� �׸��ϴ�.
        dc.DrawIcon(x, y, m_hIcon);
    }
    else
@@ -220,8 +220,8 @@
    }
}
// 사용자가 최소화된 창을 끄는 동안에 커서가 표시되도록 시스템에서
//  이 함수를 호출합니다.
// ����ڰ� �ּ�ȭ�� â�� ��� ���ȿ� Ŀ���� ǥ�õǵ��� �ý��ۿ���
//  �� �Լ��� ȣ���մϴ�.
HCURSOR CReviewRecipeEditorDlg::OnQueryDragIcon()
{
    return static_cast<HCURSOR>(m_hIcon);
@@ -230,7 +230,7 @@
void CReviewRecipeEditorDlg::OnBnClickedButtonReviewRcpEditorCreate()
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    // TODO: ���⿡ ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
    BOOL bUseRecipeInfo = FALSE;
    int nIdx;
    CString strRecipeName, strNewRecipeName, strMessage;
@@ -240,7 +240,7 @@
    if(cellID.row > 0 && cellID.col > 0)
    {
        strRecipeName = m_ctrlGridRecipeList.GetItemText(cellID.row, 1);
        strMessage.Format(_T("Do you want to create new recipe using %s recipe information?"), strRecipeName);//_T("%s 레시피 정보를 이용하여 생성하시겠습니까?"), strRecipeName);
        strMessage.Format(_T("Do you want to create new recipe using %s recipe information?"), strRecipeName);//_T("%s ������ ������ �̿��Ͽ� �����Ͻðڽ��ϱ�?"), strRecipeName);
        //if (IDYES == AfxMessageBox(strMessage, MB_YESNO | MB_ICONQUESTION))
        //{
@@ -268,11 +268,11 @@
        if(nIdx != -1)
        {
            strTemp = strTemp.Mid(nIdx + 1);
            strNewPath.Format(_T("\\\\%s\\C\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
            strNewPath.Format(_T("\\\\%s\\D\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp); //210805
        }
        else
        {
            strNewPath.Format(_T("\\\\%s\\C\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strNewRecipeName);
            strNewPath.Format(_T("\\\\%s\\D\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strNewRecipeName);  //210805
        }
    }
@@ -290,22 +290,22 @@
            if(nIdx != -1)
            {
                strTemp = strTemp.Mid(nIdx + 1);
                strSrcPath.Format(_T("\\\\%s\\C\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
                strSrcPath.Format(_T("\\\\%s\\D\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp); //210805
            }
            else
            {
                strSrcPath.Format(_T("\\\\%s\\C\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strRecipeName);
                strSrcPath.Format(_T("\\\\%s\\D\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strRecipeName);  //210805
            }
        }
            
        if(CopyFile(strSrcPath, strNewPath, FALSE) == FALSE)
        {
            strMessage.Format(_T("Fail to create %s recipe"));//_T("%s 레시피 생성 실패!"));
            strMessage.Format(_T("Fail to create %s recipe"));//_T("%s ������ ���� ����!"));
            AfxMessageBox(strMessage);
        }
        else
        {
            //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD START
            //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD START
            CString strBackupPath = _REVIEW_RECIPE_BACKUP_PATH_CPJT;
            CreateDirectory(strBackupPath, NULL);
@@ -316,9 +316,9 @@
            strSource.Format(_T("%s\\%s.rcp"), _REVIEW_RECIPE_PATH_, strNewRecipeName);
            strDest.Format(_T("%s\\%s.rcp"), strBackupPath, strNewRecipeName);
            CopyFile(strSource, strDest, TRUE);
            //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD END
            //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD END
            // [2017:4:17]-[WEZASW] : CIM(Recipe) 보고 항목 추가.
            // [2017:4:17]-[WEZASW] : CIM(Recipe) ���� �׸� �߰�.
            COPYDATA_RECIPE2REV copyData;
            copyData.Message = MsgRecipe2Rev_RecipeCreate;
            copyData.nPPID = _ttoi(strNewRecipeName);
@@ -331,12 +331,12 @@
        if(file.Open(strNewPath, CFile::modeCreate | CFile::modeWrite) == FALSE)
        {
            strMessage.Format(_T("Fail to create %s recipe"));//_T("%s 레시피 생성 실패!"));
            strMessage.Format(_T("Fail to create %s recipe"));//_T("%s ������ ���� ����!"));
            AfxMessageBox(strMessage);
        }
        else
        {
            strMessage.Format(_T("Please select the default file!"));//_T("먼저 기본 파일을 선택해주세요!"));
            strMessage.Format(_T("Please select the default file!"));//_T("���� �⺻ ������ �������ּ���!"));
            AfxMessageBox(strMessage);                
        }
@@ -368,7 +368,7 @@
void CReviewRecipeEditorDlg::OnBnClickedButtonReviewRcpEditorDelete()
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    // TODO: ���⿡ ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
    int nIdx;
    CString strRecipeName, strPath, strMessage, strTemp;
    CCellID cellID = m_ctrlGridRecipeList.GetFocusCell();
@@ -389,20 +389,20 @@
            if (nIdx != -1)
            {
                strTemp = strTemp.Mid(nIdx + 1);
                strPath.Format(_T("\\\\%s\\C\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
                strPath.Format(_T("\\\\%s\\D\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp); //210805
            }
            else
            {
                strPath.Format(_T("\\\\%s\\C\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strRecipeName);
                strPath.Format(_T("\\\\%s\\D\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strRecipeName); //210805
            }
        }
        //_T("%s 레시피를 삭제하시겠습니까?"), strRecipeName);
        //_T("%s �����Ǹ� �����Ͻðڽ��ϱ�?"), strRecipeName);
        strMessage.Format(_T("Do you want to delete %s recipe?"), strRecipeName);
        if (IDYES == AfxMessageBox(strMessage, MB_YESNO | MB_ICONQUESTION))
        {
            // [2017:5:20]-[WEZASW] : 현재 적용된 Recipe(PPID)는 삭제 금지 요청.
            // [2017:5:20]-[WEZASW] : ���� ����� Recipe(PPID)�� ���� ���� ��û.
            if (strRecipeName.Compare(m_strCurrentRecipeName) == 0)
            {
                strMessage.Format(_T("Currently applied Recipe(%s) can not be deleted!"), strRecipeName);
@@ -411,16 +411,16 @@
            }
            DeleteFile(strPath);
            //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD START
            //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD START
            CString strBackupPath = _REVIEW_RECIPE_BACKUP_PATH_CPJT;
            CString strDest;
            strDest.Format(_T("%s\\%s.rcp"), strBackupPath, strRecipeName);
            DeleteFile(strDest);
            //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD END
            //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD END
            // [2017:4:17]-[WEZASW] : CIM(Recipe) 보고 항목 추가.
            // [2017:4:17]-[WEZASW] : CIM(Recipe) ���� �׸� �߰�.
            COPYDATA_RECIPE2REV copyData;
            copyData.Message = MsgRecipe2Rev_RecipeDelete;
            copyData.nPPID = _ttoi(strRecipeName);
@@ -429,7 +429,7 @@
    }
    else
    {
        AfxMessageBox(_T("Please select recipe."));//_T("레시피를 선택하세요."));
        AfxMessageBox(_T("Please select recipe."));//_T("�����Ǹ� �����ϼ���."));
    }
    RefreshRecipeList();
@@ -442,7 +442,7 @@
void CReviewRecipeEditorDlg::OnBnClickedButtonReviewRcpEditorLoad()
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    // TODO: ���⿡ ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
    BOOL bReturn;
    CString strRecipeName;
    CCellID cellID = m_ctrlGridRecipeList.GetFocusCell();
@@ -456,7 +456,7 @@
        {
            m_strCurrentRecipeName = strRecipeName;
            // [2017:4:17]-[WEZASW] : CIM(Recipe) 보고 항목 추가.
            // [2017:4:17]-[WEZASW] : CIM(Recipe) ���� �׸� �߰�.
            COPYDATA_RECIPE2REV copyData;
            copyData.Message = MsgRecipe2Rev_RecipeChange;
            copyData.nPPID = _ttoi(m_strCurrentRecipeName);
@@ -471,7 +471,7 @@
    }
    else
    {
        AfxMessageBox(_T("Please select recipe."));//_T("레시피를 선택하세요."));
        AfxMessageBox(_T("Please select recipe."));//_T("�����Ǹ� �����ϼ���."));
    }
}
@@ -517,7 +517,7 @@
        if (bRet)
        {
            // [2017:4:17]-[WEZASW] : CIM(Recipe) 보고 항목 추가.
            // [2017:4:17]-[WEZASW] : CIM(Recipe) ���� �׸� �߰�.
            COPYDATA_RECIPE2REV copyData;
            copyData.Message = MsgRecipe2Rev_RecipeModify;
            copyData.nPPID = _ttoi(RecipeName);
@@ -540,14 +540,14 @@
            strDest.Format(_T("%s\\%s_%s.rcp"), strBackupPath, RecipeName, strBackupFile);
            CopyFile(strSource, strDest, TRUE);
            //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD START
            //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD START
            strBackupPath = _REVIEW_RECIPE_BACKUP_PATH_CPJT;
            CreateDirectory(strBackupPath, NULL);
            strSource.Format(_T("%s\\%s.rcp"), _REVIEW_RECIPE_PATH_, RecipeName);
            strDest.Format(_T("%s\\%s.rcp"), strBackupPath, RecipeName);
            CopyFile(strSource, strDest, TRUE);
            //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD END
            //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD END
            strMessage.Format(_T("Complete to save %s recipe!"), RecipeName);
            //AfxMessageBox(strMessage);
@@ -567,7 +567,7 @@
void CReviewRecipeEditorDlg::OnBnClickedButtonReviewRcpEditorSave()
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    // TODO: ���⿡ ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
    CString strMessage;
    if (m_strCurrentRecipeName.IsEmpty())
@@ -584,7 +584,7 @@
        if (bRet)
        {
            // [2017:4:17]-[WEZASW] : CIM(Recipe) 보고 항목 추가.
            // [2017:4:17]-[WEZASW] : CIM(Recipe) ���� �׸� �߰�.
            COPYDATA_RECIPE2REV copyData;
            copyData.Message = MsgRecipe2Rev_RecipeModify;
            copyData.nPPID = _ttoi(m_strCurrentRecipeName);
@@ -607,14 +607,14 @@
            strDest.Format(_T("%s\\%s_%s.rcp"), strBackupPath, m_strCurrentRecipeName, strBackupFile);
            CopyFile(strSource, strDest, TRUE);
            //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD START
            //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD START
            strBackupPath = _REVIEW_RECIPE_BACKUP_PATH_CPJT;
            CreateDirectory(strBackupPath, NULL);
            strSource.Format(_T("%s\\%s.rcp"), _REVIEW_RECIPE_PATH_, m_strCurrentRecipeName);
            strDest.Format(_T("%s\\%s.rcp"), strBackupPath, m_strCurrentRecipeName);
            CopyFile(strSource, strDest, FALSE);
            //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD END
            //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD END
            strMessage.Format(_T("Complete to save %s recipe!"), m_strCurrentRecipeName);
            AfxMessageBox(strMessage);
@@ -641,7 +641,7 @@
void CReviewRecipeEditorDlg::OnBnClickedButtonReviewrcpEditorExit()
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    // TODO: ���⿡ ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
    DestroyWindow();
}
@@ -706,15 +706,15 @@
void CReviewRecipeEditorDlg::InitTabControl()
{
    int nIdx = 0;
    m_ctrlTabMain.InsertItem(nIdx++, _T("Common"));            //_T("  공통  "));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Review"));            //_T("  리뷰  "));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Common"));            //_T("  ����  "));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Review"));            //_T("  ����  "));
    m_ctrlTabMain.InsertItem(nIdx++, _T("WSI"));            //_T("  WSI  "));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Align"));            //_T(" 얼라인 "));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Judgement"));        //_T(" 판정  "));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Align"));            //_T(" ����� "));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Judgement"));        //_T(" ����  "));
    // 미사용으로 제외
//    m_ctrlTabMain.InsertItem(nIdx++, _T("Measure"));        //_T("  측정  "));
//    m_ctrlTabMain.InsertItem(nIdx++, _T("Finding Defect"));    //_T(" 결함찾기 "));
    // �̻������ ����
//    m_ctrlTabMain.InsertItem(nIdx++, _T("Measure"));        //_T("  ����  "));
//    m_ctrlTabMain.InsertItem(nIdx++, _T("Finding Defect"));    //_T(" ����ã�� "));
    //m_ctrlTabMain.InsertItem(nIdx++, _T("Glass"));            //_T(" Glass Info "));
}
@@ -750,19 +750,19 @@
    Item.mask = GVIF_TEXT;
    Item.row = nRowIdx;
    Item.col = nColIdx++;
    strTemp.Format(_T("Index"));//_T("인덱스"));
    strTemp.Format(_T("Index"));//_T("�ε���"));
    Item.strText = strTemp;
    m_ctrlGridRecipeList.SetItem(&Item);
    Item.row = nRowIdx;
    Item.col = nColIdx++;
    strTemp.Format(_T("Recipe Name"));//_T("레시피 이름"));
    strTemp.Format(_T("Recipe Name"));//_T("������ �̸�"));
    Item.strText = strTemp;
    m_ctrlGridRecipeList.SetItem(&Item);
    Item.row = nRowIdx;
    Item.col = nColIdx++;
    strTemp.Format(_T("Last Modified Date"));//_T("최종 수정 날짜"));
    strTemp.Format(_T("Last Modified Date"));//_T("���� ���� ��¥"));
    Item.strText = strTemp;
    m_ctrlGridRecipeList.SetItem(&Item);
}
@@ -787,7 +787,7 @@
        for(i = 0; i < nRecipeCount; i++)
        {
            //레시피 인덱스
            //������ �ε���
            nColIdx = 0;
            Item.mask = GVIF_TEXT;
            Item.row = nRowIdx;
@@ -796,13 +796,13 @@
            Item.strText = strTemp;
            m_ctrlGridRecipeList.SetItem(&Item);
            //레시피 이름
            //������ �̸�
            nColIdx++;
            strTemp = strArrayRecipeName.GetAt(i);
            m_ctrlGridRecipeList.SetItemText(nRowIdx, nColIdx, strTemp);
            m_ctrlGridRecipeList.SetItemState(nRowIdx, nColIdx, GVIS_READONLY);
            //최종 수정 날짜
            //���� ���� ��¥
            nColIdx++;
            strTemp = strArrayLastWriteTime.GetAt(i);
            m_ctrlGridRecipeList.SetItemText(nRowIdx, nColIdx, strTemp);
@@ -837,11 +837,11 @@
        if(nIdx != -1)
        {
            strTemp = strTemp.Mid(nIdx + 1);
            strSearchPath.Format(_T("\\\\%s\\C\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
            strSearchPath.Format(_T("\\\\%s\\D\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
        }
        else
        {
            strSearchPath.Format(_T("\\\\%s\\C\\DIT_Review\\Recipe\\*.rcp"), NETIP_A2E_REVIEW_SYSTEM);
            strSearchPath.Format(_T("\\\\%s\\D\\DIT_Review\\Recipe\\*.rcp"), NETIP_A2E_REVIEW_SYSTEM); //210805
        }
    }
@@ -902,12 +902,12 @@
        if(nIdx != -1)
        {
            strTemp = strTemp.Mid(nIdx + 1);
            strPath.Format(_T("\\\\%s\\C\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
            strPath.Format(_T("\\\\%s\\D\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
        }
        else
        {
            strPath.Format(_T("\\\\%s\\C\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strRecipeName);
        }
            strPath.Format(_T("\\\\%s\\D\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strRecipeName);//210805
        }
    }
    CMacroFile macroFile;
@@ -995,11 +995,11 @@
        if(nIdx != -1)
        {
            strTemp = strTemp.Mid(nIdx + 1);
            strPath.Format(_T("\\\\%s\\C\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
            strPath.Format(_T("\\\\%s\\D\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
        }
        else
        {
            strPath.Format(_T("\\\\%s\\C\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strRecipeName);
            strPath.Format(_T("\\\\%s\\D\\DIT_Review\\Recipe\\%s.rcp"), NETIP_A2E_REVIEW_SYSTEM, strRecipeName); //210805
        }
    }
    
@@ -1069,11 +1069,11 @@
        if(nIdx != -1)
        {
            strTemp = strTemp.Mid(nIdx + 1);
            strPath.Format(_T("\\\\%s\\C\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
            strPath.Format(_T("\\\\%s\\D\\%s"), NETIP_A2E_REVIEW_SYSTEM, strTemp);
        }
        else
        {
            strPath.Format(_T("\\\\%s\\C\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg"), NETIP_A2E_REVIEW_SYSTEM);
            strPath.Format(_T("\\\\%s\\D\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg"), NETIP_A2E_REVIEW_SYSTEM); //210805
        }
    }
@@ -1106,12 +1106,12 @@
void CReviewRecipeEditorDlg::OnTcnSelchangeTabReviewRcpEditorMainTab(NMHDR *pNMHDR, LRESULT *pResult)
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    // TODO: ���⿡ ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
    RecipeMainTab nTabIdx;
    nTabIdx = (RecipeMainTab)m_ctrlTabMain.GetCurSel();
    // [2017:1:25]-[WEZASW] : SystemMachine_B7E_WSI 설비 분리(WSI 유/무)
    // [2017:1:25]-[WEZASW] : SystemMachine_B7E_WSI ���� �и�(WSI ��/��)
    switch(GetCurrentTapIndex(nTabIdx))
    {
    case COMMON_TAB:
@@ -1217,8 +1217,8 @@
}
void CReviewRecipeEditorDlg::OnCancel()
{
    // TODO: 여기에 특수화된 코드를 추가 및/또는 기본 클래스를 호출합니다.
    //_T("레시피 에디터 프로그램을 종료하시겠습니까?"), MB_YESNO | MB_ICONQUESTION))
    // TODO: ���⿡ Ư��ȭ�� �ڵ带 �߰� ��/�Ǵ� �⺻ Ŭ������ ȣ���մϴ�.
    //_T("������ ������ ���α׷��� �����Ͻðڽ��ϱ�?"), MB_YESNO | MB_ICONQUESTION))
    if (IDNO == AfxMessageBox(_T("Do you want to exit recipe editor program?"), MB_YESNO | MB_ICONERROR))
    {
        return;
@@ -1344,7 +1344,7 @@
void CReviewRecipeEditorDlg::OnStnClickedStaticSelectRcipe()
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    // TODO: ���⿡ ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
}
@@ -1447,7 +1447,7 @@
    }
    else
    {
        AfxMessageBox(_T("Please select recipe."));//_T("레시피를 선택하세요."));
        AfxMessageBox(_T("Please select recipe."));//_T("�����Ǹ� �����ϼ���."));
    }
    return bSuccess;
@@ -1457,7 +1457,7 @@
{
    BOOL bSuccess = TRUE;
    // 중복 Recipe 생성 금지.
    // �ߺ� Recipe ���� ����.
    CFileFind finder;
    CString strRecipeFile;
    strRecipeFile.Format(_T("%s\\%s.rcp"), _REVIEW_RECIPE_PATH_, strRecipeName);
ReviewSystem/ReviewRecipeEditor/stdafx.h
@@ -1,7 +1,7 @@
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
// 들어 있는 포함 파일입니다.
// stdafx.h : ���� ��������� ���� ��������� �ʴ�
// ǥ�� �ý��� ���� ���� �� ������Ʈ ���� ���� ������
// ��� �ִ� ���� �����Դϴ�.
#pragma once
@@ -10,37 +10,42 @@
#endif
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN            // 거의 사용되지 않는 내용은 Windows 헤더에서 제외합니다.
#define VC_EXTRALEAN            // ���� ������ �ʴ� ������ Windows ������� �����մϴ�.
#endif
#include "targetver.h"
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // 일부 CString 생성자는 명시적으로 선언됩니다.
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // �Ϻ� CString �����ڴ� ��������� ����˴ϴ�.
// MFC의 공통 부분과 무시 가능한 경고 메시지에 대한 숨기기를 해제합니다.
// MFC�� ���� �κа� ���� ������ ��� �޽����� ���� ����⸦ �����մϴ�.
#define _AFX_ALL_WARNINGS
#include <afxwin.h>         // MFC 핵심 및 표준 구성 요소입니다.
#include <afxext.h>         // MFC 확장입니다.
#include <afxwin.h>         // MFC �ٽ� �� ǥ�� ���� ����Դϴ�.
#include <afxext.h>         // MFC Ȯ���Դϴ�.
#include <afxdisp.h>        // MFC 자동화 클래스입니다.
#include <afxdisp.h>        // MFC �ڵ�ȭ Ŭ�����Դϴ�.
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h>           // Internet Explorer 4 공용 컨트롤에 대한 MFC 지원입니다.
#include <afxdtctl.h>           // Internet Explorer 4 ���� ��Ʈ�ѿ� ���� MFC �����Դϴ�.
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>             // Windows 공용 컨트롤에 대한 MFC 지원입니다.
#include <afxcmn.h>             // Windows ���� ��Ʈ�ѿ� ���� MFC �����Դϴ�.
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxcontrolbars.h>     // MFC의 리본 및 컨트롤 막대 지원
#include <afxcontrolbars.h>     // MFC�� ���� �� ��Ʈ�� ���� ����
#include <afxinet.h>
#include <afxcontrolbars.h>
#define _REVIEW_BASE_PATH_                            _T("C:\\DIT_Review")
#define _REVIEW_RECIPE_PATH_                        _T("C:\\DIT_Review\\Recipe")
#define _REVIEW_RECIPE_BACKUP_PATH_                    _T("C:\\DIT_Review\\Recipe\\Backup")
#define _REVIEW_RECIPE_LOGIN_LOG_PATH_                _T("C:\\DIT_Review\\Recipe\\LoginLog")
#define _REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_    _T("C:\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg")
//#define _REVIEW_BASE_PATH_                            _T("C:\\DIT_Review")
//#define _REVIEW_RECIPE_PATH_                        _T("C:\\DIT_Review\\Recipe")
//#define _REVIEW_RECIPE_BACKUP_PATH_                    _T("C:\\DIT_Review\\Recipe\\Backup")
//#define _REVIEW_RECIPE_LOGIN_LOG_PATH_                _T("C:\\DIT_Review\\Recipe\\LoginLog")
//#define _REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_    _T("C:\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg")
#define _REVIEW_BASE_PATH_                            _T("D:\\DIT_Review")  //210805
#define _REVIEW_RECIPE_PATH_                        _T("D:\\DIT_Review\\Recipe")
#define _REVIEW_RECIPE_BACKUP_PATH_                    _T("D:\\DIT_Review\\Recipe\\Backup")
#define _REVIEW_RECIPE_LOGIN_LOG_PATH_                _T("D:\\DIT_Review\\Recipe\\LoginLog")
#define _REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_    _T("D:\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg")
#define _REVIEW_RECIPE_BACKUP_PATH_CPJT                _T("\\\\126.100.100.5\\d\\DIT Back up\\DIT Review\\Recipe")
#define _REVIEW_SERVER_SYSTEM_SETTING_BACKUP_PATH_CPJT    _T("\\\\126.100.100.5\\d\\DIT Back up\\DIT Review\\ReviewServerConfig")
@@ -72,19 +77,19 @@
#define    COPYDATA_RECIPEEDITOR2REVIEWSYSTEM            1600
// [2017:4:17]-[WEZASW] : CIM(Recipe) 보고 항목 추가.
// [2017:4:17]-[WEZASW] : CIM(Recipe) ���� �׸� �߰�.
enum MsgRecipe2Rev
{
    MsgRecipe2Rev_None = -1,
    MsgRecipe2Rev_StandardCameraGlassPos,
    MsgRev2Recipe_StandardCameraGlassPos,
    MsgRecipe2Rev_RecipeCreate,                    // Recipe(PPID) 추가
    MsgRecipe2Rev_RecipeCreate,                    // Recipe(PPID) �߰�
    MsgRev2Recipe_RecipeCreate,
    MsgRecipe2Rev_RecipeChange,                    // Recipe(PPID) 변경
    MsgRecipe2Rev_RecipeChange,                    // Recipe(PPID) ����
    MsgRev2Recipe_RecipeChange,
    MsgRecipe2Rev_RecipeDelete,                    // Recipe(PPID) 삭제
    MsgRecipe2Rev_RecipeDelete,                    // Recipe(PPID) ����
    MsgRev2Recipe_RecipeDelete,
    MsgRecipe2Rev_RecipeModify,                    // Recipe(PPID) Parameter 수정
    MsgRecipe2Rev_RecipeModify,                    // Recipe(PPID) Parameter ����
    MsgRev2Recipe_RecipeModify
};
ReviewSystem/ReviewSystem/CameraControlAlign.cpp
@@ -5,7 +5,8 @@
#include "CHReviewSetting/SystemInfo.h"
#include "CHReviewRecipe/RsRcpAlignInfo.h"
#define ALIGN_TEMPLATE_PATH _T("C:\\DIT_Review\\Recipe\\AlignImage\\")
#define ALIGN_TEMPLATE_PATH _T("D:\\DIT_Review\\Recipe\\AlignImage\\")
//#define ALIGN_TEMPLATE_PATH _T("C:\\DIT_Review\\Recipe\\AlignImage\\") //210805
using namespace CHImageControls;
ReviewSystem/ReviewSystem/CameraControlReview.cpp
@@ -207,11 +207,13 @@
    CString strPath =m_pRCC2P->IRCC2P_GetTotalPitchImageName();
    if(strPath == _T("")){
        strPath = _T("C:\\DIT_Review\\Recipe\\AlignImage\\ReviewAlign.bmp");
        strPath = _T("D:\\DIT_Review\\Recipe\\AlignImage\\ReviewAlign.bmp");
        //strPath = _T("C:\\DIT_Review\\Recipe\\AlignImage\\ReviewAlign.bmp");  //210805
    }
    else
    {
        strPath = _T("C:\\DIT_Review\\Recipe\\AlignImage\\")+strPath;
        strPath = _T("D:\\DIT_Review\\Recipe\\AlignImage\\") + strPath;
        //strPath = _T("C:\\DIT_Review\\Recipe\\AlignImage\\")+strPath; //210805
    }
    
ReviewSystem/ReviewSystem/DisplayMessage.cpp
@@ -78,13 +78,20 @@
{
    va_list list;
    TCHAR strText[2000] = {0};
    try
    {
        va_start(list, lpstrFormat);
        _vstprintf_s(strText, lpstrFormat, list);
        va_end(list);
    va_start(list, lpstrFormat);
    _vstprintf_s(strText, lpstrFormat, list);
    va_end(list);
        CString* pstrLog = new CString(strText);
        PostThreadMessage(m_ThreadId, WM_DIPLAY_LOG, reinterpret_cast<WPARAM>(pstrLog), 0);
    }
    catch (...)
    {
        return;
    }
    CString* pstrLog = new CString(strText);
    PostThreadMessage(m_ThreadId, WM_DIPLAY_LOG, reinterpret_cast<WPARAM>(pstrLog), 0);
//     WriteToFile(strText);
// 
ReviewSystem/ReviewSystem/DitGlassRawClient.cpp
@@ -138,14 +138,14 @@
    int nCmdId = (m_pGlassRawInfo->m_nCommandIdxWrite+1) % COMMAND_MAXCOUNT;
    if(m_pGlassRawInfo->m_nCommandIdxRead == nCmdId)//���� ���ٴ°��� ��ŧ�� ���۰� �ѹ��� ���Ҵٴ°�!! [������ 2018/11/12]
    if(m_pGlassRawInfo->m_nCommandIdxRead == nCmdId)
    {
        m_pGlassRawInfo->m_nCommandIdxRead++;//占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占?占싹놂옙占쏙옙 占쏙옙占쏙옙占싼댐옙. [占쏙옙占쏙옙占쏙옙 2018/11/12]
        m_pGlassRawInfo->m_nCommandIdxRead++;
    }
    m_pGlassRawInfo->m_nCommandBuffer[nCmdId].nCommand = (short)nCmd;
    m_pGlassRawInfo->m_nCommandBuffer[nCmdId].strParam;
    m_pGlassRawInfo->m_nCommandBuffer[nCmdId].nResult = -1; //-1������, 0����, 1���� [������ 2018/11/13]
    m_pGlassRawInfo->m_nCommandBuffer[nCmdId].nResult = -1;
    m_nLastCommandIdx = m_pGlassRawInfo->m_nCommandIdxWrite = nCmdId;
@@ -217,7 +217,7 @@
void CDitGlassRawClient::RemoveReviewDefects()
{
    int nDefectNum = m_pGlassData->m_nDefectNum;
    int nRightDefectNum = 0;//������ �����ʿ� ��ġ�� ���� ����
    int nRightDefectNum = 0;
    int nDefectDeleteNum = 0;
    for(int i=nDefectNum-1; i>=0; i--)
    {
ReviewSystem/ReviewSystem/DlgControl.cpp
@@ -30,6 +30,7 @@
    m_nMoveAxis            = MoveAxis_Center;
    m_nGlassGridViewIndex = 0;
    pDlgContol          = NULL;
    m_bAlignCamGrab        = FALSE;
}
#define ENABLE_RADIO_TIMER
@@ -111,6 +112,7 @@
    ON_BN_CLICKED(IDC_BT_REVIEW_POPUP, &CDlgControl::OnBnClickedBtReviewPopup)
    ON_BN_CLICKED(IDC_CHECK_USE_SIMULATION, &CDlgControl::OnBnClickedCheckUseSimulation)
    ON_STN_DBLCLK(IDC_STATIC_MAGNIFICATION, &CDlgControl::OnDblclkStaticMagnification)
    ON_BN_CLICKED(IDC_BUTTON_ALIGNCAM_GRAB, &CDlgControl::OnBnClickedButtonAligncamGrab)
END_MESSAGE_MAP()
@@ -184,6 +186,10 @@
                m_ctrlButtonColorCtrl.addControl(IDC_BT_REVIEW_POPUP, this);
                m_ctrlButtonColorCtrl.addControl(IDC_CHECK_USE_SIMULATION, this);
                //#3561 CF AOI Review Align 카메라 끊김 현상 조치 ADD START
                m_ctrlButtonColorCtrl.addControl(IDC_BUTTON_ALIGNCAM_GRAB, this);
                //#3561 CF AOI Review Align 카메라 끊김 현상 조치 ADD END
@@ -1450,4 +1456,24 @@
    {
        (GetDlgItem(IDC_CHECK_USE_SIMULATION))->ShowWindow(SW_SHOW);
    }
}
}
//#3561 CF AOI Review Align 카메라 끊김 현상 조치 ADD START
void CDlgControl::OnBnClickedButtonAligncamGrab()
{
    CSequenceProcessor* pSequenceProcessor = m_pDC2P->IRP2P_GetSequenceProcessor();
    if (pSequenceProcessor == NULL) return;
    if (m_bAlignCamGrab == FALSE)
    {
        pSequenceProcessor->AlignCamera_CameraControl(CameraControlLive);
        m_bAlignCamGrab = TRUE;
    }
    else
    {
        pSequenceProcessor->AlignCamera_CameraControl(CameraControlStop);
        m_bAlignCamGrab = FALSE;
    }
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
}
//#3561 CF AOI Review Align 카메라 끊김 현상 조치 ADD END
ReviewSystem/ReviewSystem/DlgControl.h
@@ -100,6 +100,7 @@
    
    CFontStatic                    m_ctrlKeyMoveJog;
    BOOL                        m_bAlignCamGrab;
    double                        m_dGoPosX;
@@ -209,4 +210,5 @@
    afx_msg void OnBnClickedBtReviewPopup();
    afx_msg void OnBnClickedCheckUseSimulation();
    afx_msg void OnDblclkStaticMagnification();
    afx_msg void OnBnClickedButtonAligncamGrab();
};
ReviewSystem/ReviewSystem/DlgReviewOffSetTool.cpp
@@ -1033,6 +1033,17 @@
    bReturn = macroFile.Write(strFilePath);
    // #3563 LYW_ CF AOI Review Offset 파라미터 저장시 완료 팝업 추가 ADD START
    CString strMessage;
    strMessage.Format(_T("Save Offset Success!!"));
    if (IDOK == AfxMessageBox(strMessage, MB_OK | MB_ICONINFORMATION))
    {
        g_pLog->DisplayMessage(_T("Save Offset Success!!"));
    }
    // #3563 LYW_ CF AOI Review Offset 파라미터 저장시 완료 팝업 추가 ADD END
    return bReturn;
}
ReviewSystem/ReviewSystem/DlgReviewOffSetTool.h
@@ -21,11 +21,11 @@
//enum MotorOringTYPE {
//    LEFT_Top = 0, RIGHT_TOP,LEFT_BOTTOM, RIGHT_BOTTOM
//};
#define    REVIEW_OFFSET_CONFIGFILE_PATH _T("C:\\DIT_Review\\ReviewServerConfig\\")
#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("C:\\DIT_Review\\ReviewServerConfig\\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("C:\\DIT_Review\\ReviewServerConfig\\OffsetBackup\\")
#define    REVIEW_OFFSET_BACKUP_FORDER_PATH _T("D:\\DIT_Review\\ReviewServerConfig\\OffsetBackup\\")
// CDlgDefocusList 대화 상자입니다.
interface IDialogReviewOffSet2Parent
ReviewSystem/ReviewSystem/FileUploadControl.cpp
@@ -179,7 +179,7 @@
// 
//     CCommendParam *pParam = NULL;
// 
//     //FTPUpLoad이면 반환
//     //FTPUpLoad�̸� ��ȯ
//     if( bFTPUpload )
//         return FALSE;
// 
@@ -301,7 +301,8 @@
    if (NULL == hWnd)
    {
        g_pLog->DisplayMessage(_T("Find FTPUploader Program : Fail."));
        StartFTPUploader(_T("C:\\DIT_Review"));
        StartFTPUploader(_T("D:\\DIT_Review"));  //210805
    }
    else
    {
@@ -314,7 +315,7 @@
        else
        {
            g_pLog->DisplayMessage(_T("Send Data to FTPUploader : Fail."));
            RestartFTPUploader(_T("C:\\DIT_Review")); //A2E FTPUploader
            RestartFTPUploader(_T("D:\\DIT_Review")); //A2E FTPUploader //210805
            bRet = FALSE;
        }
    }
ReviewSystem/ReviewSystem/MainFrm.cpp
@@ -41,6 +41,8 @@
    ID_INDICATOR_SCRL,
};
// 정의
// CMainFrame 생성/소멸
CMainFrame::CMainFrame()
@@ -67,6 +69,8 @@
{
    if (CFrameWndEx::OnCreate(lpCreateStruct) == -1)
        return -1;
    SetUnhandledExceptionFilter(TopLevelExceptionFilterCallBack);
    ModifyStyle(WS_CAPTION, NULL);
@@ -447,9 +451,9 @@
#define strScript "RESTART^AFControl.exe^C:\\AFControl\\program\\AFControl.exe"
    
    CFile file;
    if( FALSE == file.Open(_T("C:\\DIT_Review\\MakeScript.TSF"),CFile::modeCreate | CFile::modeWrite) )
    if( FALSE == file.Open(_T("D:\\DIT_Review\\MakeScript.TSF"),CFile::modeCreate | CFile::modeWrite) ) //210805
    {
        g_pLog->DisplayMessage(_T("File[C:\\DIT_Review\\MakeScript.TSF] Create Fail!!"));
        g_pLog->DisplayMessage(_T("File[D:\\DIT_Review\\MakeScript.TSF] Create Fail!!")); //210805
        return;
    }
@@ -481,7 +485,7 @@
    CString strTarget;
    strTarget.Format(_T("\\\\126.100.100.220\\c\\RemoteTaskMgr\\T\\CopyScript.TSF"));
    
    BOOL bRet = CopyFile(_T("C:\\DIT_Review\\MakeScript.TSF"),strTarget,FALSE);
    BOOL bRet = CopyFile(_T("D:\\DIT_Review\\MakeScript.TSF"),strTarget,FALSE); //210805
    if(bRet == FALSE)
        g_pLog->DisplayMessage(_T("[%s]Send Script Fail!"), strTarget);
    /////////////////////////////////////
@@ -940,4 +944,5 @@
        return TRUE;
    }
    return FALSE;
}
}
ReviewSystem/ReviewSystem/MainFrm.h
@@ -19,7 +19,6 @@
#include "stdafx.h"
class CMainFrame :    public CFrameWndEx, public CReviewInterface
{
    
ReviewSystem/ReviewSystem/ReviewInterface.cpp
@@ -1272,7 +1272,7 @@
        // process status observer
        AddObserverUpdateProcessStatus(static_cast<IUpdateProcessStatus*>(m_pAlignCameraControl));
        m_pAlignCameraControl->Camera_Control(CameraControlLive);
        /*m_pAlignCameraControl->Camera_Control(CameraControlLive);*/      // 210805 Align Camera Sequence 변경
    }
    else
    {
@@ -3318,6 +3318,12 @@
{
    if (m_pDoc==NULL) return NULL;
    return m_pDoc->System_GetSystemInfo();
}
const CSignalControlInfo* CReviewInterface::IRP2P_GetReviewSignalinfo()
{
    if (m_pDoc == NULL) return NULL;
    return m_pDoc->System_GetSignalInfo();
}
CGlassResult* CReviewInterface::IRP2P_GetCurrentGlassResult()
@@ -6519,6 +6525,10 @@
{
    if (m_pSequenceProcessor==NULL) return;
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD START
    m_pSequenceProcessor->SetSimulationMode(TRUE);
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD END
    if (nCommand == -1)        // DBClick Date
    {
ReviewSystem/ReviewSystem/ReviewInterface.h
@@ -249,6 +249,7 @@
    virtual void                        IRP2P_UpdateCameraControl(int nModuleIdx, const SCameraControl *pCameraControl, const SCameraInfo* pCameraInfo);
    virtual const CRsRcpReviewInfo*        IRP2P_Recipe_GetRsRcpReviewInfo();
    virtual const CSystemInfo*          IRP2P_GetReviewSysteminfo();
    virtual const CSignalControlInfo*    IRP2P_GetReviewSignalinfo();
    virtual CGlassResult*                IRP2P_GetCurrentGlassResult();                                                    
    virtual void                        IRP2P_DisplayMessage(const TCHAR* lpstrFormat, ...);
    virtual CResultServerControl*        IRP2P_GetResultServerControl();
ReviewSystem/ReviewSystem/ReviewProcessor.h
@@ -62,6 +62,7 @@
    
    virtual const CRsRcpReviewInfo* IRP2P_Recipe_GetRsRcpReviewInfo() = 0;
    virtual const CSystemInfo*      IRP2P_GetReviewSysteminfo() = 0;
    virtual const CSignalControlInfo*    IRP2P_GetReviewSignalinfo() = 0;
    virtual CGlassResult*            IRP2P_GetCurrentGlassResult() = 0;                                                    
    virtual void                    IRP2P_DisplayMessage(const TCHAR* lpstrFormat, ...) = 0;
    virtual CResultServerControl*    IRP2P_GetResultServerControl() = 0;
ReviewSystem/ReviewSystem/ReviewProcessor_CPJT.cpp
@@ -5,6 +5,7 @@
#include "CameraControlReview.h"
#include "CHImageControls/CHImageProcess.h"
#include "CHMotorControls/MotorControl.h"
#include "CHSignalControls/SignalControl.h"
#include "CHEdgeTriangle/EdgeTriangle.h"
#include "CHEdgeTriangle/RecipeManager.h"
@@ -88,7 +89,6 @@
    int nEndResultIdx    = pReviewResult->GetEndSReviewResultIndex();
                        
    
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)  
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -96,8 +96,6 @@
        g_pLog->DisplayMessage(_T("[ReviewProcessor]SetWsiResultData module[%d] point[%d] result[%d]"), nModuleIndex, measureResut.nResultIndex, nCurResultIdx);
    }
    // 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙
    wsiResult.nWsi_ResultIndex = measureResut.nResultIndex;
    wsiResult.nResultCode = measureResut.nResultCode;
@@ -138,8 +136,6 @@
//         g_pLog->DisplayMessage(_T("[ReviewProcessor]JugementR [%d] JugementG [%d] JugementB [%d]"), wsiResult.nJugementR, wsiResult.nJugementG, wsiResult.nJugementB);
//         g_pLog->DisplayMessage(_T("[ReviewProcessor]RZoneHeight [%.03lf] GZoneHeight [%.03lf] BZoneHeight [%.03lf]"), wsiResult.dRZoneHeight, wsiResult.dGZoneHeight, wsiResult.dBZoneHeight);
//         wsiResult.�߰� �ϼ���= measureResut.nMultiShot;
//         wsiResult.�߰� �ϼ���= measureResut.nCurrentShotNumber;
        break;
    case 3: //BANK
        wsiResult.dRZoneHeight = measureResut.dRZoneHeight;
@@ -147,14 +143,13 @@
        wsiResult.dBZoneHeight = measureResut.dBZoneHeight;
        wsiResult.dDefectHeight = measureResut.dDefectHeight;
        wsiResult.nWsi_DefectType = measureResut.nDefectType;
//         wsiResult.�߰� �ϼ���= measureResut.nMultiShot;
//         wsiResult.�߰� �ϼ���= measureResut.nCurrentShotNumber;
        break;
    case 4: //CS
        wsiResult.dCSHeight = measureResut.dCSHeight;
        wsiResult.dDefectHeight = measureResut.dDefectHeight;
        wsiResult.nWsi_DefectType = measureResut.nDefectType;
//         wsiResult.�߰� �ϼ���= measureResut.nMultiShot;
        break;
    }
@@ -162,8 +157,6 @@
    memcpy(wsiResult.pWsi_ResultData, measureResut.pResultData, sizeof(wsiResult.pWsi_ResultData));
    // 占쏙옙占?占쏙옙占쏙옙占쏙옙 占쌩곤옙
    SReviewResult *pProcessResult = NULL;
    if (pGlassResult->SetWsiResultData(nModuleIndex, nCurResultIdx, wsiResult, nGlassPosX, nGlassPosY, nMotorPosX, nMotorPosY, dTime))
    {
@@ -173,10 +166,8 @@
        pProcessResult = pReviewResult->GetSReviewResult(nCurResultIdx);
    }
    // ���� ������, ���� ���μ����� ������ ����
    if (pProcessResult)
    {
        // ó�� ������ ����
        if (AddReviewProcessData(pProcessResult)==1)
        {
            g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx);
@@ -192,7 +183,6 @@
    
    LeaveCriticalSection(&m_csUserCriticalSection);
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult);
    return;
@@ -238,7 +228,6 @@
    int nEndResultIdx    = pReviewResult->GetEndSReviewResultIndex();
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)  
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -246,14 +235,12 @@
        g_pLog->DisplayMessage(_T("[ReviewProcessor]SetWsiResultData module[%d] point[%d] result[%d]"), nModuleIndex, measureResut.nResultIndex, nCurResultIdx);
    }
    // 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙
    wsiUserResult.nWsi_ResultCode        = measureResut.nResultCode;
    wsiUserResult.nWsi_Type                = measureResut.nResultType;
    wsiUserResult.nWsi_SlopeWarn        = measureResut.nXSlopeWarn;
    memcpy(wsiUserResult.pWsi_ResultData, measureResut.pResultData, sizeof(wsiUserResult.pWsi_ResultData));
    // 占쏙옙占?占쏙옙占쏙옙占쏙옙 占쌩곤옙
    SReviewResult *pProcessResult = NULL;
    if (pGlassResult->SetUserWsiResultData(nModuleIndex, nCurResultIdx, wsiUserResult, nGlassPosX, nGlassPosY, nMotorPosX, nMotorPosY, dTime))
    {
@@ -263,10 +250,8 @@
        pProcessResult = pReviewResult->GetSReviewResult(nCurResultIdx);
    }
    // ���� ������, ���� ���μ����� ������ ����
    if (pProcessResult)
    {
        // ó�� ������ ����
        if (AddReviewProcessData(pProcessResult)==1)
        {
            g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx); 
@@ -282,7 +267,6 @@
    LeaveCriticalSection(&m_csUserCriticalSection);
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult);
    return;
@@ -337,7 +321,6 @@
    int nEndResultIdx = pReviewResult->GetEndSReviewResultIndex();
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -345,7 +328,6 @@
        g_pLog->DisplayMessage(_T("[ReviewProcessor]SetWsiMultiShotResultData module[%d] point[%d] result[%d]"), nModuleIndex, measureResut.nResultIndex, nCurResultIdx);
    }
    // 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙
    wsiResult.nWsi_ResultCode = measureResut.nResultCode;
    wsiResult.nWsi_Type = measureResut.nResultType;
    wsiResult.nWsi_SlopeWarn = measureResut.nXSlopeWarn;
@@ -353,7 +335,6 @@
    memcpy(wsiResult.pWsi_ResultData, measureResut.pResultData, sizeof(wsiResult.pWsi_ResultData));
    // 占쏙옙占?占쏙옙占쏙옙占쏙옙 占쌩곤옙
    SReviewResult *pProcessResult = NULL;
    if (pGlassResult->SetWsiResultData(nModuleIndex, nCurResultIdx, wsiResult, nGlassPosX, nGlassPosY, nMotorPosX, nMotorPosY, dTime))
    {
@@ -363,10 +344,8 @@
        pProcessResult = pReviewResult->GetSReviewResult(nCurResultIdx);
    }
    // ���� ������, ���� ���μ����� ������ ����
    if (pProcessResult)
    {
        // ó�� ������ ����
        if (AddReviewProcessData(pProcessResult) == 1)
        {
            g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx); 
@@ -381,8 +360,6 @@
    }
    LeaveCriticalSection(&m_csUserCriticalSection);
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult);
    return;
@@ -457,7 +434,6 @@
    int nStartResultIdx    = pReviewResult->GetStartSReviewResultIndex();
    int nEndResultIdx    = pReviewResult->GetEndSReviewResultIndex();
    
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)  
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -465,7 +441,6 @@
        g_pLog->DisplayMessage(_T("[ReviewProcessor]SetReviewResultData module[%d] point[%d] result[%d]"), nModuleIndex, nResultIndex, nCurResultIdx);
    }
    // 占쏙옙占쏙옙 占쏙옙占쏙옙譴占쏙옙占?占쏙옙占쏙옙
    SReviewResult *pProcessResult = NULL;
    switch(GetReviewProcessStatus())
    {
@@ -509,10 +484,8 @@
        break;
    }
    // ���� ������, ���� ���μ����� ������ ����
    if (pProcessResult)
    {
        // ó�� ������ ����
        if (AddReviewProcessData(pProcessResult)==1)
        {
            g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx); 
@@ -526,9 +499,7 @@
        pReviewResult->SetLastSReviewResultIndex(nCurResultIdx);
    }
        LeaveCriticalSection(&m_csUserCriticalSection);
        //占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙占쏙옙占쏙옙占쏙옙트 占쏙옙占쏙옙占쏙옙 占쏙옙占쌔뱄옙占쏙옙占쏙옙 占싣뤄옙 占쏙옙占쏙옙占쏙옙 占쏙옙타占쏙옙 占쌕쏙옙 占쏙옙占쏙옙占쏙옙표 占싫쏙옙占쏙옙
        // ��ȣó�� �ʿ��� �̰� ����
        if (nCurResultIdx + 1== pReviewResult->GetSReviewResultCount())
        {
            if (nModuleIndex == 0)
@@ -542,7 +513,7 @@
            if (bLeftGantryReviewDone&&bRightGantryReviewDone)
            {
                ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
                ::Sleep(3000);
                g_pLog->DisplayMessage(_T("[ReviewProcessor]RemainReview Started module[%d]"), nModuleIndex);
                CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
                switch (GetReviewProcessStatus())
@@ -567,13 +538,10 @@
            }
            else if(m_pRP2P->IRP2P_Recipe_GetRsRcpReviewInfo()->GetRcpSchedulingInfo()->GetSingleGantryPath()>0)
            {
                //20210302 占싱깍옙 占쏙옙트占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占싸곤옙占쏙옙 占쏙옙트占쏙옙占쏙옙 占싹뤄옙占?占쏙옙占승울옙占쏙옙
                //占쏙옙占쏙옙占쏙옙 占쌔야듸옙占쏙옙占쏙옙 Review 占쏙옙占쏙옙 Count 체크 占싹댐옙 占쏙옙占쏙옙占쏙옙占?占싼곤옙트占쏙옙 占쏙옙占쏙옙 200占쏙옙占쏙옙占쏙옙 占쏙옙占쌩댐옙 占쏙옙占쏙옙 占쌩삼옙
                //占쌓뤄옙占쏙옙 占싱깍옙 占쏙옙트占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙처占쏙옙 占싹울옙 占쏙옙占쏙옙占싹듸옙占쏙옙 占쌕뀐옙森占?CHM
                g_pLog->DisplayMessage(_T("[ReviewProcessor]Single GantryPath Use"), nModuleIndex);
                if (bLeftGantryReviewDone || bRightGantryReviewDone)
                {
                    ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
                    ::Sleep(3000);
                    g_pLog->DisplayMessage(_T("[ReviewProcessor]RemainReview Started module[%d]"), nModuleIndex);
                    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
                    switch (GetReviewProcessStatus())
@@ -601,7 +569,6 @@
        }
        
        // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
        if(nCurResultIdx==nEndResultIdx && nCurResultIdx+1 < pReviewResult->GetSReviewResultCount())
        {
@@ -624,8 +591,7 @@
        pReviewResult->SetStartSReviewResultIndex(nStartResultIdx);
        pReviewResult->SetEndSReviewResultIndex(nEndResultIdx);
        // ������ ����Ʈ ���� ��������.
        ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
        ::Sleep(3000);
           if (bLeftGantryReviewDone&&bRightGantryReviewDone)
           {
            
@@ -685,7 +651,6 @@
        }
    }
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult, m_nReviewPlanIndex);
    return;
@@ -729,7 +694,6 @@
{
    if (m_pRP2P==NULL) return 0;
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -737,7 +701,6 @@
        return 1;
    }
    // ����Ȯ��
    if (pGlassResult->CheckReviewComplete())
    {
        // check motor ready!
@@ -763,7 +726,6 @@
{
    if (m_pRP2P==NULL) return 0;
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -771,7 +733,6 @@
        return 1;
    }
    // ����Ȯ��
    if (pGlassResult->CheckUserComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("User Last Point Complete! "));
@@ -796,7 +757,6 @@
{
    if (m_pRP2P==NULL) return 0;
    // ������ ����Ʈ���� Ȯ�� �� PLC ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -804,7 +764,6 @@
        return 1;
    }
    // ����Ȯ��
    if (pGlassResult->CheckReflowComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Reflow Last Point Complete! "));
@@ -829,7 +788,6 @@
{
    if (m_pRP2P==NULL) return 0;
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -837,7 +795,6 @@
        return 1;
    }
    // ����Ȯ��
    if (pGlassResult->CheckWsiComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Wsi Last Point Complete! "));
@@ -863,7 +820,6 @@
    g_pLog->DisplayMessage(_T("PostProcessMeasureResult[%d]"),nThreadIdx);
    if (m_pRP2P==NULL) return 0;
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -871,7 +827,6 @@
        return 1;
    }
    // ����Ȯ��
    if (pGlassResult->CheckMeasureComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Measure Last Point Complete! "));
@@ -900,7 +855,6 @@
{
    if (m_pRP2P==NULL) return 0;
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -908,7 +862,6 @@
        return 1;
    }
    // ����Ȯ��
    if (pGlassResult->CheckWsiReflowComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Wsi Reflow Last Point Complete! "));
@@ -932,7 +885,6 @@
{
    if (m_pRP2P==NULL) return 0;
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -940,7 +892,6 @@
        return 1;
    }
    // ����Ȯ��
    if (pGlassResult->CheckWsiUserComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Wsi Last Point Complete! "));
@@ -965,7 +916,6 @@
{
    if (m_pRP2P == NULL) return 0;
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult == NULL || pSequenceProcessor == NULL)
@@ -973,7 +923,6 @@
        return 1;
    }
    // ����Ȯ��
    if (pGlassResult->CheckWsiMultiShotComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("WsiMultiShot Last Point Complete! "));
@@ -1138,23 +1087,19 @@
        return ReviewResult_Process_Fail;
    }
    
    // Snap �ð� ����.
    CTime snapTime = CTime::GetCurrentTime();
    pReviewResult->strSnapTime.Format(_T("%04d%02d%02d%02d%02d%02d"), snapTime.GetYear(), snapTime.GetMonth(), snapTime.GetDay(), 
        snapTime.GetHour(), snapTime.GetMinute(), snapTime.GetSecond());    // snap_time
    // 占쏙옙占쏙옙 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占쏙옙 占싱몌옙 占쏙옙占쏙옙占?
    CString strImageFileName = _T("");
    if (MakeReviewImageFileName(pReviewResult)==FALSE)
    {
        
    }
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨몌옙 占쏙옙占쏙옙 占싱뱄옙占쏙옙 占싱몌옙 占쏙옙 占쏙옙표 채占쏙옙占쌍깍옙
    if(!UpdateMemoryReviewPlan(pReviewResult))
        m_pRP2P->IRP2P_DisplayMessage(_T("[ReviewPlan] Memory Update Fail!! DefectIdx : %d"), pReviewResult->nDefectidx2);
    
    // ���� �̹��� ���� ���� �̸�
    pReviewResult->strImgFileName = m_strSaveImageBasePath + _T("\\") +pReviewResult->strImgFileName;
    pReviewResult->nOpticType = 1;
@@ -1178,7 +1123,6 @@
        //    UINT64 nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
            //if (nSize > 0)
            //    m_pRP2P->IRP2P_DisplayMessage(_T("Backup Review Image Save Success! Size: %d byte [%s]"), nSize, pReviewResult->strUploadImgFileName);
            // 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 20190917 chm
            strPath.Format(_T("%s\\%s"), m_strSaveImageUploadPath, pReviewResult->strUploadImgFileName);
            nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
@@ -1193,7 +1137,7 @@
                    m_pRP2P->IRP2P_DisplayMessage(_T("RTMS Review Image Save Fail!!"));
                }
                else m_pRP2P->IRP2P_DisplayMessage(_T("RTMS Review Image Save Success! Size: %d byte [%s] index[%d]"), nSize, strRTMSPath, pReviewResult->nDefectIdx); //taek 210128 �ӵ� ������ �ӽ÷� �α� ������ ����
                else m_pRP2P->IRP2P_DisplayMessage(_T("RTMS Review Image Save Success! Size: %d byte [%s] index[%d]"), nSize, strRTMSPath, pReviewResult->nDefectIdx);
            }
            if (nSize > 0)
@@ -1237,7 +1181,7 @@
    const CRsRcpReviewInfo*  psRcpReviewInfo = m_pRP2P->IRP2P_Recipe_GetRsRcpReviewInfo();
    if(psRcpReviewInfo== NULL) m_pRP2P->IRP2P_DisplayMessage(_T("RcpReviewInfo is NULL"));
    
    if(psRcpReviewInfo->m_bDefocusUse) //190819chm 占쏙옙占쏙옙커占쏙옙 占싯띰옙 占쏙옙占?
    if(psRcpReviewInfo->m_bDefocusUse)
    {
      if(pReviewResult->nLocation == DefectLoc_ASG || pReviewResult->nLocation == DefectLoc_PAD || pReviewResult->nLocation == DefectLoc_C2C)
      {
@@ -1280,18 +1224,37 @@
          if (pReviewResult->nModuleIdx == 0 && m_pRP2P->IRP2P_GetFirstReviewLeft())
          {
              const CSignalControlInfo* pSignalInfo = m_pRP2P->IRP2P_GetReviewSignalinfo();
              int nDefocusValueMin = pSignalInfo->GetDefocusValueMin();
              int nDefocusValueMax = pSignalInfo->GetDefocusValueMax();
              m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview00ImageContrast = dFocusValue;
              m_pRP2P->IRP2P_SetFirstReviewLeft(FALSE);
              m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewLeft FDC FocusValue = %.2f "), dFocusValue);
              if (dFocusValue < nDefocusValueMin || dFocusValue > nDefocusValueMax)
              {
                  m_pRP2P->IRP2P_GetSequenceProcessor()->SendSignalToSignalControl(0, 3, 1000);
              }
          }
          else if(pReviewResult->nModuleIdx == 1 && m_pRP2P->IRP2P_GetFirstReviewRight())
          {
              const CSignalControlInfo* pSignalInfo = m_pRP2P->IRP2P_GetReviewSignalinfo();
              int nDefocusValueMin = pSignalInfo->GetDefocusValueMin();
              int nDefocusValueMax = pSignalInfo->GetDefocusValueMax();
              m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview01ImageContrast = dFocusValue;
              m_pRP2P->IRP2P_SetFirstReviewRight(FALSE);
              m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewRight FDC FocusValue = %.2f "), dFocusValue);
              if (dFocusValue < nDefocusValueMin || dFocusValue > nDefocusValueMax)
              {
                  m_pRP2P->IRP2P_GetSequenceProcessor()->SendSignalToSignalControl(0, 3, 1000);
              }
          }
      }
    }
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD Start
    else
    {
        double dFocusValue = 0.;
@@ -1311,16 +1274,38 @@
        if (pReviewResult->nModuleIdx == 0 && m_pRP2P->IRP2P_GetFirstReviewLeft())
        {
            const CSignalControlInfo* pSignalInfo = m_pRP2P->IRP2P_GetReviewSignalinfo();
            int nDefocusValueMin = pSignalInfo->GetDefocusValueMin();
            int nDefocusValueMax = pSignalInfo->GetDefocusValueMax();
            m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview00ImageContrast = dFocusValue;
            m_pRP2P->IRP2P_SetFirstReviewLeft(FALSE);
            m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewLeft FDC FocusValue = %.2f "), dFocusValue);
            if (dFocusValue < nDefocusValueMin || dFocusValue > nDefocusValueMax)
            {
                m_pRP2P->IRP2P_GetSequenceProcessor()->SendSignalToSignalControl(0, 3, 1000);
            }
        }
        else if (pReviewResult->nModuleIdx == 1 && m_pRP2P->IRP2P_GetFirstReviewRight())
        {
            const CSignalControlInfo* pSignalInfo = m_pRP2P->IRP2P_GetReviewSignalinfo();
            int nDefocusValueMin = pSignalInfo->GetDefocusValueMin();
            int nDefocusValueMax = pSignalInfo->GetDefocusValueMax();
            m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview01ImageContrast = dFocusValue;
            m_pRP2P->IRP2P_SetFirstReviewRight(FALSE);
            m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewRight FDC FocusValue = %.2f "), dFocusValue);
            if (dFocusValue < nDefocusValueMin || dFocusValue > nDefocusValueMax)
            {
                m_pRP2P->IRP2P_GetSequenceProcessor()->SendSignalToSignalControl(0, 3, 1000);
            }
        }
    }
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD End
    
    
@@ -1340,12 +1325,10 @@
        return ReviewResult_Process_Fail;
    }
    // Snap �ð� ����.
    CTime snapTime = CTime::GetCurrentTime();
    pReviewResult->strSnapTime.Format(_T("%04d%02d%02d%02d%02d%02d"), snapTime.GetYear(), snapTime.GetMonth(), snapTime.GetDay(), 
        snapTime.GetHour(), snapTime.GetMinute(), snapTime.GetSecond());    // snap_time
    // 占쏙옙占쏙옙 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占쏙옙 占싱몌옙 占쏙옙占쏙옙占?
    CString strImageFileName = _T("");
    if (MakeUserImageFileName(pReviewResult)==FALSE)
    {
@@ -1357,8 +1340,6 @@
    if(!UpdateMemoryUserPlan(pReviewResult))
        m_pRP2P->IRP2P_DisplayMessage(_T("[UserPlan] Memory Update Fail!! DefectIdx : %d"), pReviewResult->nDefectidx2);
    //// ���� �̹��� ���� ���� �̸�
    //strImageFileName.Format(_T("ModuleIdx[%d]_PointIdx[%d]_Zoom[%d]"), pReviewResult->nModuleIdx, pReviewResult->nResultIdx, pReviewResult->nZoomIdx);
    //pReviewResult->strImgFileName = strImageFileName;
@@ -1377,10 +1358,9 @@
            UINT64 nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
            m_pRP2P->IRP2P_DisplayMessage(_T("Upload Review Image Save Success! Size: %d byte"), nSize);
            //uploadImage.SaveImage(strPath, 40);  // ȭ�� 60% 150k
            //uploadImage.SaveImage(strPath, 40);
            if(GetReviewProcessStatus() == ReviewProcessStatus_UserStart)
            {
                // 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 20190917 chm
                //strPath.Format(_T("%s\\%s\\%s"), m_strSaveImageUploadPath, m_strGlassID, pReviewResult->strUploadImgFileName);
                strPath.Format(_T("%s\\%s"), m_strSaveImageUploadPath, pReviewResult->strUploadImgFileName);
                nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
@@ -1402,7 +1382,7 @@
    const CRsRcpReviewInfo*  psRcpReviewInfo = m_pRP2P->IRP2P_Recipe_GetRsRcpReviewInfo();
    if(psRcpReviewInfo== NULL) m_pRP2P->IRP2P_DisplayMessage(_T("RcpReviewInfo is NULL"));
    if(psRcpReviewInfo->m_bDefocusUse) //190819chm 占쏙옙占쏙옙커占쏙옙 占싯띰옙 占쏙옙占?
    if(psRcpReviewInfo->m_bDefocusUse)
    {
        if(pReviewResult->nLocation == DefectLoc_ASG || pReviewResult->nLocation == DefectLoc_PAD || pReviewResult->nLocation == DefectLoc_C2C)
        {
@@ -1428,15 +1408,33 @@
                if (pReviewResult->nModuleIdx == 0 && m_pRP2P->IRP2P_GetFirstReviewLeft())
                {
                    const CSignalControlInfo* pSignalInfo = m_pRP2P->IRP2P_GetReviewSignalinfo();
                    int nDefocusValueMin = pSignalInfo->GetDefocusValueMin();
                    int nDefocusValueMax = pSignalInfo->GetDefocusValueMax();
                    m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview00ImageContrast = dFocusValue;
                    m_pRP2P->IRP2P_SetFirstReviewLeft(FALSE);
                    m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewLeft FDC FocusValue = %.2f "), dFocusValue);
                    if (dFocusValue < nDefocusValueMin || dFocusValue > nDefocusValueMax)
                    {
                        m_pRP2P->IRP2P_GetSequenceProcessor()->SendSignalToSignalControl(0, 3, 1000);
                    }
                }
                else if (pReviewResult->nModuleIdx == 1 && m_pRP2P->IRP2P_GetFirstReviewRight())
                {
                    const CSignalControlInfo* pSignalInfo = m_pRP2P->IRP2P_GetReviewSignalinfo();
                    int nDefocusValueMin = pSignalInfo->GetDefocusValueMin();
                    int nDefocusValueMax = pSignalInfo->GetDefocusValueMax();
                    m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview01ImageContrast = dFocusValue;
                    m_pRP2P->IRP2P_SetFirstReviewRight(FALSE);
                    m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewRight FDC FocusValue = %.2f "), dFocusValue);
                    if (dFocusValue < nDefocusValueMin || dFocusValue > nDefocusValueMax)
                    {
                        m_pRP2P->IRP2P_GetSequenceProcessor()->SendSignalToSignalControl(0, 3, 1000);
                    }
                }
@@ -1461,6 +1459,57 @@
        }
    }
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 ADD Start
    else
    {
        double dFocusValue = 0.;
        CCHImageData imageConvert;
        if (pImageData->GetChannels() != 1)
        {
            CCHImageProcess::ImageConvert(pImageData, &imageConvert, ConvertTypeRGB2Gray);
        }
        else
        {
            pImageData->CopyImageTo(&imageConvert);
        }
        if (imageConvert.GetImageExist())
        {
            dFocusValue = CalcFocusValue(imageConvert.GetImageBuffer(), imageConvert.GetWidth(), imageConvert.GetHeight());
        }
        if (pReviewResult->nModuleIdx == 0 && m_pRP2P->IRP2P_GetFirstReviewLeft())
        {
            const CSignalControlInfo* pSignalInfo = m_pRP2P->IRP2P_GetReviewSignalinfo();
            int nDefocusValueMin = pSignalInfo->GetDefocusValueMin();
            int nDefocusValueMax = pSignalInfo->GetDefocusValueMax();
            m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview00ImageContrast = dFocusValue;
            m_pRP2P->IRP2P_SetFirstReviewLeft(FALSE);
            m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewLeft FDC FocusValue = %.2f "), dFocusValue);
            if (dFocusValue < nDefocusValueMin || dFocusValue > nDefocusValueMax)
            {
                m_pRP2P->IRP2P_GetSequenceProcessor()->SendSignalToSignalControl(0, 3, 1000);
            }
        }
        else if (pReviewResult->nModuleIdx == 1 && m_pRP2P->IRP2P_GetFirstReviewRight())
        {
            const CSignalControlInfo* pSignalInfo = m_pRP2P->IRP2P_GetReviewSignalinfo();
            int nDefocusValueMin = pSignalInfo->GetDefocusValueMin();
            int nDefocusValueMax = pSignalInfo->GetDefocusValueMax();
            m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview01ImageContrast = dFocusValue;
            m_pRP2P->IRP2P_SetFirstReviewRight(FALSE);
            m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewRight FDC FocusValue = %.2f "), dFocusValue);
            if (dFocusValue < nDefocusValueMin || dFocusValue > nDefocusValueMax)
            {
                m_pRP2P->IRP2P_GetSequenceProcessor()->SendSignalToSignalControl(0, 3, 1000);
            }
        }
    }
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 ADD End
    return ReviewResult_Process_Complete;
}
@@ -1474,7 +1523,6 @@
    int nTestMode = FALSE;
    
    //�ù� �������� �̹��� ���� ���� 20190827 chm
    if(nTestMode){
        Sleep(500);
        CString strPathName;
@@ -1496,12 +1544,10 @@
        return ReviewResult_Process_Fail;
    }
    // Snap �ð� ����.
    CTime snapTime = CTime::GetCurrentTime();
    pReviewResult->strSnapTime.Format(_T("%04d%02d%02d%02d%02d%02d"), snapTime.GetYear(), snapTime.GetMonth(), snapTime.GetDay(), 
        snapTime.GetHour(), snapTime.GetMinute(), snapTime.GetSecond());    // snap_time
    // 占쏙옙占쏙옙 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占쏙옙 占싱몌옙 占쏙옙占쏙옙占?
    CString strImageFileName = _T("");
    if (MakeReflowImageFileName(pReviewResult)==FALSE)
    {
@@ -1517,8 +1563,8 @@
    }
    reflowParam reParam; //Reflow ���� ����
    reflowResult reResult;//Reflow 占쏙옙占?占쏙옙占쏙옙
    reflowParam reParam;
    reflowResult reResult;
    //////////////////////////////////////////////////////////////////////////////////////////////
    BOOL btFlag =0;
@@ -1530,10 +1576,10 @@
    CCHImageData tempImage;
    tempImageOrigin.CopyImageFrom(pImageData);
    if(pReviewResult->nReflow_Side==7) // ���� ����
    if(pReviewResult->nReflow_Side==7)
    {
        btFlag=1;
        CCHImageProcess::ImageRotate(pImageData,&tempImage,135);//���� �̹����� Right ȸ�� ���� Right ���� ����
        CCHImageProcess::ImageRotate(pImageData,&tempImage,135);
        pImageData = &tempImage;
        //reParam.nImageWidth = 2048;
        //reParam.nImageHeight = 2432;
@@ -1643,9 +1689,9 @@
    CCHImageData tmepData2;
    if(btFlag==1){
        CCHImageProcess::ImageRotate(pImageData,&tmepData2,135);//Right ������ �ٽ� �̹��� ������
        CCHImageProcess::ImageRotate(pImageData,&tmepData2,135);
        pImageData= &tmepData2;
        //pImageData->SaveImage(_T("D:\\Testafter.bmp"));//Test �� ���� bmp ����
        //pImageData->SaveImage(_T("D:\\Testafter.bmp"));
    }
@@ -1670,17 +1716,15 @@
            UINT64 nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
            m_pRP2P->IRP2P_DisplayMessage(_T("Upload Review Image Save Success! Size: %d byte"), nSize);
            //uploadImage.SaveImage(strPath, 40);  // ȭ�� 60% 150k
            //uploadImage.SaveImage(strPath, 40);
            if(GetReviewProcessStatus() == ReviewProcessStatus_ReflowStart)
            {
                // 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 20190917 chm
                //strPath.Format(_T("%s\\%s\\%s"), m_strSaveImageUploadPath, m_strGlassID, pReviewResult->strUploadImgFileName);
                strPath.Format(_T("%s\\%s"), m_strSaveImageUploadPath, pReviewResult->strUploadImgFileName);
                nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
                m_pRP2P->IRP2P_DisplayMessage(_T("Upload Reflow Image Save Success! Size: %d byte"), nSize);
                
                //�ùĵ����� �̹��� �ڵ����� ������ 20190927chm
                if(nTestMode)
                {
                    CString csParam;
@@ -1700,7 +1744,6 @@
        m_pRP2P->IRP2P_DisplayMessage(_T("Upload Reflow Image Save Fail![%s]"), pReviewResult->strUploadImgFileName);
    }
    //�����޸� ������Ʈ
    if(!UpdateMemoryReflowPlan(pReviewResult))
        m_pRP2P->IRP2P_DisplayMessage(_T("[ReflowPlan] Memory Update Fail!! DefectIdx : %d"), pReviewResult->nDefectidx2);
@@ -1912,8 +1955,6 @@
}
//���ϸ� 181227 cmark
BOOL CReviewProcessor_CPJT::MakeReviewImageFileName(SReviewResult* pReviewResult)
{
    if (m_pRP2P==NULL || pReviewResult==NULL) return FALSE;
@@ -1926,7 +1967,7 @@
    if(GetReviewProcessStatus() == ReviewProcessStatus_ReviewStart)
    {
        // [2017:6:5]-[WEZASW] : Review Image 占쏙옙占싹몌옙占?'*' 占쏙옙占?占쏙옙占쏙옙.(占쏙옙占쏙옙처占쏙옙)
        // [2017:6:5]-[WEZASW] : Review Image
        if (pReviewResult->strDefectCode.Compare(_T("***")) == 0)
            strDefectCodeTemp = _T("DC");    
        else 
@@ -2017,7 +2058,7 @@
        snapTime.GetHour(), snapTime.GetMinute(), snapTime.GetSecond());    // snap_time
    // [2017:4:10]-[WEZASW] : 占쏙옙占쏙옙占?占쏙옙청占쏙옙 占쏙옙占쏙옙 bmp 占쏙옙占쏙옙 占쌩곤옙 占쏙옙占쏙옙. (占쌈시삼옙占?
    // [2017:4:10]-[WEZASW] :
    pReviewResult->strOrignalImgFileName = strFileName + _T(".bmp");
    strFileName += _T(".jpg");
@@ -2030,11 +2071,10 @@
int    CReviewProcessor_CPJT::ProcessWSIReflow(int nThreadIdx, SReviewResult* pReviewResult)
{
    // [2016:11:15]-[WEZASW] : ���� �ʿ�
    // [2016:11:15]-[WEZASW] :
    if(!UpdateMemoryWsiReflowPlan(pReviewResult))
        m_pRP2P->IRP2P_DisplayMessage(_T("[WsiReflowPlan] Memory Update Fail!! DefectIdx : %d"), pReviewResult->nDefectidx2);
    // wsi�� return ������ ���� [6/20/2017 bhs]
    return WsiResultSuccess;
}
@@ -2078,7 +2118,7 @@
    
    if(GetReviewProcessStatus() == ReviewProcessStatus_UserStart)
    {
        // [2017:6:5]-[WEZASW] : Review Image 占쏙옙占싹몌옙占?'*' 占쏙옙占?占쏙옙占쏙옙.(占쏙옙占쏙옙처占쏙옙)
        // [2017:6:5]-[WEZASW] : Review Image
        if (pReviewResult->strDefectCode.Compare(_T("***")) == 0)
            strDefectCodeTemp = _T("DC");    
        else 
@@ -2172,7 +2212,7 @@
    //         strFileName += pReviewResult->strSnapTime;
    //     }
    // [2017:4:10]-[WEZASW] : 占쏙옙占쏙옙占?占쏙옙청占쏙옙 占쏙옙占쏙옙 bmp 占쏙옙占쏙옙 占쌩곤옙 占쏙옙占쏙옙. (占쌈시삼옙占?
    // [2017:4:10]-[WEZASW] :
    pReviewResult->strOrignalImgFileName = strFileName + _T(".bmp");
    strFileName += _T(".jpg");
@@ -2249,13 +2289,11 @@
void CReviewProcessor_CPJT::LoadAoiImage(const CString& strGlassID, int nOpticType, int nPosX, int nPosY, CCHImageData* pAoiDark, CCHImageData *pAoiBright)
{
    // 3. �˻� ���� �̹��� ã��
    CString strAoiDarkPath = _T("");
    CString strAoiBrightPath = _T("");
    FindAoiDefectImagePath(strGlassID, nOpticType, nPosX, nPosY, strAoiDarkPath, strAoiBrightPath);
    // Dark, Bright 占쏙옙占?찾占쏙옙 占쏙옙占쏙옙 占쌍쇽옙처占쏙옙 [2017.7.1 bhs]
    // Dark image
    //if(nOpticType & DEFECT_OPTIC_DARK)
    {
@@ -2300,7 +2338,6 @@
    CFileFind finder;
    CString strSearchPath = _T("");
    // Dark, Bright 占쏙옙占?찾占쏙옙 占쏙옙占쏙옙 占쌍쇽옙처占쏙옙 [2017.7.1 bhs]
    //if (nOpticType & DEFECT_OPTIC_DARK)
    {
        // Dark field
@@ -2374,7 +2411,6 @@
            processTimer.End();
        }
        // 4-3. 占쏙옙占쏙옙占쏙옙占?占쏙옙占?
        double dAverageGray = 0.0;
        if (CCHImageProcess::ImageAverage(&bandImage, dAverageGray)==1)
        {
@@ -2411,14 +2447,12 @@
    CCHImageData pReviewCam;
    CCHImageData tempImage1;
    
    // ������ �̹��� ȸ��
    if (m_nImageRotate > 0)
    {
        tempImage1.CopyImageFrom(pReviewCamSource);
        CCHImageProcess::ImageRotate(pReviewCamSource, &tempImage1, (90.0*m_nImageRotate));
    }
    // ������ �̹��� ����
    if (m_nimageFlip > 0)
    {
        if(m_nImageRotate > 0)
@@ -2455,7 +2489,6 @@
    // set total size * scale
    int nTotalWidth        = int(m_nReviewResizeWidth * m_dReviewImageScale + 0.5);
    // 20170817 smok Dark, Bright �̹����� ���� �̹��� �Ʒ��� �ٵ��� ����
    int nTotalHeight    = int(m_nReviewResizeHeight * m_dReviewImageScale + 0.5 + max(pAoiDark2.GetHeight(), pAoiBright2.GetHeight()));
    int nTotalHeight2    = int(m_nReviewResizeHeight * m_dReviewImageScale + 0.5);
@@ -2481,14 +2514,13 @@
    double dRulerGab = 20.0 / m_dReviewImageScale;
    double dScaleResolution = pReviewResult->dMeasureResolution / m_dReviewImageScale;
    //DrawRuler(&memDC, nTotalWidth, nTotalHeight2, dScaleResolution, dRulerGab); // resolution, ruler gab //taek 210127 占쏙옙占?X
    //DrawRuler(&memDC, nTotalWidth, nTotalHeight2, dScaleResolution, dRulerGab); // resolution, ruler gab //taek 210127
    // draw text string
    DrawDefectInfo(&memDC, findResult, pReviewResult);
    
    //DrawAoiImage(&memDC, &pAoiDark2, &pAoiBright2, &pAoiDark2, &pAoiBright2, nAoiWidth, nAoiHeight);
    // draw line ���� ������
    //DrawCenterLine(&memDC, nTotalWidth, nTotalHeight);
   // DrawCenterRect(&memDC, nTotalWidth, nTotalHeight, 100, 100, pReviewResult->dMeasureResolution);
@@ -2516,7 +2548,7 @@
    nWidthDark = nHeightDark = nWidthBright = nHeightBright = 0;
    // 20170817 smok Dark, Bright �̹����� ���� �̹��� �Ʒ��� �ٵ��� ����
    // 20170817 smok Dark, Bright
    // dark
    CCHImageData subImage;
    if(pAoiDark!=NULL && pAoiDark->GetImageExist())
@@ -2597,11 +2629,9 @@
    int nTotalWidth        = int(m_nReviewResizeWidth * m_dReviewImageScale + 0.5);
    int nTotalHeight    = int(m_nReviewResizeHeight * m_dReviewImageScale + 0.5);
    // Dark, Bright 占싱뱄옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쌕듸옙占쏙옙 占쏙옙占쏙옙, Dark 占쏙옙, Bright 占싣뤄옙 - 占쏙옙占쏙옙占?占쏙옙청[2017.6.30 bhs]
    //int nX = nTotalWidth - nWidth;
    //int nY = nTotalHeight - (nHeight * 2);
    // 20170817 smok Dark, Bright �̹����� ���� �̹��� �Ʒ��� �ٵ��� ����
    int nX = 0;
    int nY = nTotalHeight;
    pAoiDark1->ShowImage(pDC->m_hDC, nX, nY, pAoiDark1->GetWidth(), pAoiDark1->GetHeight(), 0, 0);
@@ -2609,7 +2639,6 @@
    //pAoiDark1->ShowImage(pDC->m_hDC,    nTotalWidth - nWidth,    nTotalHei4ght-nHeight,    pAoiDark1->GetWidth(), pAoiDark1->GetHeight(), 0, 0);
    //pAoiBright1->ShowImage(pDC->m_hDC,    nTotalWidth - nWidth,    nTotalHeight-nHeight,    pAoiBright1->GetWidth(), pAoiBright1->GetHeight(), 0, 0);
    // 占싯삼옙 占싱뱄옙占쏙옙 占쌩앙울옙 화占쏙옙표 표占쏙옙 - 占쏙옙占쏙옙占?占쏙옙청 [2017.6.30 bhs]
    CFont Font;
    VERIFY(Font.CreateFont(
        50,                        // nHeight
@@ -2630,7 +2659,7 @@
    CFont *pOldFont = pDC->SelectObject(&Font);
    pDC->SetTextColor(RGB(255,0,0));
    CString strArrow = _T("��");
    CString strArrow = _T("↗");
    CSize size = pDC->GetTextExtent(strArrow);
    int nCenterX = nX + (nWidth / 2) - size.cx;
    int nCenterY = nY + (nHeight / 2)/* + (size.cy / 2)*/;
@@ -2833,7 +2862,6 @@
    else {
        wchar_t  pstrPrefix[128] ={};
        //Zone �ѹ� 210127
        int nValue = 0;
        for (int i = 15; i >= 0; i--)
        {
@@ -2844,8 +2872,6 @@
        }
        //taek 210127
        //占쏙옙占쏙옙占쏙옙占?占쏙옙표占쏙옙 y 占쏙옙 *-1占쏙옙 占쏙옙占쏙옙
        //���� ID, �˻� ī�޶� ����, �˻� Camera ���� : (? ) ķ ?, Cell ID,    Review Cam ���� : Gantry ����,    ���� Size,    ���� Zone ����,    Stak Flag, CODE ����, ��ǥ ����
        
        // PPID
//         strValue.Format(_T("Tool[%s].Recipe[%s].ScanNo[%d/%d].Time[%4d/%2d/%2d_%d:%d:%d].MaxGray[%d].RefGray[%d].REVCnt[%d]"),pReviewResult->strEquipID,pGlassResult->m_strPPID,pReviewResult->nAOIScanIdx,0,snapTime.GetYear(), snapTime.GetMonth(), snapTime.GetDay(),
@@ -3060,7 +3086,7 @@
    if(GetReviewProcessStatus() == ReviewProcessStatus_ReflowStart)
    {
        // [2017:6:5]-[WEZASW] : Review Image 占쏙옙占싹몌옙占?'*' 占쏙옙占?占쏙옙占쏙옙.(占쏙옙占쏙옙처占쏙옙)
        // [2017:6:5]-[WEZASW] : Review Image
        if (pReviewResult->strDefectCode.Compare(_T("***")) == 0)
            strDefectCodeTemp = _T("DC");    
        else 
@@ -3137,7 +3163,7 @@
    //         strFileName += pReviewResult->strSnapTime;
    //     }
    // [2017:4:10]-[WEZASW] : 占쏙옙占쏙옙占?占쏙옙청占쏙옙 占쏙옙占쏙옙 bmp 占쏙옙占쏙옙 占쌩곤옙 占쏙옙占쏙옙. (占쌈시삼옙占?
    // [2017:4:10]-[WEZASW] :
    pReviewResult->strOrignalImgFileName = strFileName + _T(".bmp");
    strFileName += _T(".jpg");
@@ -3183,7 +3209,6 @@
    int nStartResultIdx    = pReviewResult->GetStartSReviewResultIndex();
    int nEndResultIdx    = pReviewResult->GetEndSReviewResultIndex();
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)  
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -3191,7 +3216,6 @@
        g_pLog->DisplayMessage(_T("[ReviewProcessor]SetWsiResultData module[%d] point[%d] result[%d]"), nModuleIndex, measureResut.nResultIndex, nCurResultIdx);
    }
    // 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙
    wsiResult.nWsi_ResultCode        = measureResut.nResultCode;
    wsiResult.dWsi_DamDistance        = measureResut.dDamDistance;
@@ -3201,7 +3225,6 @@
    }
    //memcpy(wsiResult.nWsi_pReflowResultData, measureResut.pReflowResultData, sizeof(wsiResult.nWsi_pReflowResultData));
    
    // 占쏙옙占?占쏙옙占쏙옙占쏙옙 占쌩곤옙
    SReviewResult *pProcessResult = NULL;
    if (pGlassResult->SetWsiReflowResultData(nModuleIndex, nCurResultIdx, wsiResult, nGlassPosX, nGlassPosY, nMotorPosX, nMotorPosY, dTime))
    {
@@ -3210,10 +3233,8 @@
        pProcessResult = pReviewResult->GetSReviewResult(nCurResultIdx);
    }
    // ���� ������, ���� ���μ����� ������ ����
    if (pProcessResult)
    {
        // ó�� ������ ����
        if (AddReviewProcessData(pProcessResult)==1)
        {
            g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Wsi Reflow Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx);
@@ -3229,7 +3250,6 @@
    LeaveCriticalSection(&m_csUserCriticalSection);
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult, 5);
    return;
@@ -3237,8 +3257,7 @@
    g_pLog->DisplayMessage(_T("[ReviewProcessor]WsiResult FAIL! module[%d] result[%d]"), nModuleIndex, measureResut.nResultIndex);
    return;
}
//0129cmark ���� ��ġ�� ���� ��ǥ�� ���� ��ǥ�� ����
double CReviewProcessor_CPJT::GetCentertoOrginCoordinate(double dPosX,double dPosY,int nCornercut,int nOriginDirection){
    double nResultPosX=0.0;
@@ -3247,60 +3266,60 @@
    // CornerCutDirection    { CLeftTop=0, CRightTop, CLeftBottom,   CRightBottom };
    // OriginDirection    { OLeftTop=0, ORightTop, OLeftBottom,   ORightBottom };
    if(nOriginDirection==RPOLeftTop){//�������»�
    if(nOriginDirection==RPOLeftTop){
        if(nCornercut == RPCLeftTop)//�»�
        if(nCornercut == RPCLeftTop)
        { 
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
        }
        else if(nCornercut == RPCRightTop)//占쏙옙占?
        else if(nCornercut == RPCRightTop)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
        }
        else if(nCornercut == RPCLeftBottom)//����
        else if(nCornercut == RPCLeftBottom)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
        }
        else if(nCornercut == RPCRightBottom)//����
        else if(nCornercut == RPCRightBottom)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2 + dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2 + dPosY;
        }
    }
    else if(nOriginDirection==RPORightTop){//占쏙옙占쏙옙占쏙옙占쏙옙占?
    else if(nOriginDirection==RPORightTop){
        if(nCornercut == RPCLeftTop)//�»�
        if(nCornercut == RPCLeftTop)
        { 
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
        }
        else if(nCornercut == RPCRightTop)//占쏙옙占?
        else if(nCornercut == RPCRightTop)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
        }
        else if(nCornercut == RPCLeftBottom)//����
        else if(nCornercut == RPCLeftBottom)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
        }
        else if(nCornercut == RPCRightBottom)//����
        else if(nCornercut == RPCRightBottom)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
        }
    }
    else if(nOriginDirection==RPOLeftBottom){//����������
    else if(nOriginDirection==RPOLeftBottom){
        if(nCornercut == RPCLeftTop)//�»�
        if(nCornercut == RPCLeftTop)
        { 
            //210402
        /*    nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
@@ -3309,13 +3328,13 @@
            nResultPosX = double(GLASS_SIZE_WIDTH) / 2. + dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT) / 2. + dPosY;
        }
        else if(nCornercut == RPCRightTop)//占쏙옙占?
        else if(nCornercut == RPCRightTop)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
        }
        else if(nCornercut == RPCLeftBottom)//����
        else if(nCornercut == RPCLeftBottom)
        {
            //210402
            /*nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
@@ -3323,33 +3342,33 @@
            nResultPosX = double(GLASS_SIZE_WIDTH) / 2. + dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT) / 2. + dPosY;
        }
        else if(nCornercut == RPCRightBottom)//����
        else if(nCornercut == RPCRightBottom)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH) / 2. - dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT) / 2. + dPosY;
        }
    }
    else if (nOriginDirection==RPORightBottom)
    {//����������
    {
        if(nCornercut == RPCLeftTop)//�»�
        if(nCornercut == RPCLeftTop)
        { 
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
        }
        else if(nCornercut == RPCRightTop)//占쏙옙占?
        else if(nCornercut == RPCRightTop)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
        }
        else if(nCornercut == RPCLeftBottom)//����
        else if(nCornercut == RPCLeftBottom)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
        }
        else if(nCornercut == RPCRightBottom)//����
        else if(nCornercut == RPCRightBottom)
        {
            nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
            nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
@@ -3374,7 +3393,7 @@
    CString strFileName = _T("");
    CString strDefectCodeTemp = _T("");
    // [2017:6:5]-[WEZASW] : Review Image 占쏙옙占싹몌옙占?'*' 占쏙옙占?占쏙옙占쏙옙.(占쏙옙占쏙옙처占쏙옙)
    // [2017:6:5]-[WEZASW] : Review Image
    if (pReviewResult->strDefectCode.Compare(_T("***")) == 0)
        strDefectCodeTemp = _T("DC");    
    else 
@@ -3438,7 +3457,6 @@
{
    if(pReviewResult == NULL)    return FALSE;
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨몌옙 占쏙옙占쏙옙 占싱뱄옙占쏙옙 占싱몌옙 占쏙옙 占쏙옙표 채占쏙옙占쌍깍옙
    CDitGlassRawClient *pDitGlassRawCleint = CDitGlassRawClient::GetInstance();
    if(pDitGlassRawCleint->isConnect() == TRUE)
    {
@@ -3452,17 +3470,17 @@
        strcpy(pSharedDefectReview->m_strRevImageName,pReviewResult->strImgFileName.MakeLower());
        
        //taek 210624 ���� ���� �� ���ش�.
        //taek 210624
        strcpy(pSharedDefectReview->m_strRevImagePath,pReviewResult->strImgFilePath.MakeLower());
        strcpy(pSharedGlassData->m_strAlignFirst, m_strReviewFirst.MakeLower());
        strcpy(pSharedGlassData->m_strAlignSecond, m_strReviewSecned.MakeLower());
        pSharedDefectReview->m_nPlanType =  ditRaw::RPT_Review;    //0:None, 1:Location(User, Fiexed) Review, 4:reflower, ??:Wsi, 1000:AOI(占쌤븝옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占?
        pSharedDefectReview->m_nPlanType =  ditRaw::RPT_Review;    //0:None, 1:Location(User, Fiexed) Review, 4:reflower, ??:Wsi, 1000:AOI(
        pSharedDefectReview->m_nResultCode = 1;  //0:None, 1:Success
        pSharedDefectReview->m_nShotIndex = pReviewResult->nResultIdx; 
        //pSharedDefectReview->m_nShotIndex = GetPlanReviewCount(); //RTMS 占쏙옙占쌔울옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占?占싣니몌옙 占쏙옙占쏙옙占쏙옙 占싹댐옙 占심뤄옙 taek 210128
        //pSharedDefectReview->m_nShotIndex = GetPlanReviewCount(); //RTMS taek 210128
        pSharedDefectReview->m_nModuleIndex = pReviewResult->nModuleIdx;
        pSharedDefectReview->m_nMagnificIndex = 20;
        pSharedDefectReview->m_fManification =pReviewResult->dMagnification;
@@ -3476,11 +3494,10 @@
BOOL CReviewProcessor_CPJT::UpdateMemoryUserPlan( SReviewResult* pReviewResult )
{
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨몌옙 占쏙옙占쏙옙 占싱뱄옙占쏙옙 占싱몌옙 占쏙옙 占쏙옙표 채占쏙옙占쌍깍옙
    CDitGlassRawClient *pDitRawClient = CDitGlassRawClient::GetInstance();
    if(pDitRawClient->isConnect() == TRUE)
    {
        int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow �� �˻� ���� ���� �����DZ⿡ ���� ī��Ʈ���� ���ų� ū���� ������ �ִ�
        int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow
        if(pReviewResult->nDefectIdx <nDefectCount)
        {    
            return FALSE;
@@ -3493,7 +3510,7 @@
        
        strcpy(pSharedDefectReview->m_strRevImageName,pReviewResult->strImgFileName);
    
        pSharedDefectReview->m_nPlanType = ditRaw::RPT_User;    //0:None, 1:Location(User, Fiexed) Review, 4:reflower, ??:Wsi, 1000:AOI(占쌤븝옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占?
        pSharedDefectReview->m_nPlanType = ditRaw::RPT_User;    //0:None, 1:Location(User, Fiexed) Review, 4:reflower, ??:Wsi, 1000:AOI(
        pSharedDefectReview->m_nResultCode = 1;  //0:None, 1:Success
        pSharedDefectReview->m_nShotIndex = pReviewResult->nResultIdx; 
        pSharedDefect->m_nShotIdx = pReviewResult->nResultIdx;
@@ -3502,7 +3519,7 @@
        pSharedDefectReview->m_nMagnificIndex = pReviewResult->dMagnification;
        pSharedDefectReview->m_fManification = pReviewResult->dMagnification;
        pSharedDefectReview->m_fManificResoultion = pReviewResult->dMagnification;
            m_pRP2P->IRP2P_DisplayMessage(_T("[�����޸�����]�ε���[%d]���ϸ�[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
            m_pRP2P->IRP2P_DisplayMessage(_T("[Access Shared Memory]IDX[%d]Filename[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
    }
@@ -3512,7 +3529,6 @@
BOOL CReviewProcessor_CPJT::UpdateMemoryReflowPlan( SReviewResult* pReviewResult )
{
    if(pReviewResult == NULL)    return FALSE;
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
    CDitGlassRawClient *pDitRawClient = CDitGlassRawClient::GetInstance();
    //int nEqpID = m_pSP2P->ISP2P_System_GetSystemInfo()->m_nMachineType;
    CString strCellID = _T("");
@@ -3534,7 +3550,6 @@
                nReflowjuge=1;
            }
            // 占쏙옙占쏙옙占?占쏙옙청占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙. 0,1 Position占쏙옙 Pass
            else if(nReflowjuge == 3 || nReflowjuge == 2)
            {
                m_pRP2P->IRP2P_DisplayMessage(_T("[ReflowResult] Reflow Judge Is No OverFlow %d"),nReflowjuge);
@@ -3553,7 +3568,6 @@
                nReflowjuge=0;
            }
            
            //0:None, // ������ Line�� ����. 3 �̸� : DAM2 Reflow ����, 4~5 : DAM1 Reflow ����, 6 : no Reflow ���� / -1 : image not loaded, -2 : roi setting error, -3 : roi length error, -5 : select wrong side
            if(pReviewResult->nReflow_CellIndex > 7)
            {
                pReviewResult->nReflow_CellIndex = 0;
@@ -3570,7 +3584,7 @@
    if(pDitRawClient->isConnect() == TRUE)
    {
        int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow �� �˻� ���� ���� �����DZ⿡ ���� ī��Ʈ���� ���ų� ū���� ������ �ִ�
        int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum;
        if(pReviewResult->nDefectidx2 <nDefectCount)
        {
            return FALSE;
@@ -3585,11 +3599,10 @@
        pSharedDefectReview->m_nPlanType =  ditRaw::RTP_Reflow;            
        pSharedDefectReview->m_nReflow_ResultCode = pReviewResult->nReflow_Result;// pReviewResult->nReflow_Result;  
        //0:None, // ������ Line�� ����. 3 �̸� : DAM2 Reflow ����, 4~5 : DAM1 Reflow ����, 6 : no Reflow ���� / -1 : image not loaded, -2 : roi setting error, -3 : roi length error, -5 : select wrong side
        //pSharedDefectReview->m_fReflow_LinePosData;    
        pSharedDefectReview->m_nReflow_Side = pReviewResult->nReflow_Side;
        pSharedDefectReview->m_nReflow_InspectionMode = 0;
        m_pRP2P->IRP2P_DisplayMessage(_T("[�����޸�����]�ε���[%d]���ϸ�[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
        m_pRP2P->IRP2P_DisplayMessage(_T("[Access Shared Memory]IDX[%d]Filename[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
    }
    
    return TRUE;
@@ -3599,7 +3612,6 @@
{
    if(pReviewResult == NULL)    return FALSE;
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
    CDitGlassRawClient *pDitGlassRawClient = CDitGlassRawClient::GetInstance();
    if(pDitGlassRawClient->isConnect() == TRUE)
@@ -3616,7 +3628,7 @@
        pSharedDefectReview->m_nPlanType =  ditRaw::RTP_WSI;            
        pSharedDefectReview->m_nWsi_ResultCode=pReviewResult->nWsi_ResultCode; //0:None, 1:Success
        pSharedDefectReview->m_nWsi_Type = 2;/* nWSIType;                                    // �Ը� / ���� //wsi ���� */
        pSharedDefectReview->m_nWsi_Type = 2;
        pSharedDefectReview->m_fWsi_ResultData[0]= pReviewResult->nWsi_DefectType; // 0:normal 1:metal 2:huge 3:diffuse 4:trashy
        pSharedDefectReview->m_fWsi_ResultData[1]=(float)(nWSIheight/1000.0); 
        pSharedDefectReview->m_fWsi_ResultData[2]=(float)(nWSIWidth/1000.0);            // 0:Type, 1:Height, 2:Width
@@ -3626,7 +3638,7 @@
        pSharedDefectReview->m_fWsi_ResultData[6] = pReviewResult->dBZoneHeight;
        pSharedDefectReview->m_strWsi_2DImageFilename;
        pSharedDefectReview->m_strWsi_3DImageFilename;
        pSharedDefectReview->m_fWsiManification = 20;//20�� ����
        pSharedDefectReview->m_fWsiManification = 20;
        pSharedDefectReview->m_dWsiMmMotorX=pReviewResult->dTargetMotorX;
        pSharedDefectReview->m_dWsiMmMotorY=pReviewResult->dTargetMotorY;
        
@@ -3641,7 +3653,6 @@
BOOL CReviewProcessor_CPJT::UpdateMemoryWsiReflowPlan( SReviewResult* pReviewResult )
{
    if(pReviewResult == NULL)    return FALSE;
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
    CDitGlassRawClient *pDitRawClient = CDitGlassRawClient::GetInstance();
    
@@ -3652,17 +3663,6 @@
    int nWsiReflowResult = 0;
    int nWsiReflowJudge = -1;
    /*
    pPacket->GetInt(0)            = Index
    pPacket->GetInt(1)            = Wsi 占쏙옙占쏙옙 占쏙옙占?
    pPacket->GetInt(2)            = A占쏙옙 占쏙옙占쏙옙 占쏙옙占?(1 占쏙옙占쏙옙 0 占쏙옙占쏙옙)
    pPacket->GetInt(3)          = B占쏙옙 占쏙옙占쏙옙 占쏙옙占?
    pPacket->GetInt(4)          = C占쏙옙 占쏙옙占쏙옙 占쏙옙占?
    pPacket->GetInt(5)          = D占쏙옙 占쏙옙占쏙옙 占쏙옙占?
    pPacket->GetInt(6)          = Review占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占?PointIndex
    pPacket->GetDouble(0)       = �£�� Monomo������ �Ÿ�
    */
    
//     int nReflowjuge=0;
//     for(int nZone=2; nZone<6; nZone++)
@@ -3672,7 +3672,7 @@
    
    nWsiReflowJudge  = pReviewResult->nWsi_ResultCode;
    //nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[0] //A 1占쏙옙 占신곤옙횡占?
    //nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[0] //A
    nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[1];//B
    nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[2];//C
    //nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[3];//D
@@ -3732,7 +3732,6 @@
{
    if(pReviewResult == NULL)    return FALSE;
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
    CDitGlassRawClient *pDitGlassRawClient = CDitGlassRawClient::GetInstance();
    if(pDitGlassRawClient->isConnect() == TRUE)
@@ -3749,13 +3748,13 @@
        pSharedDefectReview->m_nPlanType =  ditRaw::RTP_UserWsi;            
        pSharedDefectReview->m_nWsi_ResultCode=pReviewResult->nWsi_ResultCode; //0:None, 1:Success
        pSharedDefectReview->m_nWsi_Type=nWSIType;                                    // �Ը� / ����
        pSharedDefectReview->m_nWsi_Type=nWSIType;
        pSharedDefectReview->m_fWsi_ResultData[0]= nWSIType;
        pSharedDefectReview->m_fWsi_ResultData[1]=(float)(nWSIheight/100.0);
        pSharedDefectReview->m_fWsi_ResultData[2]=(float)(nWSIWidth/100.0);            // 0:Type, 1:Height, 2:Width
        pSharedDefectReview->m_strWsi_2DImageFilename;
        pSharedDefectReview->m_strWsi_3DImageFilename;
        pSharedDefectReview->m_fWsiManification = 20;//20�� ����
        pSharedDefectReview->m_fWsiManification = 20;
        pSharedDefectReview->m_dWsiMmMotorX=pReviewResult->dTargetMotorX;
        pSharedDefectReview->m_dWsiMmMotorY=pReviewResult->dTargetMotorY;
    }
@@ -3767,7 +3766,6 @@
{
    if (pReviewResult == NULL)    return FALSE;
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
    CDitGlassRawClient *pDitGlassRawClient = CDitGlassRawClient::GetInstance();
    if (pDitGlassRawClient->isConnect() == TRUE)
@@ -3784,13 +3782,13 @@
        pSharedDefectReview->m_nPlanType = ditRaw::RTP_WSI;
        pSharedDefectReview->m_nWsi_ResultCode = pReviewResult->nWsi_ResultCode; //0:None, 1:Success
        pSharedDefectReview->m_nWsi_Type = nWSIType;                                    // �Ը� / ����
        pSharedDefectReview->m_nWsi_Type = nWSIType;
        pSharedDefectReview->m_fWsi_ResultData[0] = nWSIType;
        pSharedDefectReview->m_fWsi_ResultData[1] = (float)(nWSIheight / 100.0);
        pSharedDefectReview->m_fWsi_ResultData[2] = (float)(nWSIWidth / 100.0);            // 0:Type, 1:Height, 2:Width
        pSharedDefectReview->m_strWsi_2DImageFilename;
        pSharedDefectReview->m_strWsi_3DImageFilename;
        pSharedDefectReview->m_fWsiManification = 20;//20�� ����
        pSharedDefectReview->m_fWsiManification = 20;
        pSharedDefectReview->m_dWsiMmMotorX = pReviewResult->dTargetMotorX;
        pSharedDefectReview->m_dWsiMmMotorY = pReviewResult->dTargetMotorY;
@@ -3821,7 +3819,6 @@
    double TempValue = 0;
    double m_nResultFocusValue = 0;
    // ���� XY ���� X+1, Y+1�� ���� ������
    for (int y = 0; y < nHeight - 1; y++)
    {
        for (int x = 0; x < nWidth - 1; x++)
ReviewSystem/ReviewSystem/ReviewSystem.rc
@@ -483,9 +483,9 @@
    PUSHBUTTON      "Key Jog 시작",IDC_KEY_JOD_MOVE,207,167,45,17,NOT WS_VISIBLE | NOT WS_TABSTOP
    PUSHBUTTON      "test2",IDC_BUTTON_TEST2,273,167,34,17,NOT WS_VISIBLE
    CTEXT           "Key Jog시작",IDC_KEY_JOG_MOVE,392,160,31,24
    PUSHBUTTON      "Reduce",IDC_CHECK_UI_REDUCE,436,77,51,17
    PUSHBUTTON      "Left",IDC_BUTTON_UI_LEFT,436,96,50,17
    PUSHBUTTON      "Right",IDC_BUTTON_UI_RIGHT1,436,116,50,17
    PUSHBUTTON      "Reduce",IDC_CHECK_UI_REDUCE,436,73,51,17
    PUSHBUTTON      "Left",IDC_BUTTON_UI_LEFT,436,92,50,17
    PUSHBUTTON      "Right",IDC_BUTTON_UI_RIGHT1,436,112,50,17
    CONTROL         "Track",IDC_CHECK_AFM_TRACK,"Button",BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP,369,77,29,57
    LTEXT           "GlassCenter X/Y(mm)",IDC_STATIC,10,105,74,8
    PUSHBUTTON      "Go",IDC_BUTTON_GLASSCENTER_GO_XY,196,101,27,17
@@ -494,6 +494,7 @@
    CONTROL         "OffSet ON",IDC_SELECT_OFFSET_ON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,418,61,63,10
    PUSHBUTTON      "ReviewPopUp",IDC_BT_REVIEW_POPUP,433,18,54,17
    CONTROL         "Use Simulation",IDC_CHECK_USE_SIMULATION,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,418,41,66,10
    PUSHBUTTON      "Align Grab",IDC_BUTTON_ALIGNCAM_GRAB,436,130,50,16
END
IDD_DLG_MODULE_INFO DIALOGEX 0, 0, 532, 187
ReviewSystem/ReviewSystem/ReviewSystem.vcxproj
@@ -143,7 +143,7 @@
      <TargetEnvironment>X64</TargetEnvironment>
    </Midl>
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <Optimization>Disabled</Optimization>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <AdditionalIncludeDirectories>../include;../../Internal_Library/include;../../External_Library/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -185,6 +185,9 @@
    <PreBuildEvent>
      <Command>updateDlls.bat</Command>
    </PreBuildEvent>
    <ClCompile>
      <Optimization>Disabled</Optimization>
    </ClCompile>
  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="..\include\M_AutoDiagnosisManager\StaticGNUPlot.cpp" />
ReviewSystem/ReviewSystem/SequenceProcessor.cpp
@@ -83,7 +83,9 @@
    m_nAlive = 0;
    m_nWsiTotalCount = 0;
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD START
    m_bSimulationMode = FALSE;
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD END
    InitializeCriticalSection(&m_csProcessStatus);
}
ReviewSystem/ReviewSystem/SequenceProcessor.h
@@ -587,10 +587,16 @@
    void SetSP2P(ISequenceProcessor2Parent* pSP2P);
    void SetLineMachineType(int nLineType, int nMachineType, CString strEqpID);
    void SetDefaultValue();
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD START
    void SetSimulationMode(BOOL bCheck) { m_bSimulationMode = bCheck; };
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD END
    // getter
    int        GetProcessMode() const;
    int        GetProcessStatus() const;
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD START
    BOOL GetSimulationMode() { return m_bSimulationMode; };
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD END
    static int GetDirectionX(int nGlassDirection, int nMotorDirection);
    static int GetDirectionY(int nGlassDirection, int nMotorDirection);
@@ -614,6 +620,8 @@
    // Review, WSI Stop Siganl
    BOOL    SetMotionStop();
    // Align Camera Control command
    BOOL    AlignCamera_CameraControl(int nControlCmd);
protected:
    // common
@@ -625,9 +633,6 @@
    // PCControl Control command
    BOOL    Signal_SendSignal(int nSignalIndex);
    BOOL    PCControl_ReadTransferData(STransferData* pTransferData);
    // Align Camera Control command
    BOOL    AlignCamera_CameraControl(int nControlCmd);
    // Review Camera Control Command
    void    ReviewCamera_CameraControl(int nControlCmd);
@@ -780,4 +785,8 @@
    CTime                m_wsiStartTime;
    int                    m_nWsiTotalCount;
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD START
    BOOL                m_bSimulationMode;
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD END
};
ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp
@@ -51,7 +51,7 @@
#define AOIRAWBIN_NETWORK_DRIVE_PATH    "Y:\\RawBin"
enum CPJT_MeasureMode { CPJT_ModeAuto = 0, CPJT_ModeManual };
// [2017:4:18]-[WEZASW] : WSI Module 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占?PlanType 占쏙옙호 占쏙옙占쏙옙.
// [2017:4:18]-[WEZASW] : WSI Module
enum CPJT_PlanType { CPJT_PlanReview = 0, CPJT_PlanUser, CPJT_PlanWSI, CPJT_PlanMeasure, CPJT_PlanReflow, CPJT_PlanWsiReflow, CPJT_PlanWsiUser,CPJT_PlanWsiMultiShot
};
enum CPJT_InsepectionType{REVIEW_REFLOW = 0, WSI_REFLOW, REV_WSI,WSIUSER, USER,WSIMULTISHOT};
@@ -169,7 +169,7 @@
    CDitGlassRawClient* pDitGlassRaw = CDitGlassRawClient::GetInstance();
    if(pDitGlassRaw->ConnectServer() == FALSE)
    {
        g_pLog->DisplayMessage(_T("�����޸� ���� ����!(Shared memory Access Fail)"));
        g_pLog->DisplayMessage(_T("(Shared memory Access Fail)"));
    }
}
    
@@ -183,17 +183,15 @@
    EnterCriticalSection(&m_csProcessStatus);
    
    BOOL bReturn = FALSE;
    // ���� ���°� ���� ���¿� �ٸ���?
    
    //if (nProcessStatus!=m_nProcessStatus || nProcessStatus==0)
    if (1)//nProcessStatus!=m_nProcessStatus || nProcessStatus==0)
    {
        //if (nProcessStatus==0) // �ʱ�(0) �����̸�..
        //if (nProcessStatus==0)
        //{
        //    bReturn = TRUE;
        //}
        //    else if (nProcessStatus==(m_nProcessStatus+1)) // ���� ���� ����(+1)�̸�..
        //    else if (nProcessStatus==(m_nProcessStatus+1))
        //    {
        //        bReturn = TRUE;
        //    }
@@ -204,9 +202,8 @@
        //    bReturn = FALSE;
        //}
        
        if (bReturn) // �����̸�...
        if (bReturn)
        {
            // Thread ���� �� Thread ����
            CSequenceProcessData* pThreadData = new CSequenceProcessData(this);
            if (pThreadData)
            {
@@ -227,7 +224,6 @@
            }
        }
        else if(nProcessStatus==2){
            // Thread ���� �� Thread ����
            CSequenceProcessData* pThreadData = new CSequenceProcessData(this);
            if (pThreadData)
            {
@@ -277,7 +273,6 @@
    CReviewResult* pWsiResult = pGlassResult->GetWsiResult(nModuleIndex);
    if (pWsiResult==NULL) goto RESULT_FAIL;
    // ������ �ε����� �����´�.
    int nCurResultIdx    = pWsiResult->GetLastSReviewResultIndex() + 1; // last index + 1
    int nStartResultIdx    = pWsiResult->GetStartSReviewResultIndex();
    int nEndResultIdx    = pWsiResult->GetEndSReviewResultIndex();
@@ -291,13 +286,11 @@
    int        nMPosY    = int(pPosition->dMotorPosY * 1000.0);
    double    dTime    = (double) m_ProcessTimer.GetDurationMilliSecond();
    // �ε����� �ٸ��� ��������.
    if (measureResut.nResultIndex != nCurResultIdx) 
    {
        goto RESULT_FAIL;
    }
    // ���� ������ ����.
    // measureResut
    if(pWsiResult->GetSReviewResultCount() == 0) return ;
@@ -324,7 +317,6 @@
    // set last result idx
    pWsiResult->SetLastSReviewResultIndex(nCurResultIdx);
    // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, WSI 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
    if(nCurResultIdx==nEndResultIdx && nCurResultIdx<=pWsiResult->GetSReviewResultCount())
    {
        nStartResultIdx = nCurResultIdx + 1;
@@ -335,8 +327,7 @@
        pWsiResult->SetStartSReviewResultIndex(nStartResultIdx);
        pWsiResult->SetEndSReviewResultIndex(nEndResultIdx);
        // ������ ����Ʈ ���� ��������.
        ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
        ::Sleep(3000);
//        Process_RemainWsiPoint(nModuleIndex);
    }
@@ -362,7 +353,6 @@
    CReviewResult* pWsiResult = pGlassResult->GetWsiUserResult(nModuleIndex);
    if (pWsiResult==NULL) goto RESULT_FAIL;
    // ������ �ε����� �����´�.
    int nCurResultIdx    = pWsiResult->GetLastSReviewResultIndex() + 1; // last index + 1
    int nStartResultIdx    = pWsiResult->GetStartSReviewResultIndex();
    int nEndResultIdx    = pWsiResult->GetEndSReviewResultIndex();
@@ -376,13 +366,11 @@
    int        nMPosY    = int(pPosition->dMotorPosY * 1000.0);
    double    dTime    = (double) m_ProcessTimer.GetDurationMilliSecond();
    // �ε����� �ٸ��� ��������.
    if (measureResut.nResultIndex != nCurResultIdx) 
    {
        goto RESULT_FAIL;
    }
    // ���� ������ ����.
    // measureResut
    if(pWsiResult->GetSReviewResultCount() == 0) return ;
@@ -407,7 +395,6 @@
    // set last result idx
    pWsiResult->SetLastSReviewResultIndex(nCurResultIdx);
    // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, WSI 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
    if(nCurResultIdx==nEndResultIdx && nCurResultIdx<=pWsiResult->GetSReviewResultCount())
    {
        nStartResultIdx = nCurResultIdx + 1;
@@ -418,8 +405,7 @@
        pWsiResult->SetStartSReviewResultIndex(nStartResultIdx);
        pWsiResult->SetEndSReviewResultIndex(nEndResultIdx);
        // ������ ����Ʈ ���� ��������.
        ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
        ::Sleep(3000);
        //        Process_RemainWsiPoint(nModuleIndex);
    }
@@ -442,6 +428,8 @@
         g_pLog->DisplayMessage(_T("[AlignResult] Glass Result is NULL!"));
         SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Fail Signal!"));
        AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence ����
         return;
    }
@@ -449,7 +437,6 @@
     CAlignResult *pAlignResult = &pGlassResult->m_AlignResult;
     CAlignRecipe *pAlignRecipe = &pGlassResult->m_AlignRecipe; 
 
     // 占쏙옙占쏙옙占?占쌘듸옙占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙占실울옙 占쏙옙占쏙옙占쏙옙占쏙옙.
     CRsRcpAlignInfo *pRsRcpAlignInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpAlignInfo();
     if (pRsRcpAlignInfo!=NULL && pRsRcpAlignInfo->m_bAutoProcess)
     {
@@ -463,25 +450,21 @@
             pRsRcpAlignInfo->m_dSecondCamExposure = pCurAlignResult->dExposureTime[1];
         }
 
         // ������ ����Ÿ ����
         //m_pDoc->Recipe_WriteRecipeFile();
     }
 
 
     BOOL bLastAlignResult = FALSE;
     CCoordCalibrator *pCoordCalibrator = m_pSP2P->ISP2P_GetCoordCalibrator();
     // 占쏙옙占쏙옙 占쏙옙占쏙옙占?占쏙옙占?.
     if (pCoordCalibrator && pCurAlignResult->nResultCode==Align_Success)
     {
         g_pLog->DisplayMessage(_T("[AlignResult] Align Find Success!"));
 
         // 占쏙옙占쏙옙占?占쏙옙占?占쌜띰옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙
         *pAlignResult = *pCurAlignResult;
 
         pCoordCalibrator->SetFirstMarkPos(pAlignResult->dFindPositionX[0], pAlignResult->dFindPositionY[0], pAlignRecipe->dGlassPositionX[0], pAlignRecipe->dGlassPositionY[0]);
         pCoordCalibrator->SetSecondMarkPos(pAlignResult->dFindPositionX[1], pAlignResult->dFindPositionY[1], pAlignRecipe->dGlassPositionX[1], pAlignRecipe->dGlassPositionY[1]);
 
         // 占쏙옙占쏙옙 占쏙옙占?
         if(pCoordCalibrator->CalculateAlignResult() == TRUE)
         {
             sAlignResult = pCoordCalibrator->GetAlignResult();
@@ -490,38 +473,35 @@
             bLastAlignResult = !pAlignRecipe->bRotateProcess;
         }
 
         // �۶� ���� ���� ����
         CCameraControlAlign *pAlignCameraControl    = m_pSP2P->ISP2P_GetAlignCameraControl();
         SThetaMotorInfo* pThetaMotorInfo            = m_pSP2P->ISP2P_GetThetaMotorInfo();
         CMotorControl* pMotorControl                = m_pSP2P->ISP2P_GetMotorControl();
 
         if (pAlignRecipe->bRotateProcess && pAlignCameraControl && pMotorControl && pThetaMotorInfo)
         {
             if (fabs(sAlignResult.dDegree) <= pAlignRecipe->dGlassAngleMin) // ���� �۶� ������ �ּҰ����� ������ ����
             if (fabs(sAlignResult.dDegree) <= pAlignRecipe->dGlassAngleMin)
             {
                 bLastAlignResult = TRUE;
                 g_pLog->DisplayMessage(_T("[AlignResult] Success! Last Glass Angle : %.8lf degree, Retry Count : %d ea"), 
                     sAlignResult.dDegree,  pCurAlignResult->nFindCount);
             }
             else if (fabs(sAlignResult.dDegree) > pAlignRecipe->dGlassAngleMax) // ���� �۶� ������ �ִ밢���� ũ�� ����
             else if (fabs(sAlignResult.dDegree) > pAlignRecipe->dGlassAngleMax)
             {
                 bLastAlignResult = FALSE;
                 g_pLog->DisplayMessage(_T("[AlignResult] FAIL! Last Glass Angle : %.8lf degree, Retry Count : %d ea"), 
                     sAlignResult.dDegree,  pCurAlignResult->nFindCount);
             }
             else if (pCurAlignResult->nFindCount < pAlignRecipe->nRetryCount) // �纸�� Ƚ���� ������ Ƚ�� �����̸� �纸�� ����
             else if (pCurAlignResult->nFindCount < pAlignRecipe->nRetryCount)
             {
                 g_pLog->DisplayMessage(_T("[AlignResult] Current Glass Angle : %.8lf degree, Retry Count : %d ea"), 
                     sAlignResult.dDegree,  pCurAlignResult->nFindCount);
 
                 // ���ͷ� ���� ����..
                 double dCalAngle = sAlignResult.dDegree;
                 dCalAngle = pThetaMotorInfo->dPosition - dCalAngle ;
                 g_pLog->DisplayMessage(_T("[AlignResult] Move Rotate Glass Angle : %.8lf degree"), dCalAngle);
                 pMotorControl->AxisThetaManualGoEnd(dCalAngle);
                 ::Sleep(100);
 
                 // 占쏙옙占쏙옙占?ReProcess
                 if (pAlignCameraControl->AlignProcess())
                 {
                     g_pLog->DisplayMessage(_T("[AlignResult] Align Find Process ReStarted!"));
@@ -556,8 +536,7 @@
         //m_pView->SetAlignResult(pAlignResult->nResultCode, sAlignResult.dOriginX, sAlignResult.dOriginY, sAlignResult.dDegree);
     }
 
    // PCControl 占쏙옙占쏙옙占?占쏙옙호 占쏙옙占쏙옙.
    if (bLastAlignResult) // ���� ����ΰ��...
    if (bLastAlignResult)
    {    
        SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Success Data!"));
@@ -567,6 +546,8 @@
        SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Fail Data!"));
    }
    AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence 변경
    SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
@@ -689,13 +670,10 @@
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
        m_pSP2P->ISP2P_UpdateReviewProcessStatus(ReviewProcessStatus_None, nPlanIndex);
         
        //占쏙옙占쏙옙占?
        AFM_SetAFMTracking(FALSE);
        return;
    }
    //190727 chm WSI 占쏙옙占쏙옙占?End 체크 占쏙옙 占쏙옙占쏙옙
    if(nBeforePlanIndex== CPJT_PlanWSI||nBeforePlanIndex== CPJT_PlanWsiReflow||nBeforePlanIndex== CPJT_PlanWsiUser)
    {
        if(pPlanInfo->m_nReviewType == CPJT_PlanWSI ||pPlanInfo->m_nReviewType == CPJT_PlanWsiReflow||pPlanInfo->m_nReviewType== CPJT_PlanWsiUser || pPlanInfo->m_nReviewType == CPJT_PlanWsiMultiShot)
@@ -724,13 +702,12 @@
        }
    }
    //190727 chm WSI type 占쏙옙占쏙옙占쏙옙 Review 占시뤄옙占쏙옙 占쏙옙占쏙옙占?카占쌨띰옙 占쌜띰옙 占쌜울옙 占쏙옙占쏙옙占쏙옙痢?占쏙옙占쏙옙...
    if(nBeforePlanIndex== CPJT_PlanWSI ||nBeforePlanIndex== CPJT_PlanWsiReflow||nBeforePlanIndex== CPJT_PlanWsiUser)
    {
        if(  pPlanInfo->m_nReviewType == CPJT_PlanReview|| pPlanInfo->m_nReviewType == CPJT_PlanUser|| pPlanInfo->m_nReviewType == CPJT_PlanMeasure|| pPlanInfo->m_nReviewType == CPJT_PlanReflow)
        {
            CTotalPitchMeasure* pTotapPithMeasure = m_pSP2P->ISP2P_GetTotalPitchMeasure(); // 占쏙옙占쏙옙占쏙옙占? 20190730 chm 占쏙옙占쌩울옙 占쌉쇽옙占쏙옙 占쏙옙占쏙옙....
            CTotalPitchMeasure* pTotapPithMeasure = m_pSP2P->ISP2P_GetTotalPitchMeasure();
    
            const CMotorControlInfo* pSystemMotorInfo = m_pSP2P->ISP2P_System_GetMotorInfo();
            if(pSystemMotorInfo !=NULL) 
@@ -774,8 +751,6 @@
        if(pPlanInfo == NULL) continue;
        //210325
        //END 占쏙옙 占쏙옙琯占쏙옙占?占실억옙占쏙옙占쏙옙占쏙옙占?占쌔댐옙 占쌉쇽옙占쏙옙 占쏙옙占쏙옙占쏙옙占?占쏙옙占싣곤옙占쏙옙 占쌍억옙 start 占쌉쇽옙占쏙옙 타占쏙옙占쏙옙
        //�װͿ� ���� ����ó��
        if (GetProcessStatus() == ProcessReviewEnd_CPJT || GetProcessStatus() == ProcessReviewUnloding_CPJT)
        {
            g_pLog->DisplayMessage(_T("[ProcessStop] StartProcessing Sequence Stop Status : %d"), GetProcessStatus());
@@ -788,7 +763,7 @@
            if (( nTotalCount += pGlassResult->GetTotalSReviewResultCount()) > 0)
            {
                m_pSP2P->ISP2P_DisplayMessage(_T("[Sequence Processor] Review Plan Start!"));
                //LYW DCOLL 임시조치
                //LYW DCOLL �ӽ���ġ
                CDitGlassRawClient *pDitRawClient = CDitGlassRawClient::GetInstance();
                if (pDitRawClient->isConnect() == TRUE)
                {
@@ -801,7 +776,7 @@
                    strcpy(pSharedDefectReview->m_strRevImageName, "");
                }
                //LYW DCOLL 임시조치
                //LYW DCOLL �ӽ���ġ
                ::Sleep(nWaitTime);
                m_pSP2P->ISP2P_GetReviewProcessor()->ResetGantryDone();
                bExcute = ReviewStartProcessing(pGlassResult, nPlanIdx);
@@ -830,7 +805,7 @@
                m_pSP2P->ISP2P_DisplayMessage(_T("[Sequence Processor] WSI Plan End!"));
            }
            break;
        //占싱삼옙占?
        case CPJT_PlanMeasure:
            if (( nTotalCount += pGlassResult->GetTotalSMeasureResultCount()) > 0)
            {
@@ -930,6 +905,9 @@
        break;
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD START
    SetSimulationMode(FALSE);
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 ADD END
    return;
}
@@ -939,8 +917,8 @@
    AllAckSignalOff();
    m_pSP2P->ISP2P_GetReviewProcessor()->ResetGantryDone();
    SetCheckWSIEnd(-1); //190726 wsiendüũ �ʱ�ȭ
    SetWsiType(-1);    //wsi reflow Ÿ�� ���� �ʱ�ȭ
    SetCheckWSIEnd(-1); //190726
    SetWsiType(-1);    //wsi reflow
    SetLastPointCheck(FALSE);
    bFileFind = FALSE;
@@ -949,10 +927,18 @@
    m_pSP2P->ISP2P_SetFirstReviewLeft(TRUE);
    m_pSP2P->ISP2P_SetFirstReviewRight(TRUE);
    if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_LoadingAck_CPJT))
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Ack Signal!"));
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
    if (GetSimulationMode() == FALSE)
    {
        if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_LoadingAck_CPJT))
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Ack Signal!"));
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
    //Original
//     if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_LoadingAck_CPJT))
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Ack Signal!"));
     // read config file
     if(!m_pSP2P->ISP2P_System_ReadConfigFile())
         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor] System Value Loading FAIL!"));    
@@ -970,18 +956,18 @@
     }
     m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Glass Result Count : %d ea"), nGlassResultCount);
    
    pGlassResult->ResetDefocusCount();//�ε� �κп��� defocus count �ʱ�ȭ 190821 chm
    pGlassResult->ResetDefocusCount();
     CTime time = CTime::GetCurrentTime();
     pGlassResult->m_strResultDate.Format(_T("%04d.%02d.%02d"), time.GetYear(), time.GetMonth(), time.GetDay());
    //if(Revolver_SetGoHome(0)) // ������ HOME ������
    //if(Revolver_SetGoHome(0))
    //{
    //    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Revolver Set GoHome Success!"));
    //}
    //#3357 KYH Align Image �ʱ�ȭ ADD START
    //#3357 KYH Align Image ADD START
    CCameraControlAlign* pAlignCameraControl = m_pSP2P->ISP2P_GetAlignCameraControl();
    if (pAlignCameraControl != NULL)
    {
@@ -989,7 +975,7 @@
        g_pLog->DisplayMessage(_T("[Align] Align Image Clear"));
    }
    //#3357 KYH Align Image �ʱ�ȭ ADD END
    //#3357 KYH Align Image ADD END
     // get transfer data
     int nResultCode = 0;
@@ -1016,13 +1002,20 @@
            if (pDitRawClient->isConnect()==FALSE)
            {
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]�����޸� ���� ���� �翬�� �õ� "));
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] DitRawClient Connect Fail "));
                int nReconnect=0;
                while (1)
                {
                    if (nReconnect == 3)
                    {
                        SendResultToSignalControl(PCControlSendData_LoadingResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
                        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
                        if (GetSimulationMode() == FALSE)
                        {
                            SendResultToSignalControl(PCControlSendData_LoadingResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
                        }
                        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
                        //original
                        /*SendResultToSignalControl(PCControlSendData_LoadingResult_CPJT, SIGNAL_SEND_RESULT_FAIL);*/
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading FAIL Signal!"));
                        break;
@@ -1031,11 +1024,11 @@
                    Sleep(1000);
                    if (pDitRawClient->isConnect() == FALSE)
                    {
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]�����޸� ���� ���� Count[%d]"), nReconnect);
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]DitRawClient Connect Fail Count[%d]"), nReconnect);
                    }
                    else
                    {
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]�����޸� ���� ����"));
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]DitRawClient Connect Success"));
                        break;
                    }
                    nReconnect += 1;
@@ -1045,9 +1038,9 @@
            }
            // #3381 LYW CF AOI Review ������ FDC TackTime ������ ���� ���� ADD START
            // #3381 LYW CF AOI Review FDC TackTime ADD START
            pDitRawClient->GetGlassData()->m_tmReviewLoading = CTime::GetCurrentTime();
            // #3381 LYW CF AOI Review ������ FDC TackTime ������ ���� ���� ADD END
            // #3381 LYW CF AOI Review FDC TackTime ADD END
            
            CString strGlassIDTemp = NULL;
@@ -1065,11 +1058,20 @@
            strFileName.Format(_T("%s_%s"), strGlassIDTemp, strGlassStepIdTemp);
            //업데이트시
            //������Ʈ��
            //bFileFind = FindRawBinFile(strFileName);
            bFileFind = TRUE;
            //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
            if (GetSimulationMode() == FALSE)
            {
                bFileFind = FindRawBinFile(strFileName);
            }
            else
            {
                bFileFind = TRUE;
            }
            //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
            //original
            /*bFileFind = FindRawBinFile(strFileName);*/
            pDitRawClient->SetReviewStart();
            Sleep(1000);
@@ -1114,7 +1116,7 @@
         }
     }
    //// 190725 占쏙옙占쏙옙占?占쏙옙청占쏙옙占쏙옙 chm ASCEND 占쏙옙 alarm
    //// 190725 chm ASCEND alarm
    const CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
    const CRcpSortingInfo *pSortingInfo = pRsRcpReviewInfo->GetRcpReviewSortInfo();
@@ -1131,7 +1133,7 @@
    
    
    ////������ �������� �ȱ� 190618
    ////190618
    if(GetUseAfmHomePosition())
    {
    g_pLog->DisplayMessage(_T("[AFM] AFM Home Position Start!!!"));
@@ -1140,7 +1142,6 @@
    }
    //占쏙옙占쏙옙占쌨몌옙 커占쏙옙占?占쏙옙占쏙옙 占쏙옙타트(占쌜띰옙 占싸듸옙)
    CDitGlassRawClient* pDitSharedGlassRaw = CDitGlassRawClient::GetInstance();
    if (pDitSharedGlassRaw->isConnect() == FALSE) {
        m_pSP2P->ISP2P_DisplayMessage(_T("[DitGlassRawClient] Shared Memory Connect Fail"));
@@ -1175,25 +1176,42 @@
     // review camera stop
    ReviewCamera_CameraControl(CameraControlStop);    
    //AlignCamera_CameraControl(CameraControlLive);
    AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence ����
     // send signal to plc
     if (nResultCode==0)
     {
         SendResultToSignalControl(PCControlSendData_LoadingResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Success Signal!"));
     }
     else
     {
         SendResultToSignalControl(PCControlSendData_LoadingResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading FAIL Signal!"));
     }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
        // send signal to plc
    if (GetSimulationMode() == FALSE)
    {
        if (nResultCode == 0)
        {
            SendResultToSignalControl(PCControlSendData_LoadingResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Success Signal!"));
        }
        else
        {
            SendResultToSignalControl(PCControlSendData_LoadingResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading FAIL Signal!"));
        }
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
    //original
//      send signal to plc
//           if (nResultCode==0)
//           {
//               SendResultToSignalControl(PCControlSendData_LoadingResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
//               m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Success Signal!"));
//           }
//           else
//           {
//               SendResultToSignalControl(PCControlSendData_LoadingResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
//               m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading FAIL Signal!"));
//           }
 
     // send cell data to review processorm_pDitGlass
     CReviewProcessor* pReviewProcessor = m_pSP2P->ISP2P_GetReviewProcessor();
     if(pReviewProcessor == NULL) return ;    
     pReviewProcessor->SetCellData(pGlassResult);
     pReviewProcessor->SetReviewCount(0);            // ���� Sequence No �ʱ�ȭ.
     pReviewProcessor->SetReviewCount(0);
    pReviewProcessor->SetPlanReviewCount(0);
    pReviewProcessor->SetPlanWSICount(0);
     // Process Status Update
@@ -1215,8 +1233,16 @@
         m_pSP2P->ISP2P_UpdateDefectFilter(pDefectFilter);
     }    
    
    SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_LoadingComplete_CPJT);
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Complete Signal!"));
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
    if (GetSimulationMode() == FALSE)
    {
        SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_LoadingComplete_CPJT);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Complete Signal!"));
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
    //original
//     SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_LoadingComplete_CPJT);
//     m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Complete Signal!"));
     m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::OUT] Loading!"));
@@ -1232,17 +1258,37 @@
{
     m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::IN] AlignStart!"));
    if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_AlignStartAck_CPJT))
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Start Ack!"));
    //Sleep(400);//占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占?占쌍깍옙 chm190602
    AlignCamera_CameraControl(CameraControlLive);  // 210805 Align Camera Sequence ����
    Sleep(300);
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
    if (GetSimulationMode() == FALSE)
    {
        if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_AlignStartAck_CPJT))
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Start Ack!"));
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
    //original
//     if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_AlignStartAck_CPJT))
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Start Ack!"));
     // 1. get current glass result
     CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
     if (pGlassResult==NULL) {    return;    }
     if (pGlassResult==NULL)
    {
        Sleep(350);
        AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence ����
        return;
    }
 
    const CRsRcpAlignInfo* pRsRcpAlignInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpAlignInfo();
    if(pRsRcpAlignInfo == NULL)    return;
    if (pRsRcpAlignInfo == NULL)
    {
        Sleep(350);
        AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence ����
        return;
    }
     // 2. get align camera control    
     CCameraControlAlign* pAlignCameraControl = m_pSP2P->ISP2P_GetAlignCameraControl();
 
@@ -1250,23 +1296,48 @@
    if(pRsRcpAlignInfo->m_bAlignSkipMode)
    {
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Align Skip Mode !!!!!!!"));
        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
        if (GetSimulationMode() == FALSE)
        {
            SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align SUCCESS Data!"));
            SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
            //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
        }
        //original
//         SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align SUCCESS Data!"));
//         SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
        SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align SUCCESS Data!"));
        SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
        Sleep(350);
        AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence ����
    }
    else
    {
        // 190710 SJB Align Camera Disconnect Check, Align Step ���� ���� Ȯ���Ѵ�.
        // 190710 SJB Align Camera Disconnect Check, Align Step
        if(pAlignCameraControl)
        {
            if(pAlignCameraControl->AlignCameraDisconnectCheck() == FALSE)
            {
                SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Algin Camera Disconnect!!!!"));
                //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
                if (GetSimulationMode() == FALSE)
                {
                    SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Algin Camera Disconnect!!!!"));
                }
                //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
                //original
//                 SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
//                 m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Algin Camera Disconnect!!!!"));
            }
        }        
        else
        {
            Sleep(350);
            AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence ����
        }
        if (pGlassResult && pAlignCameraControl && pAlignCameraControl->AlignProcess())
        {
@@ -1274,16 +1345,26 @@
        }
        else
        {
            //�����ߵ�
            Sleep(1000);
            //TEST 占쏙옙占?
            {
                SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align SUCCESS Data!"));
            SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
        }
                //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
                if (GetSimulationMode() == FALSE)
                {
                    SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align SUCCESS Data!"));
                    SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
                }
                //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
                //original
//                 SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
//                 m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align SUCCESS Data!"));
//                 SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
//                 m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
            }
            Sleep(350);
            AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence ����
            //�ּ� Ǯ��
            // 4. send align fail signal to plc
@@ -1291,7 +1372,7 @@
            //m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Fail Data!"));
            //SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
            //m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
    }
        }
    }
@@ -1313,21 +1394,36 @@
    m_pSP2P->ISP2P_GetSignalControl()->WriteData(_T("17110"), sizeof(pDitRawClient->GetGlassData()->m_strGlassJudge), pDitRawClient->GetGlassData()->m_strGlassJudge);
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::IN] ReadRawFile!"));
    if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReadRawFileAck_CPJT))
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Read Raw File Ack!"));
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
    if (GetSimulationMode() == FALSE)
    {
        if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReadRawFileAck_CPJT))
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Read Raw File Ack!"));
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
    //original
//     if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReadRawFileAck_CPJT))
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Read Raw File Ack!"));
     if (bFileFind == FALSE)
    {
        SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] 占쏙옙占쏙옙占쏙옙占?찾占쏙옙 占쏙옙占쏙옙"));
        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
        if (GetSimulationMode() == FALSE)
        {
            SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Find Raw File Fail"));
        }
        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
        //original
//         SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Find Raw File Fail"));
        return;
    }    
    // get current glass result
    CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
    if (pGlassResult==NULL) return;
    //占쏙옙占쏙옙占쌨몌옙 커占쏙옙占?占쏙옙占쏙옙 占쏙옙타트(占쌜띰옙 占싸듸옙)
    CDitGlassRawClient* pDitSharedGlassRaw = CDitGlassRawClient::GetInstance();
    if(pDitSharedGlassRaw->isConnect() == FALSE)                m_pSP2P->ISP2P_DisplayMessage(_T("[DitGlassRawClient] Shared Memory Connect Fail"));
@@ -1354,20 +1450,26 @@
        int nTotalPlanCount = CalculatePlanData(pGlassResult);
        m_pSP2P->ISP2P_DisplayMessage(_T("[Read Raw File] Review All Plan Total Count : %d"), nTotalPlanCount);
        //�����ߵ�
        Sleep(1000);
        // send review ready
        SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
        SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewReady_CPJT);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Review Ready Signal!"));
        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
        if (GetSimulationMode() == FALSE)
        {
            SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
            SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewReady_CPJT);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Review Ready Signal!"));
        }
        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
        //original
//         SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
//         SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewReady_CPJT);
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Review Ready Signal!"));
    }
    else
    {
        processTimer.End();
        m_pSP2P->ISP2P_DisplayMessage(_T("[ReadRawFile] AOI Result File Read Fail![%.3f ms]"), processTimer.GetDurationMilliSecond());
        //占쌓쏙옙트 占쏙옙占?
        //{
        //            // send review ready
        //    SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
@@ -1375,7 +1477,6 @@
        //            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Review Ready Signal!"));
        //}
        //�ּ� ����
        int nCurPlanIndex = 0;
        CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
        if(pRsRcpReviewInfo)
@@ -1390,15 +1491,21 @@
                    m_pSP2P->ISP2P_DisplayMessage(_T("[Read Raw File] Review All Plan Total Count : %d"), nTotalPlanCount);
                    // send review ready
                    SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewReady_CPJT);
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Review Ready Signal!"));
                    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
                    if (GetSimulationMode() == FALSE)
                    {
                        SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewReady_CPJT);
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Review Ready Signal!"));
                    }
                    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
                    //original
//                     SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewReady_CPJT);
//                     m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Review Ready Signal!"));
                }
            }
        }
    }
    //// [2017:5:24]-[WEZASW] : Review Image Upload Dir 占쏙옙占쏙옙.(FTPUploader占쏙옙占쏙옙 占쌘듸옙 占쏙옙占쏙옙 占실댐옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙)
    //// '占쌥븝옙占싯삼옙'占쏙옙 FTPUploader占쏙옙占쏙옙 占쏙옙占싸듸옙 占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 PCControl Glass Unloading 占쏙옙 占쏙옙占?Loading占쏙옙 Review占쏙옙占쏙옙占쏙옙 占쏙옙占싸듸옙 占쏙옙占?GlassID) 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙
    const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
    CString strPath = _T("");
    //if(pNetworkInfo && pNetworkInfo->m_strUploadImagePath.IsEmpty() == FALSE)
@@ -1412,8 +1519,6 @@
    CFileFind Uploadfile, RTMSUploadPath;
    if (CDitGlassRawClient::GetInstance()->GetGlassData() == NULL) return;
    //占쏙옙占싸듸옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쌕쏙옙 占쏙옙占싸듸옙 占쏙옙占?Set 20190917chm
    if(Uploadfile.FindFile(strPath)==FALSE)
    {
        CTime tmServerLoadingTime = CDitGlassRawClient::GetInstance()->GetGlassData()->m_tmGlassLoading;
@@ -1421,10 +1526,6 @@
        CreateDirectory(strPath, NULL);
        pReviewProcessor->SetUploadImagePath(strPath);
        //taek 210126 rtms 占쏙옙占쏙옙占?占싱뱄옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙
        CreateDirectory(pReviewProcessor->GetRTMSUploadImagePath(),NULL);
    }
@@ -1441,9 +1542,16 @@
    SetLastPointCheck(FALSE);
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::IN] %d Tick Count"), dwTime);
    if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewStartAck_CPJT))
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Start Ack!"));
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
    if (GetSimulationMode() == FALSE)
    {
        if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewStartAck_CPJT))
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Start Ack!"));
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
    //original
//     if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewStartAck_CPJT))
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Start Ack!"));
    const CRsRcpAlignInfo* pRsRcpAlignInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpAlignInfo();
    if(pRsRcpAlignInfo == NULL)    return;
@@ -1470,10 +1578,10 @@
    //            _grmCellData* pCellData = pDitRawClient->GetCellData(0);
    //            if(pCellData) 
    //            {
    //            //    pCellData->m_nTotalPitchData[0] = int(pTotapPithMeasure->GetTotalPitchBD() * 1000); // ����, �۾��� ���� ����
    //            //    pCellData->m_nTotalPitchData[1] = int(pTotapPithMeasure->GetTotalPitchAC() * 1000); // ����, �۾��� ���� �Ʒ���
    //            //    pCellData->m_nTotalPitchData[2] = int(pTotapPithMeasure->GetTotalPitchAB() * 1000); // ����, �۾��� ���� ����
    //            //    pCellData->m_nTotalPitchData[3] = int(pTotapPithMeasure->GetTotalPitchCD() * 1000); // ����, �۾��� ���� ������
    //            //    pCellData->m_nTotalPitchData[0] = int(pTotapPithMeasure->GetTotalPitchBD() * 1000);
    //            //    pCellData->m_nTotalPitchData[1] = int(pTotapPithMeasure->GetTotalPitchAC() * 1000);
    //            //    pCellData->m_nTotalPitchData[2] = int(pTotapPithMeasure->GetTotalPitchAB() * 1000);
    //            //    pCellData->m_nTotalPitchData[3] = int(pTotapPithMeasure->GetTotalPitchCD() * 1000);
    //            }
    //        }
    //    }
@@ -1481,7 +1589,6 @@
    //    {
    //        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor] TotalPitchMeasure Result Fail!"));
    //        // 190711 SJB, TotalPitchMeasure Fail占시울옙 占쌕뤄옙 Motor占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占쏙옙占쌕댐옙 Motion Enable 占쏙옙호占쏙옙 확占쏙옙占쏙옙占쏙옙
    //        
    //        if(!pTotapPithMeasure->GetMotorEnable())
    //        {
@@ -1507,15 +1614,23 @@
    if(FirstReviewPlanStart() <= 0)
    {
        //Sleep(1000);
        SendResultToSignalControl(PCControlSendData_ReviewComplete_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
        SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
        if (GetSimulationMode() == FALSE)
        {
            SendResultToSignalControl(PCControlSendData_ReviewComplete_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
            SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
        }
        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
        //original
//         SendResultToSignalControl(PCControlSendData_ReviewComplete_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
//         SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
    }
    else
    {
        //�����ߵ�
        //Sleep(1000);
        //Test占쏙옙占?
        //SendResultToSignalControl(PCControlSendData_ReviewComplete_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
        //SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
        //m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
@@ -1533,8 +1648,16 @@
{
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::IN] ReviewEnd!"));
    if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewEndAck_CPJT))
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Send Review End Ack!"));
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
    if (GetSimulationMode() == FALSE)
    {
        if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewEndAck_CPJT))
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Send Review End Ack!"));
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
    //original
//     if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewEndAck_CPJT))
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Send Review End Ack!"));
    CDitGlassRawClient* m_pDitGlassRaw = CDitGlassRawClient::GetInstance();
    if (m_pSP2P->ISP2P_GetWSIControl(0)!=NULL)
@@ -1555,16 +1678,22 @@
    }
    
    m_pDitGlassRaw->GetGlassData()->m_nReviewNum = m_pSP2P->ISP2P_GetReviewProcessor()->GetPlanReviewCount();
    //SendDVDataToSignalControl();// �Ⱦ���
    //OverTime 占쌩삼옙占쏙옙 占쏙옙占쏘에占쏙옙 END ACK占쏙옙 占쏙옙摸占쏙옙째占?占싣니띰옙 占쏙옙 Conplete占쏙옙 占쏙옙摸占쏙옙占?
    //�� ... ����  �����ε��ϴ� �߰�
    //SendDVDataToSignalControl();
    if (GetLastPointCheck() == FALSE)
    {
        SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
        SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
        if (GetSimulationMode() == FALSE)
        {
            SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
            SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
        }
        //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
        //original
//         SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
//         SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
    }
    CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
@@ -1585,10 +1714,8 @@
        m_pSP2P->ISP2P_GetWSIControl(0)->SendWsiAfmSafePosMove();
        m_pSP2P->ISP2P_GetWSIControl(1)->SendWsiAfmSafePosMove();
    }
    // 占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙占쏙옙 Review占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙
    if(m_pDitGlassRaw->isConnect()==FALSE)        WriteRawData(pGlassResult);
    
    //����Ŀ�� �˶� send 20190819chm
    if(pGlassResult->m_nDeFocusCount >0) 
    {
        SendSignalToSignalControl(PCControlSendSignalIndex_State,PCControlSend_Defoucs,1000);
@@ -1598,8 +1725,8 @@
        CString strTime = _T("");
        strTime.Format(_T("%04d-%02d-%02d %02d:%02d:%02d"), time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond());
        CDlgDefocusList::GetInstance()->SetDefocusTotalCount(pGlassResult->m_nDeFocusCount);//��Ż ī��Ʈ Add
        CDlgDefocusList::GetInstance()->SetDefocusData(strTime,pGlassResult->m_strGlassID,pGlassResult->m_nDeFocusCount);//ui �߰��� ����
        CDlgDefocusList::GetInstance()->SetDefocusTotalCount(pGlassResult->m_nDeFocusCount);
        CDlgDefocusList::GetInstance()->SetDefocusData(strTime,pGlassResult->m_strGlassID,pGlassResult->m_nDeFocusCount);
    }
@@ -1613,26 +1740,34 @@
    g_pLog->DisplayMessage(_T("History Button Enable"));
    m_pSP2P->ISP2P_GetDiagnosisHistory2();
    /*int nModuleCount = m_pSP2P->ISP2P_GetModuleStatusCount(); //0503 占쏙옙占쏙옙 End占쏙옙 占쏙옙占쏙옙占?0占쏙옙占쏙옙 占십깍옙화
    /*int nModuleCount = m_pSP2P->ISP2P_GetModuleStatusCount();
    for (int nModuleIdx = 0; nModuleIdx < nModuleCount; nModuleIdx++)
    {
        {
            ReviewLight_SetLightLevel(nModuleIdx, 0);
            g_pLog->DisplayMessage(_T("Module[%d] LightLevel �ʱ�ȭ"), nModuleIdx);
            g_pLog->DisplayMessage(_T("Module[%d] LightLevel"), nModuleIdx);
        }
    }*/
    //5. PCControl ��ȣ ������Ʈ
    //5. PCControl
    if (pGlassResult)
    {
        m_pSP2P->ISP2P_UpdateProcessStatus(GetProcessStatus(), pGlassResult);
        g_pLog->DisplayMessage(_T("PCControl Update Signal"));
    }
    SendResultToSignalControl(PCControlSendData_ReviewResultFileCreateComplete_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
    SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ResultDataComplete_CPJT);
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Send ResultData Complete Signal!"));
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
    if (GetSimulationMode() == FALSE)
    {
        SendResultToSignalControl(PCControlSendData_ReviewResultFileCreateComplete_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
        SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ResultDataComplete_CPJT);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Send ResultData Complete Signal!"));
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
//     SendResultToSignalControl(PCControlSendData_ReviewResultFileCreateComplete_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
//     SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ResultDataComplete_CPJT);
//     m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Send ResultData Complete Signal!"));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::OUT] ReviewEnd!"));
}
@@ -1640,9 +1775,16 @@
void CSequenceProcessor_CPJT::Process_ReviewUnloading()
{
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::IN] Review Unloading!"));
    if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewUnloadingAck_CPJT))
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Unloading Ack!"));
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
    if (GetSimulationMode() == FALSE)
    {
        if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewUnloadingAck_CPJT))
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Unloading Ack!"));
    }
    //original
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
//     if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewUnloadingAck_CPJT))
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Unloading Ack!"));
    
}
@@ -1665,8 +1807,8 @@
    CString strCode = _T("");
    int nDefectCount = pRawData->GetGlassData()->m_nDefectNum; // ���尹��
    int nJudgeCount = pRcpReviewInfo->GetRcpZoneFilterInfoCount();// ���� ����
    int nDefectCount = pRawData->GetGlassData()->m_nDefectNum;
    int nJudgeCount = pRcpReviewInfo->GetRcpZoneFilterInfoCount();
    int nFilterType = 0;
    int nJudgeType = 0;
    int nZoneNumber = 0;
@@ -1680,7 +1822,7 @@
    int nJudgeCellOKCount = 0;
    int nPixelSize = 0;
    int nPixelFilterSize = 0;
    //���� ������
    //1 wsi, 3 CS, 4 R, 5 G, 6 B
    //pRawData->GetDefectData(nDefectIdx)->m_ReviewDefect.m_fWsi_ResultData[1];//Defect
    //pRawData->GetDefectData(nDefectIdx)->m_ReviewDefect.m_fWsi_ResultData[3];//cs
@@ -1694,10 +1836,10 @@
        {
#pragma region 占쏙옙占쏙옙占?fail
#pragma region Align fail
            if (m_pSP2P->ISP2P_GetCurrentGlassResult()->GetAlignResult()->nResultCode != Align_Success)
            {
                m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd] 占쏙옙占쏙옙占?占쏙옙占쏙옙 WSI 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙"));
                m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd] Align Fail WSI Rejudge Cancel"));
                break;
            }
#pragma endregion
@@ -1735,7 +1877,7 @@
            
            if (nPixelFilterSize <= nPixelSize && nPixelFilterSize != 0)
            {
                m_pSP2P->ISP2P_DisplayMessage(_T("[ReviewEnd] ������ ���͸� Pixel Size[%d] nPixelFilterSize [%d]"), nPixelSize,nPixelFilterSize);
                m_pSP2P->ISP2P_DisplayMessage(_T("[ReviewEnd] Size filtering Pixel Size[%d] nPixelFilterSize [%d]"), nPixelSize,nPixelFilterSize);
                continue;    
            }
#pragma endregion
@@ -1745,13 +1887,13 @@
            for (int nJudgeindex = 0; nJudgeindex < nJudgeCount; nJudgeindex++)
            {
                //nZoneType = GetZoneType();
                dJudgeHight = pRcpReviewInfo->GetRcpZoneFilteringInfo(nJudgeindex)->GetJudgeHeight(); //����
                dJudgeHight = pRcpReviewInfo->GetRcpZoneFilteringInfo(nJudgeindex)->GetJudgeHeight();
                nFilterType = pRcpReviewInfo->GetRcpZoneFilteringInfo(nJudgeindex)->m_nFilterType; //ZONE
                nJudge = pRcpReviewInfo->GetRcpZoneFilteringInfo(nJudgeindex)->m_nFilterJudge; //OK TR
                //nZoneNumber = pRcpReviewInfo->GetRcpZoneInfo(nFilterType)->m_vecZoneNumber[0];
                
                if (pRawData->GetDefectData(nDefectIdx)->m_ReviewDefect.m_nWsi_Type == 2) // 210330 kyh����
                if (pRawData->GetDefectData(nDefectIdx)->m_ReviewDefect.m_nWsi_Type == 2) // 210330 kyh
                {
                    BOOL isZoneValue = FALSE;
@@ -1764,7 +1906,7 @@
                        }
                        else
                        {
                            m_pSP2P->ISP2P_DisplayMessage(_T("[WSIZoneCheck] Zone[%d], DefectIndex[%d]"), nZoneNumber, pRawData->GetDefectData(nDefectIdx)->m_nDefectIdx); //210330 kyh �α� �߰�
                            m_pSP2P->ISP2P_DisplayMessage(_T("[WSIZoneCheck] Zone[%d], DefectIndex[%d]"), nZoneNumber, pRawData->GetDefectData(nDefectIdx)->m_nDefectIdx); //210330 kyh
                            isZoneValue = TRUE;
                            //break;
@@ -1773,7 +1915,7 @@
                    if (isZoneValue == FALSE)
                    {
                        m_pSP2P->ISP2P_DisplayMessage(_T("[WSIZoneCheck] NoFail DefectIndex[%d]"), pRawData->GetDefectData(nDefectIdx)->m_nDefectIdx); //210330 kyh �α� �߰�
                        m_pSP2P->ISP2P_DisplayMessage(_T("[WSIZoneCheck] NoFail DefectIndex[%d]"), pRawData->GetDefectData(nDefectIdx)->m_nDefectIdx); //210330 kyh
                        continue;
                    }
@@ -1823,13 +1965,13 @@
                        }
                    }
                    else if (fWsiData<=0) // 0���� ���� ������ ������ ���Ѵ�.
                    else if (fWsiData<=0)
                    {
                        m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd] WSI TYPE[%d] WSI ����[%0.3lf] <= 0 ���� ���� ����"), nJudgeType, fWsiData);
                        m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd] WSI TYPE[%d] WSI Height[%0.3lf] <= 0 Cancel Rejudge"), nJudgeType, fWsiData);
                    }
                    else
                    {
                        //20210419 TR 占쏙옙占쏙옙占쏙옙占쏙옙 Judge 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占?OK 占쏙옙占쏙옙
                        //20210419 TR
                        //if (nJudge == 1)//TR -> OK
                        //{
                            if (pRawData->GetDefectData(nDefectIdx)->m_DefectJudgement == DEFECT_JUDGE_CPJT_OK || pRawData->GetDefectData(nDefectIdx)->m_DefectJudgement == DEFECT_JUDGE_CPJT_Unknown)
@@ -1880,7 +2022,7 @@
                }
                else //WSI TYPE �� �ƴϸ�
                else //WSI TYPE
                {
                    continue;
                }
@@ -1894,13 +2036,13 @@
            for (int nJudgeindex = 0; nJudgeindex < nJudgeCount; nJudgeindex++)
            {
                //nZoneType = GetZoneType();
                dJudgeHight = pRcpReviewInfo->GetRcpZoneFilteringInfo_PR(nJudgeindex)->GetJudgeHeight(); //����
                dJudgeHight = pRcpReviewInfo->GetRcpZoneFilteringInfo_PR(nJudgeindex)->GetJudgeHeight();
                nFilterType = pRcpReviewInfo->GetRcpZoneFilteringInfo_PR(nJudgeindex)->m_nFilterType; //ZONE
                nJudge = pRcpReviewInfo->GetRcpZoneFilteringInfo_PR(nJudgeindex)->m_nFilterJudge; //OK TR
                //nZoneNumber = pRcpReviewInfo->GetRcpZoneInfo(nFilterType)->m_vecZoneNumber[0];
                if (pRawData->GetDefectData(nDefectIdx)->m_ReviewDefect.m_nWsi_Type == 2) // 210330 kyh����
                if (pRawData->GetDefectData(nDefectIdx)->m_ReviewDefect.m_nWsi_Type == 2) // 210330
                {
                    BOOL isZoneValue = FALSE;
@@ -1913,7 +2055,7 @@
                        }
                        else
                        {
                            m_pSP2P->ISP2P_DisplayMessage(_T("[WSIZoneCheck] Zone[%d], DefectIndex[%d]"), nZoneNumber, pRawData->GetDefectData(nDefectIdx)->m_nDefectIdx); //210330 kyh �α� �߰�
                            m_pSP2P->ISP2P_DisplayMessage(_T("[WSIZoneCheck] Zone[%d], DefectIndex[%d]"), nZoneNumber, pRawData->GetDefectData(nDefectIdx)->m_nDefectIdx); //210330 kyh
                            isZoneValue = TRUE;
                            //break;
@@ -1922,7 +2064,7 @@
                    if (isZoneValue == FALSE)
                    {
                        m_pSP2P->ISP2P_DisplayMessage(_T("[WSIZoneCheck] NoFail DefectIndex[%d]"), pRawData->GetDefectData(nDefectIdx)->m_nDefectIdx); //210330 kyh �α� �߰�
                        m_pSP2P->ISP2P_DisplayMessage(_T("[WSIZoneCheck] NoFail DefectIndex[%d]"), pRawData->GetDefectData(nDefectIdx)->m_nDefectIdx); //210330 kyh
                        continue;
                    }
@@ -1976,7 +2118,6 @@
                    }
                    else
                    {
                        //20210419 TR 占쏙옙占쏙옙占쏙옙占쏙옙 Judge 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占?OK 占쏙옙占쏙옙
                        //if (nJudge == 1)//TR -> OK
                        //{
                        if (pRawData->GetDefectData(nDefectIdx)->m_DefectJudgement == DEFECT_JUDGE_CPJT_OK || pRawData->GetDefectData(nDefectIdx)->m_DefectJudgement == DEFECT_JUDGE_CPJT_Unknown)
@@ -2028,7 +2169,7 @@
                }
                else //WSI TYPE �� �ƴϸ�
                else //WSI TYPE
                {
                    continue;
                }
@@ -2043,7 +2184,7 @@
                
                strCode =pRcpReviewInfo->GetRcpZoneFilteringInfo_CODE(nJudgeindex)->m_FilterCode;
                if (pRawData->GetDefectData(nDefectIdx)->m_ReviewDefect.m_nWsi_Type == 2) // 210330 kyh����
                if (pRawData->GetDefectData(nDefectIdx)->m_ReviewDefect.m_nWsi_Type == 2) // 210330
                {
                    nJudgeType = ReJugdeWSIType(nFilterType);
@@ -2096,7 +2237,7 @@
                        m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd] CODE JUDGE WSI TYPE[%d] Defect CODE [%s] != [%s]"), nJudgeType, strCode, pRawData->GetDefectData(nDefectIdx)->m_strDefectCode);
                    }
                }
                else //WSI TYPE �� �ƴϸ�
                else //WSI TYPE
                {
                    continue;
                }
@@ -2107,7 +2248,6 @@
        }
        
#pragma region CELLJUDGE
    //CELL ������////////////////////////////////////////////////////////////////
    int nCellCount = pRawData->GetGlassData()->m_nCellNum;
@@ -2126,7 +2266,7 @@
        else if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_OK_CPJT)
        {
            nCelllOKJuge = nCelllOKJuge + 1;
        } //taek 21.01.25 Juge ���ϴ� ���� ���Ӱ� �ٲ���...
        } //taek 21.01.25
        else if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_PR_CPJT)
        {
            nCelllPRJuge = nCelllPRJuge + 1;
@@ -2170,7 +2310,7 @@
                }
                else
                {
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] ī��Ʈ ������ ������ [%02d]Cell DefectTRCount[%d] >= [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetJudgeCount());
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Count Number is minus! [%02d]Cell DefectTRCount[%d] >= [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetJudgeCount());
                }
                break;
            case JudgeType_T8_PR:
@@ -2220,7 +2360,7 @@
                }
                else
                {
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] ī��Ʈ ������ ������ [%02d]Cell DefectTRCount[%d] <= [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetSubJudgeCount());
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Count Number is minus! [%02d]Cell DefectTRCount[%d] <= [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetSubJudgeCount());
                }
                break;
            case JudgeType_T8_PR:
@@ -2384,7 +2524,7 @@
    }
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] CELL COUNT OK:[%d] TR[%d] PR[%d]"), nCelllOKJuge, nCellTRJudge, nCelllPRJuge);
#pragma endregion
    //GLASS ������////////////////////////////////////////////////////////////////
#pragma region GLASSJUDGE
    CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
    if (pRsRcpReviewInfo == NULL) return FALSE;
@@ -2432,7 +2572,7 @@
            }
            else
            {
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] TR ī��Ʈ�� ������ [%02d]GLASS Defect TR Count[%d] >= [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetJudgeCount());
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] TR Count is minus [%02d]GLASS Defect TR Count[%d] >= [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetJudgeCount());
            }
            break;
        case JudgeType_T8_PR:
@@ -2482,7 +2622,7 @@
            }
            else
            {
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd]TRī��Ʈ�� ������ [%02d]GLASS Defect TR Count[%d] <= [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetSubJudgeCount());
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd]TR Count is minus [%02d]GLASS Defect TR Count[%d] <= [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetSubJudgeCount());
            }
            break;
        case JudgeType_T8_PR:
@@ -2670,7 +2810,7 @@
        CakFileUtil akFileFinder;
        while (nReTryTime--)
        {
            //#3359_LYW CF AOI Review REVIEW_LOADING_COMPLETE_TIMEOVER �˶� �߻� ���� �м� START
            //#3359_LYW CF AOI Review REVIEW_LOADING_COMPLETE_TIMEOVER START
            if (nReTryTime%2 == 0)
            {
                strFilePath = AOIRAWBIN_PATH;
@@ -2679,9 +2819,9 @@
            strWild.Format("%s\\%s_*.bin", strFilePath, strFileName);
             akFileFinder.FindFile(strWild.GetBuffer(0), FALSE);
            //LYW LOG�߰�
            //LYW LOG
            g_pLog->DisplayMessage(_T("[GlassLoading][FindRawBinFile] Find Path = %s, RetryCount = %d, ResultCode = [%d]"), strFilePath, 30-nReTryTime, GetLastError());
            //#3359_LYW CF AOI Review REVIEW_LOADING_COMPLETE_TIMEOVER �˶� �߻� ���� �м� END
            //#3359_LYW CF AOI Review REVIEW_LOADING_COMPLETE_TIMEOVER END
            VECFINDDATA* pFindData = akFileFinder.getFindData();
            int nFileNamePos = strlen(akFileFinder.getProcessPath());
            std::map<LONGLONG, CString> mapSpanFileName;
@@ -2693,7 +2833,7 @@
                    parser.process(pFileName, "_.");
                    if (parser.getTokNum() < 4) continue;
                    
                    if (parser.getTokNum() >= 6) continue; // 0401 �߰�
                    if (parser.getTokNum() >= 6) continue; // 0401
                    int nDataTime[8] = {};
                    {
@@ -2721,7 +2861,6 @@
            {
                if (mapSpanFileName.begin()->first < nCloseTime)
                {
                    //占쏙옙占쏙옙 占쌍깍옙 占쏙옙占쏙옙占쏙옙占?찾占쏙옙 占쏙옙占쏙옙 [占쏙옙占쏙옙占쏙옙 2019/7/17]
                    strFindFile = mapSpanFileName.begin()->second;
                    break;
                }
@@ -2781,7 +2920,7 @@
    int nPCControlReadDataCount = pSignalInfo->GetReadDataAddressCount();
    // [2017:1:9]-[WEZASW] : PCControl GlassData �׸� ������.
    // [2017:1:9]-[WEZASW] : PCControl GlassData
    if(pSignalInfo->GetUseContinuousReadAddress())
    {
        CString strReadAddress = _T("");
@@ -3160,11 +3299,11 @@
void CSequenceProcessor_CPJT::UpdateGlassResultFromTransferData(CGlassResult *pGlassResult, STransferData* pTransferData)
{
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Transfer Data �б�!"));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Transfer Data Read!"));
    if (pGlassResult==NULL || pTransferData==NULL) return;
    // [2017:1:9]-[WEZASW] : PCControl GlassData �׸� ������
    // [2017:1:9]-[WEZASW] : PCControl GlassData
    // transfer data is not exist
    if (pTransferData->strLotID.GetLength()<1)
    {
@@ -3233,10 +3372,10 @@
    pGlassResult->m_strPairFlag = pTransferData->strPairFlag;
    pGlassResult->m_strOptionValue = pTransferData->strOptionValue;
    pGlassResult->m_strReserved = pTransferData->strReserved;
    pGlassResult->strGlassScanSchedule = pTransferData->strGlassScanSchedule;//���� ���� cmark
    pGlassResult->strGlassScanSchedule = pTransferData->strGlassScanSchedule;//cmark
    pGlassResult->m_strRTMSStepID = pTransferData->strStepID; //taek 210126
    
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Transfer Data ��!"));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Transfer Data END!"));
}
void CSequenceProcessor_CPJT::UpdateHistoryResultFromTransferData(CGlassResult *pHistoryResult, CGlassResult* pGlassResult)
@@ -3294,7 +3433,7 @@
    pHistoryResult->m_strPairFlag = pGlassResult->m_strPairFlag;
    pHistoryResult->m_strOptionValue = pGlassResult->m_strOptionValue;
    pHistoryResult->m_strReserved = pGlassResult->m_strReserved;
    pHistoryResult->strGlassScanSchedule = pGlassResult->strGlassScanSchedule;//���� ���� cmark
    pHistoryResult->strGlassScanSchedule = pGlassResult->strGlassScanSchedule;// cmark
    pHistoryResult->m_strStepID = pGlassResult->m_strRTMSStepID; //taek 210126
    pHistoryResult->m_strEquipID = pGlassResult->m_strEquipID;
    pHistoryResult->m_strProcessID = pGlassResult->m_strProcessID;
@@ -3306,7 +3445,7 @@
void CSequenceProcessor_CPJT::CreateResultDirectory(const CString& strGlassID, const CString& strDate)
{
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占쏙옙占썰리 占쏙옙占쏙옙占?占쏙옙占쏙옙"));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Make Directory Start"));
    if (m_pSP2P==NULL) return;
    const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
@@ -3352,7 +3491,7 @@
        strPath.Format(_T("%s\\%s"),pNetworkInfo->m_strAlignImagePath, strGlassID);
        CreateDirectory(strPath, NULL);
    }
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占쏙옙占썰리 占쏙옙占쏙옙占?占쏙옙"));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Make directory End"));
}
@@ -3360,7 +3499,7 @@
void CSequenceProcessor_CPJT::SetSaveImageBasePathToReviewProcessor(const CString& strGlassID, const CString& strResultDate)
{
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙"));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Make image path start"));
    const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
    if(pNetworkInfo == NULL) return;
@@ -3405,11 +3544,11 @@
                Sleep(1000);
                if (CDitGlassRawClient::GetInstance()->isConnect() == FALSE)
                {
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]�����޸� ���� ���� Count[%d]"), nReconnect);
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]access Shared Memory Fail!! Count[%d]"), nReconnect);
                }
                else
                {
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]�����޸� ���� ����"));
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]access Shared Memory Success"));
                    break;
                }
                nReconnect += 1;
@@ -3432,7 +3571,7 @@
        else
        {
            tmServerLoadingTime = CTime::GetCurrentTime();
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] �����޸� �����̻�"));
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] access Shared Memory Fail"));
            strPath.Format(_T("%s\\%s_%04d%02d%02d%02d%02d%02d"), pNetworkInfo->m_strUploadImagePath, strGlassID, tmServerLoadingTime.GetYear(), tmServerLoadingTime.GetMonth(), tmServerLoadingTime.GetDay(), tmServerLoadingTime.GetHour(), tmServerLoadingTime.GetMinute(), tmServerLoadingTime.GetSecond());
            strImagePath.Format(_T("%s\\%s_%04d%02d%02d%02d%02d%02d"), strGlassID, tmServerLoadingTime.GetYear(), tmServerLoadingTime.GetMonth(), tmServerLoadingTime.GetDay(), tmServerLoadingTime.GetHour(), tmServerLoadingTime.GetMinute(), tmServerLoadingTime.GetSecond());
            CreateDirectory(strPath, NULL);
@@ -3441,12 +3580,12 @@
        }
    }
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙占쏙옙占?占쏙옙"));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Make image path End"));
}
void CSequenceProcessor_CPJT::SetSaveImageBasePathToAlignCameraControl(const CString& strGlassID)
{
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占쏙옙占쏙옙占?占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙占쏙옙 "));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading]  Make Align image path Start"));
    const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
    if(pNetworkInfo == NULL) return;
@@ -3459,7 +3598,7 @@
        strPath.Format(_T("%s\\%s"), pNetworkInfo->m_strAlignImagePath, strGlassID);
        pAlignCameraControl->SetSaveImageBasePath(strPath);
    }
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占쏙옙占쏙옙占?占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙 "));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Make Align image path End "));
}
BOOL CSequenceProcessor_CPJT::ReadRecipeDataFromRecipeFile(const CString& strPPID_RC, CString& strRecipeName)// const CString& strPPID, CString& strRecipeName
@@ -3526,14 +3665,12 @@
{
    if(pGlassResult == NULL) return FALSE;
    // ������ ����
    const CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
    if (pRsRcpReviewInfo==NULL) return FALSE;
    // system info
    const CSystemInfo* pSystemInfo = m_pSP2P->ISP2P_System_GetSystemInfo();
    // �۶� ����
    STransferData* pTransferData = m_pSP2P->ISP2P_GetCurrentTransferData();
    if (pTransferData==NULL) return FALSE;
    int nGlassTypeInfoIndex = 0;
@@ -3549,20 +3686,16 @@
    if (pGlassTypeInfo == NULL) return FALSE;
    m_pSP2P->ISP2P_DisplayMessage(_T("GlassTypeName : %s,GlassTypeIdx : %s"),pGlassTypeInfo->m_strGlassTypeName,pTransferData->strGlassScanSchedule);
    
    // ���� ����
    const CMotorControlInfo *pMotorInfo = m_pSP2P->ISP2P_System_GetMotorInfo();
    // ��ǥ ��ȯ��
    CCoordCalibrator* pCoordCalibrator = m_pSP2P->ISP2P_GetCoordCalibrator();
    // ��ǥ�� ����
    if (pSystemInfo && pGlassTypeInfo && pMotorInfo && pCoordCalibrator)
    {
        // Get Direction        
        int nDirectionX = GetDirectionX(pGlassTypeInfo->m_nOriginDirection, pMotorInfo->GetOriginDirection());
        int nDirectionY = GetDirectionY(pGlassTypeInfo->m_nOriginDirection, pMotorInfo->GetOriginDirection());
        // ��ǥ�� ����
        pCoordCalibrator->SetTransDirection(nDirectionX, nDirectionY);
        pCoordCalibrator->SetOriginMotorPosition(pGlassTypeInfo->m_dOriginMotorX, pGlassTypeInfo->m_dOriginMotorY);
        if (fabs(pGlassTypeInfo->m_dAlignAngle) > 0.0000001)
@@ -3571,7 +3704,6 @@
                pGlassTypeInfo->m_dFirstAlignGlassX, pGlassTypeInfo->m_dFirstAlignGlassY, pGlassTypeInfo->m_dAlignAngle);
        }
        // �۶� ���� ����
        pGlassResult->SetGlassSize(pGlassTypeInfo->m_nGlassSizeX * 1000, pGlassTypeInfo->m_nGlassSizeY * 1000);
        pGlassResult->SetGlassOriginDirection(pGlassTypeInfo->m_nOriginDirection);
        pGlassResult->SetCornerCutDirection(pGlassTypeInfo->m_nCornerCutDirection);
@@ -3580,34 +3712,28 @@
        pGlassResult->SetCollisionDistanceX(int(pSystemInfo->m_dCollisionDistance*1000.));
    }
    // Align ����
    const CRsRcpAlignInfo* pRsRcpAlignInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpAlignInfo();
    // Align ���� ����
    if (pGlassTypeInfo && pRsRcpAlignInfo)
    {
        // Align ��ũ ���� ���� (�ȼ�, ����, �۶� ��ġ)
        pGlassResult->m_AlignRecipe.m_nUseAlignPosMove        = pGlassTypeInfo->m_nUseAlignPosMove;
        // �ȼ� ��ġ
        pGlassResult->m_AlignRecipe.dOriginPixelX[0]        = pGlassTypeInfo->m_nFirstAlignFindPixelX;
        pGlassResult->m_AlignRecipe.dOriginPixelY[0]        = pGlassTypeInfo->m_nFirstAlignFindPixelY;
        pGlassResult->m_AlignRecipe.dOriginPixelX[1]        = pGlassTypeInfo->m_nSecondAlignFindPixelX;
        pGlassResult->m_AlignRecipe.dOriginPixelY[1]        = pGlassTypeInfo->m_nSecondAlignFindPixelY;
        // ���� ��ġ
        pGlassResult->m_AlignRecipe.dOriginPositionX[0]        = pGlassTypeInfo->m_dFirstAlignMotorX;
        pGlassResult->m_AlignRecipe.dOriginPositionY[0]        = pGlassTypeInfo->m_dFirstAlignMotorY;
        pGlassResult->m_AlignRecipe.dOriginPositionX[1]        = pGlassTypeInfo->m_dSecondAlignMotorX;
        pGlassResult->m_AlignRecipe.dOriginPositionY[1]        = pGlassTypeInfo->m_dSecondAlignMotorY;
        // �۶� ��ġ
        pGlassResult->m_AlignRecipe.dGlassPositionX[0]        = pGlassTypeInfo->m_dFirstAlignGlassX;
        pGlassResult->m_AlignRecipe.dGlassPositionY[0]        = pGlassTypeInfo->m_dFirstAlignGlassY;
        pGlassResult->m_AlignRecipe.dGlassPositionX[1]        = pGlassTypeInfo->m_dSecondAlignGlassX;
        pGlassResult->m_AlignRecipe.dGlassPositionY[1]        = pGlassTypeInfo->m_dSecondAlignGlassY;
        // Align Recipe 占쏙옙占쏙옙 占쏙옙占쏙옙 占쌘듸옙占쏙옙占쏙옙 찾占쏙옙 占식띰옙占쏙옙占?
        // Align Recipe
        // Align Skip Mode
        pGlassResult->m_AlignRecipe.bAlignSkipMode        = pRsRcpAlignInfo->m_bAlignSkipMode;
        pGlassResult->m_AlignRecipe.bUseTotalPitchMeasure = pRsRcpAlignInfo->m_bTotalPitchMeasure;
@@ -3627,29 +3753,24 @@
        pGlassResult->m_AlignRecipe.nMergeRange            = pRsRcpAlignInfo->m_nMergeRange;
        pGlassResult->m_AlignRecipe.dEdgeRate            = pRsRcpAlignInfo->m_dEdgeRate;
        
        // 占쏙옙占쏙옙챨占?
        pGlassResult->m_AlignRecipe.bManualProcess            = pRsRcpAlignInfo->m_bManualProcess;
        pGlassResult->m_AlignRecipe.dFirstCamExposure        = pRsRcpAlignInfo->m_dFirstCamExposure;
        pGlassResult->m_AlignRecipe.dSecondCamExposure        = pRsRcpAlignInfo->m_dSecondCamExposure;
        // �ڵ����� ����
        pGlassResult->m_AlignRecipe.bAutoProcess            = pRsRcpAlignInfo->m_bAutoProcess;
        pGlassResult->m_AlignRecipe.dTargetMin                = pRsRcpAlignInfo->m_dTargetMin;
        pGlassResult->m_AlignRecipe.dTargetMax                = pRsRcpAlignInfo->m_dTargetMax;
        pGlassResult->m_AlignRecipe.dExposureMin            = pRsRcpAlignInfo->m_dExposureMin;
        pGlassResult->m_AlignRecipe.dExposureMax            = pRsRcpAlignInfo->m_dExposureMax;
        // Align Recipe ���� ���� rotate info
        pGlassResult->m_AlignRecipe.bRotateProcess            = pRsRcpAlignInfo->m_bRotateProcess;
        pGlassResult->m_AlignRecipe.nRetryCount                = pRsRcpAlignInfo->m_nRetryCount;
        pGlassResult->m_AlignRecipe.dGlassAngleMin            = pRsRcpAlignInfo->m_dGlassAngleMin;
        pGlassResult->m_AlignRecipe.dGlassAngleMax            = pRsRcpAlignInfo->m_dGlassAngleMax;
        // Align ī�޶� ���� �� �ػ� ����
        int nAlignCameraInfoCount = 2;
        for(int nAlignCameraIdx = 0; nAlignCameraIdx < nAlignCameraInfoCount; nAlignCameraIdx++)
        {
            // Align ���� �� ��������.
            int nLightValue = 0;
            
            
@@ -3657,10 +3778,8 @@
            {
                nLightValue = (nAlignCameraIdx==0) ? (int)pRsRcpAlignInfo->m_dFirstCamExposure: (int)pRsRcpAlignInfo->m_dSecondCamExposure;
                // 占쏙옙占쏙옙占?카占쌨띰옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙
                const CAlignCameraInfo *pCameraInfo = m_pSP2P->ISP2P_System_GetAlignCameraInfo(nAlignCameraIdx);
                 //占쏙옙占쏙옙占?占쏙옙占쏙옙.
                CLightControl *pLightControl = NULL;
                const CLightControlInfo *AlignLightinfo = pCameraInfo->GetLightContorlInfo();
@@ -3669,8 +3788,6 @@
                {
                    if (AlignLightinfo->GetMaster()==1&& nAlignCameraIdx==1)
                    {
                        //占쏙옙占쏙옙占?占쏙옙틀占싼뤄옙占쏙옙 占싹놂옙占쏙옙 占쏙옙占쏙옙퓸占?占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占싸뤄옙 확占쏙옙
                        //������ �̰� �´��� �𸣰ٴ� �ƹ��� �Ⱦ˷���
                        pLightControl = m_pSP2P->ISP2P_GetAlignLightControl(0);
                    }
@@ -3704,8 +3821,6 @@
                }
            }
            
            // 占쏙옙占쏙옙占?카占쌨띰옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙
            const CAlignCameraInfo *pCameraInfo    = m_pSP2P->ISP2P_System_GetAlignCameraInfo(nAlignCameraIdx);
            if (pCameraInfo)
            {
@@ -3733,7 +3848,6 @@
                }
            }
            // 占쏙옙占쏙옙占?占쏙옙占시몌옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙
            if((int)pGlassTypeInfo->m_vecTemplateImagePath.size() == nAlignCameraInfoCount)
            {
                pGlassResult->m_AlignRecipe.strTemplateName[nAlignCameraIdx] = pGlassTypeInfo->m_vecTemplateImagePath[nAlignCameraIdx];
@@ -3762,14 +3876,13 @@
            if (pRcpReviewAFMInfo)
            {
                int nRealAFMIndex = pRcpReviewAFMInfo->m_nRecipeIndex;
                if(nRealAFMIndex == -1)// �����ǿ� ���õ� ������ ���� MagnificInfo Index�� �˾ƿ�
                if(nRealAFMIndex == -1)
                {
                    //-1占쏙옙 占쏙옙占?占쏙옙占쏙옙 占싸듸옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙.
                    nRealAFMIndex = GetRealMagnification(nModuleIdx, pRcpReviewAFMInfo->m_nZoomIndex);
                }
                AFM_SetAFMRecipeName(nModuleIdx, strRecipeName, nRealAFMIndex);
                if(pRcpReviewAFMInfo->m_bAFMHomeOffMode==TRUE) //190618AFMȨ ������ ���� X
                if(pRcpReviewAFMInfo->m_bAFMHomeOffMode==TRUE) //190618AFM
                {
                    SetUseAfmHomePosition(FALSE);
                }
@@ -3781,7 +3894,6 @@
        }
    }
    // ���� ã�� ������ ����
    CReviewProcessor* pReviewProcessor = m_pSP2P->ISP2P_GetReviewProcessor();
    const CRsRcpDefectFindInfo* pRsRcpDefectFindInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpDefectFindInfo();
    if(pReviewProcessor && pRsRcpDefectFindInfo)
@@ -3832,7 +3944,6 @@
    CString strRawTDPath=_T(""), strRawCDPath=_T(""), strRawSDPath=_T("");
    // 占쏙옙占쏙옙占쏙옙占?占싱몌옙 찾占쏙옙
    FindAOIRawFilePath(pGlassResult, &strRawTDPath, &strRawCDPath, &strRawSDPath);
    bRet = m_pSP2P->ISP2P_ReadAOIRawFileToGlassResult(strRawTDPath);
@@ -3886,7 +3997,7 @@
        if(finder.IsDots()) continue;
        if(finder.IsDirectory()) continue;
        // [2017:5:16]-[WEZASW] : AOI Server占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙치占쏙옙 占쏙옙占쌉몌옙 占싱뱄옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占싹몌옙 占쏙옙占쏙옙
        // [2017:5:16]-[WEZASW] : AOI Server
        sRawFile.strFileName = finder.GetFileName();
        strExtTemp = sRawFile.strFileName;
        int nIdx = strExtTemp.Remove('.');        
@@ -4064,7 +4175,6 @@
        CModuleStatus*                    pModuleStatus    = Module_GetModuleStatus(nModuleIdx);        
        if (pModuleStatus == NULL) continue;
        //�浹�Ÿ� �ֱ�
        {
        double dCollisionPosX = pReviewResult->GetCollisionPositionX() / 1000.0;
@@ -4105,13 +4215,12 @@
        }
        //�¿� ��Ʈ�� �����̵�
        pMotorControl->GantrySetTwoGantrySyncModeSend(0);
        // set result index
        int nStartIdx = pReviewResult->GetStartSReviewResultIndex();
        int nEndIdx = pReviewResult->GetEndSReviewResultIndex();
        nEndIdx = min(nEndIdx, (pReviewResult->GetSReviewResultCount()-1)) + 1;        // End Index �ٽü���
        nEndIdx = min(nEndIdx, (pReviewResult->GetSReviewResultCount()-1)) + 1;        // End Index
        double xpostemp, ypostemp;
        // get review pos
@@ -4121,7 +4230,7 @@
            SReviewResult* pReview = pReviewResult->GetSReviewResult(nResultIdx);
            if (pReview==NULL) continue;
            //200占쏙옙 占쏙옙藥뱄옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占싹뤄옙占쏙옙占쏙옙占쏙옙占?占쌩븝옙체크
            //200
            if (pReview->bCheckSendToMotor == FALSE)
            {
                pReview->bCheckSendToMotor = TRUE;
@@ -4168,7 +4277,6 @@
            }
        }
        //���� ����Ʈ�� �ִ��� ������ üũ
        if (vectorPosX.empty() ==TRUE)
        {
            g_pLog->DisplayMessage(_T("[GantryAutoGo] No Exist Send Point "), vectorPosX.size());
@@ -4200,13 +4308,11 @@
            int nTickCount = GetTickCount();
            while (1)
            {
                //5�� ����Ÿ��
                if ((GetTickCount() - nTickCount) > 5000)
                {
                    bOverTime = TRUE;
                    break;
                }
                //占쏙옙占쏙옙 占쏙옙占?End 체크
                if (pMotorControl->IsGantryMotionEnd(pModuleStatus->GetGantryIndex()) == TRUE)
                {
                    if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
@@ -4225,15 +4331,12 @@
            }
            //5占쏙옙占식울옙占쏙옙 占싫울옙占쏙옙占싸댐옙? 占쌓뤄옙 3占쏙옙 占쏙옙천占?占쏙옙占쏙옙
            //���End �� �߸� ���ü��� ������
            if (bOverTime == TRUE)
            {
                for (int i = 0; i < 3; i++)
                {
                    Sleep(1000);
                    //���Ͱ� �����ϼ� ���»����϶� Send ��ȣ�� Fail �߻� ���� Retry 3�� ����
                    if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
                    {
                        nTotalCount += (int)vectorPosX.size();
@@ -4307,7 +4410,7 @@
    if(pGlassResult && pReviewProcessor)
    {
        // UserStart
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    //pGlassResult->m_strGlassID -> pGlassResult->m_strJobID ����
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    //pGlassResult->m_strGlassID -> pGlassResult->m_strJobID
        pReviewProcessor->SetOperID(pGlassResult->m_strOperID);
        m_pSP2P->ISP2P_UpdateReviewProcessStatus(ReviewProcessStatus_UserStart, nPlanIndex);
@@ -4370,7 +4473,6 @@
        CModuleStatus*                    pModuleStatus = Module_GetModuleStatus(nModuleIdx);
        if (pModuleStatus == NULL) continue;
        //�浹�Ÿ� �ֱ�
        {
            double dCollisionPosX = pReviewResult->GetCollisionPositionX() / 1000.0;
@@ -4413,9 +4515,9 @@
        // set result index
        int nStartIdx = pReviewResult->GetStartSReviewResultIndex();
        int nEndIdx = pReviewResult->GetEndSReviewResultIndex();
        nEndIdx = min(nEndIdx, (pReviewResult->GetSReviewResultCount() - 1)) + 1;        // End Index �ٽü���
        nEndIdx = min(nEndIdx, (pReviewResult->GetSReviewResultCount() - 1)) + 1;        // End Index
        // [2017:3:8]-[WEZASW] : CameraOffset ���� ���� (-1~1 => -5~5)
        // [2017:3:8]-[WEZASW] : CameraOffset (-1~1 => -5~5)
        double m_dMinOffset = -5.0;
        double m_dMaxOffset = 5.0;
        double xpostemp, ypostemp;
@@ -4426,7 +4528,7 @@
            SReviewResult* pReview = pReviewResult->GetSReviewResult(nResultIdx);
            if (pReview == NULL) continue;
            //200占쏙옙 占쏙옙藥뱄옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占싹뤄옙占쏙옙占쏙옙占쏙옙占?占쌩븝옙체크
            //200
            if (pReview->bCheckSendToMotor == FALSE)
            {
                pReview->bCheckSendToMotor = TRUE;
@@ -4474,7 +4576,6 @@
            }
        }
        //���� ����Ʈ�� �ִ��� ������ üũ
        if (vectorPosX.empty() == TRUE)
        {
            g_pLog->DisplayMessage(_T("[GantryAutoGo] No Exist Send Point "), vectorPosX.size());
@@ -4539,7 +4640,7 @@
    if(pGlassResult && pReviewProcessor)
    {
        // WsiStart
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID ����
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID
        pReviewProcessor->SetOperID(pGlassResult->m_strOperID);
        m_pSP2P->ISP2P_UpdateReviewProcessStatus(ReviewProcessStatus_WSIStart, nPlanIndex);
@@ -4552,7 +4653,7 @@
        MakeWSIUpLoadDirectory(pReviewProcessor->GetUploadImagePath());
        //20190219 chm 
        pReviewProcessor->SetReviewCount(0);            // ���� Sequence No �ʱ�ȭ.
        pReviewProcessor->SetReviewCount(0);
        return TRUE;
    }    
@@ -4565,7 +4666,7 @@
    strPath  = strPath + _T("\\WSI");
    if(CreateDirectory(strPath,NULL)==FALSE)
    {
        //LYW LOG�߰�
        //LYW LOG
        g_pLog->DisplayMessage(_T("[MakeWSIUpLoadDirectory]Directory Create Fail %s, ERROR CODE = %d "),strPath, GetLastError());
    }
    
@@ -4606,7 +4707,7 @@
    VectorDouble vectorCollisionPosX;
    vectorCollisionPosX.clear();
    //WSI �¿� ��Ʈ�� �����̵�
    //WSI
    pMotorControl->GantrySetTwoGantrySyncModeSend(1);
    
    // WSI result count
@@ -4619,7 +4720,6 @@
        CModuleStatus*                    pModuleStatus = Module_GetModuleStatus(nModuleIdx);
        if (pModuleStatus == NULL) continue;
        //�浹�Ÿ� �ֱ�
        {
            double dCollisionPosX = pWsiResult->GetCollisionPositionX() / 1000.0;
            double dCollisionPosY = 0.0;
@@ -4660,7 +4760,7 @@
        int nEndIdx = pWsiResult->GetEndSReviewResultIndex();
        nEndIdx = min(nEndIdx, (pWsiResult->GetSReviewResultCount() - 1)) + 1;        // set End Index 
        // [2017:3:8]-[WEZASW] : CameraOffset ���� ���� (-1~1 => -5~5)
        // [2017:3:8]-[WEZASW] : CameraOffset (-1~1 => -5~5)
        double m_dMinOffset = -5.0;
        double m_dMaxOffset = 5.0;
@@ -4672,7 +4772,7 @@
            SReviewResult* pWsi = pWsiResult->GetSReviewResult(nResultIdx);
            if (pWsi == NULL) continue;
            //200占쏙옙 占쏙옙藥뱄옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占싹뤄옙占쏙옙占쏙옙占쏙옙占?占쌩븝옙체크
            //200
            if (pWsi->bCheckWSISendToMotor == FALSE)
            {
                pWsi->bCheckWSISendToMotor = TRUE;
@@ -4719,14 +4819,13 @@
            }
        }
        //���� ����Ʈ�� �ִ��� ������ üũ
        if (vectorPosX.empty() == TRUE)
        {
            //3360 LYW_ CF AOI QD Review WSI XY MotorMoving Error �˶� �߻� ���� �м� �� ��ġ START
            //3360 LYW_ CF AOI QD Review WSI XY MotorMoving Error START
            g_pLog->DisplayMessage(_T("[GantryAutoGo] No Exist Send Point,TwoGantrySyncMode OFF!"), vectorPosX.size());
            g_pLog->DisplayMessage(_T("[GantryAutoGo] (%d)Gantry Path Send Fail"), pModuleStatus->GetGantryIndex()); //taek 210128
            pMotorControl->GantrySetTwoGantrySyncModeSend(0);
            //3360 LYW_ CF AOI QD Review WSI XY MotorMoving Error �˶� �߻� ���� �м� �� ��ġ END
            //3360 LYW_ CF AOI QD Review WSI XY MotorMoving Error END
        }
        else
        {
@@ -4750,13 +4849,12 @@
                int nTickCount = GetTickCount();
                while (1)
                {
                    //5�� ����Ÿ��
                    if ((GetTickCount() - nTickCount) > 5000)
                    {
                        bOverTime = TRUE;
                        break;
                    }
                    //占쏙옙占쏙옙 占쏙옙占?End 체크
                    //End üũ
                    if (pMotorControl->IsGantryMotionEnd(pModuleStatus->GetGantryIndex()) == TRUE)
                    {
                        if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
@@ -4775,15 +4873,12 @@
                }
                //5占쏙옙占식울옙占쏙옙 占싫울옙占쏙옙占싸댐옙? 占쌓뤄옙 3占쏙옙 占쏙옙천占?占쏙옙占쏙옙
                //���End �� �߸� ���ü��� ������
                if (bOverTime == TRUE)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        Sleep(1000);
                        //���Ͱ� �����ϼ� ���»����϶� Send ��ȣ�� Fail �߻� ���� Retry 3�� ����
                        if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
                        {
                            nTotalCount += (int)vectorPosX.size();
@@ -4918,9 +5013,9 @@
        // get result index
        int nStartIdx = pReviewResult->GetStartSReviewResultIndex();
        int nEndIdx = pReviewResult->GetEndSReviewResultIndex();
        nEndIdx = min(nEndIdx, (pReviewResult->GetSReviewResultCount()-1)) + 1;        // End Index �ٽü���
        nEndIdx = min(nEndIdx, (pReviewResult->GetSReviewResultCount()-1)) + 1;        // End Index
        // [2017:3:8]-[WEZASW] : CameraOffset ���� ���� (-1~1 => -5~5)
        // [2017:3:8]-[WEZASW] : CameraOffset (-1~1 => -5~5)
        double m_dMinOffset = -5.0; 
        double m_dMaxOffset = 5.0;
@@ -5022,7 +5117,7 @@
    if(pGlassResult && pReviewProcessor)
    {
        // MeasureStart
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID ����
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID
        pReviewProcessor->SetOperID(pGlassResult->m_strOperID);
        m_pSP2P->ISP2P_UpdateReviewProcessStatus(ReviewProcessStatus_MeasureStart, nPlanIndex);
@@ -5097,7 +5192,7 @@
                const SCoordInfo* pCoordInfo = Module_GetCoordInfo(nModuleIdx);
                if(pCoordInfo == NULL) continue;    
                // [2017:3:8]-[WEZASW] : CameraOffset ���� ���� (-1~1 => -5~5)
                // [2017:3:8]-[WEZASW] : CameraOffset (-1~1 => -5~5)
                double m_dMinOffset = -5.0; 
                double m_dMaxOffset = 5.0;
@@ -5203,7 +5298,6 @@
    int nTotalCount = 0;
    double dDefectPosX, dDefectPosY;
    // Module�� ��ġ�� ���� ModuleStatus sorting
    std::vector<CModuleStatus*> SortedModuleStatus;
    for(int nModuleIdx = 0; nModuleIdx < m_pSP2P->ISP2P_GetModuleStatusCount(); nModuleIdx++)
    {
@@ -5257,7 +5351,7 @@
                const SCoordInfo* pCoordInfo = Module_GetCoordInfo(pReviewResult->GetModuleIndex());
                if(pCoordInfo == NULL) continue;                
                // [2017:3:8]-[WEZASW] : CameraOffset ���� ���� (-1~1 => -5~5)
                // [2017:3:8]-[WEZASW] : CameraOffset (-1~1 => -5~5)
                double m_dMinOffset = -5.0; 
                double m_dMaxOffset = 5.0;
@@ -5278,7 +5372,6 @@
                if(nHeaderIdx == 0)
                {
                    // �̵��� ������ǥ �߰�
                    if((int)vectorPos.size() < MAX_MOTOR_ADDRESS_SIZE)
                    {
                        pSReviewResult->dTargetMotorX = dDefectPosX;
@@ -6545,8 +6638,6 @@
            // add user schedule result
            
            //占쏙옙占쏙옙占쌨모리울옙 채占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙표占쏙옙 占쏙옙占쏙옙체占쏙옙 채占쏙옙占쌍댐옙 占쏙옙占?
            {
@@ -7261,7 +7352,6 @@
                break;
            }
            break;
        // 占싱삼옙占?
        case CPJT_PlanMeasure:
            {
                const CRcpMeasureInfo *pRcpMeasureInfo = pRsRcpMeasureInfo->GetRcpMeasureInfo(0);
@@ -7394,7 +7484,7 @@
}
//CIM DV Data
BOOL CSequenceProcessor_CPJT::SendDVDataToSignalControl() // ����
BOOL CSequenceProcessor_CPJT::SendDVDataToSignalControl()
{
    CGlassResult *pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
    if (pGlassResult==NULL) return FALSE;
@@ -7419,7 +7509,7 @@
}
int CSequenceProcessor_CPJT::MakeDVData(CGlassResult *pGlassResult, char* pDVData, int nIndex) // ����
int CSequenceProcessor_CPJT::MakeDVData(CGlassResult *pGlassResult, char* pDVData, int nIndex)
{
    g_pLog->DisplayMessage(_T("[SequenceProcessor] SendDVDataToSignalControl->MakeDVData IN."));
@@ -7428,16 +7518,16 @@
    const CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
    if (pRsRcpReviewInfo == NULL) return FALSE;
    // Review ���� ����
    // Review
    const CRcpLightInfo *pReviewLightInfo = pRsRcpReviewInfo->GetRcpLightInfo(nIndex);
    // Review AFM ����
    // Review AFM
    const CRcpAFMRecipeInfo *pReviewAFMInfo = pRsRcpReviewInfo->GetRcpAFMRecipeInfo(nIndex);
    // Review Align Info
    const CAlignResult*    pAlignResult = pGlassResult->GetAlignResult();
    // Review Defect Info
    const CReviewResult* pReviewResult = pGlassResult->GetReviewResult(nIndex);
    // Review ���� ����
    // Review
    const CModuleStatus* pModuleStatus = Module_GetModuleStatus(nIndex);
    const SMagnificInfo* pSMagnificInfo = pModuleStatus->GetMagnificInfo(pReviewAFMInfo->GetZoomIndex());
    CSignalControl* pSignalControl = m_pSP2P->ISP2P_GetSignalControl();
@@ -7459,12 +7549,12 @@
    // Write DVData Packet
    //_DVDataPack_B7_8ver DVDataPack;
    //**Review
    //INLINE  : 10��
    //TFE-OFF : 20��
    //Hcut : 50��
    //LAMI : 5��
    //INLINE  : 10
    //TFE-OFF : 20
    //Hcut : 50
    //LAMI : 5
    //**WSI
    //10�� ����
    //10
    ///////////////////////////////////////////////////////////////////////////
@@ -7511,8 +7601,8 @@
    //nAlignResult = 1;
    
    //nAlignResult00 = pAlignResult->nFindAlign[0] * 1000;//����
    //nAlignResult01 = pAlignResult->nFindAlign[1] * 1000;//����
    //nAlignResult00 = pAlignResult->nFindAlign[0] * 1000;
    //nAlignResult01 = pAlignResult->nFindAlign[1] * 1000;
    //nAlignResult00 = pAlignResult->dFindScore[0];
    //nAlignResult01 = pAlignResult->dFindScore[1];
@@ -7530,7 +7620,6 @@
        nAlignResult01 = 0;
    }
    //�Ŀ�?
    nReviewAliveCamera00 = ReviewCamera_GetReviewCameraControl(0)->GetConnected() * 1000;
    nReviewAliveCamera01 = ReviewCamera_GetReviewCameraControl(1)->GetConnected() * 1000;
@@ -7547,8 +7636,7 @@
    {
        wsprintf(DriveText, TEXT("%C:"), Drive);
        UINT type = GetDriveType(DriveText);
        if ((dwDrive & dwDriveCh) && (type == DRIVE_REMOVABLE || type == DRIVE_FIXED || type == DRIVE_RAMDISK)) {
            // 占싹듸옙酉?
        if ((dwDrive & dwDriveCh) && (type == DRIVE_REMOVABLE || type == DRIVE_FIXED || type == DRIVE_RAMDISK)) {
            ULARGE_INTEGER i64FreeBytesToCaller = { 0 }, i64TotalBytes = { 0 }, i64FreeBytes = { 0 };
            BOOL bRsult = GetDiskFreeSpaceEx(DriveText, (PULARGE_INTEGER)&i64FreeBytesToCaller, (PULARGE_INTEGER)&i64TotalBytes, (PULARGE_INTEGER)&i64FreeBytes);
            if (bRsult) {
@@ -7762,7 +7850,7 @@
    pSignalControl->WritePacketData(_T("15100"), sizeof(DVDataPack_CPJT), (short*)&DVData);*/
}
//#3358 KYH FDC ������ ���� ���� ���� ADD START
//#3358 KYH FDC ADD START
void CSequenceProcessor_CPJT::MakeDVData2()
{
@@ -7775,9 +7863,9 @@
    }
    else
    {
    // Review ���� ����
    // Review
        pReviewLightInfo = pRsRcpReviewInfo->GetRcpLightInfo(0);
    // Review AFM ����
    // Review AFM
        pReviewAFMInfo = pRsRcpReviewInfo->GetRcpAFMRecipeInfo(0);
    }
@@ -7801,7 +7889,7 @@
    // Review ���� ����
    // Review
    const CModuleStatus* pModuleStatus = Module_GetModuleStatus(0);
    const SMagnificInfo* pSMagnificInfo = NULL;
    if (pModuleStatus == NULL)
@@ -7903,8 +7991,8 @@
    //nAlignResult = 1;
    //nAlignResult00 = pAlignResult->nFindAlign[0] * 1000;//����
    //nAlignResult01 = pAlignResult->nFindAlign[1] * 1000;//����
    //nAlignResult00 = pAlignResult->nFindAlign[0] * 1000;
    //nAlignResult01 = pAlignResult->nFindAlign[1] * 1000;
    //nAlignResult00 = pAlignResult->dFindScore[0];
    //nAlignResult01 = pAlignResult->dFindScore[1];
@@ -7944,7 +8032,6 @@
        nAlignResult01 = 1000;
    }
    //�Ŀ�?
    if (ReviewCamera_GetReviewCameraControl(0) != NULL)
    {
        nReviewAliveCamera00 = ReviewCamera_GetReviewCameraControl(0)->GetConnected() * 1000;
@@ -7976,8 +8063,7 @@
    {
        wsprintf(DriveText, TEXT("%C:"), Drive);
        UINT type = GetDriveType(DriveText);
        if ((dwDrive & dwDriveCh) && (type == DRIVE_REMOVABLE || type == DRIVE_FIXED || type == DRIVE_RAMDISK)) {
            // 占싹듸옙酉?
        if ((dwDrive & dwDriveCh) && (type == DRIVE_REMOVABLE || type == DRIVE_FIXED || type == DRIVE_RAMDISK)) {
            ULARGE_INTEGER i64FreeBytesToCaller = { 0 }, i64TotalBytes = { 0 }, i64FreeBytes = { 0 };
            BOOL bRsult = GetDiskFreeSpaceEx(DriveText, (PULARGE_INTEGER)&i64FreeBytesToCaller, (PULARGE_INTEGER)&i64TotalBytes, (PULARGE_INTEGER)&i64FreeBytes);
            if (bRsult) {
@@ -8024,7 +8110,7 @@
    return;
}
//#3358 KYH FDC ������ ���� ���� ���� ADD END
//#3358 KYH FDC  ADD END
DWORD CSequenceProcessor_CPJT::GetDiskUsage()
{
@@ -8062,7 +8148,7 @@
    BOOL bResult = FALSE;
    // PCControl D2300 (�˻� ����)
    // PCControl D2300
    switch(nSignalIndex)
    {
    case PCControlRecv_TimeChange:
@@ -8128,7 +8214,7 @@
         g_pLog->DisplayMessage(_T("[SequenceProcessor] Success! SetLocalTime(), Current: %04d-%02d-%02d %02d-%02d-%02d, Changed: %04d-%02d-%02d %02d-%02d-%02d"), 
            CurrentTime.wYear, CurrentTime.wMonth, CurrentTime.wDay, CurrentTime.wHour, CurrentTime.wMinute, CurrentTime.wSecond,
            ChangedTime.wYear, ChangedTime.wMonth, ChangedTime.wDay, ChangedTime.wHour, ChangedTime.wMinute, ChangedTime.wSecond);
        // AFM & WSI TIME ����ȭ
        // AFM & WSI TIME
        SendSystemTime(ChangedTime);
    } else {
         g_pLog->DisplayMessage(_T("[SequenceProcessor] Fail! SetLocalTime()"));
@@ -8155,7 +8241,7 @@
    return TRUE;
}
// Local System ���� �ð��� ���� ��û ��Ʈ�ѷ��� �ð��� ó�� ����
// Local System
BOOL CSequenceProcessor_CPJT::SendSystemTime(SYSTEMTIME sysTime)
{
    SYSTEMTIME CurrentTime;
@@ -8302,7 +8388,7 @@
            case PCControlSend_Defoucs:
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Send] Defoucs! => %d"),0);
                break;
            case PCControlSend_Diagnosis: // 0412 �ڰ����� ��ȣ �߰�
            case PCControlSend_Diagnosis: // 0412
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Send] Diagnosis! => %d"), 0);
                break;
            }
@@ -8413,7 +8499,7 @@
            case PCControlSend_Defoucs:
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Send] Defoucs! => %d"),0);
                break;
            case PCControlSend_Diagnosis: // 0412 �ڰ����� ��ȣ �߰�
            case PCControlSend_Diagnosis: // 0412
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Send] Diagnosis! => %d"), 0);
                break;
            }
@@ -8527,7 +8613,7 @@
            if (bResult==FALSE) m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Mode] Manual Mode Error!"));
            // lmk simul manual camera,motor stop
            //ReviewCamera_CameraControl(CameraControlStop);    // ���� ���߸� ī�޶� �ڵ� ��ž
            //ReviewCamera_CameraControl(CameraControlStop);
            CMotorControl*  pMotorControl = m_pSP2P->ISP2P_GetMotorControl();
            if(pMotorControl)
                pMotorControl->CommonSetAutoStop();
@@ -8698,10 +8784,10 @@
            if (SetLocalTime(&sTime))
            {
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Signal] �ð�����ȭ���� %s"), strtime);
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Signal] TymeSync Success %s"), strtime);
            }
            else
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Signal] �ð�����ȭ���� %s"), strtime);
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Signal] TymeSync Fail %s"), strtime);
            //memcpy(&time, strTime, 2);
@@ -8716,12 +8802,12 @@
    break;
    case PCControlRecv_Autodiagnosis:
    {
        //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
        //#3514_LYW_CF AOI Review �ڰ����� ��� ����_START
        CSignalControl* pSignalControl = m_pSP2P->ISP2P_GetSignalControl();
        CString strDiagnosisMode;
        pSignalControl->ReadData(_T("11160"), 2, strDiagnosisMode);
        int nDiagnosisMode = atoi(strDiagnosisMode);
        //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
        //#3514_LYW_CF AOI Review �ڰ����� ��� ����_END
        m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Signal] Diagno start => %d, DiagnosisMode => %d"), bSignalOn, nDiagnosisMode);
        if (bSignalOn) {
@@ -8731,7 +8817,7 @@
            
            m_pSP2P->ISP2P_GetDiagnosisManager()->RecvSignalToSignalControl(0, nDiagnosisMode);
        }
        //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
        //#3514_LYW_CF AOI Review �ڰ����� ��� ����_END
        else
            bResult = SendSignalOffToSignalControl(PCControlSendSignalIndex_DiagnoAck, 0);
@@ -8930,7 +9016,6 @@
    CReviewResult* pWsiMultiShotResult = pGlassResult->GetWsiMultiShotResult(nModuleIndex);
    if (pWsiMultiShotResult == NULL) goto RESULT_FAIL;
    // ������ �ε����� �����´�.
    int nCurResultIdx = pWsiMultiShotResult->GetLastSReviewResultIndex() + 1; // last index + 1
    int nStartResultIdx = pWsiMultiShotResult->GetStartSReviewResultIndex();
    int nEndResultIdx = pWsiMultiShotResult->GetEndSReviewResultIndex();
@@ -8944,13 +9029,11 @@
    int        nMPosY = int(pPosition->dMotorPosY * 1000.0);
    double    dTime = (double)m_ProcessTimer.GetDurationMilliSecond();
    // �ε����� �ٸ��� ��������.
    if (measureResut.nResultIndex != nCurResultIdx)
    {
        goto RESULT_FAIL;
    }
    // ���� ������ ����.
    // measureResut
    if (pWsiMultiShotResult->GetSReviewResultCount() == 0) return;
@@ -8975,7 +9058,6 @@
    // set last result idx
    pWsiMultiShotResult->SetLastSReviewResultIndex(nCurResultIdx);
    // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, WSI 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
    if (nCurResultIdx == nEndResultIdx && nCurResultIdx <= pWsiMultiShotResult->GetSReviewResultCount())
    {
        nStartResultIdx = nCurResultIdx + 1;
@@ -8986,8 +9068,7 @@
        pWsiMultiShotResult->SetStartSReviewResultIndex(nStartResultIdx);
        pWsiMultiShotResult->SetEndSReviewResultIndex(nEndResultIdx);
        // ������ ����Ʈ ���� ��������.
        ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
        ::Sleep(3000);
    //    Process_RemainWsiPoint(nModuleIndex);
    }
@@ -9053,7 +9134,7 @@
    if(pGlassResult && pReviewProcessor)
    {
        // WsiStart
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID ����
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID
        pReviewProcessor->SetOperID(pGlassResult->m_strOperID);
        m_pSP2P->ISP2P_UpdateReviewProcessStatus(ReviewProcessStatus_WSIReflowStart, nPlanIndex);
@@ -9089,7 +9170,7 @@
    if(pGlassResult && pReviewProcessor)
    {
        // WsiStart
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID ����
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID
        pReviewProcessor->SetOperID(pGlassResult->m_strOperID);
        m_pSP2P->ISP2P_UpdateReviewProcessStatus(ReviewProcessStatus_WSIStart, nPlanIndex);
@@ -9116,7 +9197,6 @@
    WSIAllReadySignal(1);
    // send wsi start
    // ���� ����
    if (!WSIMultiShotAllStartSignal())
    {
        g_pLog->DisplayMessage(_T("[WSI] WSI MultiShot Start Fail!!"));
@@ -9127,7 +9207,7 @@
    if (pGlassResult && pReviewProcessor)
    {
        // WsiStart
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID ����
        pReviewProcessor->SetJobID(pGlassResult->m_strJobID);    // pGlassResult->m_strGlassID -> pGlassResult->m_strJobID
        pReviewProcessor->SetOperID(pGlassResult->m_strOperID);
        m_pSP2P->ISP2P_UpdateReviewProcessStatus(ReviewProcessStatus_WSIMultiShotStart, nPlanIndex);
@@ -9190,7 +9270,7 @@
        int nEndIdx = pWsiResult->GetEndSReviewResultIndex();
        nEndIdx = min(nEndIdx, (pWsiResult->GetSReviewResultCount()-1)) + 1;        // set End Index 
        // [2017:3:8]-[WEZASW] : CameraOffset ���� ���� (-1~1 => -5~5)
        // [2017:3:8]-[WEZASW] : CameraOffset (-1~1 => -5~5)
        double m_dMinOffset = -5.0; 
        double m_dMaxOffset = 5.0;
@@ -9320,7 +9400,6 @@
        CModuleStatus*                    pModuleStatus    = Module_GetModuleStatus(nModuleIdx);        
        if (pModuleStatus == NULL) continue;
        //�浹�Ÿ� �ֱ�
        {
            double dCollisionPosX = pWsiUserResult->GetCollisionPositionX() / 1000.0;
            double dCollisionPosY = 0.0;
@@ -9363,7 +9442,7 @@
        int nEndIdx = pWsiUserResult->GetEndSReviewResultIndex();
        nEndIdx = min(nEndIdx, (pWsiUserResult->GetSReviewResultCount()-1)) + 1;        // set End Index 
        // [2017:3:8]-[WEZASW] : CameraOffset ���� ���� (-1~1 => -5~5)
        // [2017:3:8]-[WEZASW] : CameraOffset (-1~1 => -5~5)
        double m_dMinOffset = -5.0; 
        double m_dMaxOffset = 5.0;
@@ -9466,17 +9545,13 @@
            }
        
        }
        //������ ����
        pWsiMultiShotResult->GetVectorSReviewResult()->clear();
        int nResultCount = 0;
        if (m_vecSReviewResult.size()>0)
        {    
            //占쏙옙占쏙옙占쌕몌옙 占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙占쏙옙占쏙옙킷占?占쏙옙 占쏙옙占쏙옙殮占?占쏙옙占쏙옙
            for(int i=0; i< m_vecSReviewResult.size(); i++)
            {
                //������ ���ÿ� ���� ���� �Է��ؾߵ� �װ͸�ŭ ������!
                //������ WSI FOV 4���� ���ؿ��� ����
            {
                double dOringinX = m_vecSReviewResult[i].nUMOriginX;
                double dOringinY = m_vecSReviewResult[i].nUMOriginY;
@@ -9745,8 +9820,6 @@
        CModuleStatus*                    pModuleStatus = Module_GetModuleStatus(nModuleIdx);
        if (pModuleStatus == NULL) continue;
        //�浹�Ÿ� �ֱ�
        {
            double dCollisionPosX = pWsiMultiShotResult->GetCollisionPositionX() / 1000.0;
@@ -9774,7 +9847,7 @@
            int nEndIdx = pWsiMultiShotResult->GetEndSReviewResultIndex();
            nEndIdx = min(nEndIdx, (pWsiMultiShotResult->GetSReviewResultCount() - 1)) + 1;        // set End Index 
            // [2017:3:8]-[WEZASW] : CameraOffset ���� ���� (-1~1 => -5~5)
            // [2017:3:8]-[WEZASW] : CameraOffset (-1~1 => -5~5)
            double m_dMinOffset = -5.0;
            double m_dMaxOffset = 5.0;
@@ -10215,7 +10288,7 @@
    CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
    if(pRsRcpReviewInfo == NULL)    return FALSE;
    if(pRsRcpReviewInfo->GetRcpUserDefectInfoCount() < 1)    return TRUE;        // �������� ī��Ʈ�� ���ٸ� �Ѿ��
    if(pRsRcpReviewInfo->GetRcpUserDefectInfoCount() < 1)    return TRUE;
    double dCenterPosX, dCenterPosY;
    
@@ -10274,18 +10347,18 @@
    _grmGlassData* pSharedGlassData = pDitSharedGlassRaw->GetGlassData();
    if(pSharedGlassData == NULL) return FALSE;
    //pSharedGlassData->m_nUserReviewNum = 0; //���� �޸� User plan
    //pSharedGlassData->m_nUserReviewNum = 0; // User plan
    _grmDefectData* pSharedDefect;
    int nPointCount = pRecipeinfo->GetRcpUserDefectInfoCount(); // User ��ǥ �� ī��Ʈ
    int nPointCount = pRecipeinfo->GetRcpUserDefectInfoCount();
    int nSharedDefectNum = pSharedGlassData->m_nDefectNum; // ���� �Ѱ��� User Idx �� ù��° Index �� �ȴ�
    int nStartIdx=nSharedDefectNum;// USER ���� ���� IDX �ο��ϱ� ���� ������
    int nSharedDefectNum = pSharedGlassData->m_nDefectNum;
    int nStartIdx=nSharedDefectNum;
    CRcpPlanInfo* pRcpPlanInfo; // ������ ����
    CRcpUserDefectInfo *pDefectInfo;// ������ defect ����
    CRcpPlanInfo* pRcpPlanInfo;
    CRcpUserDefectInfo *pDefectInfo;
    
    int nInsepectionType;// User Ÿ�� Reviewreflow = 0 wsiReflow =1; REV&WSI =2; WSIUSEr =3; USER =4;
    int nInsepectionType;// User Reviewreflow = 0 wsiReflow =1; REV&WSI =2; WSIUSEr =3; USER =4;
    int nCount = 0;
@@ -10349,7 +10422,7 @@
BOOL CSequenceProcessor_CPJT::CompareRevType(int nInsType,int nRevType)
{
    //Plan Ÿ�԰� InspectionMode ��
    //Plan InspectionMode
    if(nRevType == CPJT_PlanUser)
    {
      if(nInsType == USER) return TRUE;
@@ -10407,7 +10480,7 @@
    CString strMessage, strResultFilePath, strUploadResultFilePath, strLocalRawPath;
    CString    strUploadRawPath, strUploadImagePath, strAOIRawFileName, strAOIRawFilePath;
    //3-1. 占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙
    //3-1.
    m_pSP2P->ISP2P_SetReviewResultData(pGlassResult);
    strLocalRawPath        = pNetworkInfo->m_strLocalRawPath;
@@ -10434,7 +10507,7 @@
            if(strUploadRawPath.IsEmpty() == FALSE && strAOIRawFilePath.IsEmpty() == FALSE)
            {
                // [2017:5:16]-[WEZASW] : ���� PASS���� ���� ��� ��Ȳ�� ���� AOI Server�� RAW ���� ���� ���ε� ����.
                // [2017:5:16]-[WEZASW] :
                strUploadResultFilePath.Format(_T("%s\\%s"), strUploadRawPath, strAOIRawFileName);
                if(CopyFile(strResultFilePath, strUploadResultFilePath, FALSE))
@@ -10455,9 +10528,9 @@
    }
    // delete file of Glass direction
    DeleteFile(pNetworkInfo->m_strAOIRawPath + _T("\\") + pGlassResult->m_strJobID + _T("TD"));//pGlassResult->m_strGlassID -> m_StrJobID ����
    DeleteFile(pNetworkInfo->m_strAOIRawPath + _T("\\") + pGlassResult->m_strJobID + _T("TD"));//pGlassResult->m_strGlassID -> m_StrJobID
    // [2017:4:11]-[WEZASW] :CIM(DV Data) ���� �׸� �߰�.
    // [2017:4:11]-[WEZASW] :CIM(DV Data)
    if (SendDVDataToSignalControl()==FALSE) 
    {
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] DV Data Send FAIL!"));            
@@ -10477,8 +10550,6 @@
BOOL CSequenceProcessor_CPJT::MoveReviewStartMotorPosition(CGlassResult* pGlassResult,int nReviewType)
{
    //혹占시놂옙 占쏙옙占싹깍옙占?占쏙옙占쌤듸옙
    //���� �÷��� ù��° ��ġ�� �̵�
    
    double dDefectPosX,dDefectPosY = 0;
    
@@ -10542,7 +10613,7 @@
void CSequenceProcessor_CPJT::SendWsiErrorAlarm_CPJT(int Index) //190801 chm
{    
    //wsi ���� �˶�
    //wsi
    if(Index==1)
    {
        g_pLog->DisplayMessage(_T("[SequenceProcessor_CPJT] WSI Alive Error!!!"));
@@ -10556,7 +10627,7 @@
void CSequenceProcessor_CPJT::SendWsiAlive_CPJT()//190801 chm
{
    //WSI Alive ��ȣ ����
    //WSI Alive
    SetWSIAliveCheck(TRUE);
}
@@ -10582,7 +10653,7 @@
            if(bWsiAliveCheck ==FALSE){
                m_pCSPC->SendWsiErrorAlarm_CPJT(1);
            }
            bWsiAliveCheck=FALSE; //30�ʿ� �ѹ��� 0���� �ʱ�ȭ
            bWsiAliveCheck=FALSE;
        }
    }
ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.h
@@ -412,7 +412,6 @@
    BOOL                m_nGlassCountCheck;
    BOOL                m_bUseAFMHomePosition;
    
    DWORD dwRevStartTickCount;
    DWORD dwRevEndTickCount;
ReviewSystem/ReviewSystem/resource.h
@@ -111,6 +111,7 @@
#define IDC_BUTTON_LEFT                 1008
#define IDC_BUTTON_APPLT_OFFSET         1008
#define IDC_BUTTON_PROGRAMEXIT          1008
#define IDC_BUTTON_ALIGNCAM_GRAB        1008
#define IDC_SPIN2                       1009
#define IDC_CHECK_REVIEW_PATH2          1009
#define IDC_CHECK_AUTO_SELECT_CAMERA    1009
ReviewSystem/ReviewSystem/stdafx.h
@@ -38,6 +38,9 @@
#include "CHReviewResult/GlassResult.h"
#include "CHReviewSetting/MotorParameter.h"
#include <DbgHelp.h>
#pragma comment ( lib, "DbgHelp" )
#include <WinNetWk.h>
//#pragma comment(lib,"Mpr.lib")
@@ -74,19 +77,33 @@
#define ID_TIMER_SEND_SIGNAL_ALIVE            (WM_USER + 107)
#define _REVIEW_SERVER_BASE_PATH_                    _T("C:\\DIT_Review")
#define _REVIEW_SERVER_LOG_PATH_                    _T("C:\\DIT_Review\\ReviewServerLog")
#define _REVIEW_RECIPE_PATH_                        _T("C:\\DIT_Review\\Recipe")
#define _REVIEW_REF_RECIPE_PATH_                    _T("C:\\DIT_Review\\Recipe\\Reference")
#define _REVIEW_SERVER_CONFIG_PATH_                    _T("C:\\DIT_Review\\ReviewServerConfig")
#define _REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_    _T("C:\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg")
#define _REVIEW_SERVER_BASE_PATH_                    _T("D:\\DIT_Review") //210805
#define _REVIEW_SERVER_LOG_PATH_                    _T("D:\\DIT_Review\\ReviewServerLog")
#define _REVIEW_RECIPE_PATH_                        _T("D:\\DIT_Review\\Recipe")
#define _REVIEW_REF_RECIPE_PATH_                    _T("D:\\DIT_Review\\Recipe\\Reference")
#define _REVIEW_SERVER_CONFIG_PATH_                    _T("D:\\DIT_Review\\ReviewServerConfig")
#define _REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_    _T("D:\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg")
#define _SYSTEM_SETTING_TITLE_                        _T("ReviewSystemSetting")
#define _RECIPE_EDITOR_TITLE_                        _T("ReviewRecipeEditor")
#define _REVIEW_LOGIN_LOG_PATH_                        _T("C:\\DIT_Review\\ReviewServerLog\\LoginLog")
#define _REVIEW_REFLOW_RECIPE_PATH_                    _T("C:\\DIT_Review\\Recipe\\Reflow")
#define ALIGN_TEMPLATE_PATH                            _T("C:\\DIT_Review\\Recipe\\AlignImage")
#define _REVIEW_LOGIN_LOG_PATH_                        _T("D:\\DIT_Review\\ReviewServerLog\\LoginLog")
#define _REVIEW_REFLOW_RECIPE_PATH_                    _T("D:\\DIT_Review\\Recipe\\Reflow")
#define ALIGN_TEMPLATE_PATH                            _T("D:\\DIT_Review\\Recipe\\AlignImage")
#define _REVIEW_RECIPE_BACKUP_PATH_CPJT                _T("\\\\126.100.100.5\\d\\DIT Back up\\DIT Review\\Recipe")
#define _REVIEW_SERVER_SYSTEM_SETTING_BACKUP_PATH_CPJT    _T("\\\\126.100.100.5\\d\\DIT Back up\\DIT Review\\ReviewServerConfig")
//#define _REVIEW_SERVER_BASE_PATH_                    _T("C:\\DIT_Review")
//#define _REVIEW_SERVER_LOG_PATH_                    _T("C:\\DIT_Review\\ReviewServerLog")
//#define _REVIEW_RECIPE_PATH_                        _T("C:\\DIT_Review\\Recipe")
//#define _REVIEW_REF_RECIPE_PATH_                    _T("C:\\DIT_Review\\Recipe\\Reference")
//#define _REVIEW_SERVER_CONFIG_PATH_                    _T("C:\\DIT_Review\\ReviewServerConfig")
//#define _REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_    _T("C:\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg")
//#define _SYSTEM_SETTING_TITLE_                        _T("ReviewSystemSetting")
//#define _RECIPE_EDITOR_TITLE_                        _T("ReviewRecipeEditor")
//#define _REVIEW_LOGIN_LOG_PATH_                        _T("C:\\DIT_Review\\ReviewServerLog\\LoginLog")
//#define _REVIEW_REFLOW_RECIPE_PATH_                    _T("C:\\DIT_Review\\Recipe\\Reflow")
//#define ALIGN_TEMPLATE_PATH                            _T("C:\\DIT_Review\\Recipe\\AlignImage")
//#define _REVIEW_RECIPE_BACKUP_PATH_CPJT                _T("\\\\126.100.100.5\\d\\DIT Back up\\DIT Review\\Recipe")
//#define _REVIEW_SERVER_SYSTEM_SETTING_BACKUP_PATH_CPJT    _T("\\\\126.100.100.5\\d\\DIT Back up\\DIT Review\\ReviewServerConfig")
#define TOTAL_WINDOW_SIZE_X        1920
@@ -403,4 +420,30 @@
    char            strMessageString[MAX_PATH];
};
BOOL KillProcess(CString ProcessName);BOOL getStateProcess(CString ProcessName);
BOOL KillProcess(CString ProcessName);BOOL getStateProcess(CString ProcessName);
// 선언
static LONG CALLBACK TopLevelExceptionFilterCallBack(EXCEPTION_POINTERS* exceptionInfo);
LONG CALLBACK TopLevelExceptionFilterCallBack(EXCEPTION_POINTERS * exceptionInfo)
{
    MINIDUMP_EXCEPTION_INFORMATION dmpInfo = { 0 };
    dmpInfo.ThreadId = ::GetCurrentThreadId(); // Threae ID
    dmpInfo.ExceptionPointers = exceptionInfo; // Exception Info
    dmpInfo.ClientPointers = FALSE;
    CTime time;
    CString strStamp;
    SYSTEMTIME   currentTime;
    ::GetLocalTime(&currentTime);
    time = CTime::GetCurrentTime();
    strStamp.Format(_T("Dump\\%02d_%02d_%02d_%02d_%02d_%02d.dmp"), time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond());
    HANDLE hFile = CreateFile(strStamp, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
    // 덤프 생성
    BOOL bWrite = ::MiniDumpWriteDump(::GetCurrentProcess(), ::GetCurrentProcessId(), hFile, MiniDumpNormal, &dmpInfo, NULL, NULL);
    return 0L;
}
ReviewSystem/ReviewSystemSetting/DlgSignal.cpp
@@ -25,6 +25,8 @@
    , m_nSignalReviewStartDelay(0)
    , m_nSignalReviewEndDelay(0)
    , m_nSignalUnloadingDelay(0)
    , m_nSignalDefocusValueMin(0)
    , m_nSignalDefocusValueMax(0)
{
    m_pDlgSignalReadData = NULL;
    m_pDlgSignalWriteData = NULL;
@@ -95,6 +97,8 @@
    DDX_Text(pDX, IDC_EDIT_SYS_SIGNAL_REVIEWSTART_DELAY, m_nSignalReviewStartDelay);
    DDX_Text(pDX, IDC_EDIT_SYS_SIGNAL_REVIEWEND_DELAY, m_nSignalReviewEndDelay);
    DDX_Text(pDX, IDC_EDIT_SYS_SIGNAL_UNLOADING_DELAY, m_nSignalUnloadingDelay);
    DDX_Text(pDX, IDC_EDIT_DEFOCUSVALUE_MIN, m_nSignalDefocusValueMin);
    DDX_Text(pDX, IDC_EDIT_DEFOCUSVALUE_MAX, m_nSignalDefocusValueMax);
}
@@ -114,6 +118,7 @@
    // TODO:  여기에 추가 초기화 작업을 추가합니다.
    int nSignalConnectionType = -1, nSignalPort = -1, nSignalPeriodTime = -1, nTimerTime = 0, nTotalTime = 0;
    int nLoadingDelay = 0, nAlignStartDelay = 0, nAlignEndDelay = 0, nReviewStartDelay = 0, nReviewEndDelay = 0, nUnloadingDelay = 0;
    int nDefocusValueMin = 0, nDefocusValueMax = 0;
    CString strTemp = _T(""), strSignalReceiveAddress = _T(""), strSignalSendAddress = _T("");
    CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
@@ -127,6 +132,8 @@
//             strSignalReceiveAddress        = pSignalInfo->GetReadSignalAddress(0);
//             strSignalSendAddress        = pSignalInfo->GetSendSignalAddress(0);
            nSignalPeriodTime            = pSignalInfo->GetMSPeriod();
            nDefocusValueMin            = pSignalInfo->GetDefocusValueMin();
            nDefocusValueMax            = pSignalInfo->GetDefocusValueMax();
            nLoadingDelay                = pSignalInfo->GetMSLoadingSignalDelay();
            nAlignStartDelay            = pSignalInfo->GetMSAlignStartSignalDelay();
            nAlignEndDelay                = pSignalInfo->GetMSAlignEndSignalDelay();
@@ -180,6 +187,8 @@
    m_strSendAddress = strSignalSendAddress;
    m_nSignalPeriod = nSignalPeriodTime;
    m_nSignalDefocusValueMin = nDefocusValueMin;
    m_nSignalDefocusValueMax = nDefocusValueMax;
    m_nSignalLodingDelay = nLoadingDelay;
    m_nSignalAlignStartDelay = nAlignStartDelay;
    m_nSignalAlignEndDelay = nAlignEndDelay;
@@ -275,6 +284,8 @@
    m_nSignalReviewStartDelay = 0;
    m_nSignalReviewEndDelay = 0;
    m_nSignalUnloadingDelay = 0;
    m_nSignalDefocusValueMin = 0;
    m_nSignalDefocusValueMax = 0;
    m_nTimerTime = 0;
    m_nTotalTime = 0;
@@ -298,6 +309,8 @@
    pSignalInfo->SetReadSignalAddress(m_strReceiveAddress);
    pSignalInfo->SetSendSignalAddress(m_strSendAddress);
    pSignalInfo->SetMSPeriod(m_nSignalPeriod);
    pSignalInfo->SetDefocusValueMin(m_nSignalDefocusValueMin);
    pSignalInfo->SetDefocusValueMax(m_nSignalDefocusValueMax);
    pSignalInfo->SetMSLodingSignalDelay(m_nSignalLodingDelay);
    pSignalInfo->SetMSAlignStartSignalDelay(m_nSignalAlignStartDelay);
    pSignalInfo->SetMSAlignEndSignalDelay(m_nSignalAlignEndDelay);
ReviewSystem/ReviewSystemSetting/DlgSignal.h
@@ -65,4 +65,6 @@
    int m_nSignalReviewStartDelay;
    int m_nSignalReviewEndDelay;
    int m_nSignalUnloadingDelay;
    int m_nSignalDefocusValueMin;
    int m_nSignalDefocusValueMax;
};
ReviewSystem/ReviewSystemSetting/ReviewSystemSetting.rc
@@ -141,6 +141,10 @@
    RTEXT           "Unloading Signal Delay :",IDC_STATIC,178,94,93,14,SS_CENTERIMAGE
    EDITTEXT        IDC_EDIT_SYS_SIGNAL_UNLOADING_DELAY,276,92,70,14,ES_AUTOHSCROLL
    LTEXT           "ms",IDC_STATIC,348,95,14,12,SS_CENTERIMAGE
    RTEXT           "DefocusValue :",IDC_STATIC,24,111,48,14,SS_CENTERIMAGE
    EDITTEXT        IDC_EDIT_DEFOCUSVALUE_MIN,77,111,24,13,ES_AUTOHSCROLL
    EDITTEXT        IDC_EDIT_DEFOCUSVALUE_MAX,122,110,23,13,ES_AUTOHSCROLL
    RTEXT           "~",IDC_STATIC,107,109,8,14,SS_CENTERIMAGE
END
IDD_DIALOG_SYS_SETTING_SIGNAL_READ_DATA DIALOGEX 0, 0, 416, 342
@@ -746,6 +750,11 @@
    0
END
IDD_DIALOG_SYS_SETTING_SIGNAL AFX_DIALOG_LAYOUT
BEGIN
    0
END
/////////////////////////////////////////////////////////////////////////////
//
ReviewSystem/ReviewSystemSetting/ReviewSystemSettingDlg.cpp
@@ -1,5 +1,5 @@
// ReviewSystemSettingDlg.cpp : 구현 파일
// ReviewSystemSettingDlg.cpp : ���� ����
//
#include "stdafx.h"
@@ -31,20 +31,20 @@
#endif
// 응용 프로그램 정보에 사용되는 CAboutDlg 대화 상자입니다.
// ���� ���α׷� ������ ���Ǵ� CAboutDlg ��ȭ �����Դϴ�.
class CAboutDlg : public CDialog
{
public:
    CAboutDlg();
// 대화 상자 데이터입니다.
// ��ȭ ���� �������Դϴ�.
    enum { IDD = IDD_ABOUTBOX };
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 지원입니다.
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV �����Դϴ�.
// 구현입니다.
// �����Դϴ�.
protected:
    DECLARE_MESSAGE_MAP()
};
@@ -62,7 +62,7 @@
END_MESSAGE_MAP()
// CReviewSystemSettingDlg 대화 상자
// CReviewSystemSettingDlg ��ȭ ����
@@ -87,7 +87,8 @@
    m_pNetworkManager = NULL;
    // init Log 
    new CDisplayMessage(_T("C:\\DIT_Review\\ReviewServerConfig\\Log"));
    //new CDisplayMessage(_T("C:\\DIT_Review\\ReviewServerConfig\\Log"));
    new CDisplayMessage(_T("D:\\DIT_Review\\ReviewServerConfig\\Log"));//210805
}
CReviewSystemSettingDlg::~CReviewSystemSettingDlg()
@@ -185,15 +186,15 @@
END_MESSAGE_MAP()
// CReviewSystemSettingDlg 메시지 처리기
// CReviewSystemSettingDlg �޽��� ó����
BOOL CReviewSystemSettingDlg::OnInitDialog()
{
    CDialog::OnInitDialog();
    // 시스템 메뉴에 "정보..." 메뉴 항목을 추가합니다.
    // �ý��� �޴��� "����..." �޴� �׸��� �߰��մϴ�.
    // IDM_ABOUTBOX는 시스템 명령 범위에 있어야 합니다.
    // IDM_ABOUTBOX�� �ý��� ��� ������ �־�� �մϴ�.
    ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
    ASSERT(IDM_ABOUTBOX < 0xF000);
@@ -211,12 +212,12 @@
        }
    }
    // 이 대화 상자의 아이콘을 설정합니다. 응용 프로그램의 주 창이 대화 상자가 아닐 경우에는
    //  프레임워크가 이 작업을 자동으로 수행합니다.
    SetIcon(m_hIcon, TRUE);            // 큰 아이콘을 설정합니다.
    SetIcon(m_hIcon, FALSE);        // 작은 아이콘을 설정합니다.
    // �� ��ȭ ������ �������� �����մϴ�. ���� ���α׷��� �� â�� ��ȭ ���ڰ� �ƴ� ��쿡��
    //  �����ӿ�ũ�� �� �۾��� �ڵ����� �����մϴ�.
    SetIcon(m_hIcon, TRUE);            // ū �������� �����մϴ�.
    SetIcon(m_hIcon, FALSE);        // ���� �������� �����մϴ�.
    // TODO: 여기에 추가 초기화 작업을 추가합니다.
    // TODO: ���⿡ �߰� �ʱ�ȭ �۾��� �߰��մϴ�.
    CreateReviewDirectory();
    CreateManager();
    ReadReviewSystemConfigFile();
@@ -225,7 +226,7 @@
    g_pLog->DisplayMessage(_T("SystemSetting is Started!"));
    return TRUE;  // 포커스를 컨트롤에 설정하지 않으면 TRUE를 반환합니다.
    return TRUE;  // ��Ŀ���� ��Ʈ�ѿ� �������� ������ TRUE�� ��ȯ�մϴ�.
}
void CReviewSystemSettingDlg::OnSysCommand(UINT nID, LPARAM lParam)
@@ -241,19 +242,19 @@
    }
}
// 대화 상자에 최소화 단추를 추가할 경우 아이콘을 그리려면
//  아래 코드가 필요합니다. 문서/뷰 모델을 사용하는 MFC 응용 프로그램의 경우에는
//  프레임워크에서 이 작업을 자동으로 수행합니다.
// ��ȭ ���ڿ� �ּ�ȭ ���߸� �߰��� ��� �������� �׸�����
//  �Ʒ� �ڵ尡 �ʿ��մϴ�. ����/�� ���� ����ϴ� MFC ���� ���α׷��� ��쿡��
//  �����ӿ�ũ���� �� �۾��� �ڵ����� �����մϴ�.
void CReviewSystemSettingDlg::OnPaint()
{
    if (IsIconic())
    {
        CPaintDC dc(this); // 그리기를 위한 디바이스 컨텍스트
        CPaintDC dc(this); // �׸��⸦ ���� ����̽� ���ؽ�Ʈ
        SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
        // 클라이언트 사각형에서 아이콘을 가운데에 맞춥니다.
        // Ŭ���̾�Ʈ �簢������ �������� ����� ����ϴ�.
        int cxIcon = GetSystemMetrics(SM_CXICON);
        int cyIcon = GetSystemMetrics(SM_CYICON);
        CRect rect;
@@ -261,7 +262,7 @@
        int x = (rect.Width() - cxIcon + 1) / 2;
        int y = (rect.Height() - cyIcon + 1) / 2;
        // 아이콘을 그립니다.
        // �������� �׸��ϴ�.
        dc.DrawIcon(x, y, m_hIcon);
    }
    else
@@ -270,8 +271,8 @@
    }
}
// 사용자가 최소화된 창을 끄는 동안에 커서가 표시되도록 시스템에서
//  이 함수를 호출합니다.
// ����ڰ� �ּ�ȭ�� â�� ��� ���ȿ� Ŀ���� ǥ�õǵ��� �ý��ۿ���
//  �� �Լ��� ȣ���մϴ�.
HCURSOR CReviewSystemSettingDlg::OnQueryDragIcon()
{
    return static_cast<HCURSOR>(m_hIcon);
@@ -280,7 +281,7 @@
void CReviewSystemSettingDlg::OnTcnSelchangeTabSysSettingMainTab(NMHDR *pNMHDR, LRESULT *pResult)
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    // TODO: ���⿡ ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
    SystemMainTab nTabIdx;
    nTabIdx = (SystemMainTab)m_ctrlTabMain.GetCurSel();
@@ -397,12 +398,12 @@
void CReviewSystemSettingDlg::InitTabControl()
{
    int nIdx = 0;
    m_ctrlTabMain.InsertItem(nIdx++, _T("Equipment Setting"));//_T("장비 설정"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Glass Type Setting"));//_T("글라스 타입 설정"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Align Setting"));//_T("얼라인 설정"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Signal Setting"));//_T("Signal 설정"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Motor Setting"));//_T("모터 설정"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Network Setting"));//_T("네트워크 설정"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Equipment Setting"));//_T("��� ����"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Glass Type Setting"));//_T("�۶� Ÿ�� ����"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Align Setting"));//_T("����� ����"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Signal Setting"));//_T("Signal ����"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Motor Setting"));//_T("���� ����"));
    m_ctrlTabMain.InsertItem(nIdx++, _T("Network Setting"));//_T("��Ʈ��ũ ����"));
}
BOOL CReviewSystemSettingDlg::ReadReviewSystemConfigFile()
@@ -526,7 +527,7 @@
        strBackupFile = strBackupPath + strBackupFile;
        CopyFile(_REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_, strBackupFile, TRUE);
        //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD START
        //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD START
        strBackupPath = _REVIEW_SERVER_SYSTEM_SETTING_BACKUP_PATH_CPJT;
        CreateDirectory(strBackupPath, NULL);
@@ -535,9 +536,9 @@
        strBackupFile.Format(_T("%s\\SystemSetting.cfg"), strBackupPath);
        CopyFile(_REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_, strBackupFile, FALSE);
        //LYW_#3344_CF AOI Review Config File 백업 기능 개선 ADD END
        //LYW_#3344_CF AOI Review Config File ��� ��� ���� ADD END
        if (IDNO == AfxMessageBox(_T("Save complete. Do you want to close System Setting program?"), MB_YESNO | MB_ICONQUESTION))//_T("저장 완료되었습니다. 시스템 설정 프로그램을 종료하시겠습니까?"), MB_YESNO | MB_ICONQUESTION))
        if (IDNO == AfxMessageBox(_T("Save complete. Do you want to close System Setting program?"), MB_YESNO | MB_ICONQUESTION))//_T("���� �Ϸ�Ǿ����ϴ�. �ý��� ���� ���α׷��� �����Ͻðڽ��ϱ�?"), MB_YESNO | MB_ICONQUESTION))
        {
            return;
        }
@@ -549,14 +550,14 @@
    }
    else
    {
        AfxMessageBox(_T("Save Fail!"));//_T("저장 실패하였습니다."));
        AfxMessageBox(_T("Save Fail!"));//_T("���� �����Ͽ����ϴ�."));
    }
}
void CReviewSystemSettingDlg::OnBnClickedCancel()
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    if (IDNO == AfxMessageBox(_T("Do you want to close System Setting program?"), MB_YESNO | MB_ICONQUESTION))//_T("시스템 설정 프로그램을 종료하시겠습니까?"), MB_YESNO | MB_ICONQUESTION))
    // TODO: ���⿡ ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
    if (IDNO == AfxMessageBox(_T("Do you want to close System Setting program?"), MB_YESNO | MB_ICONQUESTION))//_T("�ý��� ���� ���α׷��� �����Ͻðڽ��ϱ�?"), MB_YESNO | MB_ICONQUESTION))
    {
        return;
    }
@@ -568,7 +569,7 @@
BOOL CReviewSystemSettingDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
    // TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.
    // TODO: ���⿡ �޽��� ó���� �ڵ带 �߰� ��/�Ǵ� �⺻���� ȣ���մϴ�.
    if (pCopyDataStruct->dwData == COPYDATA_SYSTEMSETTING2REVIEWSYSTEM)
    {
        COPYDATA_SYSTEM2REV* pCopyData = (COPYDATA_SYSTEM2REV*)pCopyDataStruct->lpData;
ReviewSystem/ReviewSystemSetting/resource.h
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ReviewSystemSetting.rc
// Microsoft Visual C++에서 생성한 포함 파일입니다.
// ReviewSystemSetting.rc에서 사용되고 있습니다.
//
#define IDM_ABOUTBOX                    0x0010
#define IDD_ABOUTBOX                    100
@@ -223,14 +223,16 @@
#define IDC_EDIT_SYS_MOTOR_START_POINT_XPOS 1089
#define IDC_EDIT_START_POINT_YPOS       1090
#define IDC_EDIT_SYS_MOTOR_START_POINT_YPOS 1090
#define IDC_EDIT_DEFOCUSVALUE_MIN       1092
#define IDC_EDIT_DEFOCUSVALUE_MAX       1093
// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        144
#define _APS_NEXT_RESOURCE_VALUE        145
#define _APS_NEXT_COMMAND_VALUE         32771
#define _APS_NEXT_CONTROL_VALUE         1092
#define _APS_NEXT_CONTROL_VALUE         1094
#define _APS_NEXT_SYMED_VALUE           107
#endif
#endif
ReviewSystem/ReviewSystemSetting/stdafx.h
@@ -1,7 +1,7 @@
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
// 들어 있는 포함 파일입니다.
// stdafx.h : ���� ��������� ���� ��������� �ʴ�
// ǥ�� �ý��� ���� ���� �� ������Ʈ ���� ���� ������
// ��� �ִ� ���� �����Դϴ�.
#pragma once
@@ -10,37 +10,42 @@
#endif
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN            // 거의 사용되지 않는 내용은 Windows 헤더에서 제외합니다.
#define VC_EXTRALEAN            // ���� ������ �ʴ� ������ Windows ������� �����մϴ�.
#endif
#include "targetver.h"
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // 일부 CString 생성자는 명시적으로 선언됩니다.
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // �Ϻ� CString �����ڴ� ��������� ����˴ϴ�.
// MFC의 공통 부분과 무시 가능한 경고 메시지에 대한 숨기기를 해제합니다.
// MFC�� ���� �κа� ���� ������ ��� �޽����� ���� ����⸦ �����մϴ�.
#define _AFX_ALL_WARNINGS
#include <afxwin.h>         // MFC 핵심 및 표준 구성 요소입니다.
#include <afxext.h>         // MFC 확장입니다.
#include <afxwin.h>         // MFC �ٽ� �� ǥ�� ���� ����Դϴ�.
#include <afxext.h>         // MFC Ȯ���Դϴ�.
#include <afxdisp.h>        // MFC 자동화 클래스입니다.
#include <afxdisp.h>        // MFC �ڵ�ȭ Ŭ�����Դϴ�.
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h>           // Internet Explorer 4 공용 컨트롤에 대한 MFC 지원입니다.
#include <afxdtctl.h>           // Internet Explorer 4 ���� ��Ʈ�ѿ� ���� MFC �����Դϴ�.
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>             // Windows 공용 컨트롤에 대한 MFC 지원입니다.
#include <afxcmn.h>             // Windows ���� ��Ʈ�ѿ� ���� MFC �����Դϴ�.
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxcontrolbars.h>     // MFC의 리본 및 컨트롤 막대 지원
#include <afxcontrolbars.h>     // MFC�� ���� �� ��Ʈ�� ���� ����
#define _REVIEW_SERVER_BASE_PATH_                    _T("C:\\DIT_Review")
#define _REVIEW_SERVER_CONFIG_PATH_                    _T("C:\\DIT_Review\\ReviewServerConfig")
#define _REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_    _T("C:\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg")
#define _REVIEW_SERVER_SYSTEM_PASSWORD_FILE_PATH_    _T("C:\\DIT_Review\\ReviewServerConfig\\SystemSetting.dat")
#define _REVIEW_SERVER_BASE_PATH_                    _T("D:\\DIT_Review")  //210805
#define _REVIEW_SERVER_CONFIG_PATH_                    _T("D:\\DIT_Review\\ReviewServerConfig")
#define _REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_    _T("D:\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg")
#define _REVIEW_SERVER_SYSTEM_PASSWORD_FILE_PATH_    _T("D:\\DIT_Review\\ReviewServerConfig\\SystemSetting.dat")
//#define _REVIEW_SERVER_BASE_PATH_                    _T("C:\\DIT_Review")
//#define _REVIEW_SERVER_CONFIG_PATH_                    _T("C:\\DIT_Review\\ReviewServerConfig")
//#define _REVIEW_SERVER_SYSTEM_SETTING_FILE_PATH_    _T("C:\\DIT_Review\\ReviewServerConfig\\SystemSetting.cfg")
//#define _REVIEW_SERVER_SYSTEM_PASSWORD_FILE_PATH_    _T("C:\\DIT_Review\\ReviewServerConfig\\SystemSetting.dat")
#define _REVIEW_RECIPE_BACKUP_PATH_CPJT                _T("\\\\126.100.100.5\\d\\DIT Back up\\DIT Review\\Recipe")
#define _REVIEW_SERVER_SYSTEM_SETTING_BACKUP_PATH_CPJT    _T("\\\\126.100.100.5\\d\\DIT Back up\\DIT Review\\ReviewServerConfig")
#define _REVIEW_SYSTEM_TITLE_                        _T("ReviewSystem")
@@ -60,7 +65,7 @@
    MsgSystem2Rev_ChangeSysConfig,
    MsgRev2System_ChangeSysConfig,
    // [2017:5:2]-[WEZASW] : TFE Measurement 설비 UNIT Test(Signal 수동 발생)를 위한 추가
    // [2017:5:2]-[WEZASW] : TFE Measurement ���� UNIT Test(Signal ���� �߻�)�� ���� �߰�
    MsgSystem2Rev_SendAlignAlarmSignal,
    MsgRev2System_SendAlignAlarmSignal,
ReviewSystem/include/CHReviewRecipe/RsRcpAlignInfo.h
@@ -1,7 +1,11 @@
#pragma once
#define ALIGN_IMAGE_PATH _T("C:\\DIT_Review\\Recipe\\AlignImage")
#define REFLOW_IMAGE_PATH _T("C:\\DIT_Review\\Recipe\\Reflow")
#define ALIGN_IMAGE_PATH _T("D:\\DIT_Review\\Recipe\\AlignImage")  //210805
#define REFLOW_IMAGE_PATH _T("D:\\DIT_Review\\Recipe\\Reflow")
//#define ALIGN_IMAGE_PATH _T("C:\\DIT_Review\\Recipe\\AlignImage")
//#define REFLOW_IMAGE_PATH _T("C:\\DIT_Review\\Recipe\\Reflow")
class AFX_EXT_CLASS CRsRcpAlignInfo
{
ReviewSystem/include/CHSignalControls/SignalControlInfo.h
@@ -122,6 +122,8 @@
    int            GetMSReviewStartSignalDelay() const    { return m_pMsSignalDelayTime[SignalDelayIndex_ReviewStart]; }
    int            GetMSReviewEndSignalDelay() const    { return m_pMsSignalDelayTime[SignalDelayIndex_ReviewEnd]; }
    int            GetMSUnloadingSignalDelay() const    { return m_pMsSignalDelayTime[SignalDelayIndex_Unloading]; }
    int            GetDefocusValueMin()const            { return m_nDefocusValueMin; }
    int            GetDefocusValueMax()const            { return m_nDefocusValueMax; }
    BOOL        GetUseContinuousReadAddress() const { return m_bUseContinuousReadAddr; }
    BOOL        GetUseContinuousSendAddress() const { return m_bUseContinuousSendAddr; }
@@ -202,6 +204,8 @@
    void        SetMSTotalTime(int nTime)                        { m_nMSTotalTime = nTime; }
    void        SetUseContinuousReadAddress(BOOL bUse)            { m_bUseContinuousReadAddr = bUse; }
    void        SetUseContinuousSendAddress(BOOL bUse)            { m_bUseContinuousSendAddr = bUse; }
    void        SetDefocusValueMin(int nValue)                    { m_nDefocusValueMin = nValue; }
    void        SetDefocusValueMax(int nValue)                    { m_nDefocusValueMax = nValue; }
    void        SetReadSignalAddressCount(int nCnt)                { m_vecReadSigAddr.resize(nCnt); }
@@ -226,6 +230,8 @@
    int                        m_nMSTimerTime;
    int                        m_nMSTotalTime;
    int                        m_pMsSignalDelayTime[SignalDelayIndex_Count];
    int                        m_nDefocusValueMin;
    int                        m_nDefocusValueMax;
    BOOL                    m_bUseContinuousReadAddr;
    BOOL                    m_bUseContinuousSendAddr;
ReviewSystem/include/M_AutoDiagnosisManager/DiagnosisInfo.h
@@ -3,7 +3,8 @@
#include <vector>
// path define
#define REVIEW_AUTO_DIAGNOSIS_SETTING_FILE_PATH            _T("C:\\DIT_Review\\DiagnosisConfig")
#define REVIEW_AUTO_DIAGNOSIS_SETTING_FILE_PATH            _T("D:\\DIT_Review\\DiagnosisConfig")  //210805
//#define REVIEW_AUTO_DIAGNOSIS_SETTING_FILE_PATH            _T("C:\\DIT_Review\\DiagnosisConfig")
#define REVIEW_AUTO_DIAGNOSIS_SETTING_FILE_NAME            _T("AutoDiagnosisSetting.cfg")
#define REVIEW_AUTO_DIAGNOSIS_DATA_FILE_PATH            _T("D:\\ResultData\\AutoDiagnosis")
#define REVIEW_AUTO_DIAGNOSIS_DATA_IMAGE_FILE_PATH        _T("D:\\ResultData\\AutoDiagnosis\\ResultImage")
@@ -58,7 +59,7 @@
    virtual void IDP2P_WsiMotorMotionEnd(int nModuleIdx, double dPosX, double dPosY) = 0;
    virtual BOOL IDP2P_DiagnosisSendCompleteSig()=0;
    virtual BOOL IDP2P_DiagnosisSendJudgeAlarm() = 0; //0412 AU°¡Aø´U ½AE£ Aß°¡
    virtual BOOL IDP2P_DiagnosisSendJudgeAlarm() = 0; //0412 AU�Ƣ�A����U ��AE�� A���Ƣ�
    // Dialog
    virtual BOOL IDP2P_SetDlgFlatness(int nIndex) = 0;
@@ -224,9 +225,9 @@
        m_dReviewPanelPosY2 = 0;
        m_dReviewPanelPosX4 = 0;
        m_dReviewPanelPosY4 = 0;
        //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
        //#3514_LYW_CF AOI Review �ڰ����� ��� ����_START
        m_nFlatnessSkipMode = 0;
        //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
        //#3514_LYW_CF AOI Review �ڰ����� ��� ����_END
    }
@@ -253,12 +254,12 @@
    void                    SetPanelPosY_Wsi(double dData) {  m_dPanelPosY = dData; }
    void                    SetPanelPosX2_Wsi(double dData) { m_dPanelPosX2 = dData; }
    void                    SetPanelPosY2_Wsi(double dData) { m_dPanelPosY2 = dData; }
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_START
    void                    SetFlastnessSkipMode(double dData) { m_nFlatnessSkipMode = dData; }
    void                    SetSquarenessStandard(double dData) { m_dSquarenessStandard = dData; }
    void                    SetSquarenessStandard2(double dData) { m_dSquarenessStandard2 = dData; }
    void                    SetWSIStandard(double dData) { m_dWSIStandard = dData; }
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_END
    // getter
@@ -290,12 +291,12 @@
    double                    GetPanelPosY_Wsi() const { return m_dPanelPosY; }
    double                    GetPanelPosX2_Wsi() const { return m_dPanelPosX2; }
    double                    GetPanelPosY2_Wsi() const { return m_dPanelPosY2; }
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_START
    int                        GetFlastnessSkipMode() const { return m_nFlatnessSkipMode; }
    double                    GetSquarenessStandard() const { return m_dSquarenessStandard; }
    double                    GetSquarenessStandard2() const { return m_dSquarenessStandard2; }
    double                    GetWSIStandard() const { return m_dWSIStandard; }
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_END
    //Review
public:
    double                    GetReviewPanelPosX() const { return m_dReviewPanelPosX; }
@@ -324,10 +325,10 @@
    int                            m_nCameraFrameHeight;
    double                        m_dCameraResolution;
    double                        m_dJudgeData_Degree;
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_START
    double                        m_dSquarenessStandard;
    double                        m_dSquarenessStandard2;
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_END
    // Flatness
    CDiagnosisResult            m_dataSettingResult_Flatness;        // single data
@@ -337,17 +338,17 @@
    int                            m_nRangeCount_Flatness;
    int                            m_nGlassSizeX;
    int                            m_nGlassSizeY;
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_START
    int                            m_nFlatnessSkipMode;
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_END
    // wsi
    VectorDiagnosisResult        m_vecSettingResult_Wsi;        // add module count
    int                            m_nPanelCount_Wsi;
    double                        m_dJudgeData_3Sigma;
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_START
    double                        m_dWSIStandard;
    //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
    //#3514_LYW_CF AOI Review �ڰ����� ��� ����_END
    double                        m_dPanelPosX;
    double                        m_dPanelPosY;