Commit 20fcaaf6812898777f629b28b3ed0794c1d39551
1 parent
91480de3c3
Exists in
master
and in
2 other branches
에러 마스크 별도 적용
Showing
3 changed files
with
18 additions
and
5 deletions
Show diff stats
app/gui/oven_control/main.cpp
@@ -19,11 +19,13 @@ int main(int argc, char *argv[]) | @@ -19,11 +19,13 @@ int main(int argc, char *argv[]) | ||
19 | UdpHandler *udp = UdpHandler::getInstance(); | 19 | UdpHandler *udp = UdpHandler::getInstance(); |
20 | interface->setUdpHandler(udp); | 20 | interface->setUdpHandler(udp); |
21 | 21 | ||
22 | + oven->setDefault(Define::CombiMode); | ||
23 | + | ||
22 | Config::getInstance(oven); | 24 | Config::getInstance(oven); |
23 | 25 | ||
24 | OvenStatistics::getInstance(oven); | 26 | OvenStatistics::getInstance(oven); |
25 | 27 | ||
26 | - oven->setDefault(Define::CombiMode); | 28 | + |
27 | 29 | ||
28 | // QTranslator* trans = new QTranslator(); | 30 | // QTranslator* trans = new QTranslator(); |
29 | // qDebug() << trans->load(":/lang_en.qm"); | 31 | // qDebug() << trans->load(":/lang_en.qm"); |
app/gui/oven_control/ovenstatics.cpp
@@ -16,6 +16,7 @@ OvenStatistics* OvenStatistics::getInstance(QObject *parent){ | @@ -16,6 +16,7 @@ OvenStatistics* OvenStatistics::getInstance(QObject *parent){ | ||
16 | p_singletonInstance = new OvenStatistics(parent); | 16 | p_singletonInstance = new OvenStatistics(parent); |
17 | p_singletonInstance->udp = UdpHandler::getInstance(); | 17 | p_singletonInstance->udp = UdpHandler::getInstance(); |
18 | p_singletonInstance->oven = Oven::getInstance(); | 18 | p_singletonInstance->oven = Oven::getInstance(); |
19 | + p_singletonInstance->cfg = Config::getInstance(); | ||
19 | //for singletone event debug | 20 | //for singletone event debug |
20 | // MainWindow* mw = (MainWindow*)parent; | 21 | // MainWindow* mw = (MainWindow*)parent; |
21 | // connect(mw->pcombiButton, SIGNAL(clicked()),p_singtonInstance, SLOT(onDataChanged())); | 22 | // connect(mw->pcombiButton, SIGNAL(clicked()),p_singtonInstance, SLOT(onDataChanged())); |
@@ -85,25 +86,25 @@ void OvenStatistics::onDataChanged() | @@ -85,25 +86,25 @@ void OvenStatistics::onDataChanged() | ||
85 | 86 | ||
86 | 87 | ||
87 | if(state.system_error!=0 && state.system_error != curSysErrorState){ | 88 | if(state.system_error!=0 && state.system_error != curSysErrorState){ |
88 | - processSystemError( state.system_error & SYS_ERROR_MASK,ltime); | 89 | + processSystemError( (state.system_error & sys_err_mask[cfg->getConfigValue(Define::config_model).d32]) ,ltime); |
89 | } | 90 | } |
90 | curSysErrorState = state.system_error; | 91 | curSysErrorState = state.system_error; |
91 | 92 | ||
92 | errstatetemp = state.communication_error; | 93 | errstatetemp = state.communication_error; |
93 | if(errstatetemp!=0 && errstatetemp != curCommErrorState ){ | 94 | if(errstatetemp!=0 && errstatetemp != curCommErrorState ){ |
94 | - processCommError( errstatetemp&COMM_ERROR_MASK,ltime ); | 95 | + processCommError( (errstatetemp & comm_err_mask[cfg->getConfigValue(Define::config_model).d32]),ltime ); |
95 | } | 96 | } |
96 | curCommErrorState = errstatetemp; | 97 | curCommErrorState = errstatetemp; |
97 | 98 | ||
98 | errstatetemp = state.sensor_error; | 99 | errstatetemp = state.sensor_error; |
99 | if(errstatetemp!=0 && errstatetemp != curSensorErrorState ){ | 100 | if(errstatetemp!=0 && errstatetemp != curSensorErrorState ){ |
100 | - processSensorError(errstatetemp&SENSOR_ERROR_MASK,ltime ); | 101 | + processSensorError( (errstatetemp& sensor_err_mask[cfg->getConfigValue(Define::config_model).d32]),ltime ); |
101 | } | 102 | } |
102 | curSensorErrorState = errstatetemp; | 103 | curSensorErrorState = errstatetemp; |
103 | 104 | ||
104 | errstatetemp = state.controller_error; | 105 | errstatetemp = state.controller_error; |
105 | if(errstatetemp != 0 && errstatetemp != curControlErrorState){ | 106 | if(errstatetemp != 0 && errstatetemp != curControlErrorState){ |
106 | - processStateError(errstatetemp&STATE_ERROR_MASK,ltime); | 107 | + processStateError((errstatetemp&state_err_mask[cfg->getConfigValue(Define::config_model).d32]),ltime); |
107 | } | 108 | } |
108 | curControlErrorState = errstatetemp; | 109 | curControlErrorState = errstatetemp; |
109 | 110 |
app/gui/oven_control/ovenstatics.h
@@ -8,7 +8,10 @@ | @@ -8,7 +8,10 @@ | ||
8 | #include "udphandler.h" | 8 | #include "udphandler.h" |
9 | #include "oven.h" | 9 | #include "oven.h" |
10 | #include "servicedata.h" | 10 | #include "servicedata.h" |
11 | +#include "config.h" | ||
11 | 12 | ||
13 | + | ||
14 | +#define MAX_MODEL_COUNT 12 | ||
12 | #define SYS_STATE_MAX 4 | 15 | #define SYS_STATE_MAX 4 |
13 | 16 | ||
14 | 17 | ||
@@ -208,6 +211,12 @@ public: | @@ -208,6 +211,12 @@ public: | ||
208 | 211 | ||
209 | private: | 212 | private: |
210 | 213 | ||
214 | + const uint32_t sys_err_mask[MAX_MODEL_COUNT] = {0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff,0x03ff}; | ||
215 | + const uint32_t comm_err_mask[MAX_MODEL_COUNT] = {0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f}; | ||
216 | + const uint32_t sensor_err_mask[MAX_MODEL_COUNT] = {0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213,0x0213}; | ||
217 | + const uint32_t state_err_mask[MAX_MODEL_COUNT] = {0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018,0x0018}; | ||
218 | + | ||
219 | + | ||
211 | const error_exe_type sys_err_type_def[SYS_STATE_MAX][SYS_ERR_MAX]={ //30047 | 220 | const error_exe_type sys_err_type_def[SYS_STATE_MAX][SYS_ERR_MAX]={ //30047 |
212 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr, | 221 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr, |
213 | error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_OFF_COOK_OFF state | 222 | 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: | @@ -255,6 +264,7 @@ private: | ||
255 | static OvenStatistics* p_singletonInstance; | 264 | static OvenStatistics* p_singletonInstance; |
256 | UdpHandler *udp; | 265 | UdpHandler *udp; |
257 | Oven* oven; | 266 | Oven* oven; |
267 | + Config* cfg; | ||
258 | oven_control_t control; | 268 | oven_control_t control; |
259 | oven_state_t state; | 269 | oven_state_t state; |
260 | error_item* m_pLastErrItem; | 270 | error_item* m_pLastErrItem; |