multimanualcook.h 1.16 KB
#ifndef MULTIMANUALCOOK_H
#define MULTIMANUALCOOK_H

#include "multicook.h"
#include "interruptibletime.h"

class MultiManualCook : public MultiCook
{
    Q_OBJECT
public:
    explicit MultiManualCook(QObject *parent = 0);

    virtual QString name();
    virtual Define::Mode mode();
    virtual int temperature();
    virtual int humidity();
    virtual int remainingTime();

    virtual void increaseTime();
    virtual void decreaseTime();
    virtual void setTime();

    virtual void start();
    virtual void stop();
    virtual void pause();
    virtual void resume();

    virtual MultiCook *clone(QObject *parent);
    virtual bool equals(MultiCook *other);

    void setMode(Define::Mode mode);
    void setTemperature(int temperature);
    void setHumidity(int humidity);
    void setTime(int secs);

signals:

public slots:

private:
    Define::Mode mode_;
    int temp;
    int hum;
    int time;
    int modifiedTime;

    QTimer checkTimer;
    QTime elapsed;

    enum State {
        Idle, Running, Paused, Finished
    } state;

    InterruptibleTime decreasedTime;
    InterruptibleTime increasedTime;

private slots:
    void check();
};

#endif // MULTIMANUALCOOK_H