cooldownpopup.h 1.33 KB
#ifndef COOLDOWNPOPUP_H
#define COOLDOWNPOPUP_H

#include <QWidget>
#include <QTimer>

#include "oven.h"

namespace Ui {
class CooldownPopup;
}

class CooldownPopup : public QWidget
{
    Q_OBJECT

public:
    explicit CooldownPopup(QWidget *parent = 0, Oven *oven = 0);
    ~CooldownPopup();

protected:
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);

private slots:
    void start();
    void stop();
    void showCurrentTemp();
    void updateView();
    void checkOven();

    void on_closeButton_clicked();

    void on_closeButton_2_clicked();

    void on_tempButton_pressed();

    void on_tempButton_released();

    void on_runButton_clicked();

    void on_fanButton_clicked();

    void on_humidificationButton_clicked();

    void on_tempButton_clicked();

    void focusTempButton();

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

    QTimer cooldownStartTimer;
    QTimer checkOvenTimer;

    bool showingCurrentTemp;
    QTimer showCurrentTempTimer;

    int cookingFanLevel;
    int expectingFanLevel;
    bool started;
    bool opened;

    int lastDisplayedFanLevel;
    bool lastDisplayedHumidification;

    QTimer focusTempButtonTimer;
    QWidget *pushed = NULL;

    void onEncoderLeft();
    void onEncoderRight();
    void onEncoderClicked(QWidget *clicked);
};

#endif // COOLDOWNPOPUP_H