Files
checker_host/prot/prot_m4.h
2023-11-29 15:36:45 +08:00

50 lines
893 B
C++

#ifndef PROT_M4_H
#define PROT_M4_H
#include "QObject"
#include "base/base.h"
#include "QList"
#include "interface/codec.h"
#include "interface/interface.h"
#include "base/mycfg.h"
#include "QThread"
using namespace std;
using namespace std::placeholders;
typedef std::function<void(myarray data)> prot_m4_cb;
typedef struct
{
QList<prot_m4_cb> funs;
myarray cmd;
} HandleM4_def;
class prot_m4 : public QObject
{
public:
prot_m4() { if_ = nullptr;wait=0; }
~prot_m4() {}
void init();
bool set_irq_fun(prot_m4_cb fun, myarray data);
bool del_irq_fun(prot_m4_cb fun, myarray data);
public slots:
void send_data_slot(myarray data);
protected:
bool exe_cb_fun(myarray data);
protected:
InterFace *if_;
QList<HandleM4_def> funs;
Codec *codec_;
QThread thread;
myarray recv_data;
int wait;
QList<myarray> send_list;
};
prot_m4 *protM4();
#endif // PROT_M4_H