/**
* @projectName   XinHu_ASC
* @brief         摘要
* 外围设备控制,目前支持串口方式连接
*
* @author        ZhangYL
* @date          2022-02-16
*/
#ifndef EQPTCONTROL_H
#define EQPTCONTROL_H

#include <QObject>
#include <QSerialPort>

class EqptControl : public QObject
{
    Q_OBJECT
public:
    explicit EqptControl(QObject *parent = nullptr);

signals:
    void SendToBridge(QByteArray data);
    void SendRFIDStatus(bool status);
    //自己的信号
    void SendToSelf_Close();
    void SendToSelf_HeadTrunkUp();
    void SendToSelf_HeadTrunkUpRelease();
    void SendToSelf_HeadTrunkLock();
    void SendToSelf_HeadTrunkUnLock();
    void SendToSelf_HeadTrunkDown();
    void SendToSelf_HeadTrunkDownRelease();
    void SendToSelf_SnapByHand();

public slots:
    void setComm(QString ComName,long baudRate);    //打开串口
private:
    QSerialPort *SerialPort;
private:
    QByteArray WriteData(QString order);    //组装命令
private:
    ///控制指令
    QString m_head_trunk_up = "01 05 08 15 FF 00 9F 9E";
    QString m_head_trunk_up2 = "01 05 08 15 00 00 DE 6E";
    QString m_head_trunk_down = "01 05 08 16 FF 00 6F 9E";
    QString m_head_trunk_down2 = "01 05 08 16 00 00 2E 6E";
    //相机抓拍参数
    QString m_snap = "01 05 08 19 FF 00 5F 9D";
    QString m_snap_r = "01 05 08 19 00 00 1E 6D";
};

#endif // EQPTCONTROL_H
