cook.h 4.15 KB
#ifndef COOK_H
#define COOK_H

#include <QObject>
#include <QTimer>
#include <QList>

namespace Cook {
    enum CookType
    {
        Poultry,
        Meat,
        Fish,
        Desert,
        Vegetable,
        Bread,
        Etc
    };

    enum StepClass
    {
        InvalidClass,
        PreheatClass,
        DoorClass,
        CookClass
    };

    enum StepType
    {
        Invalid,

        Preheat,        // 예열
        PutThermometer, // 중심 온도계 삽입
        Load,           // 식재료 적재
        Cut,            // 자르기
        Pour,           // 물 붓기

        Bake,           // 베이킹
        Dry,            // 건조
        Ferment,        // 발효
        BlowSteam,      // 스팀 쏘이기
        CoolDown,       // 식히기
        Steam,          // 찌기
        Roast,          // 로스팅
        Boil,           // 끓이기
        Thicken,        // 걸쭉하게 만들기
        WarmUp,         // 데우기
        MakeCrispy,     // 바삭하게 만들기
        Finish,         // 피니싱
        Damp,           // 습윤하게 만들기
        Defer,          // 보류
        Grill,          // 그릴
        End,            // 종료
        Burn,           // 그을리기
        Fry,            // 기름에 볶기
        HeatUp,         // 온도 높이기
        Ripen,          // 숙성
        RipenKeep,      // 숙성 & 보존
        BoilSteadily,   // 뭉근하게 끓이기
        CookGratin,     // 그라탱 요리
        Brown,          // 브라우닝
        Simmer,         // 약한 불로 끓이기
        Moisten         // 촉촉하게
    };

    enum Mode {
        SteamMode, DryMode, CombiMode
    };

    struct Step {
        StepType type;
        Mode mode;
        int humidity;
        int temp;
    };

    enum Configuration {
        Brightness,
        Time,
        BurnDegree
    };

    StepClass classify(StepType type);
    QString name(StepType type);
    QString icon(CookType type);
    QString icon(StepType type);
}

class AbstractCookConfig
{
public:
    Cook::Configuration type();
    QString icon();
    QString overlayIcon();
    QString minLabel();
    QString maxLabel();
    virtual QString currentLabel();

    int count();
    int current();
    int standard();

    virtual int configureTime(int standardTime);
    virtual int configureInterTemp(int standardInterTemp);
    virtual Cook::Step configureStep(Cook::Step standardStep);

public slots:
    void setCount(int value);
    void setCurrent(int value);
    void setStandard(int value);

protected:
    Cook::Configuration type_;
    QString icon_;
    QString overayIcon_;
    QString minLabel_;
    QString maxLabel_;
    QString currentLabel_;

    int standard_;
    int current_;
    int count_;
};

class AbstractCook
{
public:
    AbstractCook() { for (int idx = 0; idx < 5; idx++) configurations[idx] = NULL; }
    ~AbstractCook();

    Cook::CookType type();
    QString name();
    int time();
    bool interTempEnabled();
    void setInterTempEnabled(bool enabled);
    int interTemp();

    Cook::Step currentStep();
    Cook::Step step(int index);

    int currentStepIndex();
    void setCurrentStepIndex(int index);

    int stepCount();

    AbstractCookConfig *configurations[5];

protected:
    Cook::CookType type_;
    QString name_;
    int time_;
    bool interTempEnabled_;
    int interTemp_;
    int currentStep_;
    int stepCount_;
    Cook::Step stepList[10];
};

class BrightnessConfig : public AbstractCookConfig
{
public:
    BrightnessConfig();
    Cook::Step configureStep(Cook::Step standardStep);
};

class TimeConfig : public AbstractCookConfig
{
public:
    TimeConfig();
    int configureTime(int standardTime);
};

class BurnDegreeConfig : public AbstractCookConfig
{
public:
    BurnDegreeConfig();
    Cook::Step configureStep(Cook::Step standardStep);
    int configureInterTemp(int standardInterTemp);
};

class FriedRice : public AbstractCook
{
public:
    FriedRice();
};

class ChickenCook : public AbstractCook
{
public:
    ChickenCook();
};

class MeatPie : public AbstractCook
{
public:
    MeatPie();
};

class Croissant : public AbstractCook
{
public:
    Croissant();
};

#endif // COOK_H