SDC C-Project CF Review 프로그램
LYW
2022-07-05 63439977901d54a01924ed76290931aeddbce66c
ReviewSystem/ReviewSystem/MainFrm.cpp
@@ -41,6 +41,8 @@
   ID_INDICATOR_SCRL,
};
// 정의
// CMainFrame 생성/소멸
CMainFrame::CMainFrame()
@@ -68,6 +70,8 @@
   if (CFrameWndEx::OnCreate(lpCreateStruct) == -1)
      return -1;
   SetUnhandledExceptionFilter(TopLevelExceptionFilterCallBack);
   ModifyStyle(WS_CAPTION, NULL);
   SetMenu(NULL);
@@ -84,11 +88,15 @@
   SetTimer(ID_TIMER_SEND_SIGNAL_ALIVE, 100, NULL);
   system("net use Y: \\\\126.100.100.1\\d\\DIT_ResultData pw:dit/user:Server/persistent:yes");
   //LYW Align Reconnect
   //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(2000);
   //업데이트시
   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"
      "&& net use Y : \\\\126.100.100.1\\d\\DIT_ResultData pw : dit / user : Server / persistent : yes");
   Sleep(2000);
//   SetTimer(ID_TIMER_WSI_LONGRUN_TEST_TIME, 10000, NULL);
@@ -340,7 +348,10 @@
      if (pSequenceProcessor == NULL)   return;
   pSequenceProcessor->SendSignalReviewAlive((long)m_bAlive);
   //#3358 KYH FDC 데이터 전송 시점 개선 ADD START
   pSequenceProcessor->MakeDVData2(); // 210325 kyh
   //#3358 KYH FDC 데이터 전송 시점 개선 ADD END
}
void CMainFrame::SendAFMAlive()
{
@@ -443,9 +454,9 @@
#define strScript "RESTART^AFControl.exe^C:\\AFControl\\program\\AFControl.exe"
   
   CFile file;
   if( FALSE == file.Open(_T("C:\\DIT_Review\\MakeScript.TSF"),CFile::modeCreate | CFile::modeWrite) )
   if( FALSE == file.Open(_T("D:\\DIT_Review\\MakeScript.TSF"),CFile::modeCreate | CFile::modeWrite) ) //210805
   {
      g_pLog->DisplayMessage(_T("File[C:\\DIT_Review\\MakeScript.TSF] Create Fail!!"));
      g_pLog->DisplayMessage(_T("File[D:\\DIT_Review\\MakeScript.TSF] Create Fail!!")); //210805
      return;
   }
@@ -477,7 +488,7 @@
   CString strTarget;
   strTarget.Format(_T("\\\\126.100.100.220\\c\\RemoteTaskMgr\\T\\CopyScript.TSF"));
   
   BOOL bRet = CopyFile(_T("C:\\DIT_Review\\MakeScript.TSF"),strTarget,FALSE);
   BOOL bRet = CopyFile(_T("D:\\DIT_Review\\MakeScript.TSF"),strTarget,FALSE); //210805
   if(bRet == FALSE)
      g_pLog->DisplayMessage(_T("[%s]Send Script Fail!"), strTarget);
   /////////////////////////////////////
@@ -610,12 +621,10 @@
void CMainFrame::OnClose()
{
   // TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.
   if (IDNO == AfxMessageBox(_T("Exit Review System?"), MB_YESNO | MB_ICONQUESTION))
   if (IDNO == AfxMessageBox(_T("프로그램 종료시 \nCIM OFFLINE \n설비 매뉴얼 모드\n상태를 먼저 확인해 주십시오.\n정말 종료 하시겠습니까?"), MB_YESNO | MB_ICONQUESTION))
   {
      return;
   }
   g_pLog->DisplayMessage(_T("Program exit by User!"));
   DeinitReviewInterface();
@@ -850,6 +859,24 @@
   switch(pCopyDataStruct->dwData)
   {
   case COPYDATA_RAW_DOWNLOAD_ACK:
   case COPYDATA_RAW_UPLOAD_ACK:
   case COPYDATA_LOT_UPLOAD_ACK:
   case COPYDATA_IMAGE_UPLOAD_ACK:
   {
      CFTPCopyDataParam ftpCopyDataParam;
      ftpCopyDataParam = *(static_cast<CFTPCopyDataParam*>(pCopyDataStruct->lpData));
      if (ftpCopyDataParam.m_nSendResultCode == FALSE)
      {
         CMainFrame* pMain = static_cast<CMainFrame*>(AfxGetMainWnd());
         CSequenceProcessor* pSequenceProcessor = pMain->IRP2P_GetSequenceProcessor();
         if (pSequenceProcessor == NULL)   return FALSE;
         pSequenceProcessor->sendUploadResult2SequenceProcessor(ftpCopyDataParam.m_nSendResultCode);
      }
   }
   break;
   case COPYDATA_SYSTEMSETTING2REVIEWSYSTEM:
      {
         COPYDATA_SYSTEM2REV* pCopyData = (COPYDATA_SYSTEM2REV*)pCopyDataStruct->lpData;
@@ -877,6 +904,14 @@
         if (pCopyData) OnCopyDataAoiServer(pCopyData);
      }
      break;
   case COPYDATA_REVIEWHISTORYOR2REVIEWSYSTEM:
   {
      DlgReviewOffSetTool* pReviewOffSetTool = m_pView->GetReviewOffSetToolHandle();
      pReviewOffSetTool->PostMessage(WM_OFFSETTOOL_MESSAGE, 0, 200);
   }
   break;
   }
   return __super::OnCopyData(pWnd, pCopyDataStruct);
@@ -936,4 +971,5 @@
      return TRUE;
   }
   return FALSE;
}
}