#ifndef OVENSTATICS_H #define OVENSTATICS_H #include #include #include #include "../../app-prime-modbus/include/all_share.h" #include "udphandler.h" #include "oven.h" #include "servicedata.h" #include "config.h" #define MAX_MODEL_COUNT 12 #define SYS_STATE_MAX 5 #define DELAY_ERROR_TIME 10 //Secs #define SYS_ERR_MAX 10 #define SYS_ERROR_MASK 0x03ff #define COMM_ERROR_MASK 0x001f #define SENSOR_ERROR_MASK 0x0213 #define STATE_ERROR_MASK 0x0018 #define SYS_ERR_MASK_ERR_CLEAR_COOKING 0x00ff #define SYS_ERR_MASK_ERR_CLEAR_NONCOOKING 0x00ff #define SYS_ERR_MASK_COOKING 0x00ff #define SYS_ERR_MASK_NONCOOKING (SYS_ERR_OVNE_TEMP_ALARM) #define COMM_ERR_MAX 5 #define STATE_ERR_MAX 5 #define COMM_ERR_MASK_ERR_CLEAR_COOKING 0x0000 #define COMM_ERR_MASK_ERR_CLEAR_NONCOOKING 0x0000 #define COMM_ERR_MASK_COOKING 0x0000 #define COMM_ERR_MASK_NONCOOKING 0x0000 #define SENSOR_ERR_MAX 10 #define SENSOR_ERR_MASK_ERR_CLEAR 0x0000 #define SENSOR_ERR_MASK_COOKING 0x0000 #define SENSOR_ERR_MASK_NONCOOKING 0x0000 #define MAKE_MASK(MASK) (1< m_mapPopupList; uint32_t m_nLastPopupidx; bool m_bPopupShow; bool curdoorstate; uint16_t curSysErrorState; uint16_t curCommErrorState; uint16_t curSensorErrorState; uint16_t curControlErrorState; bool bNeedErrorClear; bool bDataRefreshed; realtime_data realdata; explicit OvenStatistics(QObject* parent); ~OvenStatistics(); void processSystemError(uint16_t errflag,time_t ltime); void processCommError(uint16_t errflag,time_t ltime); void processSensorError(uint16_t errflag, time_t ltime); void processStateError(uint16_t errflat, time_t ltime); void processErrorItems(error_item *item, error_exe_type errtype, const QString &MsgDesc,const QString &MsgTitle, time_t ltime, error_sound_type errsnd=error_sound1); public: bool loadWashState(void){return srvdata->loadWashState();} bool setWashState(bool bval,bool save=true){return srvdata->setWashState(bval,save);} uint32_t loadTotalCookingTime(void){return srvdata->loadTotalCookingTime();} bool setTotalCookingTime(uint32_t val, bool save=true){return srvdata->setTotalCookingTime(val,save);} bool addTotalCookingTime(uint32_t val, bool save=true){return srvdata->addTotalCookingTime(val,save);} uint32_t loadTotalCookingCount(void){return srvdata->loadTotalCookingCount();} bool setTotalCookingCount(uint32_t val,bool save = true){return srvdata->setTotalCookingCount(val,save);} bool addTotalCookingCount(uint32_t val, bool save = true){return srvdata->addTotalCookingCount(val,save);} public slots: void onDataChanged(); void oneSecTimerFired(void); void onErrorPopupClosed(int erridx); signals: void onErrorFired(int erridx); }; #endif // OVENSTATICS_H