multiautocook.h
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef MULTIAUTOCOOK_H
#define MULTIAUTOCOOK_H
#include "multicook.h"
#include "interruptibletime.h"
class MultiAutoCook : public MultiCook
{
Q_OBJECT
public:
explicit MultiAutoCook(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 setName(QString name);
void setMode(Define::Mode mode);
void append(int temperature, int humidity, int time);
signals:
public slots:
private:
void updateTime();
QString name_;
Define::Mode mode_;
struct Step {
int temperature;
int humidity;
int time;
bool operator==(const Step &other);
};
QList<Step> steps;
enum State {
Idle, Running, Paused, Finished
} state;
QTime elapsed;
int decreasedTimeCount;
int increasedTimeCount;
InterruptibleTime decreasedTime;
InterruptibleTime increasedTime;
QTimer checkTimer;
bool isModifying;
QList<Step> modifiedSteps;
private slots:
void check();
};
#endif // MULTIAUTOCOOK_H