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++
141 lines
7.1 KiB
C++
#pragma once
|
|
#include "module.h"
|
|
|
|
//报警错误的类型(后期只能在后面增加类型)
|
|
enum EWarningCode
|
|
{
|
|
_Warning_Code_00 = 0,//
|
|
_Warning_Code_01,//"Motion Ctrl Init Devs Error";//运动控制器初始化错误
|
|
_Warning_Code_02,//"Motion Ctrl Devs State Error";//运动控制器状态错误
|
|
_Warning_Code_03,//"Motion Ctrl Speed Error";//运动控制器速度错误
|
|
_Warning_Code_04,//"Motion Ctrl Move Error";//运动控制器移动错误
|
|
_Warning_Code_05,//"Motion Ctrl I/O Error";//运动控制器IO错误
|
|
_Warning_Code_06,//"PLC Communication Error";//PLC 通信错误
|
|
_Warning_Code_07,//"Motor W Drive Error";//光闸电机报警(PLC 点位反馈)
|
|
_Warning_Code_08,//"Motor Z Drive Error";//Z 轴电机报警(PLC 点位反馈)
|
|
_Warning_Code_09,//"Machine Gate Check Err";//机械关闸检查失败
|
|
_Warning_Code_10,//"Laser Beam Check Err";//光束检测失败
|
|
_Warning_Code_11,//"Wafer adsorption Err";//晶圆吸附检测异常
|
|
_Warning_Code_12,//"Door State Check Err";//门状态检测异常
|
|
_Warning_Code_13,//"Laipu IO Card Init Devs Error";//莱普pci365 卡初始化错误
|
|
_Warning_Code_14,//"Authorization Error";//授权异常
|
|
_Warning_Code_15,//"Dis Meter Error";//激光测距仪错误
|
|
_Warning_Code_16,//"Laser Power Meter Error";//激光功率计错误
|
|
_Warning_Code_17,//"Laser Spot Meter Error";//光束分析仪错误
|
|
_Warning_Code_18,//"Laser Device Comm Error";//激光器通信错误
|
|
_Warning_Code_19,//"Laser device state Error";//激光器状态错误
|
|
_Warning_Code_20,//"Oscilloscope state Error";//tek 示波器状态错误
|
|
_Warning_Code_21,//"Operate Ldd Error";//操作激光LDD 错误
|
|
_Warning_Code_22,//"Transfer Wafer Error";//wafer 传输错误
|
|
_Warning_Code_23,//"Laser Energy Density Check Err";//Recipe 功率密度检测失败
|
|
_Warning_Code_24,//"Red Laser Device Comm Error";//红光激光器通信错误
|
|
_Warning_Code_25,//"Red Laser device state Error";//红光激光器状态错误
|
|
_Warning_Code_26,//"Transfer Arm Alarm";//传片机报警(PLC 点位反馈)
|
|
_Warning_Code_27,//"Water leaking Alarm";//红光激光器漏水(PLC 点位反馈)
|
|
_Warning_Code_28,//"O2 Senser Alarm";//氧气含量过低报警(PLC 点位反馈)
|
|
_Warning_Code_29,//"Wind pressure Alarm";//风压检测报警(PLC 点位反馈)
|
|
_Warning_Code_30,//"Device Temperature Alarm";//机台温度报警(PLC 点位反馈)
|
|
_Warning_Code_31,//"APT pressure Alarm";//APT负压报警(PLC 点位反馈)
|
|
_Warning_Code_32,//"Smoke Senser Alarm";//烟雾传感器报警(PLC 点位反馈)
|
|
_Warning_Code_33,//"Wave Form Channel Error";//波形发生器错误
|
|
_Warning_Code_34,//"Laser Cooling Alarm";//绿光水冷机报警(PLC 点位反馈)
|
|
_Warning_Code_35,//"Water leaking Alarm";//载盘水冷机漏水(PLC 点位反馈)
|
|
_Warning_Code_36,//"Water leaking Alarm";//绿光激光器漏水(PLC 点位反馈)
|
|
_Warning_Code_37,//"Water leaking Alarm";//绿光水冷机漏水(PLC 点位反馈)
|
|
_Warning_Code_38,//"Water leaking Alarm";//总进水盘漏水(PLC 点位反馈)
|
|
_Warning_Code_39,//"Water leaking Alarm";//总出水盘漏水(PLC 点位反馈)
|
|
_Warning_Code_40,//"Laser Par Error";//激光器参数错误
|
|
_Warning_Code_41,//"Laser1 Pow Check Error";//激光1 功率点检错误
|
|
_Warning_Code_42,//"Laser2 Pow Check Error";//激光2 功率点检错误
|
|
_Warning_Code_43,//"Red Laser Pow Check Error";//红光功率点检错误
|
|
_Warning_Code_44,//"Wafer Aligner Error";//准直器错误
|
|
_Warning_Code_45,//"Oxygen Check Error";//氧气浓度检测错误
|
|
_Warning_Code_46,//"Tempratue Measure Error";//温度检测错误
|
|
_Warning_Code_47,//"Anneal Pow Check Error";//退火过程功率监控错误
|
|
_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,//
|
|
};
|
|
//报警的类型
|
|
enum EWarningType
|
|
{
|
|
_WarningType_Warning = 0,//一般性报警
|
|
_WarningType_Error,//严重报警
|
|
};
|
|
#define WARNING_ON true
|
|
#define WARNING_OFF false
|
|
|
|
//报警状态
|
|
class CWarningState
|
|
{
|
|
public:
|
|
CWarningState(void)
|
|
{
|
|
m_bWarning = false;//是否正在报警
|
|
m_pModule = NULL;//用于响应报警清除的模块指针(有些报警需要再次检测)
|
|
|
|
m_bNeedInitDevice = false;//清除错误状态的时候是否需要重新初始化设备
|
|
m_bStopAnnealFlow = true;//是否立即终止退火过程
|
|
m_bSendToServer = false;//是否发送到服务器
|
|
m_SecsAlarmId = 0;
|
|
}
|
|
public:
|
|
EWarningCode m_WarningCode;//报警错误的code
|
|
int m_SecsAlarmId;//发送给Secs 服务器的alarm id(定义在Alarm.csv)
|
|
bool m_bWarning;//是否正在报警
|
|
bool m_bNeedInitDevice;//清除错误状态的时候是否需要重新初始化设备
|
|
bool m_bStopAnnealFlow;//是否立即终止退火过程
|
|
bool m_bSendToServer;//报警时是否发送给服务器
|
|
CString m_Description;//报警描述(固定)
|
|
CString m_AddInfo;//附加信息(由报警发生位置设置,用于区分相同类型报警)
|
|
CString m_DateTime;//报警发生的时间
|
|
CModule* m_pModule;//用于响应报警清除的模块指针
|
|
};
|
|
|
|
//报警管理
|
|
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;//当前所有报警状态(用来判断报警状态是否变化)
|
|
vector<CWarningState> m_RecordInfoVec;//当前显示的报警信息列表
|
|
bool m_bClearAllWarningState;//是否正在清空报警
|
|
};
|
|
|
|
extern CWarningMgr *gWarningMgr; |