Commit 003971acb6ccd8d9bc2b05eccf006ef8c9aa15ed
1 parent
cc2cf54b42
Exists in
master
and in
2 other branches
에러 발생시 패스워드 인풋 윈도우 및 엔지니어링 윈도우 중복 실행 방지
Showing
4 changed files
with
30 additions
and
10 deletions
Show diff stats
app/gui/oven_control/configwindow.cpp
app/gui/oven_control/ovenstatics.cpp
... | ... | @@ -47,6 +47,7 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent) |
47 | 47 | realdata.d32 = 0; |
48 | 48 | m_bPopupShow = false; |
49 | 49 | m_nLastPopupidx = MAX_ERROR_TYPE_CNT; |
50 | + m_wndSrvpassdlg = NULL; | |
50 | 51 | |
51 | 52 | for(i=0;i<MAX_LOG_SENSOR;i++){ |
52 | 53 | curSensorValue[i].utemp = 0; |
... | ... | @@ -675,9 +676,11 @@ void OvenStatistics::processErrorItems(error_item *item, error_exe_type errtype, |
675 | 676 | m_mapPopupList.insert(erridx,dlg); |
676 | 677 | dlg->showFullScreen(); |
677 | 678 | |
678 | - ServicePassInputDlg *w = new ServicePassInputDlg(pParent, NORMAL_SERVICE_PASS_MODE, (errtype > error_type_clrsplit)); | |
679 | - //w->exec(); | |
680 | - connect(dlg, SIGNAL(destroyed(QObject*)), w, SLOT(showFullScreen())); | |
679 | + if(m_wndSrvpassdlg == NULL){ | |
680 | + m_wndSrvpassdlg = new ServicePassInputDlg(pParent, NORMAL_SERVICE_PASS_MODE, (errtype > error_type_clrsplit)); | |
681 | + connect(dlg, SIGNAL(destroyed(QObject*)), m_wndSrvpassdlg, SLOT(showFullScreen())); | |
682 | + connect(m_wndSrvpassdlg, SIGNAL(destroyed(QObject*)), SLOT(setWndPassInputNull())); | |
683 | + } | |
681 | 684 | } |
682 | 685 | break; |
683 | 686 | } | ... | ... |
app/gui/oven_control/ovenstatics.h
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | #include "oven.h" |
10 | 10 | #include "servicedata.h" |
11 | 11 | #include "config.h" |
12 | +#include "servicepassinputdlg.h" | |
12 | 13 | |
13 | 14 | |
14 | 15 | #define MAX_MODEL_COUNT 12 |
... | ... | @@ -486,6 +487,7 @@ private: |
486 | 487 | bool bNeedErrorClear; |
487 | 488 | bool bDataRefreshed; |
488 | 489 | realtime_data realdata; |
490 | + ServicePassInputDlg *m_wndSrvpassdlg; | |
489 | 491 | |
490 | 492 | explicit OvenStatistics(QObject* parent); |
491 | 493 | ~OvenStatistics(); |
... | ... | @@ -509,6 +511,7 @@ public slots: |
509 | 511 | void onDataChanged(); |
510 | 512 | void oneSecTimerFired(void); |
511 | 513 | void onErrorPopupClosed(int erridx); |
514 | + void setWndPassInputNull(void){m_wndSrvpassdlg = NULL;} | |
512 | 515 | |
513 | 516 | signals: |
514 | 517 | void onErrorFired(int erridx); | ... | ... |
app/gui/oven_control/servicepassinputdlg.cpp
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | #include <QDebug> |
5 | 5 | #include "soundplayer.h" |
6 | 6 | #include "udphandler.h" |
7 | +#include "mainwindow.h" | |
7 | 8 | |
8 | 9 | |
9 | 10 | ServicePassInputDlg::ServicePassInputDlg(QWidget *parent, service_pass_type mode, bool sendClrCmd) : |
... | ... | @@ -33,10 +34,12 @@ ServicePassInputDlg::ServicePassInputDlg(QWidget *parent, service_pass_type mode |
33 | 34 | ui->keyboardwidget->focusInKeyboard(); |
34 | 35 | m_nMode = mode; |
35 | 36 | m_bSendClrCmd = sendClrCmd; |
37 | + qDebug() << __func__; | |
36 | 38 | } |
37 | 39 | |
38 | 40 | ServicePassInputDlg::~ServicePassInputDlg() |
39 | 41 | { |
42 | + qDebug() << __func__; | |
40 | 43 | delete ui; |
41 | 44 | } |
42 | 45 | |
... | ... | @@ -46,12 +49,23 @@ void ServicePassInputDlg::on_ctrBtnOk_clicked() |
46 | 49 | if( QString(m_strInputPass) == QString(NORMAL_PASS_WORD) && m_nMode == NORMAL_SERVICE_PASS_MODE){ |
47 | 50 | qDebug() << this->parentWidget() <<this->parent(); |
48 | 51 | if(m_bSendClrCmd) UdpHandler::getInstance()->set(TG_ERROR_CLEAR,0xCECE); |
49 | - EngineerMenuWindow *w = new EngineerMenuWindow(this->parentWidget()); | |
50 | - connect(w,SIGNAL(destroyed(QObject*)),this,SLOT(close())); | |
51 | - w->setWindowModality(Qt::WindowModal); | |
52 | - w->showFullScreen(); | |
53 | - w->raise(); | |
54 | - this->hide(); | |
52 | + if(MainWindow::getEngineerMenuWindow()==NULL){ | |
53 | + EngineerMenuWindow *w = new EngineerMenuWindow(this->parentWidget()); | |
54 | + w->setWindowModality(Qt::WindowModal); | |
55 | + w->showFullScreen(); | |
56 | + w->raise(); | |
57 | + hide(); | |
58 | + deleteLater(); | |
59 | + } | |
60 | + else{ | |
61 | + EngineerMenuWindow *w = MainWindow::getEngineerMenuWindow(); | |
62 | + w->killChild(); | |
63 | + w->raise(); | |
64 | + hide(); | |
65 | + deleteLater(); | |
66 | + } | |
67 | + //connect(w,SIGNAL(destroyed(QObject*)),this,SLOT(close())); | |
68 | + | |
55 | 69 | } |
56 | 70 | else if(QString(m_strInputPass) == QString(DEMO_PASS_WORD) && m_nMode == DEMO_SERVICE_PASS_MODE){ |
57 | 71 | accept(); | ... | ... |