#ifndef EXPERIMENTSETTINGFORM_H
#define EXPERIMENTSETTINGFORM_H

#include <QWidget>
#include <qvector.h>

#include "protocol.h"

namespace Ui
{
class ExperimentSettingForm;
}

class ExperimentSettingForm : public QWidget
{
    Q_OBJECT

public:
    explicit ExperimentSettingForm(QWidget *parent = nullptr);
    ~ExperimentSettingForm();

signals:
    void sigDeliverData(const QByteArray &);
public slots:
    void slotRecvPhaseInfo(const QByteArray &);
protected:
    void showEvent(QShowEvent *event) override;
private slots:
    void on_pushButton_deliverData_clicked();
private:
    //ui
    void uiReset();
    void uiSetPhaseEnable(const int index);
    GasType conver2GasType(const int index);
    bool phaseCufoffTempAndTempFlowCheck(const int phaseIndex,
                                         const float prePhaseCufoffTemp,
                                         const float currentPhaseCufoffTemp,
                                         const float tempFlow);
    // slot
    void slotPhaseCheck();
    void slotPhase2StateChanged(int state);
    void slotPhase3StateChanged(int state);
    void slotPhase4StateChanged(int state);
    void slotPhase5StateChanged(int state);
    void slotPhase6StateChanged(int state);

    void slotCancel();

    void phaseCufoffTempErrorMesgBox(const int);
    void phaseScanRateErrorMesgBox(const int);
private:
    Ui::ExperimentSettingForm *ui;
};

#endif // EXPERIMENTSETTINGFORM_H
