manualcookwindow.h 2.67 KB
#ifndef MANUALCOOKWINDOW_H
#define MANUALCOOKWINDOW_H

#include <QMainWindow>

#include "oven.h"
#include "udphandler.h"
#include "cookhistory.h"

namespace Ui {
class ManualCookWindow;
}

class ManualCookWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit ManualCookWindow(QWidget *parent, Define::Mode mode);
    explicit ManualCookWindow(QWidget *parent, ManualCookSetting setting);
    ~ManualCookWindow();

signals:
    void cookStopRequested();

public slots:

private slots:
    void setupAnimation();
    void setOvenDefault(Define::Mode mode);
    void start();
    void stop();
    void updateView();
    void showCurrentHumidity();
    void hideCurrentHumidity();
    void showCurrentTemp();
    void hideCurrentTemp();

    void onOvenUpdated(Oven *oven);

    void addFavorite();
    void jumpConfig();
    void jumpFavorites();
    void jumpWash();

    void onMonitor1Timeout();
    void onMonitor2Timeout();
    void onMonitor3Timeout();

    void on_steamButton_clicked();
    void on_combiButton_clicked();
    void on_dryheatButton_clicked();

    void on_humidityButton_pressed();
    void on_humidityButton_released();
    void on_tempButton_pressed();
    void on_tempButton_released();
    void on_interTempButton_clicked();

    void on_runStopButton_clicked();
    void on_fanButton_clicked();
    void on_preheatButton_clicked();
    void on_damperButton_clicked();
    void on_humidificationButton_clicked();
    void on_repeatButton_clicked();
    void on_cooldownButton_clicked();
    void on_reserveButton_clicked();
    void on_favoriteButton_clicked();
    void on_goBackStackButton_clicked();
    void on_goFrontStackButton_clicked();

    void on_backButton_clicked();
    void on_configButton_clicked();
    void on_favoritesButton_clicked();
    void on_washButton_clicked();
    void on_helpButton_clicked();

    void on_timeSlider_valueChanged();

private:
    Ui::ManualCookWindow *ui;
    Oven *oven;

    QTimer startCookingTimer;
    QTimer updateViewTimer;

    QTimer showCurrentHumidityTimer;
    QTimer showCurrentTempTimer;

    int humidity;
    int temp;
    int time;
    int interTemp;

    bool showCurrentHumidity_ = false;
    bool showCurrentTemp_ = false;

    int lastViewHumidity;
    int lastViewTemp;
    int lastViewTime;
    int lastViewInterTemp;
    bool lastViewInterTempEnabled;
    bool lastViewCooking;
    bool lastViewDamper;
    bool lastViewHumidification;
    int lastViewFan;

    int monitorLevel;
    QTimer monitor1;
    QTimer monitor2;
    QTimer monitor3;
    bool monitorTriggered;


    ManualCookSetting repeatSetting;
    bool repeat;

    int sliderToTime(int value);
    int timeToSlider(int secs);
};

#endif // MANUALCOOKWINDOW_H