#include "autocookwindow.h" #include "ui_autocookwindow.h" #include #include "keepwarmpopup.h" #include "cookhistory.h" #include "confirmpopup.h" #include "favoritenamepopup.h" #include "stringer.h" #include "soundplayer.h" #include "configwindow.h" #include "washwindow.h" #include "mainwindow.h" #include "config.h" #include "errorpopupdlg.h" AutoCookWindow::AutoCookWindow(QWidget *parent, Cook cook) : QMainWindow(parent), ui(new Ui::AutoCookWindow), cook(cook) { ui->setupUi(this); ui->clockContainer->setParent(ui->upperStack); setAttribute(Qt::WA_DeleteOnClose); if (!this->cook.isLoaded()) this->cook.load(); autocook = AutoCook(this->cook); processSelected = false; config_item item = Config::getInstance()->getConfigValue(Define::config_loading_door_monitoring); if (item.d8.d8_0 > 0 && item.d8.d8_0 < 4) { loadingMonitorLevel = item.d8.d8_0; loadingMonitor1 = item.d8.d8_1 * 1000; loadingMonitor2 = item.d8.d8_2 * 1000; loadingMonitor3 = item.d8.d8_3 * 1000; currentLoadingMonitorLevel = 0; } else loadingMonitorLevel = 0; item = Config::getInstance()->getConfigValue(Define::config_cooking_door_monitoring); if (item.d8.d8_0 > 0 && item.d8.d8_0 < 4) { cookingMonitorLevel = item.d8.d8_0; cookingMonitor1 = item.d8.d8_1 * 1000; cookingMonitor2 = item.d8.d8_2 * 1000; cookingMonitor3 = item.d8.d8_3 * 1000; currentCookingMonitorLevel = 0; } else cookingMonitorLevel = 0; if (loadingMonitorLevel > 0 || cookingMonitorLevel > 0) { connect(&monitorTimer, SIGNAL(timeout()), SLOT(monitor())); monitorTimer.start(100); } setupUi(); Oven *oven = Oven::getInstance(); connect(oven, SIGNAL(changed(Oven*)), SLOT(updateView())); returnToCurrentStepTimer.setSingleShot(true); returnToCurrentStepTimer.setInterval(3000); connect(&returnToCurrentStepTimer, SIGNAL(timeout()), SLOT(returnToCurrentStep())); showCurrentHumidityTimer.setSingleShot(true); showCurrentHumidityTimer.setInterval(1000); connect(&showCurrentHumidityTimer, SIGNAL(timeout()), SLOT(showCurrentHumidity())); showCurrentTempTimer.setSingleShot(true); showCurrentTempTimer.setInterval(1000); connect(&showCurrentTempTimer, SIGNAL(timeout()), SLOT(showCurrentTemp())); connect(&checkCookTimer, SIGNAL(timeout()), SLOT(checkCook())); checkCookTimer.start(100); connect(&checkProcessTimer, SIGNAL(timeout()), SLOT(checkProcess())); AutoCookSetting setting; setting.type = cook.type; setting.root = cook.root; setting.name = cook.name; for (int i = 0; i < 5; i++) setting.configs[i] = cook.configs[i].current; CookHistory::record(setting); foreach (QPushButton *button, findChildren()) connect(button, &QPushButton::pressed, SoundPlayer::playClick); connect(&updateViewTimer, SIGNAL(timeout()), SLOT(updateView())); updateViewTimer.start(100); SoundPlayer::playStart(); setFocus(); } AutoCookWindow::~AutoCookWindow() { Oven::getInstance()->stop(); delete ui; } void AutoCookWindow::keyPressEvent(QKeyEvent *event) { switch (event->key()) { case 0x01000030: // Turn left onEncoderLeft(); break; case 0x01000031: // Push pushed = focusWidget(); break; case 0x01000032: // Turn right onEncoderRight(); break; } } void AutoCookWindow::keyReleaseEvent(QKeyEvent *event) { switch (event->key()) { case 0x01000030: // Turn left onEncoderLeft(); break; case 0x01000031: // Push if (focusWidget() == pushed) onEncoderClicked(pushed); pushed = NULL; break; case 0x01000032: // Turn right onEncoderRight(); break; } } void AutoCookWindow::setupUi() { steamModeIcon.load(":/images/cook_mode/small_steam.png"); dryModeIcon.load(":/images/cook_mode/small_dryheat.png"); combiModeIcon.load(":/images/cook_mode/small_combi.png"); ui->cookTypeIcon->setPixmap(Define::icon(cook.type)); ui->selectCookButton->setText(cook.name); ui->stepIndicator->setMaximum(cook.steps.size() - 1); ui->cookStepAnimation->start(300); ui->humidityGauge->setMinimum(0); ui->humidityGauge->setMaximum(100); ui->humidityGauge->setValue(0); ui->heatGauge->setMinimum(30); ui->heatGauge->setMaximum(300); ui->heatGauge->setValue(30); ui->openDoorAnimation->load(":/images/animation/door_01.png"); ui->openDoorAnimation->load(":/images/animation/door_02.png"); ui->openDoorAnimation->load(":/images/animation/door_03.png"); ui->openDoorAnimation->load(":/images/animation/door_04.png"); ui->openDoorAnimation->load(":/images/animation/door_05.png"); ui->openDoorAnimation->load(":/images/animation/door_06.png"); ui->openDoorAnimation->load(":/images/animation/door_07.png"); ui->openDoorAnimation->load(":/images/animation/door_08.png"); ui->openDoorAnimation->load(":/images/animation/door_09.png"); ui->openDoorAnimation->start(300); ui->openDoorAnimation->hide(); ui->openDoorArrow->hide(); ui->closeDoorAnimation->load(":/images/animation/door_09.png"); ui->closeDoorAnimation->load(":/images/animation/door_08.png"); ui->closeDoorAnimation->load(":/images/animation/door_07.png"); ui->closeDoorAnimation->load(":/images/animation/door_06.png"); ui->closeDoorAnimation->load(":/images/animation/door_05.png"); ui->closeDoorAnimation->load(":/images/animation/door_04.png"); ui->closeDoorAnimation->load(":/images/animation/door_03.png"); ui->closeDoorAnimation->load(":/images/animation/door_02.png"); ui->closeDoorAnimation->load(":/images/animation/door_01.png"); ui->closeDoorAnimation->start(300); ui->closeDoorAnimation->hide(); ui->closeDoorArrow->hide(); lastViewCookMode = Define::InvalidMode; lastViewCookType = Define::Invalid; lastViewCoreTemp = 999; lastViewDoorType = Define::Invalid; lastViewTime = 0; lastViewStepIndex = -1; lastViewTemp = 999; lastViewHumidity = 999; selectedStepIndex = 0; showingCurrentHumidity = false; showingCurrentTemp = false; if (autocook.cook.processes.isEmpty()) { ui->processTitleLabel->hide(); ui->processTypeLabel->hide(); ui->processButton_1->hide(); ui->processButton_2->hide(); ui->processButton_3->hide(); } else { QString typeText; QSignalMapper *sm = NULL; for (int i = 0; i < 3; i++) { QPushButton *pb; switch (i) { case 0: pb = ui->processButton_1; break; case 1: pb = ui->processButton_2; break; case 2: pb = ui->processButton_3; break; } if (i < autocook.cook.processes.size()) { if (sm == NULL) { sm = new QSignalMapper(this); connect(sm, SIGNAL(mapped(int)), SLOT(startProcess(int))); } Define::Process process = autocook.cook.processes[i]; QString text = Define::name(process); if (typeText.isEmpty()) typeText = text; else typeText += ", " + text; QString styleSheet = QString("QPushButton { border-image: url(%1) } QPushButton:pressed { border-image: url(%2) }") .arg(Define::icon(process)) .arg(Define::iconOverlay(process)); pb->setStyleSheet(styleSheet); sm->setMapping(pb, (int) process); connect(pb, SIGNAL(clicked()), sm, SLOT(map())); } else { pb->hide(); } } ui->processTypeLabel->setText(typeText); } ui->processContainer->hide(); ui->doorStepLabel->hide(); updateView(); } void AutoCookWindow::onEncoderLeft() { focusPreviousChild(); } void AutoCookWindow::onEncoderRight() { focusNextChild(); } void AutoCookWindow::onEncoderClicked(QWidget *clicked) { QPushButton *b = qobject_cast(clicked); if (b) b->click(); } void AutoCookWindow::updateView() { Oven *oven = Oven::getInstance(); if (!autocook.done()) { int remainingTime = qMax(0, autocook.msecs()); ui->timeLabel->setText(Stringer::remainingTime(remainingTime)); } int coreTemp = oven->currentInterTemp(); if (coreTemp != lastViewCoreTemp) { lastViewCoreTemp = coreTemp; if (cook.isCoreTempValid()) ui->interTempLabel->setText(Stringer::temperature(coreTemp, cook.coreTemp(), Stringer::fontSize14)); else ui->interTempLabel->setText(Stringer::temperature(coreTemp, Stringer::fontSize14)); } if (autocook.done()) { if (processSelected) { if (ui->openDoorAnimation->isVisible()) ui->openDoorAnimation->hide(); if (ui->openDoorArrow->isVisible()) ui->openDoorArrow->hide(); if (oven->door()) { if (ui->closeDoorAnimation->isVisible()) ui->closeDoorAnimation->hide(); if (ui->closeDoorArrow->isVisible()) ui->closeDoorArrow->hide(); } else { if (ui->closeDoorAnimation->isVisible()) ui->closeDoorAnimation->hide(); if (ui->closeDoorArrow->isVisible()) ui->closeDoorArrow->hide(); } } else if (!oven->door()) { if (ui->openDoorAnimation->isHidden()) ui->openDoorAnimation->show(); if (ui->openDoorArrow->isHidden()) ui->openDoorArrow->show(); if (ui->closeDoorAnimation->isVisible()) ui->closeDoorAnimation->hide(); if (ui->closeDoorArrow->isVisible()) ui->closeDoorArrow->hide(); } else { if (ui->openDoorAnimation->isVisible()) ui->openDoorAnimation->hide(); if (ui->openDoorArrow->isVisible()) ui->openDoorArrow->hide(); if (ui->closeDoorAnimation->isVisible()) ui->closeDoorAnimation->hide(); if (ui->closeDoorArrow->isVisible()) ui->closeDoorArrow->hide(); } if (processSelected) ui->processContainer->hide(); else if (ui->processContainer->isHidden()) ui->processContainer->show(); } else if (autocook.isWaitingDoorOpened() && !oven->door()) { if (ui->openDoorAnimation->isHidden()) ui->openDoorAnimation->show(); if (ui->openDoorArrow->isHidden()) ui->openDoorArrow->show(); if (ui->closeDoorAnimation->isVisible()) ui->closeDoorAnimation->hide(); if (ui->closeDoorArrow->isVisible()) ui->closeDoorArrow->hide(); } else if (!autocook.isWaitingDoorOpened() && oven->door()) { if (ui->openDoorAnimation->isVisible()) ui->openDoorAnimation->hide(); if (ui->openDoorArrow->isVisible()) ui->openDoorArrow->hide(); if (ui->closeDoorAnimation->isHidden()) ui->closeDoorAnimation->show(); if (ui->closeDoorArrow->isHidden()) ui->closeDoorArrow->show(); } else { if (ui->openDoorAnimation->isVisible()) ui->openDoorAnimation->hide(); if (ui->openDoorArrow->isVisible()) ui->openDoorArrow->hide(); if (ui->closeDoorAnimation->isVisible()) ui->closeDoorAnimation->hide(); if (ui->closeDoorArrow->isVisible()) ui->closeDoorArrow->hide(); } if (autocook.cook.steps[autocook.currentStepIndex].type == Define::Preheat) { if (ui->preheatIcon->isHidden()) ui->preheatIcon->show(); if (ui->preheatLabel->isHidden()) ui->preheatLabel->show(); if (ui->preheatGauge->isHidden()) ui->preheatGauge->show(); ui->preheatGauge->setMaximum(autocook.cook.steps[autocook.currentStepIndex].temp); ui->preheatGauge->setMinimum(autocook.startTemp); ui->preheatGauge->setValue(oven->currentTemp()); } else { if (ui->preheatIcon->isVisible()) ui->preheatIcon->hide(); if (ui->preheatLabel->isVisible()) ui->preheatLabel->hide(); if (ui->preheatGauge->isVisible()) ui->preheatGauge->hide(); } if (selectedStepIndex != autocook.currentStepIndex) { if (!returnToCurrentStepTimer.isActive()) { selectedStepIndex = autocook.currentStepIndex; } } if (selectedStepIndex != lastViewStepIndex) { lastViewStepIndex = selectedStepIndex; ui->stepIndicator->setCurrentIndex(selectedStepIndex); } CookStep showingStep = autocook.cook.steps[selectedStepIndex]; if (Define::classify(showingStep.type) == Define::DoorClass) { if (ui->cookStepIcon->isVisible()) ui->cookStepIcon->hide(); if (ui->cookStepLabel->isVisible()) ui->cookStepLabel->hide(); if (ui->cookModeIcon->isVisible()) ui->cookModeIcon->hide(); if (ui->humidityGauge->isVisible()) ui->humidityGauge->hide(); if (ui->humidityGaugeButton->isVisible()) ui->humidityGaugeButton->hide(); if (ui->humidityLabel->isVisible()) ui->humidityLabel->hide(); if (ui->heatGauge->isVisible()) ui->heatGauge->hide(); if (ui->heatGaugeButton->isVisible()) ui->heatGaugeButton->hide(); if (ui->heatLabel->isVisible()) ui->heatLabel->hide(); if (ui->doorStepLabel->isHidden()) ui->doorStepLabel->show(); if (ui->cookStepAnimation->isHidden()) ui->cookStepAnimation->show(); if (showingStep.type != lastViewDoorType) { lastViewDoorType = showingStep.type; ui->doorStepLabel->setText(Define::name(showingStep.type)); ui->cookStepAnimation->clear(); switch (showingStep.type) { case Define::PutThermometer: ui->doorStepLabel->setText(tr("중심 온도계 삽입")); ui->cookStepAnimation->load(":/images/animation/thermometer_01.png"); ui->cookStepAnimation->load(":/images/animation/thermometer_02.png"); ui->cookStepAnimation->setGeometry((900-210)/2, 800, 210, 307); ui->cookStepAnimation->start(300); break; case Define::Load: ui->doorStepLabel->setText(tr("식재료 적재")); ui->cookStepAnimation->load(":/images/animation/load_01.png"); ui->cookStepAnimation->load(":/images/animation/load_02.png"); ui->cookStepAnimation->load(":/images/animation/load_03.png"); ui->cookStepAnimation->load(":/images/animation/load_04.png"); ui->cookStepAnimation->load(":/images/animation/load_03.png"); ui->cookStepAnimation->load(":/images/animation/load_02.png"); ui->cookStepAnimation->load(":/images/animation/load_01.png"); ui->cookStepAnimation->setGeometry((900-264)/2, 800, 264, 307); ui->cookStepAnimation->start(300); break; case Define::Cut: ui->doorStepLabel->setText(tr("자르기")); ui->cookStepAnimation->load(":/images/animation/cut_01.png"); ui->cookStepAnimation->load(":/images/animation/cut_02.png"); ui->cookStepAnimation->load(":/images/animation/cut_03.png"); ui->cookStepAnimation->setGeometry((900-264)/2, 800, 264, 307); ui->cookStepAnimation->start(300); break; case Define::Pour: ui->doorStepLabel->setText(tr("물 붓기")); ui->cookStepAnimation->load(":/images/animation/pour_01.png"); ui->cookStepAnimation->load(":/images/animation/pour_02.png"); ui->cookStepAnimation->load(":/images/animation/pour_03.png"); ui->cookStepAnimation->load(":/images/animation/pour_04.png"); ui->cookStepAnimation->setGeometry((900-264)/2, 800, 264, 307); ui->cookStepAnimation->start(300); break; default: ui->doorStepLabel->hide(); ui->cookStepAnimation->hide(); } } } else { if (ui->doorStepLabel->isVisible()) ui->doorStepLabel->hide(); if (ui->cookStepAnimation->isVisible()) ui->cookStepAnimation->hide(); if (ui->cookStepIcon->isHidden()) ui->cookStepIcon->show(); if (ui->cookStepLabel->isHidden()) ui->cookStepLabel->show(); if (ui->cookModeIcon->isHidden()) ui->cookModeIcon->show(); if (ui->humidityGauge->isHidden()) ui->humidityGauge->show(); if (ui->humidityGaugeButton->isHidden()) ui->humidityGaugeButton->show(); if (ui->humidityLabel->isHidden()) ui->humidityLabel->show(); if (ui->heatGauge->isHidden()) ui->heatGauge->show(); if (ui->heatGaugeButton->isHidden()) ui->heatGaugeButton->show(); if (ui->heatLabel->isHidden()) ui->heatLabel->show(); if (showingStep.type != lastViewCookType) { lastViewCookType = showingStep.type; ui->cookStepIcon->setPixmap(Define::icon(showingStep.type)); ui->cookStepLabel->setText(Define::name(showingStep.type)); } if (showingStep.mode != lastViewCookMode) { lastViewCookMode = showingStep.mode; switch (showingStep.mode) { case Define::SteamMode: ui->cookModeIcon->setPixmap(steamModeIcon); break; case Define::CombiMode: ui->cookModeIcon->setPixmap(combiModeIcon); break; case Define::DryMode: ui->cookModeIcon->setPixmap(dryModeIcon); break; case Define::InvalidClass: ui->cookModeIcon->hide(); break; } } int humidity; if (showingCurrentHumidity) humidity = oven->currentHumidity(); else humidity = showingStep.humidity; if (humidity != lastViewHumidity) { lastViewHumidity = humidity; ui->humidityLabel->setText(QString("%1%").arg(humidity)); ui->humidityGauge->setValue(humidity); } int temp; if (showingCurrentTemp) temp = oven->currentTemp(); else temp = showingStep.temp; if (temp != lastViewTemp) { lastViewTemp = temp; ui->heatLabel->setText(Stringer::temperature(temp)); ui->heatGauge->setValue(temp); } } } void AutoCookWindow::checkCook() { int lastStepIndex = autocook.currentStepIndex; if (autocook.advance()) { if (lastStepIndex != autocook.currentStepIndex) selectedStepIndex = autocook.currentStepIndex; if (autocook.done()) checkCookTimer.stop(); } updateView(); } void AutoCookWindow::startProcess(int process) { if (processSelected) return; processSelected = true; Define::Process p = (Define::Process) process; switch (p) { case Define::CookAgain: { close(); AutoCookWindow *w = new AutoCookWindow(parentWidget(), cook); w->setWindowModality(Qt::WindowModal); w->showFullScreen(); w->raise(); break; } case Define::MakeCrisper: { selectedProcess = (Define::Process) process; CookStep &step = autocook.cook.steps[autocook.cook.steps.size() - 1]; CookStep newStep = step; newStep.type = Define::MakeCrispy; newStep.humidity = 0; newStep.temp += 10; newStep.time = 0; newStep.humidification = 0; newStep.dehumidification = 0; autocook.cook.steps.append(newStep); autocook.currentStepIndex = autocook.cook.steps.size() - 1; ui->stepIndicator->setMaximum(autocook.cook.steps.size() - 1); returnToCurrentStep(); Oven *oven = Oven::getInstance(); oven->setHumidity(0); oven->setTemp(step.temp + 10); oven->startCooking(); checkProcessTimer.start(100); SoundPlayer::playStart(); break; } case Define::KeepWarm: { processSelected = false; selectedProcess = (Define::Process) process; KeepWarmPopup *p = new KeepWarmPopup(this); p->showFullScreen(); p->raise(); break; } default: return; } } void AutoCookWindow::checkProcess() { if (!processSelected) return; switch (selectedProcess) { case Define::MakeCrisper: { Oven *oven = Oven::getInstance(); if (oven->currentTemp() >= oven->temp()) { SoundPlayer::playStop(); oven->stopCooking(); checkProcessTimer.stop(); processSelected = false; } break; } default: break; } updateView(); } void AutoCookWindow::returnToCurrentStep() { selectedStepIndex = autocook.currentStepIndex; showingDifferentStep = false; updateView(); } void AutoCookWindow::showCurrentHumidity() { showingCurrentHumidity = true; updateView(); } void AutoCookWindow::showCurrentTemp() { showingCurrentTemp = true; updateView(); } void AutoCookWindow::addFavorite() { AutoCookSetting s; s.type = cook.type; s.root = cook.root; for (int i = 0; i < 5; i++) s.configs[i] = cook.configs[i].current; FavoriteNamePopup *p = new FavoriteNamePopup(this, s); p->showFullScreen(); } void AutoCookWindow::jumpConfig() { Oven::getInstance()->stop(); ConfigWindow *w = new ConfigWindow(MainWindow::getInstance()); w->setWindowModality(Qt::WindowModal); w->showFullScreen(); w->raise(); MainWindow::jump(w); } void AutoCookWindow::jumpWash() { Oven::getInstance()->stop(); WashWindow *w = new WashWindow(MainWindow::getInstance()); w->setWindowModality(Qt::WindowModal); w->showFullScreen(); w->raise(); MainWindow::jump(w); } void AutoCookWindow::monitor() { Define::StepClass step = Define::classify(autocook.cook.steps[autocook.currentStepIndex].type); if (step == Define::PreheatClass || step == Define::CookClass) { if (Oven::getInstance()->door()) { switch (currentCookingMonitorLevel) { case 0: cookingMonitorTime1.start(); currentCookingMonitorLevel = 1; break; case 1: if (cookingMonitorLevel >= 1 && cookingMonitorTime1.elapsed() > cookingMonitor1) { SoundPlayer::playError2(); ErrorPopupDlg *d = new ErrorPopupDlg(this, tr("문을 닫아주세요"), tr("조리 중 문 열림 시간 모니터링 1단계")); d->showFullScreen(); cookingMonitorTime2.start(); currentCookingMonitorLevel = 2; } break; case 2: if (cookingMonitorLevel >= 2 && cookingMonitorTime2.elapsed() > cookingMonitor2) { SoundPlayer::playError2(); ErrorPopupDlg *d = new ErrorPopupDlg(this, tr("문을 닫아주세요"), tr("조리 중 문 열림 시간 모니터링 2단계")); d->showFullScreen(); cookingMonitorTime3.start(); currentCookingMonitorLevel = 3; } break; case 3: if (cookingMonitorLevel >= 3 && cookingMonitorTime3.elapsed() > cookingMonitor3) { SoundPlayer::playError2(); ErrorPopupDlg *d = new ErrorPopupDlg(MainWindow::getInstance(), tr("문이 오래 열려있어 조리가 취소되었습니다"), tr("조리 중 문 열림 시간 모니터링 3단계")); d->showFullScreen(); MainWindow::killChild(); } } } else if (currentCookingMonitorLevel > 0) { currentCookingMonitorLevel = 0; } } else if (step == Define::DoorClass) { if (Oven::getInstance()->door()) { switch (currentLoadingMonitorLevel) { case 0: loadingMonitorTime1.start(); currentLoadingMonitorLevel = 1; break; case 1: if (loadingMonitorLevel >= 1 && loadingMonitorTime1.elapsed() > loadingMonitor1) { SoundPlayer::playError2(); ErrorPopupDlg *d = new ErrorPopupDlg(this, tr("문을 닫아주세요"), tr("적재 중 문 열림 시간 모니터링 1단계")); d->showFullScreen(); loadingMonitorTime2.start(); currentLoadingMonitorLevel = 2; } break; case 2: if (loadingMonitorLevel >= 2 && loadingMonitorTime2.elapsed() > loadingMonitor2) { SoundPlayer::playError2(); ErrorPopupDlg *d = new ErrorPopupDlg(this, tr("문을 닫아주세요"), tr("적재 중 문 열림 시간 모니터링 2단계")); d->showFullScreen(); loadingMonitorTime3.start(); currentLoadingMonitorLevel = 3; } break; case 3: if (loadingMonitorLevel >= 3 && loadingMonitorTime3.elapsed() > loadingMonitor3) { SoundPlayer::playError2(); ErrorPopupDlg *d = new ErrorPopupDlg(this, tr("문을 닫아주세요"), tr("적재 중 문 열림 시간 모니터링 3단계")); d->showFullScreen(); MainWindow::killChild(); } } } else if (currentLoadingMonitorLevel > 0) { currentLoadingMonitorLevel = 0; } } } void AutoCookWindow::on_selectCookButton_clicked() { } void AutoCookWindow::on_homeButton_clicked() { Oven::getInstance()->stop(); MainWindow::killChild(); } void AutoCookWindow::on_configCookButton_clicked() { } void AutoCookWindow::on_humidityGaugeButton_pressed() { showCurrentHumidityTimer.start(); } void AutoCookWindow::on_humidityGaugeButton_released() { if (showCurrentHumidityTimer.isActive()) showCurrentHumidityTimer.stop(); if (showingCurrentHumidity) { showingCurrentHumidity = false; updateView(); } } void AutoCookWindow::on_heatGaugeButton_pressed() { showCurrentTempTimer.start(); } void AutoCookWindow::on_heatGaugeButton_released() { if (showCurrentTempTimer.isActive()) showCurrentTempTimer.stop(); if (showingCurrentTemp) { showingCurrentTemp = false; updateView(); } } void AutoCookWindow::on_showPrevStepButton_clicked() { returnToCurrentStepTimer.start(); if (selectedStepIndex > 0) { selectedStepIndex--; updateView(); } } void AutoCookWindow::on_showNextStepButton_clicked() { returnToCurrentStepTimer.start(); if (selectedStepIndex + 1 < autocook.cook.steps.size()) { selectedStepIndex++; updateView(); } } void AutoCookWindow::on_backButton_clicked() { Oven::getInstance()->stop(); emit back(); close(); } void AutoCookWindow::on_configButton_clicked() { if (autocook.done()) { ConfigWindow *w = new ConfigWindow(MainWindow::getInstance()); w->setWindowModality(Qt::WindowModal); w->showFullScreen(); w->raise(); MainWindow::jump(w); } else { ConfirmPopup *p = new ConfirmPopup(this, tr("요리가 중단되고 환경 설정 모드로 들어갑니다. 진행할까요?")); p->showFullScreen(); connect(p, SIGNAL(accepted()), SLOT(jumpConfig())); } } void AutoCookWindow::on_favoritesButton_clicked() { if (!autocook.done()) return; ConfirmPopup *p = new ConfirmPopup(this, tr("즐겨찾기 항목에 추가하시겠습니까?")); p->showFullScreen(); connect(p, SIGNAL(accepted()), SLOT(addFavorite())); } void AutoCookWindow::on_washButton_clicked() { if (autocook.done()) { WashWindow *w = new WashWindow(MainWindow::getInstance()); w->setWindowModality(Qt::WindowModal); w->showFullScreen(); w->raise(); MainWindow::jump(w); } else { ConfirmPopup *p = new ConfirmPopup(this, tr("요리가 중단되고 자동 세척 모드로 들어갑니다. 진행할까요?")); p->showFullScreen(); connect(p, SIGNAL(accepted()), SLOT(jumpWash())); } } void AutoCookWindow::on_helpButton_clicked() { }