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.

141 lines
7.1 KiB
C

#pragma once
#include "module.h"
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD>ں<EFBFBD><DABA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
enum EWarningCode
{
_Warning_Code_00 = 0,//
_Warning_Code_01,//"Motion Ctrl Init Devs Error";//<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_02,//"Motion Ctrl Devs State Error";//<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>
_Warning_Code_03,//"Motion Ctrl Speed Error";//<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶȴ<D9B6><C8B4><EFBFBD>
_Warning_Code_04,//"Motion Ctrl Move Error";//<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_05,//"Motion Ctrl I/O Error";//<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IO<49><4F><EFBFBD><EFBFBD>
_Warning_Code_06,//"PLC Communication Error";//PLC ͨ<>Ŵ<EFBFBD><C5B4><EFBFBD>
_Warning_Code_07,//"Motor W Drive Error";//<2F><>բ<EFBFBD><D5A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_08,//"Motor Z Drive Error";//Z <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_09,//"Machine Gate Check Err";//<2F><>е<EFBFBD><D0B5>բ<EFBFBD><D5A2><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>
_Warning_Code_10,//"Laser Beam Check Err";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>
_Warning_Code_11,//"Wafer adsorption Err";//<2F><>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_12,//"Door State Check Err";//<2F><>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_13,//"Laipu IO Card Init Devs Error";//<2F><><EFBFBD><EFBFBD>pci365 <20><><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_14,//"Authorization Error";//<2F><>Ȩ<EFBFBD>
_Warning_Code_15,//"Dis Meter Error";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD><C7B4><EFBFBD>
_Warning_Code_16,//"Laser Power Meter Error";//<2F><><EFBFBD><EFBFBD>ʼƴ<CABC><C6B4><EFBFBD>
_Warning_Code_17,//"Laser Spot Meter Error";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD><C7B4><EFBFBD>
_Warning_Code_18,//"Laser Device Comm Error";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD>
_Warning_Code_19,//"Laser device state Error";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>
_Warning_Code_20,//"Oscilloscope state Error";//tek ʾ<><CABE><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>
_Warning_Code_21,//"Operate Ldd Error";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>LDD <20><><EFBFBD><EFBFBD>
_Warning_Code_22,//"Transfer Wafer Error";//wafer <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_23,//"Laser Energy Density Check Err";//Recipe <20><><EFBFBD><EFBFBD><EFBFBD>ܶȼ<DCB6><C8BC><EFBFBD>ʧ<EFBFBD><CAA7>
_Warning_Code_24,//"Red Laser Device Comm Error";//<2F><><EFBFBD><EFBFBD><E2BCA4><EFBFBD><EFBFBD>ͨ<EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD>
_Warning_Code_25,//"Red Laser device state Error";//<2F><><EFBFBD><EFBFBD><E2BCA4><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>
_Warning_Code_26,//"Transfer Arm Alarm";//<2F><>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_27,//"Water leaking Alarm";//<2F><><EFBFBD><EFBFBD><E2BCA4><EFBFBD><EFBFBD>©ˮ(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_28,//"O2 Senser Alarm";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD>(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_29,//"Wind pressure Alarm";//<2F><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><E2B1A8>(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_30,//"Device Temperature Alarm";//<2F><>̨<EFBFBD>¶ȱ<C2B6><C8B1><EFBFBD>(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_31,//"APT pressure Alarm";//APT<50><54>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_32,//"Smoke Senser Alarm";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_33,//"Wave Form Channel Error";//<2F><><EFBFBD>η<EFBFBD><CEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_34,//"Laser Cooling Alarm";//<2F>̹<EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_35,//"Water leaking Alarm";//<2F><><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>©ˮ(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_36,//"Water leaking Alarm";//<2F>̹⼤<CCB9><E2BCA4><EFBFBD><EFBFBD>©ˮ(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_37,//"Water leaking Alarm";//<2F>̹<EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>©ˮ(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_38,//"Water leaking Alarm";//<2F>ܽ<EFBFBD>ˮ<EFBFBD><CBAE>©ˮ(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_39,//"Water leaking Alarm";//<2F>ܳ<EFBFBD>ˮ<EFBFBD><CBAE>©ˮ(PLC <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>)
_Warning_Code_40,//"Laser Par Error";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_41,//"Laser1 Pow Check Error";//<2F><><EFBFBD><EFBFBD>1 <20><><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_42,//"Laser2 Pow Check Error";//<2F><><EFBFBD><EFBFBD>2 <20><><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_43,//"Red Laser Pow Check Error";//<2F><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_44,//"Wafer Aligner Error";//׼ֱ<D7BC><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_45,//"Oxygen Check Error";//<2F><><EFBFBD><EFBFBD>Ũ<EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_46,//"Tempratue Measure Error";//<2F>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_Warning_Code_47,//"Anneal Pow Check Error";//<2F>˻<EFBFBD><CBBB><EFBFBD><EFBFBD>̹<EFBFBD><CCB9>ʼ<EFBFBD><CABC>ش<EFBFBD><D8B4><EFBFBD>
_Warning_Code_48,//
_Warning_Code_49,//
_Warning_Code_50,//
_Warning_Code_51,//
_Warning_Code_52,//
_Warning_Code_53,//
_Warning_Code_54,//
_Warning_Code_55,//
_Warning_Code_56,//
_Warning_Code_57,//
_Warning_Code_58,//
_Warning_Code_59,//
};
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum EWarningType
{
_WarningType_Warning = 0,//һ<><D2BB><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>
_WarningType_Error,//<2F><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>
};
#define WARNING_ON true
#define WARNING_OFF false
//<2F><><EFBFBD><EFBFBD>״̬
class CWarningState
{
public:
CWarningState(void)
{
m_bWarning = false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>
m_pModule = NULL;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ָ<EFBFBD><D6B8>(<28><>Щ<EFBFBD><D0A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ٴμ<D9B4><CEBC><EFBFBD>)
m_bNeedInitDevice = false;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC>ʱ<EFBFBD><CAB1><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>³<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>
m_bStopAnnealFlow = true;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>
m_bSendToServer = false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_SecsAlarmId = 0;
}
public:
EWarningCode m_WarningCode;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>code
int m_SecsAlarmId;//<2F><><EFBFBD>͸<EFBFBD>Secs <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>alarm id(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Alarm.csv)
bool m_bWarning;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>
bool m_bNeedInitDevice;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC>ʱ<EFBFBD><CAB1><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>³<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>
bool m_bStopAnnealFlow;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>
bool m_bSendToServer;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>͸<EFBFBD><CDB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CString m_Description;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28>̶<EFBFBD>)
CString m_AddInfo;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ(<28>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD>)
CString m_DateTime;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
CModule* m_pModule;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ָ<EFBFBD><D6B8>
};
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CWarningMgr :public CModule
{
public:
CWarningMgr(void);
~CWarningMgr(void);
virtual void OnAppInitialize();
void SendWarningMsg(EWarningCode WarningCode,CString AddInfo,bool bThowException=false);
void ClearAllWarningState();
bool HasWarningMsg(bool bException=false);
bool HasStopAnnealWarningMsg();
void InsertRecordList(CListCtrl &List,CString Date,bool bShowByMonth);
void InitWarningStateToList(CListCtrl &List);
void UpdateWarningStateToList(CListCtrl &List);
bool IsbClearAllWarningState(){return m_bClearAllWarningState;};
bool GetWarningState(EWarningCode WarningCode);
private:
void AddWarningRecord(CWarningState &WarningState);
CString GetRecordFilePath(CString FileName);
CString GetCurRecordFileName();
void ReadRecordInfoFile(vector<CWarningState> &RecordInfoVec,CString Path);
void WriteRecordInfoToFile(vector<CWarningState> &RecordInfoVec,CString RecordFilePath);
CString GetMonthStr(CString Date);
void GetOneMonthRecordFileName(CString Date,vector<CString> &RecordFileNameVec);
void GetOneMonthRecord(CString Date,vector<CWarningState> &RecordInfoVec);
void InsertRecordListExt(CListCtrl &List,vector<CWarningState> &WarningStateVec,bool bOnlyWarning);
CString GetWarningCode(CWarningState &WarningState);
void CreatRecordPath();
void InitWarningStateVec();
void SendWarningMsgExt(CWarningState &WarningState);
void SyncWarningRecordVec(vector<CWarningState> &RecordInfoVec);
private:
vector<CWarningState> m_WarningStateVec;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD>б<EFBFBD><D0B1><EFBFBD>״̬(<28><><EFBFBD><EFBFBD><EFBFBD>жϱ<D0B6><CFB1><EFBFBD>״̬<D7B4>Ƿ<EFBFBD><C7B7>仯)
vector<CWarningState> m_RecordInfoVec;//<2F><>ǰ<EFBFBD><C7B0>ʾ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>б<EFBFBD>
bool m_bClearAllWarningState;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>
};
extern CWarningMgr *gWarningMgr;