autocookconfigwindow.h 1.07 KB
#ifndef AUTOCOOKCONFIGWINDOW_H
#define AUTOCOOKCONFIGWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include <QPushButton>
#include <QLabel>
#include <QSlider>

#include "oven.h"
//#include "cook.h"
#include "cookbook.h"

namespace Ui {
class AutoCookConfigWindow;
}

class AutoCookConfigWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit AutoCookConfigWindow(QWidget *parent, Cook cook);
    ~AutoCookConfigWindow();

private:
    Ui::AutoCookConfigWindow *ui;
    Oven *oven;
    Cook cook;

    QTimer cookStartTimer;

    struct ConfigWidget {
        QPushButton *button;
        QLabel *minimum;
        QLabel *maximum;
        QLabel *current;
        QSlider *slider;
    };

    QList<ConfigWidget> configWidgets;

private slots:
    void setupUi();
    void updateView();
    void updateConfig();
    void startTimer();
    void stopTimer();
    void start();
    void addFavorite();

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

#endif // AUTOCOOKCONFIGWINDOW_H