You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.6 KiB
C

#pragma once
#include "GlobalDefine.h"
//<2F>̵߳<DFB3><CCB5><EFBFBD><EFBFBD><EFBFBD>
enum EThreadType
{
_EThreadType_NULL=0,
_EThreadType_AutoWorkFlowCtrlThread,//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD>߳<EFBFBD>
_EThreadType_LaserSleepThread,//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
_EThreadType_GetDataPtThread,//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
_EThreadType_ExecuteStepThread,//<2F><><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>߳<EFBFBD>
_EThreadType_FastReadInfoThread,//״̬<D7B4><CCAC>ȡ<EFBFBD>߳<EFBFBD>(fast)
_EThreadType_SlowReadInfoThread,//״̬<D7B4><CCAC>ȡ<EFBFBD>߳<EFBFBD>(slow)
_EThreadType_PlcReadInfoThread,//PLC ͨ<><CDA8><EFBFBD>߳<EFBFBD>
_EThreadType_LaserDisMeterReadThread,//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>߳<EFBFBD>
_EThreadType_SwitchLaserLddThread,//Beamtech<63><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ldd <20>߳<EFBFBD>
_EThreadType_BeamtechSetParToLaserThread,//Beamtech<63><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
_EThreadType_TimingProgressThread,//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
_EThreadType_WaferAdjustCtrlThread,//<2F><>Բ׼ֱ<D7BC>߳<EFBFBD>
_EThreadType_RecordTimeThread,//<2F><>¼<EFBFBD><C2BC>ʱ<EFBFBD>߳<EFBFBD>
_EThreadType_DlgDeviceStateInfoTimer,//״̬<D7B4><CCAC>Ϣtimer
_EThreadType_DlgDeviceStateInfoTimer2,//״̬<D7B4><CCAC>Ϣtimer2
_EThreadType_ReadLaserPower,//<2F><><EFBFBD>ʼ<EFBFBD>timer
_EThreadType_WaitTransferLoadEndThread,//<2F>ȴ<EFBFBD>load <20><><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
_EThreadType_CheckTransferLoadThread,//<2F><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫload <20><><EFBFBD>߳<EFBFBD>
_EThreadType_ReadLaserInfoThread,
_EThreadType_ReadRedLaserInfoThread,
_EThreadType_ReadTekOscilloscopeInfoThread,//<2F><>ȡʾ<C8A1><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
_EThreadType_AutoTransferFlowThread,//<2F>Զ<EFBFBD><D4B6><EFBFBD>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD>߳<EFBFBD>
_EThreadType_ReadTransferArmInfoThread,
_EThreadType_UpdateSecsDataThread,
_EThreadType_CtrlHostJobThread,
_EThreadType_CyclicRunThread,
};
class CThreadInfo
{
public:
CThreadInfo(void)
{
m_bRunning = false;
m_pThread = NULL;//<2F>̵߳<DFB3>ָ<EFBFBD><D6B8>
};
public:
EThreadType m_ThreadType;//<2F>߳<EFBFBD><DFB3><EFBFBD><EFBFBD><EFBFBD>
CWinThread* m_pThread;//<2F>̵߳<DFB3>ָ<EFBFBD><D6B8>
CString m_ThreadName;//<2F>̵߳<DFB3><CCB5><EFBFBD><EFBFBD><EFBFBD>
bool m_bRunning;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CString m_LastRunTime;//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ʱ<EFBFBD><CAB1>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3>Ƿ<EFBFBD><C7B7>ҵ<EFBFBD>)
};
class CAllThreadMgr
{
public:
CAllThreadMgr(void);
~CAllThreadMgr(void);
void InsertThreadInfoList(CListCtrl &List,bool bInsert);
void BindingThreadAdr(EThreadType ThreadType,CWinThread*p);
void SetThreadInfoState(EThreadType ThreadType,bool bRunning);
void StopAllThread();
bool IsbStopAllThread();
COLORREF GetStateColor(int idx);
bool HasThreadRunning();
void WriteAllTreadTimeToFile();
bool IsThreadRunning(EThreadType ThreadType);
void ShowRunningThreadName();
private:
void InitThreadInfoVec();
void UpdateThreadTime(EThreadType ThreadType);
private:
vector<CThreadInfo> m_ThreadInfoVec;//<2F>߳<EFBFBD><DFB3><EFBFBD><EFBFBD><EFBFBD>
};
extern CAllThreadMgr gAllThreadMgr;
extern bool gbStopAllThread;//ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>