SDC C-Project CF Review 프로그램
2개 파일 변경됨
914 ■■■■ 파일 변경됨
ReviewSystem/ReviewSystem/ReviewProcessor_CPJT.cpp 346 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp 568 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewProcessor_CPJT.cpp
@@ -88,7 +88,7 @@
    int nEndResultIdx    = pReviewResult->GetEndSReviewResultIndex();
                        
    
    // 인덱스가 현재 마지막 인덱스 보다 클시..
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)  
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -97,7 +97,7 @@
    }
    // 현재 결과데이터 저장
    // 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙
    wsiResult.nWsi_ResultIndex = measureResut.nResultIndex;
    wsiResult.nResultCode = measureResut.nResultCode;
@@ -138,8 +138,8 @@
//         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;
//         wsiResult.�߰� �ϼ���= measureResut.nMultiShot;
//         wsiResult.�߰� �ϼ���= measureResut.nCurrentShotNumber;
        break;
    case 3: //BANK
        wsiResult.dRZoneHeight = measureResut.dRZoneHeight;
@@ -147,14 +147,14 @@
        wsiResult.dBZoneHeight = measureResut.dBZoneHeight;
        wsiResult.dDefectHeight = measureResut.dDefectHeight;
        wsiResult.nWsi_DefectType = measureResut.nDefectType;
//         wsiResult.추가 하세요= measureResut.nMultiShot;
//         wsiResult.추가 하세요= measureResut.nCurrentShotNumber;
//         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;
//         wsiResult.�߰� �ϼ���= measureResut.nMultiShot;
        break;
    }
@@ -163,7 +163,7 @@
    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 +173,10 @@
        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 +192,7 @@
    
    LeaveCriticalSection(&m_csUserCriticalSection);
    // 결과 갱신.
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult);
    return;
@@ -238,7 +238,7 @@
    int nEndResultIdx    = pReviewResult->GetEndSReviewResultIndex();
    // 인덱스가 현재 마지막 인덱스 보다 클시..
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)  
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -246,14 +246,14 @@
        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 +263,10 @@
        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 +282,7 @@
    LeaveCriticalSection(&m_csUserCriticalSection);
    // 결과 갱신.
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult);
    return;
@@ -337,7 +337,7 @@
    int nEndResultIdx = pReviewResult->GetEndSReviewResultIndex();
    // 인덱스가 현재 마지막 인덱스 보다 클시..
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -345,7 +345,7 @@
        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 +353,7 @@
    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 +363,10 @@
        pProcessResult = pReviewResult->GetSReviewResult(nCurResultIdx);
    }
    // 저장 성공시, 리뷰 프로세서에 포인터 전달
    // ���� ������, ���� ���μ����� ������ ����
    if (pProcessResult)
    {
        // 처리 쓰레드 수행
        // ó�� ������ ����
        if (AddReviewProcessData(pProcessResult) == 1)
        {
            g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx); 
@@ -382,7 +382,7 @@
    LeaveCriticalSection(&m_csUserCriticalSection);
    // 결과 갱신.
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult);
    return;
@@ -457,7 +457,7 @@
    int nStartResultIdx    = pReviewResult->GetStartSReviewResultIndex();
    int nEndResultIdx    = pReviewResult->GetEndSReviewResultIndex();
    
    // 인덱스가 현재 마지막 인덱스 보다 클시..
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)  
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -465,7 +465,7 @@
        g_pLog->DisplayMessage(_T("[ReviewProcessor]SetReviewResultData module[%d] point[%d] result[%d]"), nModuleIndex, nResultIndex, nCurResultIdx);
    }
    // 현재 결과이미지 저장
    // 占쏙옙占쏙옙 占쏙옙占쏙옙譴占쏙옙占?占쏙옙占쏙옙
    SReviewResult *pProcessResult = NULL;
    switch(GetReviewProcessStatus())
    {
@@ -509,10 +509,10 @@
        break;
    }
    // 저장 성공시, 리뷰 프로세서에 포인터 전달
    // ���� ������, ���� ���μ����� ������ ����
    if (pProcessResult)
    {
        // 처리 쓰레드 수행
        // ó�� ������ ����
        if (AddReviewProcessData(pProcessResult)==1)
        {
            g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx); 
@@ -527,8 +527,8 @@
    }
        LeaveCriticalSection(&m_csUserCriticalSection);
        //만약 어느 한쪽이포인트 진행을 다해버리면 아래 구문을 안타서 다시 모터좌표 안쏴줌
        // 신호처리 필요함 이거 ㄱㄱ
        //占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙占쏙옙占쏙옙占쏙옙트 占쏙옙占쏙옙占쏙옙 占쏙옙占쌔뱄옙占쏙옙占쏙옙 占싣뤄옙 占쏙옙占쏙옙占쏙옙 占쏙옙타占쏙옙 占쌕쏙옙 占쏙옙占쏙옙占쏙옙표 占싫쏙옙占쏙옙
        // ��ȣó�� �ʿ��� �̰� ����
        if (nCurResultIdx + 1== pReviewResult->GetSReviewResultCount())
        {
            if (nModuleIndex == 0)
@@ -542,7 +542,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 +567,13 @@
            }
            else if(m_pRP2P->IRP2P_Recipe_GetRsRcpReviewInfo()->GetRcpSchedulingInfo()->GetSingleGantryPath()>0)
            {
                //20210302 싱글 겐트리 사용시 모터 로직상 두개의 겐트리가 완료된 상태에서
                //시작을 해야됨으로 Review 에서 Count 체크 하는 기능으로 한겐트리 사용시 200개에서 멈추는 현상 발생
                //그래서 싱글 겐트리 사용시 예외처리 하여 동작하도록 바꿔야됨 CHM
                //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 +601,7 @@
        }
        
        // 마지막 포인트까지 왔고, 리뷰할 결과가 남아 있으면...
        // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
        if(nCurResultIdx==nEndResultIdx && nCurResultIdx+1 < pReviewResult->GetSReviewResultCount())
        {
@@ -624,8 +624,8 @@
        pReviewResult->SetStartSReviewResultIndex(nStartResultIdx);
        pReviewResult->SetEndSReviewResultIndex(nEndResultIdx);
        // 나머지 포인트 리뷰 수행하자.
        ::Sleep(3000); // 딜레이는 필수임. 없으면 동작 안함.
        // ������ ����Ʈ ���� ��������.
        ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
           if (bLeftGantryReviewDone&&bRightGantryReviewDone)
           {
            
@@ -685,7 +685,7 @@
        }
    }
    // 결과 갱신.
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult, m_nReviewPlanIndex);
    return;
@@ -729,7 +729,7 @@
{
    if (m_pRP2P==NULL) return 0;
    // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -737,7 +737,7 @@
        return 1;
    }
    // 조건확인
    // ����Ȯ��
    if (pGlassResult->CheckReviewComplete())
    {
        // check motor ready!
@@ -763,7 +763,7 @@
{
    if (m_pRP2P==NULL) return 0;
    // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -771,7 +771,7 @@
        return 1;
    }
    // 조건확인
    // ����Ȯ��
    if (pGlassResult->CheckUserComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("User Last Point Complete! "));
@@ -796,7 +796,7 @@
{
    if (m_pRP2P==NULL) return 0;
    // 마지막 포인트인지 확인 후 PLC ReviewEnd 전송
    // ������ ����Ʈ���� Ȯ�� �� PLC ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -804,7 +804,7 @@
        return 1;
    }
    // 조건확인
    // ����Ȯ��
    if (pGlassResult->CheckReflowComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Reflow Last Point Complete! "));
@@ -829,7 +829,7 @@
{
    if (m_pRP2P==NULL) return 0;
    // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -837,7 +837,7 @@
        return 1;
    }
    // 조건확인
    // ����Ȯ��
    if (pGlassResult->CheckWsiComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Wsi Last Point Complete! "));
@@ -863,7 +863,7 @@
    g_pLog->DisplayMessage(_T("PostProcessMeasureResult[%d]"),nThreadIdx);
    if (m_pRP2P==NULL) return 0;
    // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -871,7 +871,7 @@
        return 1;
    }
    // 조건확인
    // ����Ȯ��
    if (pGlassResult->CheckMeasureComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Measure Last Point Complete! "));
@@ -900,7 +900,7 @@
{
    if (m_pRP2P==NULL) return 0;
    // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -908,7 +908,7 @@
        return 1;
    }
    // 조건확인
    // ����Ȯ��
    if (pGlassResult->CheckWsiReflowComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Wsi Reflow Last Point Complete! "));
@@ -932,7 +932,7 @@
{
    if (m_pRP2P==NULL) return 0;
    // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -940,7 +940,7 @@
        return 1;
    }
    // 조건확인
    // ����Ȯ��
    if (pGlassResult->CheckWsiUserComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("Wsi Last Point Complete! "));
@@ -965,7 +965,7 @@
{
    if (m_pRP2P == NULL) return 0;
    // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
    // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
    CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
    CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
    if (pGlassResult == NULL || pSequenceProcessor == NULL)
@@ -973,7 +973,7 @@
        return 1;
    }
    // 조건확인
    // ����Ȯ��
    if (pGlassResult->CheckWsiMultiShotComplete())
    {
        m_pRP2P->IRP2P_DisplayMessage(_T("WsiMultiShot Last Point Complete! "));
@@ -1138,23 +1138,23 @@
        return ReviewResult_Process_Fail;
    }
    
    // Snap 시간 저장.
    // 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 +1178,7 @@
        //    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
            // 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 20190917 chm
            strPath.Format(_T("%s\\%s"), m_strSaveImageUploadPath, pReviewResult->strUploadImgFileName);
            nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
@@ -1192,12 +1192,15 @@
                {
                    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]"), nSize, strRTMSPath);
                else m_pRP2P->IRP2P_DisplayMessage(_T("RTMS Review Image Save Success! Size: %d byte [%s] index[%d]"), nSize, strRTMSPath, pReviewResult->nDefectIdx); //taek 210128 �ӵ� ������ �ӽ÷� �α� ������ ����
            }
            if (nSize > 0)
            {
                
                 int aoiindex = CDitGlassRawClient::GetInstance()->GetDefectData(pReviewResult->nDefectidx2)->m_nDefectIdx;
                m_pRP2P->IRP2P_DisplayMessage(_T("Upload Review Image Save Success! Size: %d byte [%s] index[%d] AOI NO[%d]"), nSize, pReviewResult->strUploadImgFileName, pReviewResult->nDefectIdx, aoiindex); //taek 210128 속도 문제로 임시로 로그 남기지 않음
                //m_pRP2P->IRP2P_DisplayMessage(_T("Upload Review Image Save Success! Size: %d byte [%s]"), nSize, pReviewResult->strUploadImgFileName);
            }
@@ -1234,7 +1237,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) //190819chm 占쏙옙占쏙옙커占쏙옙 占싯띰옙 占쏙옙占?
    {
      if(pReviewResult->nLocation == DefectLoc_ASG || pReviewResult->nLocation == DefectLoc_PAD || pReviewResult->nLocation == DefectLoc_C2C)
      {
@@ -1336,12 +1339,12 @@
        return ReviewResult_Process_Fail;
    }
    // Snap 시간 저장.
    // 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)
    {
@@ -1354,7 +1357,7 @@
        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;
@@ -1373,10 +1376,10 @@
            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);  // ȭ�� 60% 150k
            if(GetReviewProcessStatus() == ReviewProcessStatus_UserStart)
            {
                // 업로드 이미지 경로 수정 20190917 chm
                // 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 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);
@@ -1398,7 +1401,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) //190819chm 占쏙옙占쏙옙커占쏙옙 占싯띰옙 占쏙옙占?
    {
        if(pReviewResult->nLocation == DefectLoc_ASG || pReviewResult->nLocation == DefectLoc_PAD || pReviewResult->nLocation == DefectLoc_C2C)
        {
@@ -1456,7 +1459,7 @@
    int nTestMode = FALSE;
    
    //시뮬 돌릴려는 이미지 파일 선택 20190827 chm
    //�ù� �������� �̹��� ���� ���� 20190827 chm
    if(nTestMode){
        Sleep(500);
        CString strPathName;
@@ -1478,12 +1481,12 @@
        return ReviewResult_Process_Fail;
    }
    // Snap 시간 저장.
    // 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)
    {
@@ -1499,8 +1502,8 @@
    }
    reflowParam reParam; //Reflow 연산 정보
    reflowResult reResult;//Reflow 결과 정보
    reflowParam reParam; //Reflow ���� ����
    reflowResult reResult;//Reflow 占쏙옙占?占쏙옙占쏙옙
    //////////////////////////////////////////////////////////////////////////////////////////////
    BOOL btFlag =0;
@@ -1512,10 +1515,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);//���� �̹����� Right ȸ�� ���� Right ���� ����
        pImageData = &tempImage;
        //reParam.nImageWidth = 2048;
        //reParam.nImageHeight = 2432;
@@ -1625,9 +1628,9 @@
    CCHImageData tmepData2;
    if(btFlag==1){
        CCHImageProcess::ImageRotate(pImageData,&tmepData2,135);//Right 연산후 다시 이미지 돌리기
        CCHImageProcess::ImageRotate(pImageData,&tmepData2,135);//Right ������ �ٽ� �̹��� ������
        pImageData= &tmepData2;
        //pImageData->SaveImage(_T("D:\\Testafter.bmp"));//Test 를 위한 bmp 저장
        //pImageData->SaveImage(_T("D:\\Testafter.bmp"));//Test �� ���� bmp ����
    }
@@ -1652,17 +1655,17 @@
            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);  // ȭ�� 60% 150k
            if(GetReviewProcessStatus() == ReviewProcessStatus_ReflowStart)
            {
                // 업로드 이미지 경로 수정 20190917 chm
                // 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 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
                //�ùĵ����� �̹��� �ڵ����� ������ 20190927chm
                if(nTestMode)
                {
                    CString csParam;
@@ -1682,7 +1685,7 @@
        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);
@@ -1895,7 +1898,7 @@
//파일명 181227 cmark
//���ϸ� 181227 cmark
BOOL CReviewProcessor_CPJT::MakeReviewImageFileName(SReviewResult* pReviewResult)
{
    if (m_pRP2P==NULL || pReviewResult==NULL) return FALSE;
@@ -1908,7 +1911,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 
@@ -1999,23 +2002,24 @@
        snapTime.GetHour(), snapTime.GetMinute(), snapTime.GetSecond());    // snap_time
    // [2017:4:10]-[WEZASW] : 고객사 요청에 의한 bmp 파일 추가 저장. (임시사용)
    // [2017:4:10]-[WEZASW] : 占쏙옙占쏙옙占?占쏙옙청占쏙옙 占쏙옙占쏙옙 bmp 占쏙옙占쏙옙 占쌩곤옙 占쏙옙占쏙옙. (占쌈시삼옙占?
    pReviewResult->strOrignalImgFileName = strFileName + _T(".bmp");
    strFileName += _T(".jpg");
    pReviewResult->strUploadImgFileName = strFileName;
    pReviewResult->strImgFileName = strFileName;
    pReviewResult->strImgFilePath = GetReviewUploadImagePath();
    return TRUE;
}
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]
    // wsi�� return ������ ���� [6/20/2017 bhs]
    return WsiResultSuccess;
}
@@ -2059,7 +2063,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 
@@ -2153,12 +2157,13 @@
    //         strFileName += pReviewResult->strSnapTime;
    //     }
    // [2017:4:10]-[WEZASW] : 고객사 요청에 의한 bmp 파일 추가 저장. (임시사용)
    // [2017:4:10]-[WEZASW] : 占쏙옙占쏙옙占?占쏙옙청占쏙옙 占쏙옙占쏙옙 bmp 占쏙옙占쏙옙 占쌩곤옙 占쏙옙占쏙옙. (占쌈시삼옙占?
    pReviewResult->strOrignalImgFileName = strFileName + _T(".bmp");
    strFileName += _T(".jpg");
    pReviewResult->strUploadImgFileName = strFileName;
    pReviewResult->strImgFileName = strFileName;
    pReviewResult->strImgFilePath = GetReviewUploadImagePath();
    return TRUE;
}
@@ -2229,13 +2234,13 @@
void CReviewProcessor_CPJT::LoadAoiImage(const CString& strGlassID, int nOpticType, int nPosX, int nPosY, CCHImageData* pAoiDark, CCHImageData *pAoiBright)
{
    // 3. 검사 결함 이미지 찾기
    // 3. �˻� ���� �̹��� ã��
    CString strAoiDarkPath = _T("");
    CString strAoiBrightPath = _T("");
    FindAoiDefectImagePath(strGlassID, nOpticType, nPosX, nPosY, strAoiDarkPath, strAoiBrightPath);
    // Dark, Bright 모두 찾기 위해 주석처리 [2017.7.1 bhs]
    // Dark, Bright 占쏙옙占?찾占쏙옙 占쏙옙占쏙옙 占쌍쇽옙처占쏙옙 [2017.7.1 bhs]
    // Dark image
    //if(nOpticType & DEFECT_OPTIC_DARK)
    {
@@ -2280,7 +2285,7 @@
    CFileFind finder;
    CString strSearchPath = _T("");
    // Dark, Bright 모두 찾기 위해 주석처리 [2017.7.1 bhs]
    // Dark, Bright 占쏙옙占?찾占쏙옙 占쏙옙占쏙옙 占쌍쇽옙처占쏙옙 [2017.7.1 bhs]
    //if (nOpticType & DEFECT_OPTIC_DARK)
    {
        // Dark field
@@ -2354,7 +2359,7 @@
            processTimer.End();
        }
        // 4-3. 리뷰평균 밝기
        // 4-3. 占쏙옙占쏙옙占쏙옙占?占쏙옙占?
        double dAverageGray = 0.0;
        if (CCHImageProcess::ImageAverage(&bandImage, dAverageGray)==1)
        {
@@ -2391,14 +2396,14 @@
    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)
@@ -2435,7 +2440,7 @@
    // set total size * scale
    int nTotalWidth        = int(m_nReviewResizeWidth * m_dReviewImageScale + 0.5);
    // 20170817 smok Dark, Bright 이미지가 리뷰 이미지 아래에 붙도록 수정
    // 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);
@@ -2461,14 +2466,14 @@
    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 占쏙옙占?X
    // draw text string
    DrawDefectInfo(&memDC, findResult, pReviewResult);
    
    //DrawAoiImage(&memDC, &pAoiDark2, &pAoiBright2, &pAoiDark2, &pAoiBright2, nAoiWidth, nAoiHeight);
    // draw line 히팅 검증용
    // draw line ���� ������
    //DrawCenterLine(&memDC, nTotalWidth, nTotalHeight);
   // DrawCenterRect(&memDC, nTotalWidth, nTotalHeight, 100, 100, pReviewResult->dMeasureResolution);
@@ -2496,7 +2501,7 @@
    nWidthDark = nHeightDark = nWidthBright = nHeightBright = 0;
    // 20170817 smok Dark, Bright 이미지가 리뷰 이미지 아래에 붙도록 수정
    // 20170817 smok Dark, Bright �̹����� ���� �̹��� �Ʒ��� �ٵ��� ����
    // dark
    CCHImageData subImage;
    if(pAoiDark!=NULL && pAoiDark->GetImageExist())
@@ -2577,11 +2582,11 @@
    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]
    // Dark, Bright 占싱뱄옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쌕듸옙占쏙옙 占쏙옙占쏙옙, Dark 占쏙옙, Bright 占싣뤄옙 - 占쏙옙占쏙옙占?占쏙옙청[2017.6.30 bhs]
    //int nX = nTotalWidth - nWidth;
    //int nY = nTotalHeight - (nHeight * 2);
    // 20170817 smok Dark, Bright 이미지가 리뷰 이미지 아래에 붙도록 수정
    // 20170817 smok Dark, Bright �̹����� ���� �̹��� �Ʒ��� �ٵ��� ����
    int nX = 0;
    int nY = nTotalHeight;
    pAoiDark1->ShowImage(pDC->m_hDC, nX, nY, pAoiDark1->GetWidth(), pAoiDark1->GetHeight(), 0, 0);
@@ -2589,7 +2594,7 @@
    //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]
    // 占싯삼옙 占싱뱄옙占쏙옙 占쌩앙울옙 화占쏙옙표 표占쏙옙 - 占쏙옙占쏙옙占?占쏙옙청 [2017.6.30 bhs]
    CFont Font;
    VERIFY(Font.CreateFont(
        50,                        // nHeight
@@ -2610,7 +2615,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)*/;
@@ -2813,7 +2818,7 @@
    else {
        wchar_t  pstrPrefix[128] ={};
        //Zone 넘버 210127
        //Zone �ѹ� 210127
        int nValue = 0;
        for (int i = 15; i >= 0; i--)
        {
@@ -2824,8 +2829,8 @@
        }
        //taek 210127
        //결과파일 좌표값 y 는 *-1을 하자
        //설비 ID, 검사 카메라 정보, 검사 Camera 정보 : (? ) 캠 ?, Cell ID,    Review Cam 정보 : Gantry 정보,    검출 Size,    검출 Zone 정보,    Stak Flag, CODE 정보, 좌표 정보
        //占쏙옙占쏙옙占쏙옙占?占쏙옙표占쏙옙 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(),
@@ -3040,7 +3045,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 
@@ -3117,7 +3122,7 @@
    //         strFileName += pReviewResult->strSnapTime;
    //     }
    // [2017:4:10]-[WEZASW] : 고객사 요청에 의한 bmp 파일 추가 저장. (임시사용)
    // [2017:4:10]-[WEZASW] : 占쏙옙占쏙옙占?占쏙옙청占쏙옙 占쏙옙占쏙옙 bmp 占쏙옙占쏙옙 占쌩곤옙 占쏙옙占쏙옙. (占쌈시삼옙占?
    pReviewResult->strOrignalImgFileName = strFileName + _T(".bmp");
    strFileName += _T(".jpg");
@@ -3163,7 +3168,7 @@
    int nStartResultIdx    = pReviewResult->GetStartSReviewResultIndex();
    int nEndResultIdx    = pReviewResult->GetEndSReviewResultIndex();
    // 인덱스가 현재 마지막 인덱스 보다 클시..
    // �ε����� ���� ������ �ε��� ���� Ŭ��..
    if (nCurResultIdx > nEndResultIdx)  
    {
        LeaveCriticalSection(&m_csUserCriticalSection);
@@ -3171,7 +3176,7 @@
        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;
@@ -3181,7 +3186,7 @@
    }
    //memcpy(wsiResult.nWsi_pReflowResultData, measureResut.pReflowResultData, sizeof(wsiResult.nWsi_pReflowResultData));
    
    // 결과 데이터 추가
    // 占쏙옙占?占쏙옙占쏙옙占쏙옙 占쌩곤옙
    SReviewResult *pProcessResult = NULL;
    if (pGlassResult->SetWsiReflowResultData(nModuleIndex, nCurResultIdx, wsiResult, nGlassPosX, nGlassPosY, nMotorPosX, nMotorPosY, dTime))
    {
@@ -3190,10 +3195,10 @@
        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);
@@ -3209,7 +3214,7 @@
    LeaveCriticalSection(&m_csUserCriticalSection);
    // 결과 갱신.
    // 占쏙옙占?占쏙옙占쏙옙.
    m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult, 5);
    return;
@@ -3218,7 +3223,7 @@
    return;
}
//0129cmark 원점 위치별 센터 좌표를 원점 좌표로 변형
//0129cmark ���� ��ġ�� ���� ��ǥ�� ���� ��ǥ�� ����
double CReviewProcessor_CPJT::GetCentertoOrginCoordinate(double dPosX,double dPosY,int nCornercut,int nOriginDirection){
    double nResultPosX=0.0;
@@ -3227,60 +3232,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;
@@ -3289,13 +3294,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;
@@ -3303,33 +3308,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;
@@ -3354,7 +3359,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 
@@ -3418,24 +3423,31 @@
{
    if(pReviewResult == NULL)    return FALSE;
    //결과파일 공유 메모리 리뷰 이미지 이름 및 좌표 채워주기
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨몌옙 占쏙옙占쏙옙 占싱뱄옙占쏙옙 占싱몌옙 占쏙옙 占쏙옙표 채占쏙옙占쌍깍옙
    CDitGlassRawClient *pDitGlassRawCleint = CDitGlassRawClient::GetInstance();
    if(pDitGlassRawCleint->isConnect() == TRUE)
    {
        
        _grmDefectData* pSharedDefect = pDitGlassRawCleint->GetDefectData(pReviewResult->nDefectidx2);
        _grmDefectReviewData * pSharedDefectReview = &pSharedDefect->m_ReviewDefect;
        _grmGlassData* pSharedGlassData = pDitGlassRawCleint->GetGlassData();
        
        //size_t CharactersConverted;
        //wcstombs_s(&CharactersConverted, pSharedDefectReview->m_strRevImageName, pReviewResult->strImgFileName, _TRUNCATE);
        strcpy(pSharedDefectReview->m_strRevImageName,pReviewResult->strImgFileName.MakeLower());
        
        //taek 210624 ���� ���� �� ���ش�.
        pSharedDefectReview->m_nPlanType =  ditRaw::RPT_Review;    //0:None, 1:Location(User, Fiexed) Review, 4:reflower, ??:Wsi, 1000:AOI(외부 로컬 리뷰 명령)
        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_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;
@@ -3449,11 +3461,11 @@
BOOL CReviewProcessor_CPJT::UpdateMemoryUserPlan( SReviewResult* pReviewResult )
{
    //결과파일 공유 메모리 리뷰 이미지 이름 및 좌표 채워주기
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨몌옙 占쏙옙占쏙옙 占싱뱄옙占쏙옙 占싱몌옙 占쏙옙 占쏙옙표 채占쏙옙占쌍깍옙
    CDitGlassRawClient *pDitRawClient = CDitGlassRawClient::GetInstance();
    if(pDitRawClient->isConnect() == TRUE)
    {
        int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow 는 검사 디펙 이후 생성되기에 디펙 카운트보다 같거나 큰값을 가지고 있다
        int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow �� �˻� ���� ���� �����DZ⿡ ���� ī��Ʈ���� ���ų� ū���� ������ �ִ�
        if(pReviewResult->nDefectIdx <nDefectCount)
        {    
            return FALSE;
@@ -3466,14 +3478,16 @@
        
        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;
        pSharedDefectReview->m_nModuleIndex;
        pSharedDefect->m_nModelIdx = pReviewResult->nModuleIdx;
        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("[�����޸�����]�ε���[%d]���ϸ�[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
    }
@@ -3483,7 +3497,7 @@
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("");
@@ -3505,7 +3519,7 @@
                nReflowjuge=1;
            }
            // 고객사 요청으로 수정함. 0,1 Position은 Pass
            // 占쏙옙占쏙옙占?占쏙옙청占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙. 0,1 Position占쏙옙 Pass
            else if(nReflowjuge == 3 || nReflowjuge == 2)
            {
                m_pRP2P->IRP2P_DisplayMessage(_T("[ReflowResult] Reflow Judge Is No OverFlow %d"),nReflowjuge);
@@ -3524,7 +3538,7 @@
                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
            //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;
@@ -3541,7 +3555,7 @@
    if(pDitRawClient->isConnect() == TRUE)
    {
        int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow 는 검사 디펙 이후 생성되기에 디펙 카운트보다 같거나 큰값을 가지고 있다
        int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow �� �˻� ���� ���� �����DZ⿡ ���� ī��Ʈ���� ���ų� ū���� ������ �ִ�
        if(pReviewResult->nDefectidx2 <nDefectCount)
        {
            return FALSE;
@@ -3556,11 +3570,11 @@
        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
        //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("[�����޸�����]�ε���[%d]���ϸ�[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
    }
    
    return TRUE;
@@ -3570,7 +3584,7 @@
{
    if(pReviewResult == NULL)    return FALSE;
    //결과파일 공유 메모리에 결과 채워 넣기
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
    CDitGlassRawClient *pDitGlassRawClient = CDitGlassRawClient::GetInstance();
    if(pDitGlassRawClient->isConnect() == TRUE)
@@ -3587,7 +3601,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;/* nWSIType;                                    // �Ը� / ���� //wsi ���� */
        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
@@ -3597,7 +3611,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;//20�� ����
        pSharedDefectReview->m_dWsiMmMotorX=pReviewResult->dTargetMotorX;
        pSharedDefectReview->m_dWsiMmMotorY=pReviewResult->dTargetMotorY;
        
@@ -3612,7 +3626,7 @@
BOOL CReviewProcessor_CPJT::UpdateMemoryWsiReflowPlan( SReviewResult* pReviewResult )
{
    if(pReviewResult == NULL)    return FALSE;
    //결과파일 공유 메모리에 결과 채워 넣기
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
    CDitGlassRawClient *pDitRawClient = CDitGlassRawClient::GetInstance();
    
@@ -3626,13 +3640,13 @@
    /*
    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까지의 거리
    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;
@@ -3643,7 +3657,7 @@
    
    nWsiReflowJudge  = pReviewResult->nWsi_ResultCode;
    //nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[0] //A 1차 신경안씀
    //nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[0] //A 1占쏙옙 占신곤옙횡占?
    nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[1];//B
    nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[2];//C
    //nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[3];//D
@@ -3703,7 +3717,7 @@
{
    if(pReviewResult == NULL)    return FALSE;
    //결과파일 공유 메모리에 결과 채워 넣기
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
    CDitGlassRawClient *pDitGlassRawClient = CDitGlassRawClient::GetInstance();
    if(pDitGlassRawClient->isConnect() == TRUE)
@@ -3720,13 +3734,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;//20�� ����
        pSharedDefectReview->m_dWsiMmMotorX=pReviewResult->dTargetMotorX;
        pSharedDefectReview->m_dWsiMmMotorY=pReviewResult->dTargetMotorY;
    }
@@ -3738,7 +3752,7 @@
{
    if (pReviewResult == NULL)    return FALSE;
    //결과파일 공유 메모리에 결과 채워 넣기
    //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
    CDitGlassRawClient *pDitGlassRawClient = CDitGlassRawClient::GetInstance();
    if (pDitGlassRawClient->isConnect() == TRUE)
@@ -3755,13 +3769,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;//20�� ����
        pSharedDefectReview->m_dWsiMmMotorX = pReviewResult->dTargetMotorX;
        pSharedDefectReview->m_dWsiMmMotorY = pReviewResult->dTargetMotorY;
@@ -3792,7 +3806,7 @@
    double TempValue = 0;
    double m_nResultFocusValue = 0;
    // 원점 XY 기준 X+1, Y+1에 대한 차영상
    // ���� XY ���� X+1, Y+1�� ���� ������
    for (int y = 0; y < nHeight - 1; y++)
    {
        for (int x = 0; x < nWidth - 1; x++)
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 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占?PlanType 占쏙옙호 占쏙옙占쏙옙.
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)"));
    }
}
    
@@ -184,16 +184,16 @@
    
    BOOL bReturn = FALSE;
    // 현재 상태가 이전 상태와 다른가?
    // ���� ���°� ���� ���¿� �ٸ���?
    
    //if (nProcessStatus!=m_nProcessStatus || nProcessStatus==0)
    if (1)//nProcessStatus!=m_nProcessStatus || nProcessStatus==0)
    {
        //if (nProcessStatus==0) // 초기(0) 상태이면..
        //if (nProcessStatus==0) // �ʱ�(0) �����̸�..
        //{
        //    bReturn = TRUE;
        //}
        //    else if (nProcessStatus==(m_nProcessStatus+1)) // 이전 상태 다음(+1)이면..
        //    else if (nProcessStatus==(m_nProcessStatus+1)) // ���� ���� ����(+1)�̸�..
        //    {
        //        bReturn = TRUE;
        //    }
@@ -204,9 +204,9 @@
        //    bReturn = FALSE;
        //}
        
        if (bReturn) // 수행이면...
        if (bReturn) // �����̸�...
        {
            // Thread 생성 후 Thread 수행
            // Thread ���� �� Thread ����
            CSequenceProcessData* pThreadData = new CSequenceProcessData(this);
            if (pThreadData)
            {
@@ -227,7 +227,7 @@
            }
        }
        else if(nProcessStatus==2){
            // Thread 생성 후 Thread 수행
            // Thread ���� �� Thread ����
            CSequenceProcessData* pThreadData = new CSequenceProcessData(this);
            if (pThreadData)
            {
@@ -277,7 +277,7 @@
    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 +291,13 @@
    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 +324,7 @@
    // set last result idx
    pWsiResult->SetLastSReviewResultIndex(nCurResultIdx);
    // 마지막 포인트까지 왔고, WSI 결과가 남아 있으면...
    // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, WSI 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
    if(nCurResultIdx==nEndResultIdx && nCurResultIdx<=pWsiResult->GetSReviewResultCount())
    {
        nStartResultIdx = nCurResultIdx + 1;
@@ -335,8 +335,8 @@
        pWsiResult->SetStartSReviewResultIndex(nStartResultIdx);
        pWsiResult->SetEndSReviewResultIndex(nEndResultIdx);
        // 나머지 포인트 리뷰 수행하자.
        ::Sleep(3000); // 딜레이는 필수임. 없으면 동작 안함.
        // ������ ����Ʈ ���� ��������.
        ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
//        Process_RemainWsiPoint(nModuleIndex);
    }
@@ -362,7 +362,7 @@
    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 +376,13 @@
    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 +407,7 @@
    // set last result idx
    pWsiResult->SetLastSReviewResultIndex(nCurResultIdx);
    // 마지막 포인트까지 왔고, WSI 결과가 남아 있으면...
    // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, WSI 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
    if(nCurResultIdx==nEndResultIdx && nCurResultIdx<=pWsiResult->GetSReviewResultCount())
    {
        nStartResultIdx = nCurResultIdx + 1;
@@ -418,8 +418,8 @@
        pWsiResult->SetStartSReviewResultIndex(nStartResultIdx);
        pWsiResult->SetEndSReviewResultIndex(nEndResultIdx);
        // 나머지 포인트 리뷰 수행하자.
        ::Sleep(3000); // 딜레이는 필수임. 없으면 동작 안함.
        // ������ ����Ʈ ���� ��������.
        ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
        //        Process_RemainWsiPoint(nModuleIndex);
    }
@@ -449,7 +449,7 @@
     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 +463,25 @@
             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 +490,38 @@
             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
                 // 占쏙옙占쏙옙占?ReProcess
                 if (pAlignCameraControl->AlignProcess())
                 {
                     g_pLog->DisplayMessage(_T("[AlignResult] Align Find Process ReStarted!"));
@@ -556,8 +556,8 @@
         //m_pView->SetAlignResult(pAlignResult->nResultCode, sAlignResult.dOriginX, sAlignResult.dOriginY, sAlignResult.dDegree);
     }
 
    // PCControl 얼라인 신호 전송.
    if (bLastAlignResult) // 최종 얼라인결과...
    // PCControl 占쏙옙占쏙옙占?占쏙옙호 占쏙옙占쏙옙.
    if (bLastAlignResult) // ���� ����ΰ��...
    {    
        SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Success Data!"));
@@ -690,12 +690,12 @@
        m_pSP2P->ISP2P_UpdateReviewProcessStatus(ReviewProcessStatus_None, nPlanIndex);
         
        //데모용
        //占쏙옙占쏙옙占?
        AFM_SetAFMTracking(FALSE);
        return;
    }
    //190727 chm WSI 진행시 End 체크 후 진행
    //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 +724,13 @@
        }
    }
    //190727 chm WSI type 진행후 Review 플랜시 진행시 카메라가 글라스 밖에 있을경우를 위한...
    //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(); // 占쏙옙占쏙옙占쏙옙占? 20190730 chm 占쏙옙占쌩울옙 占쌉쇽옙占쏙옙 占쏙옙占쏙옙....
    
            const CMotorControlInfo* pSystemMotorInfo = m_pSP2P->ISP2P_System_GetMotorInfo();
            if(pSystemMotorInfo !=NULL) 
@@ -774,8 +774,8 @@
        if(pPlanInfo == NULL) continue;
        //210325
        //END 나 언로딩이 되어버렸지만 해당 함수가 쓰레드로 돌아가고 있어 start 함수를 타버림
        //그것에 대한 예외처리
        //END 占쏙옙 占쏙옙琯占쏙옙占?占실억옙占쏙옙占쏙옙占쏙옙占?占쌔댐옙 占쌉쇽옙占쏙옙 占쏙옙占쏙옙占쏙옙占?占쏙옙占싣곤옙占쏙옙 占쌍억옙 start 占쌉쇽옙占쏙옙 타占쏙옙占쏙옙
        //�װͿ� ���� ����ó��
        if (GetProcessStatus() == ProcessReviewEnd_CPJT || GetProcessStatus() == ProcessReviewUnloding_CPJT)
        {
            g_pLog->DisplayMessage(_T("[ProcessStop] StartProcessing Sequence Stop Status : %d"), GetProcessStatus());
@@ -830,7 +830,7 @@
                m_pSP2P->ISP2P_DisplayMessage(_T("[Sequence Processor] WSI Plan End!"));
            }
            break;
        //미사용
        //占싱삼옙占?
        case CPJT_PlanMeasure:
            if (( nTotalCount += pGlassResult->GetTotalSMeasureResultCount()) > 0)
            {
@@ -939,8 +939,8 @@
    AllAckSignalOff();
    m_pSP2P->ISP2P_GetReviewProcessor()->ResetGantryDone();
    SetCheckWSIEnd(-1); //190726 wsiend체크 초기화
    SetWsiType(-1);    //wsi reflow 타입 구별 초기화
    SetCheckWSIEnd(-1); //190726 wsiendüũ �ʱ�ȭ
    SetWsiType(-1);    //wsi reflow Ÿ�� ���� �ʱ�ȭ
    SetLastPointCheck(FALSE);
    bFileFind = FALSE;
@@ -967,18 +967,18 @@
     }
     m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Glass Result Count : %d ea"), nGlassResultCount);
    
    pGlassResult->ResetDefocusCount();//로딩 부분에서 defocus count 초기화 190821 chm
    pGlassResult->ResetDefocusCount();//�ε� �κп��� defocus count �ʱ�ȭ 190821 chm
     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)) // ������ HOME ������
    //{
    //    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)
    {
@@ -986,7 +986,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;
@@ -1013,7 +1013,7 @@
            if (pDitRawClient->isConnect()==FALSE)
            {
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]공유메모리 연결 끊김 재연결 시도 "));
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]�����޸� ���� ���� �翬�� �õ� "));
                int nReconnect=0;
                while (1)
                {
@@ -1028,11 +1028,11 @@
                    Sleep(1000);
                    if (pDitRawClient->isConnect() == FALSE)
                    {
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]공유메모리 연결 실패 Count[%d]"), nReconnect);
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]�����޸� ���� ���� Count[%d]"), nReconnect);
                    }
                    else
                    {
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]공유메모리 연결 성공"));
                        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]�����޸� ���� ����"));
                        break;
                    }
                    nReconnect += 1;
@@ -1042,9 +1042,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;
@@ -1061,9 +1061,12 @@
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Success Signal!"));
            strFileName.Format(_T("%s_%s"), strGlassIDTemp, strGlassStepIdTemp);
            //업데이트시
            bFileFind = FindRawBinFile(strFileName);
            //bFileFind = TRUE;
            //bFileFind = FindRawBinFile(strFileName);
            bFileFind = TRUE;
            pDitRawClient->SetReviewStart();
            Sleep(1000);
@@ -1108,7 +1111,7 @@
         }
     }
    //// 190725 고객사 요청사항 chm ASCEND 시 alarm
    //// 190725 占쏙옙占쏙옙占?占쏙옙청占쏙옙占쏙옙 chm ASCEND 占쏙옙 alarm
    const CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
    const CRcpSortingInfo *pSortingInfo = pRsRcpReviewInfo->GetRcpReviewSortInfo();
@@ -1125,7 +1128,7 @@
    
    
    ////레시피 세팅으로 옴김 190618
    ////������ �������� �ȱ� 190618
    if(GetUseAfmHomePosition())
    {
    g_pLog->DisplayMessage(_T("[AFM] AFM Home Position Start!!!"));
@@ -1134,7 +1137,7 @@
    }
    //공유메모리 커멘드 리뷰 스타트(글라스 로딩)
    //占쏙옙占쏙옙占쌨몌옙 커占쏙옙占?占쏙옙占쏙옙 占쏙옙타트(占쌜띰옙 占싸듸옙)
    CDitGlassRawClient* pDitSharedGlassRaw = CDitGlassRawClient::GetInstance();
    if (pDitSharedGlassRaw->isConnect() == FALSE) {
        m_pSP2P->ISP2P_DisplayMessage(_T("[DitGlassRawClient] Shared Memory Connect Fail"));
@@ -1187,7 +1190,7 @@
     CReviewProcessor* pReviewProcessor = m_pSP2P->ISP2P_GetReviewProcessor();
     if(pReviewProcessor == NULL) return ;    
     pReviewProcessor->SetCellData(pGlassResult);
     pReviewProcessor->SetReviewCount(0);            // 리뷰 Sequence No 초기화.
     pReviewProcessor->SetReviewCount(0);            // ���� Sequence No �ʱ�ȭ.
    pReviewProcessor->SetPlanReviewCount(0);
    pReviewProcessor->SetPlanWSICount(0);
     // Process Status Update
@@ -1228,7 +1231,7 @@
    if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_AlignStartAck_CPJT))
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Start Ack!"));
    //Sleep(400);//프레임 문제 딜레이 주기 chm190602
    //Sleep(400);//占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占?占쌍깍옙 chm190602
     // 1. get current glass result
     CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
@@ -1252,7 +1255,7 @@
    }
    else
    {
        // 190710 SJB Align Camera Disconnect Check, Align Step 진행 전에 확인한다.
        // 190710 SJB Align Camera Disconnect Check, Align Step ���� ���� Ȯ���Ѵ�.
        if(pAlignCameraControl)
        {
            if(pAlignCameraControl->AlignCameraDisconnectCheck() == FALSE)
@@ -1268,9 +1271,9 @@
        }
        else
        {
            //지워야됨
            //�����ߵ�
            Sleep(1000);
            //TEST 모드
            //TEST 占쏙옙占?
            {
                SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
                m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align SUCCESS Data!"));
@@ -1279,7 +1282,7 @@
        }
            //주석 풀기
            //�ּ� Ǯ��
            // 4. send align fail signal to plc
            //SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
            //m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Fail Data!"));
@@ -1313,7 +1316,7 @@
     if (bFileFind == FALSE)
    {
        SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] 결과파일 찾기 실패"));
        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] 占쏙옙占쏙옙占쏙옙占?찾占쏙옙 占쏙옙占쏙옙"));
        return;
    }    
@@ -1321,7 +1324,7 @@
    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"));
@@ -1348,7 +1351,7 @@
        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);
@@ -1361,7 +1364,7 @@
        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);
@@ -1369,7 +1372,7 @@
        //            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] Send Review Ready Signal!"));
        //}
        //주석 해제
        //�ּ� ����
        int nCurPlanIndex = 0;
        CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
        if(pRsRcpReviewInfo)
@@ -1391,8 +1394,8 @@
        }
    }
    //// [2017:5:24]-[WEZASW] : Review Image Upload Dir 생성.(FTPUploader에서 자동 삭제 되더라도 실제 리뷰시 생성)
    //// '반복검사'시 FTPUploader에서 업로드 후 삭제 시점과 PCControl Glass Unloading 후 즉시 Loading시 Review에서의 업로드 경로(GlassID) 생성 시점 오류
    //// [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)
@@ -1407,7 +1410,7 @@
    if (CDitGlassRawClient::GetInstance()->GetGlassData() == NULL) return;
    
    //업로드 폴더가 없으면 폴더 생성후 다시 업로드 경로 Set 20190917chm
    //占쏙옙占싸듸옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쌕쏙옙 占쏙옙占싸듸옙 占쏙옙占?Set 20190917chm
    if(Uploadfile.FindFile(strPath)==FALSE)
    {
        CTime tmServerLoadingTime = CDitGlassRawClient::GetInstance()->GetGlassData()->m_tmGlassLoading;
@@ -1418,7 +1421,7 @@
        
        //taek 210126 rtms 보고용 이미지 폴더 생성
        //taek 210126 rtms 占쏙옙占쏙옙占?占싱뱄옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙
        CreateDirectory(pReviewProcessor->GetRTMSUploadImagePath(),NULL);
    }
@@ -1464,10 +1467,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); // ����, �۾��� ���� ������
    //            }
    //        }
    //    }
@@ -1475,7 +1478,7 @@
    //    {
    //        m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor] TotalPitchMeasure Result Fail!"));
    //        // 190711 SJB, TotalPitchMeasure Fail시에 바로 Motor로 명령을 날리기 보다는 Motion Enable 신호를 확인하자
    //        // 190711 SJB, TotalPitchMeasure Fail占시울옙 占쌕뤄옙 Motor占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占쏙옙占쌕댐옙 Motion Enable 占쏙옙호占쏙옙 확占쏙옙占쏙옙占쏙옙
    //        
    //        if(!pTotapPithMeasure->GetMotorEnable())
    //        {
@@ -1507,9 +1510,9 @@
    }
    else
    {
        //지워야됨
        //�����ߵ�
        //Sleep(1000);
        //Test모드
        //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!"));
@@ -1538,17 +1541,21 @@
    }
    if (GetLastPointCheck() == FALSE)
    {
        Sleep(2500);
        Sleep(1000);
    }
    ReJudgeProcessing(m_pDitGlassRaw);
    m_pDitGlassRaw->GetGlassData()->m_tmReviewEnd = CTime::GetCurrentTime();
    if (m_pDitGlassRaw->isConnect() != FALSE)    m_pDitGlassRaw->SetReviewEnd();
    if (m_pDitGlassRaw->isConnect() != FALSE)
    {
        m_pDitGlassRaw->SetReviewEnd();
        m_pDitGlassRaw->WriteReviewRawBinFile();
    }
    
    m_pDitGlassRaw->GetGlassData()->m_nReviewNum = m_pSP2P->ISP2P_GetReviewProcessor()->GetPlanReviewCount();
    //SendDVDataToSignalControl();// 안쓰쥬
    //SendDVDataToSignalControl();// �Ⱦ���
    //OverTime 발생시 제어에서 END ACK를 기다리는게 아니라 걍 Conplete를 기다린다.
    //음 ... 로직  오류인데일단 추가
    //OverTime 占쌩삼옙占쏙옙 占쏙옙占쏘에占쏙옙 END ACK占쏙옙 占쏙옙摸占쏙옙째占?占싣니띰옙 占쏙옙 Conplete占쏙옙 占쏙옙摸占쏙옙占?
    //�� ... ����  �����ε��ϴ� �߰�
    if (GetLastPointCheck() == FALSE)
    {
@@ -1575,10 +1582,10 @@
        m_pSP2P->ISP2P_GetWSIControl(0)->SendWsiAfmSafePosMove();
        m_pSP2P->ISP2P_GetWSIControl(1)->SendWsiAfmSafePosMove();
    }
    // 결과파일 생성은 Review에서 관여 안함
    // 占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙占쏙옙 Review占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙
    if(m_pDitGlassRaw->isConnect()==FALSE)        WriteRawData(pGlassResult);
    
    //디포커스 알람 send 20190819chm
    //����Ŀ�� �˶� send 20190819chm
    if(pGlassResult->m_nDeFocusCount >0) 
    {
        SendSignalToSignalControl(PCControlSendSignalIndex_State,PCControlSend_Defoucs,1000);
@@ -1588,8 +1595,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);//��Ż ī��Ʈ Add
        CDlgDefocusList::GetInstance()->SetDefocusData(strTime,pGlassResult->m_strGlassID,pGlassResult->m_nDeFocusCount);//ui �߰��� ����
    }
@@ -1603,17 +1610,17 @@
    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(); //0503 占쏙옙占쏙옙 End占쏙옙 占쏙옙占쏙옙占?0占쏙옙占쏙옙 占십깍옙화
    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);
@@ -1655,8 +1662,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;
@@ -1670,7 +1677,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
@@ -1684,10 +1691,10 @@
        {
#pragma region 얼라인 fail
#pragma region 占쏙옙占쏙옙占?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] 占쏙옙占쏙옙占?占쏙옙占쏙옙 WSI 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙"));
                break;
            }
#pragma endregion
@@ -1725,7 +1732,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] ������ ���͸� Pixel Size[%d] nPixelFilterSize [%d]"), nPixelSize,nPixelFilterSize);
                continue;    
            }
#pragma endregion
@@ -1735,13 +1742,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;
@@ -1754,7 +1761,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;
@@ -1763,7 +1770,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;
                    }
@@ -1813,13 +1820,13 @@
                        }
                    }
                    else if (fWsiData<=0) // 0이하 값은 재판정 진행을 안한다.
                    else if (fWsiData<=0) // 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 ����[%0.3lf] <= 0 ���� ���� ����"), nJudgeType, fWsiData);
                    }
                    else
                    {
                        //20210419 TR 고정으로 Judge 보다 낮을경우 OK ㄱㄱ
                        //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)
@@ -1870,7 +1877,7 @@
                }
                else //WSI TYPE 이 아니면
                else //WSI TYPE �� �ƴϸ�
                {
                    continue;
                }
@@ -1884,13 +1891,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 kyh����
                {
                    BOOL isZoneValue = FALSE;
@@ -1903,7 +1910,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;
@@ -1912,7 +1919,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;
                    }
@@ -1966,7 +1973,7 @@
                    }
                    else
                    {
                        //20210419 TR 고정으로 Judge 보다 낮을경우 OK ㄱㄱ
                        //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)
@@ -2018,7 +2025,7 @@
                }
                else //WSI TYPE 이 아니면
                else //WSI TYPE �� �ƴϸ�
                {
                    continue;
                }
@@ -2033,7 +2040,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 kyh����
                {
                    nJudgeType = ReJugdeWSIType(nFilterType);
@@ -2086,7 +2093,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;
                }
@@ -2097,7 +2104,7 @@
        }
        
#pragma region CELLJUDGE
    //CELL 재판정////////////////////////////////////////////////////////////////
    //CELL ������////////////////////////////////////////////////////////////////
    int nCellCount = pRawData->GetGlassData()->m_nCellNum;
@@ -2116,7 +2123,7 @@
        else if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_OK_CPJT)
        {
            nCelllOKJuge = nCelllOKJuge + 1;
        } //taek 21.01.25 Juge 구하는 곳을 새롭게 바꾸자...
        } //taek 21.01.25 Juge ���ϴ� ���� ���Ӱ� �ٲ���...
        else if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_PR_CPJT)
        {
            nCelllPRJuge = nCelllPRJuge + 1;
@@ -2160,7 +2167,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] ī��Ʈ ������ ������ [%02d]Cell DefectTRCount[%d] >= [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetJudgeCount());
                }
                break;
            case JudgeType_T8_PR:
@@ -2210,7 +2217,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] ī��Ʈ ������ ������ [%02d]Cell DefectTRCount[%d] <= [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetSubJudgeCount());
                }
                break;
            case JudgeType_T8_PR:
@@ -2374,7 +2381,7 @@
    }
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] CELL COUNT OK:[%d] TR[%d] PR[%d]"), nCelllOKJuge, nCellTRJudge, nCelllPRJuge);
#pragma endregion
    //GLASS 재판정////////////////////////////////////////////////////////////////
    //GLASS ������////////////////////////////////////////////////////////////////
#pragma region GLASSJUDGE
    CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
    if (pRsRcpReviewInfo == NULL) return FALSE;
@@ -2422,7 +2429,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 ī��Ʈ�� ������ [%02d]GLASS Defect TR Count[%d] >= [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetJudgeCount());
            }
            break;
        case JudgeType_T8_PR:
@@ -2472,7 +2479,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ī��Ʈ�� ������ [%02d]GLASS Defect TR Count[%d] <= [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgeTR, pRcpJudgeInfo->GetSubJudgeCount());
            }
            break;
        case JudgeType_T8_PR:
@@ -2660,7 +2667,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;
@@ -2669,9 +2676,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;
@@ -2683,7 +2690,7 @@
                    parser.process(pFileName, "_.");
                    if (parser.getTokNum() < 4) continue;
                    
                    if (parser.getTokNum() >= 6) continue; // 0401 추가
                    if (parser.getTokNum() >= 6) continue; // 0401 �߰�
                    int nDataTime[8] = {};
                    {
@@ -2711,7 +2718,7 @@
            {
                if (mapSpanFileName.begin()->first < nCloseTime)
                {
                    //가장 최근 결과파일 찾기 성공 [김태현 2019/7/17]
                    //占쏙옙占쏙옙 占쌍깍옙 占쏙옙占쏙옙占쏙옙占?찾占쏙옙 占쏙옙占쏙옙 [占쏙옙占쏙옙占쏙옙 2019/7/17]
                    strFindFile = mapSpanFileName.begin()->second;
                    break;
                }
@@ -2771,7 +2778,7 @@
    int nPCControlReadDataCount = pSignalInfo->GetReadDataAddressCount();
    // [2017:1:9]-[WEZASW] : PCControl GlassData 항목 재정의.
    // [2017:1:9]-[WEZASW] : PCControl GlassData �׸� ������.
    if(pSignalInfo->GetUseContinuousReadAddress())
    {
        CString strReadAddress = _T("");
@@ -3150,11 +3157,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 �б�!"));
    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)
    {
@@ -3223,10 +3230,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 ��!"));
}
void CSequenceProcessor_CPJT::UpdateHistoryResultFromTransferData(CGlassResult *pHistoryResult, CGlassResult* pGlassResult)
@@ -3284,7 +3291,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;
@@ -3296,7 +3303,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] 占쏙옙占썰리 占쏙옙占쏙옙占?占쏙옙占쏙옙"));
    if (m_pSP2P==NULL) return;
    const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
@@ -3342,7 +3349,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] 占쏙옙占썰리 占쏙옙占쏙옙占?占쏙옙"));
}
@@ -3350,7 +3357,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] 占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙"));
    const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
    if(pNetworkInfo == NULL) return;
@@ -3358,6 +3365,7 @@
    if(pReviewProcessor == NULL) return;
    
    CString strPath = _T("");
    CString strImagePath = _T("");
    if(pNetworkInfo->m_strLocalImagePath.IsEmpty() == FALSE && strGlassID.IsEmpty() == FALSE)
    {
        CTime snapTime = CTime::GetCurrentTime();
@@ -3394,11 +3402,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]�����޸� ���� ���� Count[%d]"), nReconnect);
                }
                else
                {
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]공유메모리 연결 성공"));
                    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading]�����޸� ���� ����"));
                    break;
                }
                nReconnect += 1;
@@ -3413,25 +3421,29 @@
        {
            
            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_%04d%02d%02d%02d%02d%02d"), strGlassID, tmServerLoadingTime.GetYear(), tmServerLoadingTime.GetMonth(), tmServerLoadingTime.GetDay(), tmServerLoadingTime.GetHour(), tmServerLoadingTime.GetMinute(), tmServerLoadingTime.GetSecond());
            CreateDirectory(strPath, NULL);
            pReviewProcessor->SetUploadImagePath(strPath);
            pReviewProcessor->SetReviewImagePath(strImagePath);
        }
        else
        {
            tmServerLoadingTime = CTime::GetCurrentTime();
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] 공유메모리 접근이상"));
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] �����޸� �����̻�"));
            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);
            pReviewProcessor->SetUploadImagePath(strPath);
            pReviewProcessor->SetReviewImagePath(strImagePath);
        }
    }
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 이미지 패스 만들기 끝"));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙占쏙옙占?占쏙옙"));
}
void CSequenceProcessor_CPJT::SetSaveImageBasePathToAlignCameraControl(const CString& strGlassID)
{
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 얼라인 이미지 패스 시작 "));
    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占쏙옙占쏙옙占?占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙占쏙옙 "));
    const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
    if(pNetworkInfo == NULL) return;
@@ -3444,7 +3456,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] 占쏙옙占쏙옙占?占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙 "));
}
BOOL CSequenceProcessor_CPJT::ReadRecipeDataFromRecipeFile(const CString& strPPID_RC, CString& strRecipeName)// const CString& strPPID, CString& strRecipeName
@@ -3511,14 +3523,14 @@
{
    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;
@@ -3534,20 +3546,20 @@
    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)
@@ -3556,7 +3568,7 @@
                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);
@@ -3565,34 +3577,34 @@
        pGlassResult->SetCollisionDistanceX(int(pSystemInfo->m_dCollisionDistance*1000.));
    }
    // Align 정보
    // Align ����
    const CRsRcpAlignInfo* pRsRcpAlignInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpAlignInfo();
    // Align 정보 설정
    // Align ���� ����
    if (pGlassTypeInfo && pRsRcpAlignInfo)
    {
        // Align 마크 정보 설정 (픽셀, 모터, 글라스 위치)
        // 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;
@@ -3612,29 +3624,29 @@
        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
        // 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 카메라 방향 및 해상도 설정
        // Align ī�޶� ���� �� �ػ� ����
        int nAlignCameraInfoCount = 2;
        for(int nAlignCameraIdx = 0; nAlignCameraIdx < nAlignCameraInfoCount; nAlignCameraIdx++)
        {
            // Align 조명 값 가져오기.
            // Align ���� �� ��������.
            int nLightValue = 0;
            
            
@@ -3642,10 +3654,10 @@
            {
                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();
@@ -3654,8 +3666,8 @@
                {
                    if (AlignLightinfo->GetMaster()==1&& nAlignCameraIdx==1)
                    {
                        //얼라인 컨틀롤러가 하나만 연결되어 있을때 마스터 여부로 확인
                        //솔직히 이거 맞는지 모르겟다 아무도 안알랴쥼
                        //占쏙옙占쏙옙占?占쏙옙틀占싼뤄옙占쏙옙 占싹놂옙占쏙옙 占쏙옙占쏙옙퓸占?占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占싸뤄옙 확占쏙옙
                        //������ �̰� �´��� �𸣰ٴ� �ƹ��� �Ⱦ˷���
                        pLightControl = m_pSP2P->ISP2P_GetAlignLightControl(0);
                    }
@@ -3690,7 +3702,7 @@
            }
            
            // 얼라인 카메라 정보 가져오기
            // 占쏙옙占쏙옙占?카占쌨띰옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙
            const CAlignCameraInfo *pCameraInfo    = m_pSP2P->ISP2P_System_GetAlignCameraInfo(nAlignCameraIdx);
            if (pCameraInfo)
            {
@@ -3718,7 +3730,7 @@
                }
            }
            // 얼라인 템플릿 정보 가져오기
            // 占쏙옙占쏙옙占?占쏙옙占시몌옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙
            if((int)pGlassTypeInfo->m_vecTemplateImagePath.size() == nAlignCameraInfoCount)
            {
                pGlassResult->m_AlignRecipe.strTemplateName[nAlignCameraIdx] = pGlassTypeInfo->m_vecTemplateImagePath[nAlignCameraIdx];
@@ -3747,14 +3759,14 @@
            if (pRcpReviewAFMInfo)
            {
                int nRealAFMIndex = pRcpReviewAFMInfo->m_nRecipeIndex;
                if(nRealAFMIndex == -1)// 레시피에 선택된 배율의 실제 MagnificInfo Index를 알아옴
                if(nRealAFMIndex == -1)// �����ǿ� ���õ� ������ ���� MagnificInfo Index�� �˾ƿ�
                {
                    //-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Ȩ ������ ���� X
                {
                    SetUseAfmHomePosition(FALSE);
                }
@@ -3766,7 +3778,7 @@
        }
    }
    // 결함 찾기 레시피 설정
    // ���� ã�� ������ ����
    CReviewProcessor* pReviewProcessor = m_pSP2P->ISP2P_GetReviewProcessor();
    const CRsRcpDefectFindInfo* pRsRcpDefectFindInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpDefectFindInfo();
    if(pReviewProcessor && pRsRcpDefectFindInfo)
@@ -3817,7 +3829,7 @@
    CString strRawTDPath=_T(""), strRawCDPath=_T(""), strRawSDPath=_T("");
    // 결과파일 이름 찾기
    // 占쏙옙占쏙옙占쏙옙占?占싱몌옙 찾占쏙옙
    FindAOIRawFilePath(pGlassResult, &strRawTDPath, &strRawCDPath, &strRawSDPath);
    bRet = m_pSP2P->ISP2P_ReadAOIRawFileToGlassResult(strRawTDPath);
@@ -3871,7 +3883,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('.');        
@@ -4049,7 +4061,7 @@
        CModuleStatus*                    pModuleStatus    = Module_GetModuleStatus(nModuleIdx);        
        if (pModuleStatus == NULL) continue;
        //충돌거리 넣기
        //�浹�Ÿ� �ֱ�
        {
        double dCollisionPosX = pReviewResult->GetCollisionPositionX() / 1000.0;
@@ -4090,13 +4102,13 @@
        }
        //좌우 겐트리 동시이동
        //�¿� ��Ʈ�� �����̵�
        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
@@ -4106,7 +4118,7 @@
            SReviewResult* pReview = pReviewResult->GetSReviewResult(nResultIdx);
            if (pReview==NULL) continue;
            //200개 어드레스를 보낸후 완료시점에서 중복체크
            //200占쏙옙 占쏙옙藥뱄옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占싹뤄옙占쏙옙占쏙옙占쏙옙占?占쌩븝옙체크
            if (pReview->bCheckSendToMotor == FALSE)
            {
                pReview->bCheckSendToMotor = TRUE;
@@ -4153,7 +4165,7 @@
            }
        }
        //보낼 포인트가 있는지 없는지 체크
        //���� ����Ʈ�� �ִ��� ������ üũ
        if (vectorPosX.empty() ==TRUE)
        {
            g_pLog->DisplayMessage(_T("[GantryAutoGo] No Exist Send Point "), vectorPosX.size());
@@ -4185,13 +4197,13 @@
            int nTickCount = GetTickCount();
            while (1)
            {
                //5초 오버타임
                //5�� ����Ÿ��
                if ((GetTickCount() - nTickCount) > 5000)
                {
                    bOverTime = TRUE;
                    break;
                }
                //모터 모션 End 체크
                //占쏙옙占쏙옙 占쏙옙占?End 체크
                if (pMotorControl->IsGantryMotionEnd(pModuleStatus->GetGantryIndex()) == TRUE)
                {
                    if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
@@ -4210,15 +4222,15 @@
            }
            //5초후에도 안움직인다? 그럼 3번 재시도 ㄱㄱ
            //모션End 가 잘못 나올수도 있으니
            //5占쏙옙占식울옙占쏙옙 占싫울옙占쏙옙占싸댐옙? 占쌓뤄옙 3占쏙옙 占쏙옙천占?占쏙옙占쏙옙
            //���End �� �߸� ���ü��� ������
            if (bOverTime == TRUE)
            {
                for (int i = 0; i < 3; i++)
                {
                    Sleep(1000);
                    //모터가 움직일수 없는상태일때 Send 신호시 Fail 발생 가능 Retry 3번 ㄱㄱ
                    //���Ͱ� �����ϼ� ���»����϶� Send ��ȣ�� Fail �߻� ���� Retry 3�� ����
                    if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
                    {
                        nTotalCount += (int)vectorPosX.size();
@@ -4292,7 +4304,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);
@@ -4355,7 +4367,7 @@
        CModuleStatus*                    pModuleStatus = Module_GetModuleStatus(nModuleIdx);
        if (pModuleStatus == NULL) continue;
        //충돌거리 넣기
        //�浹�Ÿ� �ֱ�
        {
            double dCollisionPosX = pReviewResult->GetCollisionPositionX() / 1000.0;
@@ -4398,9 +4410,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;
@@ -4411,7 +4423,7 @@
            SReviewResult* pReview = pReviewResult->GetSReviewResult(nResultIdx);
            if (pReview == NULL) continue;
            //200개 어드레스를 보낸후 완료시점에서 중복체크
            //200占쏙옙 占쏙옙藥뱄옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占싹뤄옙占쏙옙占쏙옙占쏙옙占?占쌩븝옙체크
            if (pReview->bCheckSendToMotor == FALSE)
            {
                pReview->bCheckSendToMotor = TRUE;
@@ -4459,7 +4471,7 @@
            }
        }
        //보낼 포인트가 있는지 없는지 체크
        //���� ����Ʈ�� �ִ��� ������ üũ
        if (vectorPosX.empty() == TRUE)
        {
            g_pLog->DisplayMessage(_T("[GantryAutoGo] No Exist Send Point "), vectorPosX.size());
@@ -4524,7 +4536,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);
@@ -4537,7 +4549,7 @@
        MakeWSIUpLoadDirectory(pReviewProcessor->GetUploadImagePath());
        //20190219 chm 
        pReviewProcessor->SetReviewCount(0);            // 리뷰 Sequence No 초기화.
        pReviewProcessor->SetReviewCount(0);            // ���� Sequence No �ʱ�ȭ.
        return TRUE;
    }    
@@ -4550,7 +4562,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());
    }
    
@@ -4591,7 +4603,7 @@
    VectorDouble vectorCollisionPosX;
    vectorCollisionPosX.clear();
    //WSI 좌우 겐트리 동시이동
    //WSI �¿� ��Ʈ�� �����̵�
    pMotorControl->GantrySetTwoGantrySyncModeSend(1);
    
    // WSI result count
@@ -4604,7 +4616,7 @@
        CModuleStatus*                    pModuleStatus = Module_GetModuleStatus(nModuleIdx);
        if (pModuleStatus == NULL) continue;
        //충돌거리 넣기
        //�浹�Ÿ� �ֱ�
        {
            double dCollisionPosX = pWsiResult->GetCollisionPositionX() / 1000.0;
            double dCollisionPosY = 0.0;
@@ -4645,7 +4657,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;
@@ -4657,7 +4669,7 @@
            SReviewResult* pWsi = pWsiResult->GetSReviewResult(nResultIdx);
            if (pWsi == NULL) continue;
            //200개 어드레스를 보낸후 완료시점에서 중복체크
            //200占쏙옙 占쏙옙藥뱄옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占싹뤄옙占쏙옙占쏙옙占쏙옙占?占쌩븝옙체크
            if (pWsi->bCheckWSISendToMotor == FALSE)
            {
                pWsi->bCheckWSISendToMotor = TRUE;
@@ -4704,14 +4716,14 @@
            }
        }
        //보낼 포인트가 있는지 없는지 체크
        //���� ����Ʈ�� �ִ��� ������ üũ
        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
        {
@@ -4735,13 +4747,13 @@
                int nTickCount = GetTickCount();
                while (1)
                {
                    //5초 오버타임
                    //5�� ����Ÿ��
                    if ((GetTickCount() - nTickCount) > 5000)
                    {
                        bOverTime = TRUE;
                        break;
                    }
                    //모터 모션 End 체크
                    //占쏙옙占쏙옙 占쏙옙占?End 체크
                    if (pMotorControl->IsGantryMotionEnd(pModuleStatus->GetGantryIndex()) == TRUE)
                    {
                        if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
@@ -4760,15 +4772,15 @@
                }
                //5초후에도 안움직인다? 그럼 3번 재시도 ㄱㄱ
                //모션End 가 잘못 나올수도 있으니
                //5占쏙옙占식울옙占쏙옙 占싫울옙占쏙옙占싸댐옙? 占쌓뤄옙 3占쏙옙 占쏙옙천占?占쏙옙占쏙옙
                //���End �� �߸� ���ü��� ������
                if (bOverTime == TRUE)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        Sleep(1000);
                        //모터가 움직일수 없는상태일때 Send 신호시 Fail 발생 가능 Retry 3번 ㄱㄱ
                        //���Ͱ� �����ϼ� ���»����϶� Send ��ȣ�� Fail �߻� ���� Retry 3�� ����
                        if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
                        {
                            nTotalCount += (int)vectorPosX.size();
@@ -4903,9 +4915,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;
@@ -5007,7 +5019,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);
@@ -5082,7 +5094,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;
@@ -5188,7 +5200,7 @@
    int nTotalCount = 0;
    double dDefectPosX, dDefectPosY;
    // Module의 위치에 따른 ModuleStatus sorting
    // Module�� ��ġ�� ���� ModuleStatus sorting
    std::vector<CModuleStatus*> SortedModuleStatus;
    for(int nModuleIdx = 0; nModuleIdx < m_pSP2P->ISP2P_GetModuleStatusCount(); nModuleIdx++)
    {
@@ -5242,7 +5254,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;
@@ -5263,7 +5275,7 @@
                if(nHeaderIdx == 0)
                {
                    // 이동할 모터좌표 추가
                    // �̵��� ������ǥ �߰�
                    if((int)vectorPos.size() < MAX_MOTOR_ADDRESS_SIZE)
                    {
                        pSReviewResult->dTargetMotorX = dDefectPosX;
@@ -6531,7 +6543,7 @@
            // add user schedule result
            
            
            //공유메모리에 채워줄 리뷰할 갯수와 디펙 좌표를 구조체에 채워주는 장소
            //占쏙옙占쏙옙占쌨모리울옙 채占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙표占쏙옙 占쏙옙占쏙옙체占쏙옙 채占쏙옙占쌍댐옙 占쏙옙占?
            {
@@ -7246,7 +7258,7 @@
                break;
            }
            break;
        // 미사용
        // 占싱삼옙占?
        case CPJT_PlanMeasure:
            {
                const CRcpMeasureInfo *pRcpMeasureInfo = pRsRcpMeasureInfo->GetRcpMeasureInfo(0);
@@ -7379,7 +7391,7 @@
}
//CIM DV Data
BOOL CSequenceProcessor_CPJT::SendDVDataToSignalControl() // 수정
BOOL CSequenceProcessor_CPJT::SendDVDataToSignalControl() // ����
{
    CGlassResult *pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
    if (pGlassResult==NULL) return FALSE;
@@ -7404,7 +7416,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."));
@@ -7413,16 +7425,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();
@@ -7444,12 +7456,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�� ����
    ///////////////////////////////////////////////////////////////////////////
@@ -7496,8 +7508,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];
@@ -7515,7 +7527,7 @@
        nAlignResult01 = 0;
    }
    //파워?
    //�Ŀ�?
    nReviewAliveCamera00 = ReviewCamera_GetReviewCameraControl(0)->GetConnected() * 1000;
    nReviewAliveCamera01 = ReviewCamera_GetReviewCameraControl(1)->GetConnected() * 1000;
@@ -7533,7 +7545,7 @@
        wsprintf(DriveText, TEXT("%C:"), Drive);
        UINT type = GetDriveType(DriveText);
        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) {
@@ -7747,7 +7759,7 @@
    pSignalControl->WritePacketData(_T("15100"), sizeof(DVDataPack_CPJT), (short*)&DVData);*/
}
//#3358 KYH FDC 데이터 전송 시점 개선 ADD START
//#3358 KYH FDC ������ ���� ���� ���� ADD START
void CSequenceProcessor_CPJT::MakeDVData2()
{
@@ -7760,9 +7772,9 @@
    }
    else
    {
    // Review 조명 정보
    // Review ���� ����
        pReviewLightInfo = pRsRcpReviewInfo->GetRcpLightInfo(0);
    // Review AFM 정보
    // Review AFM ����
        pReviewAFMInfo = pRsRcpReviewInfo->GetRcpAFMRecipeInfo(0);
    }
@@ -7786,7 +7798,7 @@
    // Review 배율 정보
    // Review ���� ����
    const CModuleStatus* pModuleStatus = Module_GetModuleStatus(0);
    const SMagnificInfo* pSMagnificInfo = NULL;
    if (pModuleStatus == NULL)
@@ -7888,8 +7900,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];
@@ -7929,7 +7941,7 @@
        nAlignResult01 = 1000;
    }
    //파워?
    //�Ŀ�?
    if (ReviewCamera_GetReviewCameraControl(0) != NULL)
    {
        nReviewAliveCamera00 = ReviewCamera_GetReviewCameraControl(0)->GetConnected() * 1000;
@@ -7962,7 +7974,7 @@
        wsprintf(DriveText, TEXT("%C:"), Drive);
        UINT type = GetDriveType(DriveText);
        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) {
@@ -8009,7 +8021,7 @@
    return;
}
//#3358 KYH FDC 데이터 전송 시점 개선 ADD END
//#3358 KYH FDC ������ ���� ���� ���� ADD END
DWORD CSequenceProcessor_CPJT::GetDiskUsage()
{
@@ -8047,7 +8059,7 @@
    BOOL bResult = FALSE;
    // PCControl D2300 (검사 영역)
    // PCControl D2300 (�˻� ����)
    switch(nSignalIndex)
    {
    case PCControlRecv_TimeChange:
@@ -8113,7 +8125,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()"));
@@ -8140,7 +8152,7 @@
    return TRUE;
}
// Local System 변경 시간과 변경 요청 컨트롤러의 시간차 처리 생각
// Local System ���� �ð��� ���� ��û ��Ʈ�ѷ��� �ð��� ó�� ����
BOOL CSequenceProcessor_CPJT::SendSystemTime(SYSTEMTIME sysTime)
{
    SYSTEMTIME CurrentTime;
@@ -8287,7 +8299,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;
            }
@@ -8398,7 +8410,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;
            }
@@ -8512,7 +8524,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();
@@ -8683,10 +8695,10 @@
            if (SetLocalTime(&sTime))
            {
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Signal] 시간동기화성공 %s"), strtime);
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Signal] �ð�����ȭ���� %s"), strtime);
            }
            else
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Signal] 시간동기화실패 %s"), strtime);
                m_pSP2P->ISP2P_DisplayMessage(_T("[PCControl_Signal] �ð�����ȭ���� %s"), strtime);
            //memcpy(&time, strTime, 2);
@@ -8907,7 +8919,7 @@
    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();
@@ -8921,13 +8933,13 @@
    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;
@@ -8952,7 +8964,7 @@
    // set last result idx
    pWsiMultiShotResult->SetLastSReviewResultIndex(nCurResultIdx);
    // 마지막 포인트까지 왔고, WSI 결과가 남아 있으면...
    // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, WSI 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
    if (nCurResultIdx == nEndResultIdx && nCurResultIdx <= pWsiMultiShotResult->GetSReviewResultCount())
    {
        nStartResultIdx = nCurResultIdx + 1;
@@ -8963,8 +8975,8 @@
        pWsiMultiShotResult->SetStartSReviewResultIndex(nStartResultIdx);
        pWsiMultiShotResult->SetEndSReviewResultIndex(nEndResultIdx);
        // 나머지 포인트 리뷰 수행하자.
        ::Sleep(3000); // 딜레이는 필수임. 없으면 동작 안함.
        // ������ ����Ʈ ���� ��������.
        ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
    //    Process_RemainWsiPoint(nModuleIndex);
    }
@@ -9030,7 +9042,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);
@@ -9066,7 +9078,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);
@@ -9093,7 +9105,7 @@
    WSIAllReadySignal(1);
    // send wsi start
    // 수정 사항
    // ���� ����
    if (!WSIMultiShotAllStartSignal())
    {
        g_pLog->DisplayMessage(_T("[WSI] WSI MultiShot Start Fail!!"));
@@ -9104,7 +9116,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);
@@ -9167,7 +9179,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;
@@ -9297,7 +9309,7 @@
        CModuleStatus*                    pModuleStatus    = Module_GetModuleStatus(nModuleIdx);        
        if (pModuleStatus == NULL) continue;
        //충돌거리 넣기
        //�浹�Ÿ� �ֱ�
        {
            double dCollisionPosX = pWsiUserResult->GetCollisionPositionX() / 1000.0;
            double dCollisionPosY = 0.0;
@@ -9340,7 +9352,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;
@@ -9444,16 +9456,16 @@
        
        }
        //기존꺼 삭제
        //������ ����
        pWsiMultiShotResult->GetVectorSReviewResult()->clear();
        int nResultCount = 0;
        if (m_vecSReviewResult.size()>0)
        {    
            //스케줄링 순서 대로 집어넣은거라 걍 집어넣기 ㄱㄱ
            //占쏙옙占쏙옙占쌕몌옙 占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙占쏙옙占쏙옙킷占?占쏙옙 占쏙옙占쏙옙殮占?占쏙옙占쏙옙
            for(int i=0; i< m_vecSReviewResult.size(); i++)
            {
                //원래는 세팅에 분할 갯수 입력해야됨 그것만큼 돌리기!
                //지금은 WSI FOV 4분할 기준에서 ㄱㄱ
                //������ ���ÿ� ���� ���� �Է��ؾߵ� �װ͸�ŭ ������!
                //������ WSI FOV 4���� ���ؿ��� ����
                double dOringinX = m_vecSReviewResult[i].nUMOriginX;
                double dOringinY = m_vecSReviewResult[i].nUMOriginY;
@@ -9723,7 +9735,7 @@
        if (pModuleStatus == NULL) continue;
        //충돌거리 넣기
        //�浹�Ÿ� �ֱ�
        {
            double dCollisionPosX = pWsiMultiShotResult->GetCollisionPositionX() / 1000.0;
@@ -9751,7 +9763,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;
@@ -10192,7 +10204,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;
    
@@ -10251,18 +10263,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(); // User ��ǥ �� ī��Ʈ
    int nSharedDefectNum = pSharedGlassData->m_nDefectNum; // 디펙 총개수 User Idx 의 첫번째 Index 가 된다
    int nStartIdx=nSharedDefectNum;// USER 디펙 종류 IDX 부여하기 위한 시작점
    int nSharedDefectNum = pSharedGlassData->m_nDefectNum; // ���� �Ѱ��� User Idx �� ù��° Index �� �ȴ�
    int nStartIdx=nSharedDefectNum;// USER ���� ���� IDX �ο��ϱ� ���� ������
    CRcpPlanInfo* pRcpPlanInfo; // 레시피 정보
    CRcpUserDefectInfo *pDefectInfo;// 레시피 defect 정보
    CRcpPlanInfo* pRcpPlanInfo; // ������ ����
    CRcpUserDefectInfo *pDefectInfo;// ������ defect ����
    
    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;
@@ -10326,7 +10338,7 @@
BOOL CSequenceProcessor_CPJT::CompareRevType(int nInsType,int nRevType)
{
    //Plan 타입과 InspectionMode 비교
    //Plan Ÿ�԰� InspectionMode ��
    if(nRevType == CPJT_PlanUser)
    {
      if(nInsType == USER) return TRUE;
@@ -10384,7 +10396,7 @@
    CString strMessage, strResultFilePath, strUploadResultFilePath, strLocalRawPath;
    CString    strUploadRawPath, strUploadImagePath, strAOIRawFileName, strAOIRawFilePath;
    //3-1. 리뷰 결과 파일 쓰기
    //3-1. 占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙
    m_pSP2P->ISP2P_SetReviewResultData(pGlassResult);
    strLocalRawPath        = pNetworkInfo->m_strLocalRawPath;
@@ -10411,7 +10423,7 @@
            if(strUploadRawPath.IsEmpty() == FALSE && strAOIRawFilePath.IsEmpty() == FALSE)
            {
                // [2017:5:16]-[WEZASW] : 리뷰 PASS시의 설비 운영의 상황에 따라 AOI Server가 RAW 파일 직접 업로드 진행.
                // [2017:5:16]-[WEZASW] : ���� PASS���� ���� ��� ��Ȳ�� ���� AOI Server�� RAW ���� ���� ���ε� ����.
                strUploadResultFilePath.Format(_T("%s\\%s"), strUploadRawPath, strAOIRawFileName);
                if(CopyFile(strResultFilePath, strUploadResultFilePath, FALSE))
@@ -10432,9 +10444,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!"));            
@@ -10454,8 +10466,8 @@
BOOL CSequenceProcessor_CPJT::MoveReviewStartMotorPosition(CGlassResult* pGlassResult,int nReviewType)
{
    //혹시나 쓰일까봐 남겨듐
    //다음 플랜의 첫번째 위치로 이동
    //혹占시놂옙 占쏙옙占싹깍옙占?占쏙옙占쌤듸옙
    //���� �÷��� ù��° ��ġ�� �̵�
    
    double dDefectPosX,dDefectPosY = 0;
    
@@ -10519,7 +10531,7 @@
void CSequenceProcessor_CPJT::SendWsiErrorAlarm_CPJT(int Index) //190801 chm
{    
    //wsi 에러 알람
    //wsi ���� �˶�
    if(Index==1)
    {
        g_pLog->DisplayMessage(_T("[SequenceProcessor_CPJT] WSI Alive Error!!!"));
@@ -10533,7 +10545,7 @@
void CSequenceProcessor_CPJT::SendWsiAlive_CPJT()//190801 chm
{
    //WSI Alive 신호 받음
    //WSI Alive ��ȣ ����
    SetWSIAliveCheck(TRUE);
}
@@ -10559,7 +10571,7 @@
            if(bWsiAliveCheck ==FALSE){
                m_pCSPC->SendWsiErrorAlarm_CPJT(1);
            }
            bWsiAliveCheck=FALSE; //30초에 한번씩 0으로 초기화
            bWsiAliveCheck=FALSE; //30�ʿ� �ѹ��� 0���� �ʱ�ȭ
        }
    }