Commit a7e8cc0aad82dace291939746a1b4bb33bd89576
1 parent
e84d48604c
Exists in
master
and in
2 other branches
버그 및 동작 개선
- 모델 설정 후 초기화 명령 추가 - 에러 팝업 발생 후 오븐 중지 명령 추가
Showing
8 changed files
with
114 additions
and
79 deletions
Show diff stats
app/gui/oven_control/config.cpp
| @@ -246,7 +246,8 @@ void Config::applyConfig(){ | @@ -246,7 +246,8 @@ void Config::applyConfig(){ | ||
| 246 | ipdata.netmask = QString("%1.%2.%3.%4").arg(configlist.items.netmask.d8.d8_0).arg(configlist.items.netmask.d8.d8_1).arg(configlist.items.netmask.d8.d8_2).arg(configlist.items.netmask.d8.d8_3); | 246 | ipdata.netmask = QString("%1.%2.%3.%4").arg(configlist.items.netmask.d8.d8_0).arg(configlist.items.netmask.d8.d8_1).arg(configlist.items.netmask.d8.d8_2).arg(configlist.items.netmask.d8.d8_3); |
| 247 | 247 | ||
| 248 | System::setIP(ipdata); | 248 | System::setIP(ipdata); |
| 249 | - | 249 | + //All Error Reset |
| 250 | + UdpHandler::getInstance()->set(TG_ERROR_CLEAR,0xCECE); | ||
| 250 | } | 251 | } |
| 251 | 252 | ||
| 252 | Define::config_item Config::getConfigValue(Define::ConfigType idx){ | 253 | Define::config_item Config::getConfigValue(Define::ConfigType idx){ |
app/gui/oven_control/errorpopupdlg.cpp
| @@ -3,8 +3,9 @@ | @@ -3,8 +3,9 @@ | ||
| 3 | #include <QDebug> | 3 | #include <QDebug> |
| 4 | 4 | ||
| 5 | #include "soundplayer.h" | 5 | #include "soundplayer.h" |
| 6 | +#include "udphandler.h" | ||
| 6 | 7 | ||
| 7 | -ErrorPopupDlg::ErrorPopupDlg(QWidget *parent, const QString &MsgDesc, const QString &MsgTitle) : | 8 | +ErrorPopupDlg::ErrorPopupDlg(QWidget *parent, const QString &MsgDesc, const QString &MsgTitle, bool sendClrCmd,int erridx) : |
| 8 | QDialog(parent), | 9 | QDialog(parent), |
| 9 | ui(new Ui::ErrorPopupDlg) | 10 | ui(new Ui::ErrorPopupDlg) |
| 10 | { | 11 | { |
| @@ -20,6 +21,8 @@ ErrorPopupDlg::ErrorPopupDlg(QWidget *parent, const QString &MsgDesc, const QStr | @@ -20,6 +21,8 @@ ErrorPopupDlg::ErrorPopupDlg(QWidget *parent, const QString &MsgDesc, const QStr | ||
| 20 | 21 | ||
| 21 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 22 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 22 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 23 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 24 | + m_bClrCmd = sendClrCmd; | ||
| 25 | + m_nErrIdx = erridx; | ||
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | ErrorPopupDlg::~ErrorPopupDlg() | 28 | ErrorPopupDlg::~ErrorPopupDlg() |
| @@ -29,8 +32,9 @@ ErrorPopupDlg::~ErrorPopupDlg() | @@ -29,8 +32,9 @@ ErrorPopupDlg::~ErrorPopupDlg() | ||
| 29 | 32 | ||
| 30 | void ErrorPopupDlg::on_ctrlOkBtn_clicked() | 33 | void ErrorPopupDlg::on_ctrlOkBtn_clicked() |
| 31 | { | 34 | { |
| 32 | - //emit closedPopup(m_pParent); | 35 | + emit closedErrorPopup(m_nErrIdx); |
| 33 | qApp->setActiveWindow(m_pParent); | 36 | qApp->setActiveWindow(m_pParent); |
| 34 | this->hide(); | 37 | this->hide(); |
| 38 | + if(m_bClrCmd) UdpHandler::getInstance()->set(TG_ERROR_CLEAR,0xCECE); | ||
| 35 | close(); | 39 | close(); |
| 36 | } | 40 | } |
app/gui/oven_control/errorpopupdlg.h
| @@ -12,11 +12,12 @@ class ErrorPopupDlg : public QDialog | @@ -12,11 +12,12 @@ class ErrorPopupDlg : public QDialog | ||
| 12 | Q_OBJECT | 12 | Q_OBJECT |
| 13 | 13 | ||
| 14 | public: | 14 | public: |
| 15 | - explicit ErrorPopupDlg(QWidget *parent = 0, const QString &MsgDesc=0, const QString &MsgTitle=0); | 15 | + explicit ErrorPopupDlg(QWidget *parent = 0, const QString &MsgDesc=0, const QString &MsgTitle=0, bool sendClrCmd = false, int erridx = -1); |
| 16 | ~ErrorPopupDlg(); | 16 | ~ErrorPopupDlg(); |
| 17 | 17 | ||
| 18 | signals: | 18 | signals: |
| 19 | void closedPopup(QWidget* parent=0); | 19 | void closedPopup(QWidget* parent=0); |
| 20 | + void closedErrorPopup(int erridx); | ||
| 20 | 21 | ||
| 21 | private slots: | 22 | private slots: |
| 22 | void on_ctrlOkBtn_clicked(); | 23 | void on_ctrlOkBtn_clicked(); |
| @@ -24,6 +25,8 @@ private slots: | @@ -24,6 +25,8 @@ private slots: | ||
| 24 | private: | 25 | private: |
| 25 | Ui::ErrorPopupDlg *ui; | 26 | Ui::ErrorPopupDlg *ui; |
| 26 | QWidget* m_pParent; | 27 | QWidget* m_pParent; |
| 28 | + bool m_bClrCmd; | ||
| 29 | + int m_nErrIdx; | ||
| 27 | }; | 30 | }; |
| 28 | 31 | ||
| 29 | #endif // ERRORPOPUPDLG_H | 32 | #endif // ERRORPOPUPDLG_H |
app/gui/oven_control/main.cpp
| @@ -19,9 +19,10 @@ int main(int argc, char *argv[]) | @@ -19,9 +19,10 @@ 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 | - OvenStatistics::getInstance(oven); | ||
| 23 | Config::getInstance(oven); | 22 | Config::getInstance(oven); |
| 24 | 23 | ||
| 24 | + OvenStatistics::getInstance(oven); | ||
| 25 | + | ||
| 25 | oven->setDefault(Define::CombiMode); | 26 | oven->setDefault(Define::CombiMode); |
| 26 | 27 | ||
| 27 | // QTranslator* trans = new QTranslator(); | 28 | // QTranslator* trans = new QTranslator(); |
app/gui/oven_control/mainwindow.cpp
| @@ -52,10 +52,17 @@ void MainWindow::killChild() | @@ -52,10 +52,17 @@ void MainWindow::killChild() | ||
| 52 | instance->child->deleteLater(); | 52 | instance->child->deleteLater(); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | -void MainWindow::killChildCook() | 55 | +bool MainWindow::killChildCook() |
| 56 | { | 56 | { |
| 57 | + | ||
| 57 | if (instance->child && !instance->child->inherits("ConfigWindow")) | 58 | if (instance->child && !instance->child->inherits("ConfigWindow")) |
| 59 | + { | ||
| 60 | + qDebug() << "kill child"; | ||
| 61 | + instance->child->hide(); | ||
| 58 | instance->child->deleteLater(); | 62 | instance->child->deleteLater(); |
| 63 | + return true; | ||
| 64 | + } | ||
| 65 | + else return false; | ||
| 59 | } | 66 | } |
| 60 | 67 | ||
| 61 | void MainWindow::keyPressEvent(QKeyEvent *event) | 68 | void MainWindow::keyPressEvent(QKeyEvent *event) |
app/gui/oven_control/mainwindow.h
| @@ -22,7 +22,7 @@ public: | @@ -22,7 +22,7 @@ public: | ||
| 22 | static MainWindow *getInstance() { return instance; } | 22 | static MainWindow *getInstance() { return instance; } |
| 23 | static void jump(QMainWindow *newChild); | 23 | static void jump(QMainWindow *newChild); |
| 24 | static void killChild(); | 24 | static void killChild(); |
| 25 | - static void killChildCook(); | 25 | + static bool killChildCook(); |
| 26 | 26 | ||
| 27 | protected: | 27 | protected: |
| 28 | void keyPressEvent(QKeyEvent *event); | 28 | void keyPressEvent(QKeyEvent *event); |
app/gui/oven_control/ovenstatics.cpp
| @@ -40,6 +40,7 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent) | @@ -40,6 +40,7 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent) | ||
| 40 | curSysErrorState = 0; | 40 | curSysErrorState = 0; |
| 41 | curCommErrorState = 0; | 41 | curCommErrorState = 0; |
| 42 | curSensorErrorState = 0; | 42 | curSensorErrorState = 0; |
| 43 | + curControlErrorState = 0; | ||
| 43 | bDataRefreshed = false; | 44 | bDataRefreshed = false; |
| 44 | realdata.d32 = 0; | 45 | realdata.d32 = 0; |
| 45 | m_bPopupShow = false; | 46 | m_bPopupShow = false; |
| @@ -112,9 +113,10 @@ void OvenStatistics::processSensorError(uint16_t errflag, time_t ltime){ | @@ -112,9 +113,10 @@ void OvenStatistics::processSensorError(uint16_t errflag, time_t ltime){ | ||
| 112 | error_item *item; | 113 | error_item *item; |
| 113 | QString strMsg = "",strTitle=""; | 114 | QString strMsg = "",strTitle=""; |
| 114 | uint8_t state; | 115 | uint8_t state; |
| 115 | - if( control.system==0 && !oven->cooking()) state = SYS_OFF_COOK_OFF; | ||
| 116 | - else if(control.system != 0 && !oven->cooking()) state = SYS_ON_COOK_OFF; | ||
| 117 | - else if(control.system !=0 && oven->cooking()) state = SYS_ON_COOK_ON; | 116 | + bool bCookingState = (control.cooking || oven->cooking() || oven->preheating() || oven->cooldown()); |
| 117 | + if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; | ||
| 118 | + else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF; | ||
| 119 | + else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON; | ||
| 118 | else state = SYS_ON_COOK_OFF; | 120 | else state = SYS_ON_COOK_OFF; |
| 119 | 121 | ||
| 120 | if(errflag & MAKE_MASK(SENSOR_ERR_SENSOR_1)){ | 122 | if(errflag & MAKE_MASK(SENSOR_ERR_SENSOR_1)){ |
| @@ -187,9 +189,10 @@ void OvenStatistics::processCommError(uint16_t errflag, time_t ltime){ | @@ -187,9 +189,10 @@ void OvenStatistics::processCommError(uint16_t errflag, time_t ltime){ | ||
| 187 | error_item *item; | 189 | error_item *item; |
| 188 | QString strMsg = "",strTitle=""; | 190 | QString strMsg = "",strTitle=""; |
| 189 | uint8_t state; | 191 | uint8_t state; |
| 190 | - if( control.system==0 && !oven->cooking()) state = SYS_OFF_COOK_OFF; | ||
| 191 | - else if(control.system != 0 && !oven->cooking()) state = SYS_ON_COOK_OFF; | ||
| 192 | - else if(control.system !=0 && oven->cooking()) state = SYS_ON_COOK_ON; | 192 | + bool bCookingState = (control.cooking || oven->cooking() || oven->preheating() || oven->cooldown()); |
| 193 | + if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; | ||
| 194 | + else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF; | ||
| 195 | + else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON; | ||
| 193 | else state = SYS_ON_COOK_OFF; | 196 | else state = SYS_ON_COOK_OFF; |
| 194 | 197 | ||
| 195 | if(errflag & MAKE_MASK(COMM_ERR_BUNNER1)){ | 198 | if(errflag & MAKE_MASK(COMM_ERR_BUNNER1)){ |
| @@ -228,9 +231,10 @@ void OvenStatistics::processStateError(uint16_t errflag, time_t ltime){ | @@ -228,9 +231,10 @@ void OvenStatistics::processStateError(uint16_t errflag, time_t ltime){ | ||
| 228 | error_item *item; | 231 | error_item *item; |
| 229 | QString strMsg = "",strTitle=""; | 232 | QString strMsg = "",strTitle=""; |
| 230 | uint8_t state; | 233 | uint8_t state; |
| 231 | - if( control.system==0 && !oven->cooking()) state = SYS_OFF_COOK_OFF; | ||
| 232 | - else if(control.system != 0 && !oven->cooking()) state = SYS_ON_COOK_OFF; | ||
| 233 | - else if(control.system !=0 && oven->cooking()) state = SYS_ON_COOK_ON; | 234 | + bool bCookingState = (control.cooking || oven->cooking() || oven->preheating() || oven->cooldown()); |
| 235 | + if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; | ||
| 236 | + else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF; | ||
| 237 | + else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON; | ||
| 234 | else state = SYS_ON_COOK_OFF; | 238 | else state = SYS_ON_COOK_OFF; |
| 235 | 239 | ||
| 236 | if(errflag & MAKE_MASK(STATE_ERR_BUNNER1)){ | 240 | if(errflag & MAKE_MASK(STATE_ERR_BUNNER1)){ |
| @@ -269,9 +273,10 @@ void OvenStatistics::processSystemError(uint16_t errflag,time_t ltime){ | @@ -269,9 +273,10 @@ void OvenStatistics::processSystemError(uint16_t errflag,time_t ltime){ | ||
| 269 | error_item *item; | 273 | error_item *item; |
| 270 | QString strMsg = "",strTitle = ""; | 274 | QString strMsg = "",strTitle = ""; |
| 271 | uint8_t state; | 275 | uint8_t state; |
| 272 | - if( control.system==0 && !oven->cooking()) state = SYS_OFF_COOK_OFF; | ||
| 273 | - else if(control.system != 0 && !oven->cooking()) state = SYS_ON_COOK_OFF; | ||
| 274 | - else if(control.system !=0 && oven->cooking()) state = SYS_ON_COOK_ON; | 276 | + bool bCookingState = (control.cooking || oven->cooking() || oven->preheating() || oven->cooldown()); |
| 277 | + if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; | ||
| 278 | + else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF; | ||
| 279 | + else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON; | ||
| 275 | else state = SYS_ON_COOK_OFF; | 280 | else state = SYS_ON_COOK_OFF; |
| 276 | 281 | ||
| 277 | if( errflag & MAKE_MASK(SYS_ERR_FIRE_TRIGGER1)){ | 282 | if( errflag & MAKE_MASK(SYS_ERR_FIRE_TRIGGER1)){ |
| @@ -462,14 +467,9 @@ void OvenStatistics::oneSecTimerFired(void){ | @@ -462,14 +467,9 @@ void OvenStatistics::oneSecTimerFired(void){ | ||
| 462 | realdata.b.snv_open = (state.onoff_state2&LOAD_STATE2_SNV)==0?0:1; | 467 | realdata.b.snv_open = (state.onoff_state2&LOAD_STATE2_SNV)==0?0:1; |
| 463 | realdata.b.wsv_open = (state.onoff_state2&LOAD_STATE2_WSV)==0?0:1; | 468 | realdata.b.wsv_open = (state.onoff_state2&LOAD_STATE2_WSV)==0?0:1; |
| 464 | realdata.b.ssv_open = (state.onoff_state2&LOAD_STATE2_SSV)==0?0:1; | 469 | realdata.b.ssv_open = (state.onoff_state2&LOAD_STATE2_SSV)==0?0:1; |
| 465 | - if( (state.reserved11 & 0x0018) !=0){ | ||
| 466 | - if( (state.reserved11&0x0008) != 0){ | ||
| 467 | - realdata.b.water_level = water_level_high; | ||
| 468 | - } | ||
| 469 | - else if( (state.reserved11 & 0x0010) !=0){ | ||
| 470 | - realdata.b.water_level = water_level_low; | ||
| 471 | - } | ||
| 472 | - } | 470 | + |
| 471 | + if( (state.reserved11&0x0018) == 0x0018) realdata.b.water_level = water_level_high; | ||
| 472 | + else if( (state.reserved11&0x0018) == 0x0000) realdata.b.water_level = water_level_low; | ||
| 473 | else realdata.b.water_level = water_level_normal; | 473 | else realdata.b.water_level = water_level_normal; |
| 474 | 474 | ||
| 475 | if(srvdata->sensor_log.items.B1.high_temp.itemp < state.sensor1 ){ | 475 | if(srvdata->sensor_log.items.B1.high_temp.itemp < state.sensor1 ){ |
| @@ -549,7 +549,9 @@ void OvenStatistics::oneSecTimerFired(void){ | @@ -549,7 +549,9 @@ void OvenStatistics::oneSecTimerFired(void){ | ||
| 549 | } | 549 | } |
| 550 | 550 | ||
| 551 | void OvenStatistics::processErrorItems(error_item *item, error_exe_type errtype, const QString &MsgDesc, const QString &MsgTitle, time_t ltime){ | 551 | void OvenStatistics::processErrorItems(error_item *item, error_exe_type errtype, const QString &MsgDesc, const QString &MsgTitle, time_t ltime){ |
| 552 | - uint32_t erridx = (uint32_t) (item - &(srvdata->err_log.values[0])); | 552 | + QWidget* pParent; |
| 553 | + uint32_t erridx = (uint32_t) (item - &(srvdata->err_log.values[0])); | ||
| 554 | + | ||
| 553 | qDebug() << (uint32_t) (item - &(srvdata->err_log.values[0])) << "ERROR Fired!"; | 555 | qDebug() << (uint32_t) (item - &(srvdata->err_log.values[0])) << "ERROR Fired!"; |
| 554 | if(m_pLastErrItem == item ){ | 556 | if(m_pLastErrItem == item ){ |
| 555 | srvdata->err_log.items.repeat_error.fired_cnt =item->fired_cnt; | 557 | srvdata->err_log.items.repeat_error.fired_cnt =item->fired_cnt; |
| @@ -557,49 +559,78 @@ void OvenStatistics::processErrorItems(error_item *item, error_exe_type errtype, | @@ -557,49 +559,78 @@ void OvenStatistics::processErrorItems(error_item *item, error_exe_type errtype, | ||
| 557 | srvdata->err_log.items.repeat_error.last_fried = item->last_fried; | 559 | srvdata->err_log.items.repeat_error.last_fried = item->last_fried; |
| 558 | } | 560 | } |
| 559 | m_pLastErrItem = item; | 561 | m_pLastErrItem = item; |
| 560 | - | 562 | + qDebug() << "error type" << errtype; |
| 561 | if(errtype >= error_type_onlychk){ | 563 | if(errtype >= error_type_onlychk){ |
| 562 | item->fired_cnt+=1; | 564 | item->fired_cnt+=1; |
| 563 | if(item->first_fired == 0) item->first_fired = ltime; | 565 | if(item->first_fired == 0) item->first_fired = ltime; |
| 564 | item->last_fried = ltime; | 566 | item->last_fried = ltime; |
| 565 | } | 567 | } |
| 566 | 568 | ||
| 569 | + if(errtype>=error_type_chkclrstopcmd){ | ||
| 570 | + qDebug() << "exec killchild"; | ||
| 571 | + if(MainWindow::killChildCook()){ | ||
| 572 | + pParent = MainWindow::getInstance(); | ||
| 573 | + } | ||
| 574 | + else{ | ||
| 575 | + pParent = QApplication::activeWindow(); | ||
| 576 | + } | ||
| 577 | + } | ||
| 578 | + else{ | ||
| 579 | + pParent = QApplication::activeWindow(); | ||
| 580 | + } | ||
| 581 | + | ||
| 582 | + | ||
| 583 | + | ||
| 567 | switch(errtype){ | 584 | switch(errtype){ |
| 568 | case error_type_onlypop: | 585 | case error_type_onlypop: |
| 569 | case error_type_popclr: | 586 | case error_type_popclr: |
| 570 | case error_type_popnonclr: | 587 | case error_type_popnonclr: |
| 588 | + case error_type_popclrstopcmd: | ||
| 571 | { | 589 | { |
| 572 | - ErrorPopupDlg *dlg = new ErrorPopupDlg(QApplication::activeWindow(),MsgDesc,MsgTitle); | ||
| 573 | - dlg->exec(); | 590 | + if(m_mapPopupList.find(erridx) == m_mapPopupList.end()){ |
| 591 | + ErrorPopupDlg *dlg = new ErrorPopupDlg(pParent,MsgDesc,MsgTitle , (errtype > error_type_clrsplit), erridx); | ||
| 592 | + connect(dlg,SIGNAL(closedErrorPopup(int)), this, SLOT(onErrorPopupClosed(int))); | ||
| 593 | + m_mapPopupList.insert(erridx,dlg); | ||
| 594 | + qApp->setActiveWindow(dlg); | ||
| 595 | + dlg->showFullScreen(); | ||
| 596 | + } | ||
| 574 | break; | 597 | break; |
| 575 | } | 598 | } |
| 576 | - case error_type_engclr: | 599 | + case error_type_engclr: |
| 577 | case error_type_engnonclr: | 600 | case error_type_engnonclr: |
| 578 | case error_type_onlyeng: | 601 | case error_type_onlyeng: |
| 602 | + case error_type_engclrstopcmd: | ||
| 579 | { | 603 | { |
| 580 | //EngineerMenuWindow *w = new EngineerMenuWindow(0); | 604 | //EngineerMenuWindow *w = new EngineerMenuWindow(0); |
| 581 | //w->showFullScreen(); | 605 | //w->showFullScreen(); |
| 582 | - ErrorPopupDlg *dlg = new ErrorPopupDlg(QApplication::activeWindow(),MsgDesc,MsgTitle); | ||
| 583 | - dlg->exec(); | ||
| 584 | - ServicePassInputDlg *w = new ServicePassInputDlg(QApplication::activeWindow()); | ||
| 585 | - w->exec(); | 606 | + if(m_mapPopupList.find(erridx)==m_mapPopupList.end()){ |
| 607 | + ErrorPopupDlg *dlg = new ErrorPopupDlg(pParent,MsgDesc,MsgTitle, (errtype > error_type_clrsplit),erridx); | ||
| 608 | + connect(dlg,SIGNAL(closedErrorPopup(int)),this,SLOT(onErrorPopupClosed(int))); | ||
| 609 | + m_mapPopupList.insert(erridx,dlg); | ||
| 610 | + dlg->showFullScreen(); | ||
| 611 | + | ||
| 612 | + ServicePassInputDlg *w = new ServicePassInputDlg(pParent); | ||
| 613 | + //w->exec(); | ||
| 614 | + connect(dlg, SIGNAL(destroyed(QObject*)), w, SLOT(showFullScreen())); | ||
| 615 | + } | ||
| 586 | break; | 616 | break; |
| 587 | } | 617 | } |
| 588 | default: | 618 | default: |
| 589 | break; | 619 | break; |
| 590 | } | 620 | } |
| 591 | 621 | ||
| 592 | - if(errtype > error_type_clrsplit){ | ||
| 593 | - //에러 클리어 명령 송신 | ||
| 594 | - if(errtype == error_type_engclr){ | ||
| 595 | - //확인 후 송신 | ||
| 596 | - bNeedErrorClear = true; | ||
| 597 | - } | ||
| 598 | - else{ | ||
| 599 | - //에러클리어 메시지 즉시 송신 | ||
| 600 | - udp->set(TG_ERROR_CLEAR,0xCECE); | ||
| 601 | - } | ||
| 602 | - } | 622 | +// if(errtype > error_type_clrsplit){ |
| 623 | +// //에러 클리어 명령 송신 | ||
| 624 | +//// if(errtype == error_type_engclr){ | ||
| 625 | +//// //확인 후 송신 | ||
| 626 | +//// bNeedErrorClear = true; | ||
| 627 | +//// } | ||
| 628 | +//// else{ | ||
| 629 | +//// //에러클리어 메시지 즉시 송신 | ||
| 630 | +// qDebug() << "send error clr"; | ||
| 631 | +// udp->set(TG_ERROR_CLEAR,0xCECE); | ||
| 632 | +//// } | ||
| 633 | + //} | ||
| 603 | 634 | ||
| 604 | 635 | ||
| 605 | } | 636 | } |
| @@ -617,25 +648,9 @@ type_temp OvenStatistics::getCurSensorValueByIdx(uint16_t idx){ | @@ -617,25 +648,9 @@ type_temp OvenStatistics::getCurSensorValueByIdx(uint16_t idx){ | ||
| 617 | return curSensorValue[idx]; | 648 | return curSensorValue[idx]; |
| 618 | } | 649 | } |
| 619 | 650 | ||
| 620 | -void OvenStatistics::onErrorPopupClosed(QWidget* parent){ | ||
| 621 | - qDebug() << "Error Popup Closed!"; | ||
| 622 | - if(bNeedErrorClear) { | ||
| 623 | - qDebug() << "send error clear command"; | ||
| 624 | - bNeedErrorClear = false; | ||
| 625 | - udp->set(TG_ERROR_CLEAR,0xCECE); | ||
| 626 | - } | ||
| 627 | - if(m_mapPopupList.isEmpty()==false){ | ||
| 628 | - popup_list_item item; | ||
| 629 | - item = m_mapPopupList.first(); | ||
| 630 | - m_nLastPopupidx = m_mapPopupList.firstKey(); | ||
| 631 | - bNeedErrorClear = item.bNeedClear; | ||
| 632 | - ErrorPopupDlg *dlg = new ErrorPopupDlg(parent,item.strDesc,item.strTitle); | ||
| 633 | - m_mapPopupList.remove(m_nLastPopupidx); | ||
| 634 | - connect(dlg,SIGNAL(closedPopup(QWidget*)),this, SLOT(onErrorPopupClosed(QWidget*))); | ||
| 635 | - dlg->showFullScreen(); | ||
| 636 | - } | ||
| 637 | - else{ | ||
| 638 | - m_bPopupShow = false; | ||
| 639 | - m_nLastPopupidx = MAX_ERROR_TYPE_CNT; | 651 | +void OvenStatistics::onErrorPopupClosed(int erridx){ |
| 652 | + qDebug() << "error idx" << erridx; | ||
| 653 | + if(m_mapPopupList.find(erridx)!= m_mapPopupList.end()){ | ||
| 654 | + m_mapPopupList.remove(erridx); | ||
| 640 | } | 655 | } |
| 641 | } | 656 | } |
app/gui/oven_control/ovenstatics.h
| @@ -137,6 +137,7 @@ enum sensor_err_id{ | @@ -137,6 +137,7 @@ enum sensor_err_id{ | ||
| 137 | 137 | ||
| 138 | enum error_exe_type{ | 138 | enum error_exe_type{ |
| 139 | error_type_allnone=0, | 139 | error_type_allnone=0, |
| 140 | + error_type_olnystopcmd, | ||
| 140 | error_type_onlypop, | 141 | error_type_onlypop, |
| 141 | error_type_onlyeng, | 142 | error_type_onlyeng, |
| 142 | error_type_onlychk, | 143 | error_type_onlychk, |
| @@ -146,6 +147,9 @@ enum error_exe_type{ | @@ -146,6 +147,9 @@ enum error_exe_type{ | ||
| 146 | error_type_chkclr, | 147 | error_type_chkclr, |
| 147 | error_type_popclr, | 148 | error_type_popclr, |
| 148 | error_type_engclr, | 149 | error_type_engclr, |
| 150 | + error_type_chkclrstopcmd, | ||
| 151 | + error_type_popclrstopcmd, | ||
| 152 | + error_type_engclrstopcmd, | ||
| 149 | }; | 153 | }; |
| 150 | 154 | ||
| 151 | 155 | ||
| @@ -206,34 +210,34 @@ private: | @@ -206,34 +210,34 @@ private: | ||
| 206 | const error_exe_type sys_err_type_def[SYS_STATE_MAX][SYS_ERR_MAX]={ //30047 | 210 | const error_exe_type sys_err_type_def[SYS_STATE_MAX][SYS_ERR_MAX]={ //30047 |
| 207 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr, | 211 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr, |
| 208 | error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_OFF_COOK_OFF state | 212 | error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_OFF_COOK_OFF state |
| 209 | - {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr, | ||
| 210 | - error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_ON_COOK_OFF state | ||
| 211 | - {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr, | ||
| 212 | - error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_ON_COOK_ON state | 213 | + {error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd, |
| 214 | + error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd}, // SYS_ON_COOK_OFF state | ||
| 215 | + {error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd, | ||
| 216 | + error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd}, // SYS_ON_COOK_ON state | ||
| 213 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr, | 217 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr, |
| 214 | error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_OFF_COOK_ON state | 218 | error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_OFF_COOK_ON state |
| 215 | }; | 219 | }; |
| 216 | 220 | ||
| 217 | const error_exe_type comm_err_type_def[SYS_STATE_MAX][COMM_ERR_MAX] ={ //30048 | 221 | const error_exe_type comm_err_type_def[SYS_STATE_MAX][COMM_ERR_MAX] ={ //30048 |
| 218 | {error_type_popnonclr,error_type_popnonclr,error_type_popnonclr,error_type_engnonclr,error_type_engnonclr}, //SYS_OFF_COO_OFF | 222 | {error_type_popnonclr,error_type_popnonclr,error_type_popnonclr,error_type_engnonclr,error_type_engnonclr}, //SYS_OFF_COO_OFF |
| 219 | - {error_type_popclr,error_type_popclr,error_type_popclr,error_type_engnonclr,error_type_engnonclr}, //SYS_ON_COO_OFF | ||
| 220 | - {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, //SYS_ON_COO_ON | 223 | + {error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd}, //SYS_ON_COO_OFF |
| 224 | + {error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd}, //SYS_ON_COO_ON | ||
| 221 | {error_type_popnonclr,error_type_popnonclr,error_type_popnonclr,error_type_engnonclr,error_type_engnonclr}, //SYS_OFF_COO_ON | 225 | {error_type_popnonclr,error_type_popnonclr,error_type_popnonclr,error_type_engnonclr,error_type_engnonclr}, //SYS_OFF_COO_ON |
| 222 | }; | 226 | }; |
| 223 | 227 | ||
| 224 | const error_exe_type state_err_type_def[SYS_STATE_MAX][STATE_ERR_MAX] ={ //30057 | 228 | const error_exe_type state_err_type_def[SYS_STATE_MAX][STATE_ERR_MAX] ={ //30057 |
| 225 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, //SYS_OFF_COO_OFF | 229 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, //SYS_OFF_COO_OFF |
| 226 | - {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, //SYS_ON_COO_OFF | ||
| 227 | - {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, //SYS_ON_COO_ON | 230 | + {error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd}, //SYS_ON_COO_OFF |
| 231 | + {error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_popclrstopcmd}, //SYS_ON_COO_ON | ||
| 228 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, //SYS_OFF_COO_ON | 232 | {error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, //SYS_OFF_COO_ON |
| 229 | }; | 233 | }; |
| 230 | 234 | ||
| 231 | const error_exe_type sensor_err_type_def[SYS_STATE_MAX][SENSOR_ERR_MAX]={ //30049 | 235 | const error_exe_type sensor_err_type_def[SYS_STATE_MAX][SENSOR_ERR_MAX]={ //30049 |
| 232 | {error_type_engnonclr,error_type_popnonclr,error_type_allnone,error_type_popnonclr,error_type_onlychk, | 236 | {error_type_engnonclr,error_type_popnonclr,error_type_allnone,error_type_popnonclr,error_type_onlychk, |
| 233 | error_type_popnonclr,error_type_allnone,error_type_allnone,error_type_allnone,error_type_popnonclr}, // SYS_OFF_COOK_OFF state | 237 | error_type_popnonclr,error_type_allnone,error_type_allnone,error_type_allnone,error_type_popnonclr}, // SYS_OFF_COOK_OFF state |
| 234 | - {error_type_engnonclr,error_type_popclr,error_type_allnone,error_type_popclr,error_type_onlychk, | 238 | + {error_type_engclrstopcmd,error_type_popclrstopcmd,error_type_allnone,error_type_popclrstopcmd,error_type_popclrstopcmd, |
| 235 | error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_ON_COOK_OFF state | 239 | error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_ON_COOK_OFF state |
| 236 | - {error_type_onlychk,error_type_onlychk,error_type_allnone,error_type_popclr,error_type_popclr, | 240 | + {error_type_popclrstopcmd,error_type_popclrstopcmd,error_type_allnone,error_type_popclrstopcmd,error_type_popclrstopcmd, |
| 237 | error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_ON_COOK_ON state | 241 | error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr,error_type_popclr}, // SYS_ON_COOK_ON state |
| 238 | {error_type_engnonclr,error_type_popnonclr,error_type_allnone,error_type_popnonclr,error_type_onlychk, | 242 | {error_type_engnonclr,error_type_popnonclr,error_type_allnone,error_type_popnonclr,error_type_onlychk, |
| 239 | error_type_popnonclr,error_type_allnone,error_type_allnone,error_type_allnone,error_type_popnonclr}, // SYS_OFF_COOK_ON state same with SYS_OFF_COOK_OFF | 243 | error_type_popnonclr,error_type_allnone,error_type_allnone,error_type_allnone,error_type_popnonclr}, // SYS_OFF_COOK_ON state same with SYS_OFF_COOK_OFF |
| @@ -253,7 +257,7 @@ private: | @@ -253,7 +257,7 @@ private: | ||
| 253 | oven_control_t control; | 257 | oven_control_t control; |
| 254 | oven_state_t state; | 258 | oven_state_t state; |
| 255 | error_item* m_pLastErrItem; | 259 | error_item* m_pLastErrItem; |
| 256 | - QMap<uint32_t, popup_list_item> m_mapPopupList; | 260 | + QMap<uint32_t, QWidget *> m_mapPopupList; |
| 257 | uint32_t m_nLastPopupidx; | 261 | uint32_t m_nLastPopupidx; |
| 258 | bool m_bPopupShow; | 262 | bool m_bPopupShow; |
| 259 | 263 | ||
| @@ -281,7 +285,7 @@ private: | @@ -281,7 +285,7 @@ private: | ||
| 281 | public slots: | 285 | public slots: |
| 282 | void onDataChanged(); | 286 | void onDataChanged(); |
| 283 | void oneSecTimerFired(void); | 287 | void oneSecTimerFired(void); |
| 284 | - void onErrorPopupClosed(QWidget* parent); | 288 | + void onErrorPopupClosed(int erridx); |
| 285 | }; | 289 | }; |
| 286 | 290 | ||
| 287 | #endif // OVENSTATICS_H | 291 | #endif // OVENSTATICS_H |