Files
checker_host/prot/prot_slave.h

61 lines
958 B
C
Raw Normal View History

2023-11-26 23:05:35 +08:00
#ifndef PROT_SLAVE_H
#define PROT_SLAVE_H
#include "QObject"
#include "base/base.h"
#include "QList"
#include "interface/codec.h"
#include "interface/interface.h"
#include "base/mycfg.h"
#include "QThread"
class HandleSlave:public QObject{
Q_OBJECT
public:
HandleSlave(){busy=0;}
virtual ~HandleSlave(){}
virtual int start(myarray data)=0;
virtual int dolater(int cmd,myarray data)=0;
int busy;
signals:
void send_data_signal(int addr,int cmd,myarray data);
};
class prot_slave:public QObject
{
Q_OBJECT
public:
prot_slave(){if_=nullptr;codec_=nullptr;busy=0;addr=0;}
~prot_slave(){}
void init();
bool set_slave_handle(int addr,HandleSlave *handle);
int busy;
int addr;
protected slots:
void send_data_slot(int addr,int cmd,myarray data);
protected:
InterFace *if_;
Codec *codec_;
QList<HandleSlave *> slaves;
};
prot_slave *protSlave();
#endif // PROT_SLAVE_H