protected override int ProcessMsg(MEvent evnt) { Debug.WriteLine($"{ToString()} received message : {evnt}"); switch (evnt.Msg) { // if need to change response for common message, then add case state here. default: base.ProcessMsg(evnt); break; case (int)MSG_START_CASSETTE_SUPPLY: m_bSupplyCassette = true; break; case (int)MSG_STOP_CASSETTE_SUPPLY: m_bSupplyCassette = false; break; case (int)MSG_START_WAFER_SUPPLY: m_bSupplyWafer = true; break; case (int)MSG_STOP_WAFER_SUPPLY: m_bSupplyWafer = false; break; case (int)MSG_PUSHPULL_LOADER_REQUEST_UNLOADING: m_bPushPull_RequestUnloading = true; break; case (int)MSG_PUSHPULL_LOADER_START_LOADING: m_bPushPull_StartLoading = true; break; case (int)MSG_PUSHPULL_LOADER_COMPLETE_LOADING: m_bPushPull_CompleteLoading = true; break; case (int)MSG_PUSHPULL_LOADER_REQUEST_LOADING: m_bPushPull_RequestLoading = true; break; case (int)MSG_PUSHPULL_LOADER_START_UNLOADING: m_bPushPull_StartUnloading = true; break; case (int)MSG_PUSHPULL_LOADER_COMPLETE_UNLOADING: m_bPushPull_CompleteUnloading = true; break; case (int)MSG_AUTO_LOADER_REQUEST_LOAD_CASSETTE: m_bAuto_RequestLoadCassette = true; break; case (int)MSG_AUTO_LOADER_REQUEST_UNLOAD_CASSETTE: m_bAuto_RequestUnloadCassette = true; break; } return(0); }
public int SendAlarmTo(int iAlaramCode, int iChannel = TrsAutoManager) { OpStatus = STS_ERROR_STOP; MEvent evnt = new MEvent((int)MSG_PROCESS_ALARM, iAlaramCode, iChannel, ThreadID); return(PostMsg(iChannel, evnt)); }
protected override int ProcessMsg(MEvent evnt) { Debug.WriteLine($"{ToString()} received message : {evnt}"); switch (evnt.Msg) { case (int)MSG_MANUAL_CMD: SetOpStatus(STS_MANUAL); PostMsg(TrsAutoManager, (int)MSG_MANUAL_CNF); break; case (int)MSG_START_RUN_CMD: OnStartRun(); PostMsg(TrsAutoManager, (int)MSG_START_RUN_CNF); break; case (int)MSG_START_CMD: if (OpStatus == STS_RUN_READY || OpStatus == STS_STEP_STOP || OpStatus == STS_ERROR_STOP) { SetOpStatus(STS_RUN); PostMsg(TrsAutoManager, (int)MSG_START_CNF); } break; case (int)MSG_ERROR_STOP_CMD: SetOpStatus(STS_ERROR_STOP); PostMsg(TrsAutoManager, (int)MSG_ERROR_STOP_CNF); break; case (int)MSG_STEP_STOP_CMD: if (OpStatus == STS_STEP_STOP || OpStatus == STS_ERROR_STOP) { SetOpStatus(STS_MANUAL); } else { SetOpStatus(STS_STEP_STOP); } PostMsg(TrsAutoManager, (int)MSG_STEP_STOP_CNF); break; case (int)MSG_CYCLE_STOP_CMD: SetOpStatus(STS_CYCLE_STOP); PostMsg(TrsAutoManager, (int)MSG_CYCLE_STOP_CNF); break; } return(0); }
public int PostMsg(MEvent evnt) { lock (_Lock) { Debug.WriteLine("[EnQueue] " + evnt.ToString()); m_eventQ.Enqueue(evnt); } return(DEF_Error.SUCCESS); }
public int PostMsg(int iChannel, MEvent evnt) { if ((iChannel < 0) || (iChannel >= MAX_THREAD_CHANNEL)) { return(-1); } if (m_LinkedThreadArray[iChannel] == null) { return(-1); } return(m_LinkedThreadArray[iChannel].PostMsg(evnt)); }
public virtual void CheckMsg(int nMsgCount = 2) { while (m_eventQ.Count > 0) { MEvent evnt = GetMsg(); if (evnt == null) { break; } ProcessMsg(evnt); if (--nMsgCount <= 0) { break; } } }
MEvent GetMsg() { lock (_Lock) { try { MEvent evnt = (MEvent)m_eventQ.Dequeue(); Debug.WriteLine("[DeQueue] " + evnt.ToString()); return(evnt); } catch (Exception ex) { Debug.WriteLine(ex.Message); } return(null); } }
protected override int ProcessMsg(MEvent evnt) { Debug.WriteLine($"{ToString()} received message : {evnt}"); switch (evnt.Msg) { case (int)MSG_MANUAL_CMD: SetOpStatus(STS_MANUAL); PostMsg(TrsAutoManager, (int)MSG_MANUAL_CNF); break; case (int)MSG_MANUAL_CNF: SetThreadStatus(evnt.Sender, STS_MANUAL); // 메세지를 보낸 Thread를 STS_MANUAL 상태로 놓는다. if (CheckAllThreadStatus(STS_MANUAL)) // 모든 Thread가 STS_MANUAL 상태인지 확인한다. { SetSystemStatus(STS_MANUAL); m_bExchangeMode = false; m_bErrDispMode = false; m_bBuzzerMode = false; // m_bAlarmProcFlag = false; //setVelocityMode(VELOCITY_MODE_SLOW); // Manual일 때 느린 속도로 이동 SendMessageToMainWnd((int)WM_START_MANUAL_MSG); //m_RefComp.m_pManageOpPanel->SetAutoManual(MANUAL); } break; case (int)MSG_START_RUN_CMD: OnStartRun(); PostMsg(TrsAutoManager, (int)MSG_START_RUN_CNF); break; case (int)MSG_START_CMD: if (OpStatus == STS_RUN_READY || OpStatus == STS_STEP_STOP || OpStatus == STS_ERROR_STOP) { SetOpStatus(STS_RUN); PostMsg(TrsAutoManager, (int)MSG_START_CNF); } break; case (int)MSG_ERROR_STOP_CMD: SetOpStatus(STS_ERROR_STOP); PostMsg(TrsAutoManager, (int)MSG_ERROR_STOP_CNF); break; case (int)MSG_STEP_STOP_CMD: if (OpStatus == STS_STEP_STOP || OpStatus == STS_ERROR_STOP) { SetOpStatus(STS_MANUAL); } else { SetOpStatus(STS_STEP_STOP); } PostMsg(TrsAutoManager, (int)MSG_STEP_STOP_CNF); break; case (int)MSG_CYCLE_STOP_CMD: SetOpStatus(STS_CYCLE_STOP); PostMsg(TrsAutoManager, (int)MSG_CYCLE_STOP_CNF); break; case (int)MSG_PROCESS_ALARM: //if (AfxGetApp()->GetMainWnd() != NULL) //{ // if (((CMainFrame*)AfxGetApp()->GetMainWnd())->m_pErrorDlg == NULL) // return processAlarm(evnt); // process에서 올라온 알람메세지의 처리 //} break; case (int)MSG_START_CASSETTE_SUPPLY: m_bSupplyCassette = true; break; case (int)MSG_STOP_CASSETTE_SUPPLY: m_bSupplyCassette = false; break; case (int)MSG_START_WAFER_SUPPLY: m_bSupplyWafer = true; break; case (int)MSG_STOP_WAFER_SUPPLY: m_bSupplyWafer = false; break; } return(0); }
protected override int ProcessMsg(MEvent evnt) { Debug.WriteLine($"{ToString()} received message : {evnt}"); switch (evnt.Msg) { // if need to change response for common message, then add case state here. default: base.ProcessMsg(evnt); break; case (int)MSG_LOADER_PUSHPULL_READY_UNLOADING: m_bLoader_ReadyUnloading = true; break; case (int)MSG_LOADER_PUSHPULL_READY_LOADING: m_bLoader_ReadyLoading = true; break; case (int)MSG_LOADER_PUSHPULL_ALL_WAFER_WORKED: m_bLoader_AllWaferWorked = true; break; case (int)MSG_LOADER_PUSHPULL_STACKS_FULL: m_bLoader_StacksFull = true; break; case (int)MSG_CLEANER_PUSHPULL_READY_LOADING: m_bCleaner_ReadyLoading = true; break; case (int)MSG_CLEANER_PUSHPULL_START_LOADING: m_bCleaner_StartLoading = true; break; case (int)MSG_CLEANER_PUSHPULL_COMPLETE_LOADING: m_bCoater_CompleteLoading = true; break; case (int)MSG_CLEANER_PUSHPULL_READY_UNLOADING: m_bCleaner_ReadyUnloading = true; break; case (int)MSG_CLEANER_PUSHPULL_START_UNLOADING: m_bCleaner_StartUnloading = true; break; case (int)MSG_CLEANER_PUSHPULL_COMPLETE_UNLOADING: m_bCleaner_CompleteUnloading = true; break; case (int)MSG_COATER_PUSHPULL_READY_LOADING: m_bCoater_ReadyLoading = true; break; case (int)MSG_COATER_PUSHPULL_START_LOADING: m_bCoater_StartLoading = true; break; case (int)MSG_COATER_PUSHPULL_COMPLETE_LOADING: m_bCoater_CompleteLoading = true; break; case (int)MSG_COATER_PUSHPULL_READY_UNLOADING: m_bCoater_ReadyUnloading = true; break; case (int)MSG_COATER_PUSHPULL_START_UNLOADING: m_bCoater_StartUnloading = true; break; case (int)MSG_COATER_PUSHPULL_COMPLETE_UNLOADING: m_bCoater_CompleteUnloading = true; break; case (int)MSG_HANDLER_PUSHPULL_READY_LOADING: m_bHandler_ReadyLoading = true; break; case (int)MSG_HANDLER_PUSHPULL_START_LOADING: m_bHandler_StartLoading = true; break; case (int)MSG_HANDLER_PUSHPULL_COMPLETE_LOADING: m_bCoater_CompleteLoading = true; break; case (int)MSG_HANDLER_PUSHPULL_READY_UNLOADING: m_bHandler_ReadyUnloading = true; break; case (int)MSG_HANDLER_PUSHPULL_START_UNLOADING: m_bHandler_StartUnloading = true; break; case (int)MSG_HANDLER_PUSHPULL_COMPLETE_UNLOADING: m_bHandler_CompleteUnloading = true; break; } return(0); }
protected virtual int ProcessMsg(MEvent evnt) { Debug.WriteLine("Process " + evnt.ToString()); return(0); }
public int SendMsg(MEvent evnt) { return(ProcessMsg(evnt)); }