123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- #pragma once
- //#pragma warning(disable:4251)
- #include <vector>
- #include <mutex>
- #include <map>
- #include "string.h"
- #include "dt.h"
- #include "CLog.h"
- enum BUTTON_TYPE
- {
- CLOSE_BUTTON = 0x1, //关闭
- STOP_BUTTON = 0x2, //终止
- REPEAT_BUTTON = 0x4,//重复
- IGNORE_BUTTON = 0x8,//忽略
- };
- typedef struct
- {
- int eViewButton; //弹框需显示的按钮(BUTTON_TYPE)的组合
- LogStream::LogLevel iLevel; //报警级别
- long iId; //报警Id
- std::string strDescribe; //报警描述
- std::string strTip; //报警提示
- std::string strHelp; //报警帮助信息
- }MESSAGE_INFO;
- enum AlarmID
- {
- //初始化错误
- SoftWareInitError,
- ReadDBError,
- GetAxisError,
- CardInitError,
- ModuleInitError,
- //轴
- ZHotZone,
- XHotZone,
- YHotZone,
- AxisMoveError,
- AxisStopError,
- GetAxisPosError,
- GetCurrentError,
- ChangeForceCurrentError,
- AxisOnError,
- AxisOffError,
- AxisHomeError,
- AxisTimeOut,
- RunAcsBufferError,
- StopAcsBufferError,
- WriteAcsBufferError,
- GetAcsBufferError,
- WriteSocketError,
- WriteSerialError,
- SetAxisParamError,
- //IO
- GetIOStatusError,
- SetIOError,
- //坐标系
- CoordMoveError,
- CoordTimeOut,
- //模组
- DieLose, //晶粒丢失
- NozzleBlocked, //吸嘴堵塞
- ExceedEjectorMaxLifeTime,
- ExceedNozzleMaxLifeTime,
- WaitTemperatureTimeOut,
- NozzleNotExist,
- NozzleHavedExist,
- UnloadNozzleFail,
- LoadNozzleFail,
- WaferZAtUpPos,
- WaferRingNotInPos,
- WaferRunOut,
- //视觉
- CameraGrabFail,
- TempIdWrong,
- PRCameraIdWrong,
- CreateTempError,
- SearchTempError,
- SearchTempWithoutXResult,
- SearchTempWithoutYResult,
- SearchTempWithoutAngleResult,
- AlnExceedDeviation,
- // 标定
- RCalibError,
- HandEyeCalibError,
- FindForceTimeOut,
- //提示
- PleasePlaceCalss,
- CalibHalfStop,
- //其他
- LightCtrlConnectError,
- SetLightError,
- GetLightError,
- SetTemperatureError,
- GetTemperatureError,
- TemperatureCtrlConnectError,
- TemperatureCtrlTypeError,
- };
- struct MixAlarmMessge
- {
- AlarmID id;
- std::string chineseInfo;
- std::string EnglishInfo;
- };
- //报警弹框回调函数
- typedef BUTTON_TYPE(*CallMessageBox) (MESSAGE_INFO stMsgInfo);
- class __declspec(dllexport) CMessageBox
- {
- private:
- static std::mutex m_Mutex;
- static CMessageBox* m_pMessageBox;
- std::vector<MESSAGE_INFO> m_vecMessageBox;
- CallMessageBox m_funCallMessageBox = nullptr;
- std::mutex m_PopBoxMutex;
- //用于消息发布
- //void* m_pPubSocket;
- //void* m_pSubscriberSocket;
- long Init();
- void AddPopMassage(MESSAGE_INFO stMsgInfo);
- void ErasePopMassage(int iId);
- public:
- // 获取单实例对象
- static CMessageBox* GetInstance();
- //static CMessageBox* GetInstance();
- void SetCallMessageBoxFunc(CallMessageBox func);
-
- void ClearAllPopMassage();
- BUTTON_TYPE PopMassageBox(long iId, std::string strDescribe,
- LogStream::LogLevel iLevel = LogStream::LogLevel::Error, int eViewButton = BUTTON_TYPE::CLOSE_BUTTON, std::string strTip="", std::string strHelp = "");
- };
|