cookhistory.h
1.18 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
#ifndef COOKHISTORY_H
#define COOKHISTORY_H
#include <QList>
#include "cook.h"
struct ManualCookSetting
{
Define::Mode mode;
int humidity;
int temp;
int time;
bool coreTempEnabled;
int coreTemp;
int fan;
};
struct ManualCookRecord
{
ManualCookSetting setting;
QDateTime cookedTime;
};
struct AutoCookSetting
{
Define::CookType type;
QString name;
QString root;
int configs[5];
};
struct AutoCookRecord
{
AutoCookSetting setting;
int count;
};
struct CookRecord
{
QString name;
int id;
enum Type { Manual, Auto } type;
ManualCookRecord manualRecord;
AutoCookRecord autoRecord;
};
namespace CookHistory
{
void record(ManualCookSetting cook);
void record(AutoCookSetting cook);
int addFavorite(ManualCookSetting cook, QString name);
int addFavorite(AutoCookSetting cook, QString name);
void removeMostCooked(CookRecord record);
void removeRecent(CookRecord record);
void removeFavorite(CookRecord record);
QList<CookRecord> listMostCooked();
QList<CookRecord> listRecents();
QList<CookRecord> listFavorites();
QPixmap render(CookRecord record);
void start(CookRecord record, QWidget *parent = 0);
}
#endif // COOKHISTORY_H