#ifndef CLASERPATHDRIVER_H
#define CLASERPATHDRIVER_H

#include "cdrivercard.h"
#include "export_laser_path_driver.h"

class LASER_PATH_DRIVER_EXPORT CLaserPathDriver : public CDriverCard
{
public:
    enum msg_id
    {
        LASERPATHDRIVER_MSG_ID_MSG_ID=MAX_DRIVER_MSG_ID,
        MOVEPATHANGLE,		//移动到角度,设置到理论功率
        MOVEPATHINITANGLE,	//移动到初始角度
        MOVEBEAMPOS,
        OPENSHUTTER,
        OPENLENSPROTECT,
        CHECKLESNPROTECT,
        MAX_LASERPATHDRIVER_MSG_ID,
    };

    CLaserPathDriver(const QString& name,int32_t id);
    virtual ~CLaserPathDriver();

    /**
     * @brief 设置光路的玻片角度，频率和功率.
     * 
     * \param pathid
     * \param iEpulse 单位KHz
     * \param dBeamWidth 单位mm Wide光斑宽度 D_Narrow光斑间距
     * \param iFreq 单位KHz
     * \param dPower 单位W
     * \param bWait
     * \return 
     */
    virtual int32_t MovePathAngle(int pathid, int iEpulse, double dBeamWidth, int iFreq, double dPower, bool bWait=true);
    virtual int32_t MovePathInitAngle(int pathid);

    /**
     * 移动光路到宽度位置.
     * 
     * \param iPathId
     * \param dBeamWidth
     * \return 
     */
    virtual int32_t MoveBeamWidthPos(int iPathId, double dBeamWidth);
    /**
     * 打开光闸.
     * 
     * \param pathid
     * \param bOpen
     * \param bWait
     * \return 
     */
    virtual int32_t OpenShutter(int pathid, bool bOpen, bool bWait=true);
    /**
     * @brief 设置光路的光阑宽度.
     */
    virtual int32_t MoveBeamPosCali(int pathid, double dWidth);
	virtual int32_t MoveBeamPos(int pathid, double dBeamWidth);

    /**
     * @brief 打开光路的吹气保护.
     * 
     * \param pathid
     * \param bOpen
     * \return 
     */
    virtual int32_t OpenLensBlow(int pathid, bool bOpen);
    /**
     * 检查吹气的流量保护.
     * 
     * \param pathid
     * \return 
     */
    virtual int32_t CheckLensBlow(int pathid);
    virtual void do_msg(int iID, QVariantList& vlInput, V_MsgOutput* pvlOutput);
};

#endif // CLASERPATHDRIVER_H
