#ifndef CMWCALILASERFOUCS_H
#define CMWCALILASERFOUCS_H

#include "cmwidget.h"
#include <QTableWidgetItem>
#include <QResizeEvent>
#include "cmpoint.h"
#include "v_msgqueue.h"
#include "cprocess_laserfoucscali.h"
#include "export_laser_power_cali.h"
class CProcess_LaserFoucsCali;

namespace Ui {
class CMWCaliLaserFoucs;
}
class LASER_POWER_CALI_EXPORT CMWCaliLaserFoucs : public CMWidget
{
    Q_OBJECT

public:
    explicit CMWCaliLaserFoucs(QWidget *parent ,int iLaserPathID);
    ~CMWCaliLaserFoucs();
    void MInit();
    void MFresh();
    void MApply();
    void MTimeFresh();
    void MFreshPos();
    void MFreshCombo();
    void resizeEvent(QResizeEvent *event);
    int32_t m_iLaserPathID;
    CProcess_LaserFoucsCali* m_pLaserFoucs;

    typedef struct _tagFoucsPt
    {
        double dX;
        double dY;
        double dZ;
        void Reset()
        {
            dX=dY=dZ=0;
        }
        _tagFoucsPt()
        {
            Reset();
        }

    }FOUCSPT,*PFOUCSPT;
    typedef QVector<FOUCSPT> FOUCSPTVECTOR;
    FOUCSPTVECTOR m_VectorFoucsPt;

    void DrawSingle(int iIndex, V_MsgQueue &msgqueue);
    void DrawSingle(CMPointd WPDP, double dZPos, V_MsgQueue &msgqueue);
    void MovePos(int iIndex);
    CMPointd m_InitWPDP;
    bool m_bMarked;
    int m_iSelRow;
    int m_iCurChannel;
private slots:
    void on_pushButton_LaserMark_clicked();

    void on_tableWidget_cellClicked(int row, int column);

    void on_pushButton_HASet_clicked();

    void on_pushButton_FoucsSearch_clicked();

    void on_pushButton_CurPos_clicked();

    void on_pushButton_SetFoucs_clicked();

    void on_pushButton_FoucsSearchUp_clicked();

    void on_pushButton_FoucsSearchDown_clicked();

    void on_btnCalibrationHairLine_clicked();

private:
    Ui::CMWCaliLaserFoucs *ui;
    void CalcuPosList();
    void CalcPosListY();
    void CalcuPosListUp(bool bUp);
};

#endif // CMWCALILASERFOUCS_H
