diff --git a/app/gui/oven_control/config.cpp b/app/gui/oven_control/config.cpp index b0c5b76..44cbd95 100644 --- a/app/gui/oven_control/config.cpp +++ b/app/gui/oven_control/config.cpp @@ -18,6 +18,7 @@ #include "confighalfenergydlg.h" #include "config1digitsetdlg.h" #include "configdutywashdlg.h" +#include "configsteamwashdlg.h" #include "fileprocessor.h" #include "backlight.h" #include "udphandler.h" @@ -536,6 +537,9 @@ void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){ case config_demo_mode: dlg = new ConfigDemoModeDlg(parent); break; + case config_steam_wash: + dlg = new ConfigSteamWashDlg(parent); + break; default: dlg=NULL; } diff --git a/app/gui/oven_control/configsteamwashdlg.cpp b/app/gui/oven_control/configsteamwashdlg.cpp new file mode 100644 index 0000000..aa19db5 --- /dev/null +++ b/app/gui/oven_control/configsteamwashdlg.cpp @@ -0,0 +1,193 @@ +#include "configsteamwashdlg.h" +#include "ui_configsteamwashdlg.h" + +#include "udphandler.h" + +ConfigSteamWashDlg::ConfigSteamWashDlg(QWidget *parent) : + QDialog(parent), + ui(new Ui::ConfigSteamWashDlg) +{ + ui->setupUi(this); + + setWindowFlags(Qt::FramelessWindowHint); + setAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_TranslucentBackground); + setAttribute(Qt::WA_DeleteOnClose); + setFocus(); + + qApp->setActiveWindow(this); + + UdpHandler *udp = UdpHandler::getInstance(); + connect(udp, SIGNAL(changed()), SLOT(onChanged())); + + updateView(); +} + +ConfigSteamWashDlg::~ConfigSteamWashDlg() +{ + delete ui; +} + +void ConfigSteamWashDlg::updateView() +{ + switch (phase) { + case Idle: + ui->ctrLbBody->setText(tr("시작하시겠습니까?")); + ui->ctrLbBody->show(); + ui->ctrGauge->hide(); + ui->ctrBtnOk->setGeometry(300, 350, 150, 100); + ui->ctrBtnOk->show(); + ui->ctrBtnCancel->show(); + break; + case Starting: + ui->ctrLbBody->hide(); + ui->ctrGauge->hide(); + ui->ctrBtnOk->hide(); + ui->ctrBtnCancel->hide(); + break; + case Started: + { + UdpHandler *udp = UdpHandler::getInstance(); + + oven_control_t control; + udp->fillControl(control); + + switch (control.clean_step_type) + { + case 1: + ui->ctrLbBody->setText(tr("내부 헹굼 진행 중입니다.")); + break; + case 2: + ui->ctrLbBody->setText(tr("스팀 급수 진행 중입니다.")); + break; + case 3: + ui->ctrLbBody->setText(tr("내부 팬 세척 진행 중입니다.")); + break; + case 4: + ui->ctrLbBody->setText(tr("내부 스팀 불림 진행 중입니다.")); + break; + case 5: + ui->ctrLbBody->setText(tr("내부 강 세척 진행 중입니다.")); + break; + case 6: + ui->ctrLbBody->setText(tr("내부 상부 세척 진행 중입니다.")); + break; + case 7: + ui->ctrLbBody->setText(tr("내부 스팀 세척 진행 중입니다.")); + break; + case 8: + ui->ctrLbBody->setText(tr("세척 종료 진행 중입니다.")); + break; + case 9: + ui->ctrLbBody->setText(tr("세제 세척수 만들기 진행 중입니다.")); + break; + case 10: + ui->ctrLbBody->setText(tr("세제 세척수 헹굼 진행 중입니다.")); + break; + case 11: + ui->ctrLbBody->setText(tr("하부 탱크 세척수 만들기 진행 중입니다.")); + break; + } + ui->ctrLbBody->show(); + + ui->ctrGauge->setMaximum(control.clean_total); + ui->ctrGauge->setValue(control.clean_step); + ui->ctrGauge->show(); + + ui->ctrBtnOk->hide(); + ui->ctrBtnCancel->hide(); + break; + } + case Finished: + ui->ctrLbBody->setText(tr("세척이 종료되었습니다")); + ui->ctrLbBody->show(); + ui->ctrGauge->setMaximum(1); + ui->ctrGauge->setValue(1); + ui->ctrGauge->show(); + ui->ctrBtnOk->setGeometry(300, 350, 300, 100); + ui->ctrBtnOk->show(); + ui->ctrBtnCancel->hide(); + } +} + +void ConfigSteamWashDlg::onChanged() +{ + switch (phase) { + case Idle: + return; + case Starting: + if (isStarted()) + phase = Started; + break; + case Started: + if (isFinished()) + phase = Finished; + break; + case Finished: + return; + } + + updateView(); +} + +void ConfigSteamWashDlg::start() +{ + UdpHandler *udp = UdpHandler::getInstance(); + udp->set(TG_OVEN_MODE, 2); + udp->set(TG_CLEAN_TYPE, 6); + udp->turnOn(TG_CLEANING); + + phase = Starting; + + updateView(); +} + +bool ConfigSteamWashDlg::isStarted() +{ + UdpHandler *udp = UdpHandler::getInstance(); + + oven_control_t control; + oven_state_t state; + udp->fillControl(control); + udp->fillData(state); + + return state.cleaning_sate != 0 + && control.clean_total != 0 + && control.clean_step != 0 + && control.clean_step_type != 0; +} + +bool ConfigSteamWashDlg::isFinished() +{ + UdpHandler *udp = UdpHandler::getInstance(); + + oven_state_t state; + udp->fillData(state); + + return state.cleaning_sate == 0; +} + +void ConfigSteamWashDlg::on_ctrBtnOk_clicked() +{ + switch (phase) { + case Idle: + start(); + break; + case Finished: + close(); + break; + default: + return; + } +} + +void ConfigSteamWashDlg::on_ctrBtnCancel_clicked() +{ + switch (phase) { + case Idle: + close(); + break; + default: + return; + } +} diff --git a/app/gui/oven_control/configsteamwashdlg.h b/app/gui/oven_control/configsteamwashdlg.h new file mode 100644 index 0000000..e4fa932 --- /dev/null +++ b/app/gui/oven_control/configsteamwashdlg.h @@ -0,0 +1,41 @@ +#ifndef CONFIGSTEAMWASHDLG_H +#define CONFIGSTEAMWASHDLG_H + +#include +#include + +namespace Ui { +class ConfigSteamWashDlg; +} + +class ConfigSteamWashDlg : public QDialog +{ + Q_OBJECT + + enum Phase { + Idle, Starting, Started, Finished + }; + +public: + explicit ConfigSteamWashDlg(QWidget *parent = 0); + ~ConfigSteamWashDlg(); + +private slots: + void updateView(); + + void onChanged(); + + void start(); + bool isStarted(); + bool isFinished(); + + void on_ctrBtnOk_clicked(); + void on_ctrBtnCancel_clicked(); + +private: + Ui::ConfigSteamWashDlg *ui; + + enum Phase phase = Idle; +}; + +#endif // CONFIGSTEAMWASHDLG_H diff --git a/app/gui/oven_control/configsteamwashdlg.ui b/app/gui/oven_control/configsteamwashdlg.ui new file mode 100644 index 0000000..cac9d4d --- /dev/null +++ b/app/gui/oven_control/configsteamwashdlg.ui @@ -0,0 +1,186 @@ + + + ConfigSteamWashDlg + + + + 0 + 0 + 900 + 1600 + + + + Dialog + + + #centralWidget { background-image: url(:/images/background/popup/503.png); +} + + + + + + 0 + 430 + 900 + 503 + + + + + + + + + 300 + 350 + 150 + 100 + + + + + 75 + true + true + + + + QPushButton { +border: none; +color: white; +} +QPushButton:pressed, QPushButton:focus { +color: yellow; +} + + + 확인 + + + + + + 0 + 0 + 900 + 91 + + + + + 나눔고딕 + 13 + 75 + true + + + + QLabel { + color : white; + border : none; +} + + + 증기 발생기 헹굼 + + + Qt::AlignCenter + + + + + + 0 + 93 + 900 + 3 + + + + Qt::Horizontal + + + + + + 0 + 100 + 900 + 91 + + + + + 나눔고딕 + 13 + 75 + true + + + + QLabel { + color : white; + border : none; +} + + + 시작하시겠습니까? + + + Qt::AlignCenter + + + + + + 184 + 210 + 532 + 58 + + + + + + + 450 + 350 + 150 + 100 + + + + + 75 + true + true + + + + QPushButton { +border: none; +color: white; +} +QPushButton:pressed, QPushButton:focus { +color: yellow; +} + + + 취소 + + + + + + + WashStepGauge + QWidget +
washstepgauge.h
+ 1 +
+
+ + +
diff --git a/app/gui/oven_control/oven_control.pro b/app/gui/oven_control/oven_control.pro index dba1e3a..f1618a6 100644 --- a/app/gui/oven_control/oven_control.pro +++ b/app/gui/oven_control/oven_control.pro @@ -126,7 +126,8 @@ SOURCES += main.cpp\ configdemomodedlg.cpp \ demoicon.cpp \ halfenergyicon.cpp \ - notipopupdlg.cpp + notipopupdlg.cpp \ + configsteamwashdlg.cpp HEADERS += mainwindow.h \ @@ -243,7 +244,8 @@ HEADERS += mainwindow.h \ configdemomodedlg.h \ demoicon.h \ halfenergyicon.h \ - notipopupdlg.h + notipopupdlg.h \ + configsteamwashdlg.h FORMS += mainwindow.ui \ manualcookwindow.ui \ @@ -323,7 +325,8 @@ FORMS += mainwindow.ui \ autocookcheckconfigwindow.ui \ programmedcookpanelbutton.ui \ configdemomodedlg.ui \ - notipopupdlg.ui + notipopupdlg.ui \ + configsteamwashdlg.ui RESOURCES += \ resources.qrc