#ifndef CAMERACONTROL_H
#define CAMERACONTROL_H

#include <QObject>
#include <QDateTime>
#include <QTimer>
#include "HCNetSDK.h"
#include <windows.h>
using namespace std;
class CameraControl : public QObject
{
    Q_OBJECT
public:
    explicit CameraControl(QObject *parent = nullptr);
    long play(HWND hWnd,NET_DVR_PREVIEWINFO struPlayInfo,long userID);
    long setupAlarm();
    bool initSDK();
    bool uninitSDK();
signals:
    //发送车牌号；
    void SendToBridge_CarPlnum(QString data);
    void SendToBridge_CarPic(QString data1,QString data2,QString data3);   //车头图,车牌图,车牌号,
    void SendToBridge_CarPlnumPic(QString data);
    void SendToBridge_LoginOk();
public slots:
    //摄像头登录
    void OnClickedLogin(QString ip, int port,QString user,QString pwd);
    //摄像头退出登录
    void OnClickedLogout();
    //摄像头预览
    void OnClickedPreview();
    //摄像头停止预览
    void OnClickedStopPreview();
    //普通抓拍（不是车牌识别抓拍）
    void OnClickedCapture();

    void Picinfo(QByteArray ba);
    //获取车牌号
    void Get_PlateNum();
    //获取车牌图
    void Get_PlatePic();
    //获取车头图
    void Get_CarPic();
    //测试显示车牌
    //void Show_Get_PlateNum(QString num);
    //定时器，轮询抓拍机，是否有车辆到来
    //void CarIsComingTimer_timeout();
private:
    QTimer *CarIsComingTimer;
private:
    bool isAlarm;

    long userID;

    long previewID;
    //传递车牌号
    QString carNumpublic;
    //车头图片路径
    QString CarPicPath;
    //车牌路径
    QString PlatePicPath;
};

#endif // CAMERACONTROL_H
