|
|
@ -124,6 +124,12 @@ UINT CtrlSoftWareRunHeartBeatThread(LPVOID pParam)
|
|
|
|
p->SoftWareRunHeartBeat();
|
|
|
|
p->SoftWareRunHeartBeat();
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
UINT UpDataSecsProcessStateThread(LPVOID pParam)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CDeviceStateMgr *p = (CDeviceStateMgr *)pParam;
|
|
|
|
|
|
|
|
p->UpDataSecsProcessState();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
CDeviceStateMgr *gDeviceStateMgr = new CDeviceStateMgr;
|
|
|
|
CDeviceStateMgr *gDeviceStateMgr = new CDeviceStateMgr;
|
|
|
|
CDeviceStateMgr::CDeviceStateMgr(void)
|
|
|
|
CDeviceStateMgr::CDeviceStateMgr(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -245,6 +251,8 @@ void CDeviceStateMgr::OnAppInitialize()
|
|
|
|
pThread = AfxBeginThread(ReadAptDeviceStateThread, this);
|
|
|
|
pThread = AfxBeginThread(ReadAptDeviceStateThread, this);
|
|
|
|
Sleep(100);
|
|
|
|
Sleep(100);
|
|
|
|
pThread = AfxBeginThread(CtrlSoftWareRunHeartBeatThread, this);
|
|
|
|
pThread = AfxBeginThread(CtrlSoftWareRunHeartBeatThread, this);
|
|
|
|
|
|
|
|
Sleep(100);
|
|
|
|
|
|
|
|
pThread = AfxBeginThread(UpDataSecsProcessStateThread, this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void CDeviceStateMgr::OnDeviceInit()
|
|
|
|
void CDeviceStateMgr::OnDeviceInit()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -481,6 +489,58 @@ void CDeviceStateMgr::SoftWareRunHeartBeat()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CDeviceStateMgr::UpDataSecsProcessState()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//第一次检查前的延时
|
|
|
|
|
|
|
|
Sleep(FIRST_OPEN_DELAY);
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (gAllThreadMgr.IsbStopAllThread())
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
set<ePJobState> StateSet1;
|
|
|
|
|
|
|
|
StateSet1.insert(_PJobState_QUEUED);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set<ePJobState> StateSet2;
|
|
|
|
|
|
|
|
StateSet2.insert(_PJobState_PROCESSING);
|
|
|
|
|
|
|
|
//刷新状态的顺序需要按照紧急级别排列
|
|
|
|
|
|
|
|
if (!IsDeviceInitialize())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurProcessState(_ProcessState_INIT);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (gCommonFlowMgr->GetJobStopType()>_JobStopType_Null
|
|
|
|
|
|
|
|
&&gJobQueueMgr->HasJob())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurProcessState(_ProcessState_PAUSED);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (gCmdInvoker_WaferAneal.IsbExcuting()&&gAnnealMonitoringMgr->IsAnnealProcessExt())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurProcessState(_ProcessState_PROCESSING);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (gCommonFlowMgr->IsbAutoRunning()&&gJobQueueMgr->HasRunningPJob())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurProcessState(_ProcessState_SETTING_UP);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if ((gJobQueueMgr->CheckLoadPortJob_ByStateSet(_LoadPortType_Port1, StateSet1)
|
|
|
|
|
|
|
|
|| gJobQueueMgr->CheckLoadPortJob_ByStateSet(_LoadPortType_Port2, StateSet1))
|
|
|
|
|
|
|
|
&& !gJobQueueMgr->HasRunningPJob())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurProcessState(_ProcessState_READY);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (_FoupState_OFF==gFoupLoadPortMgr->GetFoupState(_LoadPortType_Port1)
|
|
|
|
|
|
|
|
&& _FoupState_OFF == gFoupLoadPortMgr->GetFoupState(_LoadPortType_Port2)
|
|
|
|
|
|
|
|
&&gWarningMgr->HasWarningMsg(_WarningType_Warning))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurProcessState(_ProcessState_IDLE_WITH_ALARMS);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (_FoupState_OFF == gFoupLoadPortMgr->GetFoupState(_LoadPortType_Port1)
|
|
|
|
|
|
|
|
&& _FoupState_OFF == gFoupLoadPortMgr->GetFoupState(_LoadPortType_Port2)
|
|
|
|
|
|
|
|
&& !gWarningMgr->HasWarningMsg(_WarningType_Warning))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurProcessState(_ProcessState_IDLE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Sleep(1000);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if 1
|
|
|
|
#if 1
|
|
|
|
//更新常用IO 的状态(这个函数只是读取相应的值,不进行具体的通信操作)
|
|
|
|
//更新常用IO 的状态(这个函数只是读取相应的值,不进行具体的通信操作)
|
|
|
|