diff --git a/app/gui/oven_control/main.cpp b/app/gui/oven_control/main.cpp index 872a6a5..b7311a9 100644 --- a/app/gui/oven_control/main.cpp +++ b/app/gui/oven_control/main.cpp @@ -19,11 +19,13 @@ int main(int argc, char *argv[]) UdpHandler *udp = UdpHandler::getInstance(); interface->setUdpHandler(udp); + oven->setDefault(Define::CombiMode); + Config::getInstance(oven); OvenStatistics::getInstance(oven); - oven->setDefault(Define::CombiMode); + // QTranslator* trans = new QTranslator(); // qDebug() << trans->load(":/lang_en.qm"); diff --git a/app/gui/oven_control/ovenstatics.cpp b/app/gui/oven_control/ovenstatics.cpp index 8ac7a14..c379112 100644 --- a/app/gui/oven_control/ovenstatics.cpp +++ b/app/gui/oven_control/ovenstatics.cpp @@ -16,6 +16,7 @@ OvenStatistics* OvenStatistics::getInstance(QObject *parent){ p_singletonInstance = new OvenStatistics(parent); p_singletonInstance->udp = UdpHandler::getInstance(); p_singletonInstance->oven = Oven::getInstance(); + p_singletonInstance->cfg = Config::getInstance(); //for singletone event debug // MainWindow* mw = (MainWindow*)parent; // connect(mw->pcombiButton, SIGNAL(clicked()),p_singtonInstance, SLOT(onDataChanged())); @@ -85,25 +86,25 @@ void OvenStatistics::onDataChanged() if(state.system_error!=0 && state.system_error != curSysErrorState){ - processSystemError( state.system_error & SYS_ERROR_MASK,ltime); + processSystemError( (state.system_error & sys_err_mask[cfg->getConfigValue(Define::config_model).d32]) ,ltime); } curSysErrorState = state.system_error; errstatetemp = state.communication_error; if(errstatetemp!=0 && errstatetemp != curCommErrorState ){ - processCommError( errstatetemp&COMM_ERROR_MASK,ltime ); + processCommError( (errstatetemp & comm_err_mask[cfg->getConfigValue(Define::config_model).d32]),ltime ); } curCommErrorState = errstatetemp; errstatetemp = state.sensor_error; if(errstatetemp!=0 && errstatetemp != curSensorErrorState ){ - processSensorError(errstatetemp&SENSOR_ERROR_MASK,ltime ); + processSensorError( (errstatetemp& sensor_err_mask[cfg->getConfigValue(Define::config_model).d32]),ltime ); } curSensorErrorState = errstatetemp; errstatetemp = state.controller_error; if(errstatetemp != 0 && errstatetemp != curControlErrorState){ - processStateError(errstatetemp&STATE_ERROR_MASK,ltime); + processStateError((errstatetemp&state_err_mask[cfg->getConfigValue(Define::config_model).d32]),ltime); } curControlErrorState = errstatetemp; diff --git a/app/gui/oven_control/ovenstatics.h b/app/gui/oven_control/ovenstatics.h index fb26f5b..0be17d6 100644 --- a/app/gui/oven_control/ovenstatics.h +++ b/app/gui/oven_control/ovenstatics.h @@ -8,7 +8,10 @@ #include "udphandler.h" #include "oven.h" #include "servicedata.h" +#include "config.h" + +#define MAX_MODEL_COUNT 12 #define SYS_STATE_MAX 4 @@ -208,6 +211,12 @@ public: private: + const uint32_t sys_err_mask[MAX_MODEL_COUNT] = {0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff}; + const uint32_t comm_err_mask[MAX_MODEL_COUNT] = {0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f}; + const uint32_t sensor_err_mask[MAX_MODEL_COUNT] = {0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213}; + const uint32_t state_err_mask[MAX_MODEL_COUNT] = {0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018}; + + const error_exe_type sys_err_type_def[SYS_STATE_MAX][SYS_ERR_MAX]={ //30047 {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr, error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_OFF_COOK_OFF state @@ -255,6 +264,7 @@ private: static OvenStatistics* p_singletonInstance; UdpHandler *udp; Oven* oven; + Config* cfg; oven_control_t control; oven_state_t state; error_item* m_pLastErrItem;