#ifndef CVREYEDEVICE_H
#define CVREYEDEVICE_H

#include "IVrEyeDevice.h"
#include "IVzDeviceCoreDataReader.h"
#include "VrEyeCommon.h"

#include "VZNL_Common.h"
#include "VZNL_DetectConfig.h"
#include "VZNL_DetectLaser.h"
#include "VZNL_SwingMotor.h"
#include "VZNL_Internal.h"
#include "VZNL_RGBConfig.h"
#include "VZNL_DetectLaser.h"

class CVrEyeDevice : public IVrEyeDevice
{
public:
    CVrEyeDevice();
    ~CVrEyeDevice();

    // 初始化设备
    int InitDevice() override;

    /**
     * Open设备
     */
    int OpenDevice(const char* sIP, VzNL_OnNotifyStatusCBEx fNotify, void *param) override;

    /**
     * 获取版本信息
     * @return 版本信息
     */
    int GetVersion(SVzNLVersionInfo& sVersionInfo) override;


    /**
     * 获取设备信息
     * @return
     */
    int GetDevInfo(SVzNLEyeDeviceInfoEx& sDeviceInfo) override;

    /**
     * Close设备
     */
    int CloseDevice() override;

    /**
     * 开始自动检测
     * @return 错误代码 0表示成功
     */
    int StartDetect(VzNL_AutoOutputLaserLineExCB fCallFunc, void *param) override;

    /**
     * 是否正在检测
     * @return
     */
    bool IsDetectIng() override;

    /**
     * 停止自动检测
     * @return 错误代码 0表示成功
     */
    int StopDetect() override;

    /**
     * ROI设置
     * @param leftROI
     * @param rightROI
     * @return
     */
    int SetDetectROI(SVzNLRect& leftROI, SVzNLRect& rightROI) override;
    int GetDetectROI(SVzNLRect& leftROI, SVzNLRect& rightROI) override;


    /**
     * 曝光设置&获取
     * @return
     */
    int SetEyeExpose(unsigned int& exposeTime) override;
    int GetEyeExpose(unsigned int& exposeTime) override;

    /**
     * 增益设置&获取
     * @param gain
     * @return
     */
    int SetEyeGain(unsigned int& gain) override;
    int GetEyeGain(unsigned int& gain) override;

    /**
     * 帧率设置&获取
     * @param frame
     * @return
     */
    int SetFrame(int& frame) override;
    int GetFrame(int& frame) override;

    /**
     * 是否支持RGBD
     * @return
     */
    bool IsSupport() override;

    /**
     * 设置彩色Sensor期望值
     * @param value
     * @return
     */
    int SetRGBDExposeThres(float& value) override;
    int GetRGBDExposeThres(float& value) override;

    /**
     * 设置过滤高度
     * @param dHeight
     * @return
     */
    int SetFilterHeight(double& dHeight) override;
    int GetFilterHeight(double& dHeight) override;

    /**
     * 配置摆动机构速度
     * @return
     */
    int GetSwingSpeed(float& fSpeed) override;
    int SetSwingSpeed(float& fSpeed) override;

    /**
     * 设置工作角度
     * @param nMin
     * @param nMax
     * @return
     */
    int SetSwingAngle(float& fMin, float& fMax) override;
    int GetSwingAngle(float& fMin, float& fMax) override;

    /**
     * 设置工作距离
     * @param nMin
     * @param nMax
     * @return
     */
    int SetWorkRange(double& dMin, double& dMax) override;
    int GetWorkRange(double& dMin, double& dMax) override;

private:
    VZNLHANDLE                      m_pHandle = nullptr;
    SVzNLEyeDeviceInfoEx            m_sEeyCBDeviceInfo;
    IVzDeviceCoreDataReader*        m_pDeviceCore;

};

#endif // CVREYEDEVICE_H
