#pragma once

#include "CMWidget.h"
#include <QGraphicsScene>
#include <QMap>
#include <QPushButton>
#include <QLabel>
namespace Ui { class CMWManualTechnology; };

class CMWManualTechnology : public CMWidget
{
    Q_OBJECT

public:
    CMWManualTechnology(QWidget *parent = Q_NULLPTR);
    ~CMWManualTechnology();


    void MTimeFresh() override;

    void FreshWaferStatus();


    void MFresh() override;


    void MInit() override;

private:
    Ui::CMWManualTechnology *ui;
    //QGraphicsScene* m_GraphicsScene;

    QMap<int, QPushButton*> m_TransButtons;
    QMap<int, QPushButton*> m_CoatButtons;
    QMap<int, QPushButton*> m_CleanButtons;
    QMap<int, QPushButton*> m_CutButtons;
private:
    void OnTransBtnClicked(int iSemiMsgId, QPushButton* pBtn);
    void OnTransCompClicked(int iSemiMsgId, QPushButton* pBtn);
    void OnCoatBtnClicked(int iSemiMsgId, QPushButton* pBtn);
    void OnCleanBtnClicked(int iSemiMsgId, QPushButton* pBtn);

    void OnCutBtnClicked(int iSemiMsgId, QPushButton* pBtn);
    int AskButtonOperte(int smID, int operateID);

    void FreshTransButtonStatus(int smId, const QMap<int, QPushButton*>& btnList);

    void OnStopBtnClicked(int smID);
    void updateStatus(int iVsmId, QLabel* pLabel);

private slots:
    void on_checkBox_LaserEmit_clicked(bool checked);
    void on_checkBox_OnlyLeveling_clicked(bool checked);
    void on_checkBox_OnlyLocation_clicked(bool checked);
    void on_checkBox_OnlyA_clicked(bool checked);
    void on_checkBox_OnlyB_clicked(bool checked);
    void on_chkPauseAfterLeveling_clicked(bool checked);
    void on_chkPauseAfterLocation_clicked(bool checked);
    void on_chkStopAfterFinish_toggled(bool checked);
    void on_checkBox_CycleRun_clicked(bool checked);
    void on_chkBoxSimulatorLeveling_clicked(bool checked);
    void on_chkBoxSimulatorLocation_clicked(bool checked);

    void on_btnStopAll_clicked(bool checked);
    void on_btnManualLoad_clicked(bool checked);
    void on_btnCassUp_clicked(bool checked);
protected:
    void paintEvent(QPaintEvent* event) override;

};
