#ifndef CMWMANUALCUT_H
#define CMWMANUALCUT_H

#include "cmwidget.h"
#include <QTableWidgetItem>
namespace Ui {
class CMWManualCut;
}

class CMWManualCut : public CMWidget
{
    Q_OBJECT

public:
    explicit CMWManualCut(QWidget *parent = 0);
    ~CMWManualCut();
    void MInit();
    void MApply();
    void MFresh();
    void MTimeFresh();
    void FreshLines(bool bForce=false);
    int32_t m_iCurSideID;
    QString strCurFile;
    int32_t m_iCurLineCount;
    CMPointd m_Wt1;
    CMPointd m_Wt2;
	int m_iLineSelected;

    enum MovePos
    {
        CENTER_POS=1,
        START_POS,
        END_POS,
    };
private slots:
    void on_pushButton_LineCut_clicked();

    void on_pushButton_Stop_clicked();

    void on_pushButton_Pos1_clicked();

    void on_pushButton_Pos1MoveTo_clicked();

    void on_pushButton_Pos2_clicked();

    void on_pushButton_Pos2MoveTo_clicked();

    void on_pushButton_PosCut_clicked();

	void on_btnReadCutData_clicked();
	void on_btnWriteCutData_clicked();
	void on_btnManualLineCut_clicked();

    void on_tableWidget_Line_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);

    void mon_MovePos(int32_t iID);
//    void on_pushButton_PosCut_2_clicked();

    void on_pushButton_ClearLines_clicked();

    void on_pushButton_ImageCapture_clicked();

    void on_pushButton_GenLines_clicked();

    void on_spDelay_editingFinished();

    void on_spDelayEnd_editingFinished();

    void on_btnLocationCurLine_clicked();

    void on_btnAngleSet_clicked();

    bool RelocationLine(int iLine, double dOffsetY);

    bool CalcOffset(int iLine, double& dOffsetY);

    void on_btnLocationCurLineAndAfter_clicked();

    void on_btnKerfCut_clicked();

    void on_btnToKerf_clicked();

    void on_btnIdx_clicked(bool checked);

    void on_btnRotateCh1_clicked();

    void on_btnRotateCh2_clicked();

private:
    Ui::CMWManualCut *ui;
};

#endif // CMWMANUALCUT_H
