SDC C-Project CF Review 프로그램
7개 파일 변경됨
160 ■■■■ 파일 변경됨
ReviewSystem/CHReviewResult/GlassResult.cpp 8 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/CameraController.cpp 14 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewInterface.cpp 5 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewInterface.h 4 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/ReviewProcessor_CPJT.cpp 98 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/SequenceProcessor.h 3 ●●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp 28 ●●●● 패치 | 보기 | raw | blame | 히스토리
ReviewSystem/CHReviewResult/GlassResult.cpp
@@ -161,8 +161,8 @@
    //FDC보고용 Review Contrast
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD Start
    nReview00ImageContrast = 50;
    nReview01ImageContrast = 50;
    nReview00ImageContrast = 5;
    nReview01ImageContrast = 5;
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD End
    // defect result
@@ -312,8 +312,8 @@
    //FDC보고용 Review Contrast
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD Start
    nReview00ImageContrast = 50;
    nReview01ImageContrast = 50;
    nReview00ImageContrast = 5;
    nReview01ImageContrast = 5;
    //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD End
    //// defect result
    //for (MapDefectResultIt it = m_mapDefectResult.begin(); it != m_mapDefectResult.end(); it++)
ReviewSystem/ReviewSystem/CameraController.cpp
@@ -268,9 +268,19 @@
    
    for (VectorCameraControlIt it=m_vecCameraControl.begin(); it!=m_vecCameraControl.end(); it++)
    {
        (*it)->SetTriggerMode(ModeInternal);
        int nSub = (*it)->Grab();
        //#3561 210908 LYW ADD Start
        int nSub;
        try
        {
            (*it)->SetTriggerMode(ModeInternal);
            nSub = (*it)->Grab();
        }
        catch (...)
        {
            nSub = FALSE;
        }
        //#3561 210908 LYW ADD End
        if (nSub==1)
            g_pLog->DisplayMessage(_T("[CameraController]Camera_Grab Success![ModeInternal]"));
ReviewSystem/ReviewSystem/ReviewInterface.cpp
@@ -8934,6 +8934,11 @@
    SetCurrentWsiMode(nMode);
}
void CReviewInterface::ISP2P_InitAlignCamera()
{
    InitAlignCamera();
}
int CReviewInterface::IWC2P_GetWsiType()
{
    return GetCurrentWsiMode();
ReviewSystem/ReviewSystem/ReviewInterface.h
@@ -297,6 +297,10 @@
    virtual    void                        ISP2P_SetCurrentWsiMode(int nMode);
    //#3561 210908 LYW ADD Start
    virtual void    ISP2P_InitAlignCamera();
    //#3561 210908 LYW ADD End
    virtual CTotalPitchMeasure*            ISP2P_GetTotalPitchMeasure();
    // recipe info
ReviewSystem/ReviewSystem/ReviewProcessor_CPJT.cpp
@@ -3805,49 +3805,85 @@
    BYTE *pImageBufferByte = (BYTE*)(pImageBuffer);
    if (pImageBuffer==NULL) return 0.;
    //#3524_210902_LYW_MOD START
    int nWidth = nImageWidth;
    //int nWidthStep = nImageWidth;
    int nHeight = nImageHeight;
    int nCalWidth = nWidth/2;
    int nCalHeight = nHeight/2;
    //     int nCalWidth = nWidth/2;
    //     int nCalHeight = nHeight/2;
    //
    //     int nStartX = nWidth/2 - nCalWidth/2;
    //     int nStartY = nHeight/2 - nCalHeight/2;
    int nStartX = nWidth/2 - nCalWidth/2;
    int nStartY = nHeight/2 - nCalHeight/2;
    int nCalWidth = nWidth;
    int nCalHeight = nHeight;
    //
    double Focusvalue = 0;
    double SumValue = 0;
    double TempValue = 0;
    double m_nResultFocusValue = 0;
    int nStartX = 0;
    int nStartY = 0;
    for (int y = 0; y < nHeight - 1; y++)
    int nStep = 3;
    double dXValue = 0., dYValue = 0., dCurr = 0., dSum = 0., dFocus = 0.;
    for (int nH = nStartY; nH < nStartY + nCalHeight - nStep; nH++)
    {
        for (int x = 0; x < nWidth - 1; x++)
        for (int nW = nStartX; nW < nStartX + nCalWidth - nStep; nW++)
        {
            TempValue = (double)(pImageBufferByte[y*nWidth + x] - pImageBufferByte[y*nWidth + x + 1]);
            SumValue = TempValue * TempValue;
            TempValue = (double)(pImageBufferByte[y*nWidth + x] - pImageBufferByte[(y + 1)*nWidth + x]);
            SumValue += TempValue * TempValue;
            Focusvalue += sqrt(SumValue);
            //Focusvalue += SumValue;
        }
    }
    m_nResultFocusValue = int(Focusvalue / (double)(nWidth*nHeight));
    double dXValue=0., dYValue=0., dCurr=0., dSum=0., dFocus=0.;
    for(int nH=nStartY ; nH<nStartY+nCalHeight-1 ; nH++)
    {
        for(int nW=nStartX ; nW<nStartX+nCalWidth-1 ; nW++)
        {
            dXValue = float((pImageBufferByte[nH*nW + nW+1] - pImageBufferByte[nH*nW + nW])*(pImageBufferByte[nH*nW + nW+1] - pImageBufferByte[nH*nW + nW]));
            dYValue = float((pImageBufferByte[(nH+1)*nW + nW] - pImageBufferByte[nH*nW + nW])*(pImageBufferByte[(nH+1)*nW + nW] - pImageBufferByte[nH*nW + nW]));
            dXValue = float((pImageBufferByte[nH*nWidth + nW + nStep] - pImageBufferByte[nH*nWidth + nW])*(pImageBufferByte[nH*nWidth + nW + nStep] - pImageBufferByte[nH*nWidth + nW]));
            dYValue = float((pImageBufferByte[(nH + nStep)*nWidth + nW] - pImageBufferByte[nH*nWidth + nW])*(pImageBufferByte[(nH + nStep)*nWidth + nW] - pImageBufferByte[nH*nWidth + nW]));
            dCurr = sqrt(dXValue + dYValue);
            //break;
            dSum += dCurr;
        }
    }
    dFocus = dSum/double(nCalWidth*nCalHeight);
    dFocus = dSum / double(nCalWidth*nCalHeight);
    return dFocus;
    //#3524_210902_LYW_MOD END
    //Origin
//     int nWidth = nImageWidth;
//     int nHeight = nImageHeight;
//     int nCalWidth = nWidth/2;
//     int nCalHeight = nHeight/2;
//
//     int nStartX = nWidth/2 - nCalWidth/2;
//     int nStartY = nHeight/2 - nCalHeight/2;
//
//     //
//     double Focusvalue = 0;
//     double SumValue = 0;
//     double TempValue = 0;
//     double m_nResultFocusValue = 0;
//
//     for (int y = 0; y < nHeight - 1; y++)
//     {
//         for (int x = 0; x < nWidth - 1; x++)
//         {
//             TempValue = (double)(pImageBufferByte[y*nWidth + x] - pImageBufferByte[y*nWidth + x + 1]);
//             SumValue = TempValue * TempValue;
//             TempValue = (double)(pImageBufferByte[y*nWidth + x] - pImageBufferByte[(y + 1)*nWidth + x]);
//             SumValue += TempValue * TempValue;
//
//             Focusvalue += sqrt(SumValue);
//             //Focusvalue += SumValue;
//         }
//     }
//
//     m_nResultFocusValue = int(Focusvalue / (double)(nWidth*nHeight));
//
//     double dXValue=0., dYValue=0., dCurr=0., dSum=0., dFocus=0.;
//     for(int nH=nStartY ; nH<nStartY+nCalHeight-1 ; nH++)
//     {
//         for(int nW=nStartX ; nW<nStartX+nCalWidth-1 ; nW++)
//         {
//             dXValue = float((pImageBufferByte[nH*nW + nW+1] - pImageBufferByte[nH*nW + nW])*(pImageBufferByte[nH*nW + nW+1] - pImageBufferByte[nH*nW + nW]));
//             dYValue = float((pImageBufferByte[(nH+1)*nW + nW] - pImageBufferByte[nH*nW + nW])*(pImageBufferByte[(nH+1)*nW + nW] - pImageBufferByte[nH*nW + nW]));
//             dCurr = sqrt(dXValue + dYValue);
//             dSum += dCurr;
//         }
//     }
//     dFocus = dSum/double(nCalWidth*nCalHeight);
//
//     return dFocus;
}
ReviewSystem/ReviewSystem/SequenceProcessor.h
@@ -370,6 +370,9 @@
    virtual    void    ISP2P_SetCurrentWsiMode(int nMode) = 0;
    //#3561 210908 LYW ADD Start
    virtual void    ISP2P_InitAlignCamera() = 0;
    //#3561 210908 LYW ADD End
    // system info
    virtual const CSystemInfo*            ISP2P_System_GetSystemInfo() = 0;
ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp
@@ -1258,10 +1258,6 @@
{
     m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::IN] AlignStart!"));
    AlignCamera_CameraControl(CameraControlLive);  // 210805 Align Camera Sequence ����
    Sleep(300);
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
    if (GetSimulationMode() == FALSE)
    {
@@ -1269,6 +1265,30 @@
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Start Ack!"));
    }
    //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
    //#3561 210908 LYW ADD Start
     int nAlignReconnectRetryMaxCount = 3;
     for (int i = 0; i < nAlignReconnectRetryMaxCount; i++)
    {
        if (AlignCamera_CameraControl(CameraControlLive) == FALSE)
        {
            m_pSP2P->ISP2P_DisplayMessage(_T("[AlignStart] AlignConnect Fail! Reconect Start! ReconnectRetry count = %d"), nAlignReconnectRetryMaxCount + 1);
            system("netsh interface set interface name = \"Align #1\" admin = disable&& netsh interface set interface name = \"Align #1\" admin = enable&& netsh interface set interface name = \"Align #2\" admin = disable&& netsh interface set interface name = \"Align #2\" admin = enable");
            Sleep(10000);
            m_pSP2P->ISP2P_InitAlignCamera();
        }
        else
        {
            m_pSP2P->ISP2P_DisplayMessage(_T("[AlignStart] AlignConnect Success! "));
            break;
        }
    }
    //#3561 210908 LYW ADD End
    Sleep(300);
    //original
//     if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_AlignStartAck_CPJT))
//         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Start Ack!"));