cook.h 1.13 KB
#ifndef COOK_H
#define COOK_H

#include "define.h"

struct CookConfig
{
    Define::CookConfigType type;
    int maximum;
    int current;
};

struct CookStep
{
    Define::StepType type;
    Define::Mode mode;
    int humidity;
    int temp;
    int time;
    int fan;
    int coreTemp;
    int dehumidification;
    int humidification;
    int dehumidificationRepeatDelay;
    int humidificationRepeatDelay;
    int dehumidificationRepeatCount;
    int humidificationRepeatCount;
};

class Cook
{
public:
    Cook();
    Cook(Define::CookType type, QString root, QString name);

    Define::CookType type;
    QString name;
    QString root;

    CookConfig configs[5];
    QList<CookStep> steps;
    QList<Define::Process> processes;

    void setConfig(int first, int second, int third, int fourth, int fifth);

    bool isInitialized() { return isInitialized_; }
    bool isLoaded() { return isLoaded_; }
    void load();

    bool isCoreTempValid();
    int time();
    int coreTemp();

private:
    bool isInitialized_;
    bool isLoaded_;
    bool isCoreTempValid_;
    int time_;
    int coreTemp_;

    void initialize();
};

#endif // COOK_H