#ifndef BRIDGE_H
#define BRIDGE_H

#include <QObject>

#include "readEPC/readepccontrol.h" //读卡器模块
#include "eqptcontrol/eqptcontrol.h"    //硬件控制模块
#include "hkCapture_control/cameracontrol.h"    //海康抓拍机模块
#include "hkVideo_control/hkvideocontrol.h" //海康监控机模块
#include "picToBase64_model/pictobase64model.h"     //图片转换控制
#include <QThread>
#include <windows.h>
using namespace std;
class Bridge : public QObject
{
    Q_OBJECT
public:
    explicit Bridge(QObject *parent = nullptr);
    ReadEPCControl *m_ReadEPCControl;   //定义EPC对象
    EqptControl *m_EqptControl; //定义硬件控制对象
    CameraControl *m_CameraControl; //定义抓拍机对象
    HkVideoControl *m_HkVideoControl;   //定义监控机对象
    PicToBase64Model_CarPic *m_PicToBase64Model_CarPic; //定义图片转换对象
    PicToBase64Model_CarPlnumPic *m_PicToBase64Model_CarPlnumPic;   //定义车牌转换对象
signals:
    ///读卡器信号
    void SendToReadEPCControl_Connect(QString comName,long comBund);
    void SendToReadEPCControl_Close();
    void SendToWindow(QString data);
    void SendToWindowRFIDStatus(bool status);   //告知读卡器状态

    ///硬件控制信号
    void SendToEqptControl_Connect(QString comName,long comBund);
    void SendToEqptControl_SnapByHand();    //手动抓拍
    void SendToEqptControl_HTrunkUp();  //抬起道闸
    void SendToEqptControl_HTrunkDown();
    void SendToEqptControl_Close();

    ///抓拍机控制信号
    void SendToCameraControl_Connect(QString ip,int port,QString user,QString pwd);

    ///监控机控制信号
    void SendToHkVideoControl_Connect(QString ip,int port,QString user,QString pwd);

    ///图片转化信号
    void SendToPicToBase64Model_CarPic(QString path);

    void SendToPicToBase64Model_CarPlnumPic(QString path);

public slots:
private:
    void Func_ReadEPCControl(); //读卡器槽函数
    void Func_EqptControl(); //硬件控制槽函数
    void Func_CameraControl(); //抓拍机控制槽函数
    void Func_HkVideoControl(); //抓拍机控制槽函数
    void Func_PicToBase64Model(); //图片转换控制槽函数
private:
    QThread *m_ReadEPCControl_thread;   //定读卡器子线程
    QThread *m_EqptControl_thread;   //定硬件控制子线程
    QThread *m_CameraControl_thread;   //抓拍机控制子线程
    QThread *m_HkVideoControl_thread;   //监控机控制子线程
    QThread *m_PicToBase64Model_CarPic_thread;   //车头图子线程
    QThread *m_PicToBase64Model_CarPlnumPic_thread;   //车牌图子线程
};

#endif // BRIDGE_H
