SDC C-Project CF Review 프로그램
LYW
2021-09-14 ffe71aadfdcb4a9ea2ac4d8d320983d42ef3cad5
ReviewSystem/M_AutoDiagnosisManager/DiagnosisProcessor.cpp
@@ -77,7 +77,7 @@
      ProcessFlatness();
      Sleep(1000);
      if (ProcessDiagnosisJudge() == FALSE) {
      if (ProcessDiagnosisJudge(nProcessMode) == FALSE) {
         strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
         m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
      }
@@ -97,7 +97,7 @@
      ProcessWsi();
      Sleep(1000);
      if (ProcessDiagnosisJudge() == FALSE) {
      if (ProcessDiagnosisJudge(nProcessMode) == FALSE) {
         strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
         m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
      }
@@ -111,7 +111,7 @@
      m_pManager->m_bProcessAll = false;
      ProcessSquareness();
      Sleep(1000);
      if (ProcessDiagnosisJudge() == FALSE) {
      if (ProcessDiagnosisJudge(nProcessMode) == FALSE) {
         strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
         m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
      }
@@ -121,7 +121,7 @@
      m_pManager->m_bProcessAll = false;
      ProcessFlatness();
      Sleep(1000);
      if (ProcessDiagnosisJudge() == FALSE) {
      if (ProcessDiagnosisJudge(nProcessMode) == FALSE) {
         strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
         m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
      }
@@ -171,7 +171,7 @@
   //Sleep(2000);
   Sleep(1000);
   if (ProcessDiagnosisJudge() == FALSE) {
   if (ProcessDiagnosisJudge(DiagnosisMode_All) == FALSE) {
      strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
      m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
   }
@@ -303,7 +303,7 @@
         //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
         //if (11000 <= GetTickCount() - stTime)
         //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
         if (1000 <= GetTickCount() - stTime)
         if (1500 <= GetTickCount() - stTime)
         {
            break;
         }
@@ -313,7 +313,7 @@
      m_pDP2P->IDP2P_SetAFMTracking(nSelModuleIndex, TRUE);
      //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
      //Sleep(1000);
      Sleep(500);
      Sleep(1000);
      //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
      CString strimagename;
@@ -479,7 +479,7 @@
      {
         //#3514_LYW_CF AOI Review 자가진단 기능 개선_START
         //if (10000 <= GetTickCount() - stTime)
         if (1000 <= GetTickCount() - stTime)
         if (11000 <= GetTickCount() - stTime)
         //#3514_LYW_CF AOI Review 자가진단 기능 개선_END
         {
            break;
@@ -601,33 +601,33 @@
         Sleep(500);
      }
      if (nIdx == 0)
      {
         pResultPoint[nIdx].dPosX = 657.425
            ;
         pResultPoint[nIdx].dPosY = 540.14
            ;
      }
      else if (nIdx == 1)
      {
         pResultPoint[nIdx].dPosX = 657.425
            ;
         pResultPoint[nIdx].dPosY = 2278.636
            ;
      }
      else if (nIdx == 2)
      {
         pResultPoint[nIdx].dPosX = 2096.944
            ;
         pResultPoint[nIdx].dPosY = 540.141
            ;
      }
      else if (nIdx == 3)
      {
         pResultPoint[nIdx].dPosX = 2096.944
            ;
         pResultPoint[nIdx].dPosY = 2278.636;
      }
//       if (nIdx == 0)
//       {
//          pResultPoint[nIdx].dPosX = 657.425
//             ;
//          pResultPoint[nIdx].dPosY = 540.14
//             ;
//       }
//       else if (nIdx == 1)
//       {
//          pResultPoint[nIdx].dPosX = 657.425
//             ;
//          pResultPoint[nIdx].dPosY = 2278.636
//             ;
//       }
//       else if (nIdx == 2)
//       {
//          pResultPoint[nIdx].dPosX = 2096.944
//             ;
//          pResultPoint[nIdx].dPosY = 540.141
//             ;
//       }
//       else if (nIdx == 3)
//       {
//          pResultPoint[nIdx].dPosX = 2096.944
//             ;
//          pResultPoint[nIdx].dPosY = 2278.636;
//       }
      //1. 모터를 이동
@@ -735,7 +735,7 @@
   return TRUE;
}
int CDiagnosisProcessor::ProcessDiagnosisJudge()
int CDiagnosisProcessor::ProcessDiagnosisJudge(int nMode)
{
   for (int i = 0; i < 2; i++)
   {
@@ -760,22 +760,28 @@
      }
      CString strMessage = _T("");
      double dDate = (90 - pProcessResult->GetGantryDegree());
      if (abs(dDate) >= abs(pSettingInfo->GetJudgeData_Degree())) // 0412 kyh 직각도에서 나온 Dgree 값이 설정한 Judge 값보다 크거나 같을경우
      if (nMode == DiagnosisMode_All || nMode == DiagnosisMode_Review || nMode == DiagnosisMode_Squareness)
      {
         double dDate = (90 - pProcessResult->GetGantryDegree());
         if (abs(dDate) >= abs(pSettingInfo->GetJudgeData_Degree())) // 0412 kyh 직각도에서 나온 Dgree 값이 설정한 Judge 값보다 크거나 같을경우
         {
         m_pDP2P->IDP2P_DiagnosisSendJudgeAlarm(); // 알람 발생
         strMessage.Format(_T("[Judge Data] [Gantry %d]Diagnosis Error ! GantryDegree[%lf] Judge[%lf]"), i, dDate, pSettingInfo->GetJudgeData_Degree());
         m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
            m_pDP2P->IDP2P_DiagnosisSendJudgeAlarm(); // 알람 발생
            strMessage.Format(_T("[Judge Data] [Gantry %d]Diagnosis Error ! GantryDegree[%lf] Judge[%lf]"), i, dDate, pSettingInfo->GetJudgeData_Degree());
            m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
         }
      }
      if (pProcessWSIResult->getWSI_RTB() >= pSettingInfo->GetJudgeData_3Sigma() || pProcessWSIResult->getWSI_RTB() <= 0) // 0412 kyh WSI 표준편차 비교
      if (nMode == DiagnosisMode_All || nMode == DiagnosisMode_Wsi)
      {
         m_pDP2P->IDP2P_DiagnosisSendJudgeAlarm(); // 알람 발생
         strMessage.Format(_T("[Judge Data] [WSI %d]Diagnosis Error ! WSI RTB[%lf] Judge[%lf]"), i, pProcessWSIResult->getWSI_RTB(), pSettingInfo->GetJudgeData_3Sigma());
         m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
         if (pProcessWSIResult->getWSI_RTB() >= pSettingInfo->GetJudgeData_3Sigma() || pProcessWSIResult->getWSI_RTB() <= 0) // 0412 kyh WSI 표준편차 비교
         {
            m_pDP2P->IDP2P_DiagnosisSendJudgeAlarm(); // 알람 발생
            strMessage.Format(_T("[Judge Data] [WSI %d]Diagnosis Error ! WSI RTB[%lf] Judge[%lf]"), i, pProcessWSIResult->getWSI_RTB(), pSettingInfo->GetJudgeData_3Sigma());
            m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
         }
      }
   }
   //#3407 KYH 자가진단 Judge 판정 및 알람 발생 기능 ADD END
@@ -882,8 +888,21 @@
      for (int nIdx = 0; nIdx < nPanelCount; nIdx++)
      {
         const SPositionData* pSettingPos = pSettingResult->GetPositionData_Squareness(nIdx);
         const SPositionData* pDataPos = pProcessResult->GetPositionData_Squareness(nIdx);
         //LYW 210811
         const SPositionData* pSettingPos;
         const SPositionData* pDataPos;
         if (nSelModuleIndex == 1)
         {
            pSettingPos = pSettingResult->GetPositionData_Squareness(nIdx);
            pDataPos = pProcessResult->GetPositionData_Squareness(nIdx + 3);
         }
         else
         {
            pSettingPos = pSettingResult->GetPositionData_Squareness(nIdx);
            pDataPos = pProcessResult->GetPositionData_Squareness(nIdx);
         }
         //LYW 210811
         if (pSettingPos == NULL || pDataPos == NULL) continue;
         dMotorPosX[nIdx] = pSettingPos->dPosX;