重新构建的批检仪主板程序
This commit is contained in:
60
prot/prot_slave.h
Normal file
60
prot/prot_slave.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#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
|
Reference in New Issue
Block a user