重新构建的批检仪主板程序

This commit is contained in:
andy
2023-11-26 23:05:35 +08:00
parent b1b69d307f
commit 4a70f64693
29 changed files with 2565 additions and 64 deletions

75
prot/prot_pc.h Normal file
View File

@@ -0,0 +1,75 @@
#ifndef prot_pc_h__
#define prot_pc_h__
#include "QObject"
#include "base/base.h"
#include "QList"
#include "interface/codec.h"
#include "interface/interface.h"
#include "base/mycfg.h"
#include "QThread"
// 定义处理命令的类
class HandlePc:public QObject{
Q_OBJECT
public:
HandlePc(){busy=0;}
virtual ~HandlePc(){}
virtual int dolater(int cmd,myarray data)=0;
int busy;
signals:
void send_data_signal(int cmd,myarray data);
};
class ProtPc:public QObject{
Q_OBJECT
public:
ProtPc(){if_=nullptr;codec_=nullptr;handle_=nullptr;}
~ProtPc(){}
void init();
protected slots:
void send_data_slot(int cmd,myarray data);
protected:
InterFace *if_;
Codec *codec_;
HandlePc *handle_;
QThread thread;
myarray recv_data;
};
ProtPc *protPc();
typedef struct{
int cmd;
HandlePc *(*handle_get_fun)();
}handlepc_def;
#define protpc_export(cmd_,fun_) \
__attribute__((used)) static handlepc_def _handlepc_##name_ __attribute__((section("protpc")))={\
.cmd=cmd_,\
.handle_get_fun=fun_,\
}
#endif