#ifndef CALIBRATIONMAINFORM_H
#define CALIBRATIONMAINFORM_H

#include <QWidget>

#include "dao/service/TaskService.h"
#include "calibration/TaskListWidget.h"
#include "calibration/ConfigurationWidget.h"

namespace Ui {
class CalibrationMainForm;
}

class CalibrationMainForm : public QWidget
{
    Q_OBJECT

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

    QMap<QString, TaskDTO> & getSelectedTask();
    QStringList getVerificationItemCatIds();
    void setVerificationItemCatIds(QStringList itemCatIds);

    // 选定的检定程序（单选）
//    CheckProgramDto selectedCheckProgram;

    // 选定的标准设备清单
//    QMap<QString, BizEquipmentInfoDto> selectedStdEquipment;

protected:
    void showEvent(QShowEvent * event) override;


private:
    Ui::CalibrationMainForm *ui;

    TaskListWidget * wdgtTask;
    ConfigurationWidget * wdgtConf;

    // 选择的任务清单（待检设备清单）
    QMap<QString, TaskDTO> selectedTask;

    // 所选待检设备对应的检定项分类
    QStringList verificationItemCatIds;

    void initFormWidgets();
    void bindSignalAndHandlers();

private slots:
    // 待检设备已选择完毕
    void nextToConfiguration();
};

#endif // CALIBRATIONMAINFORM_H
