78 lines
1.2 KiB
C
78 lines
1.2 KiB
C
![]() |
#ifndef cmd_checkerself_h__
|
||
|
#define cmd_checkerself_h__
|
||
|
|
||
|
|
||
|
#include <QObject>
|
||
|
#include "prot_cmd/cmd_pc.h"
|
||
|
#include "base/check_cfg.h"
|
||
|
#include "elec/elec_judge.h"
|
||
|
#include "prot_cmd/cmd_coder.h"
|
||
|
|
||
|
|
||
|
|
||
|
/*
|
||
|
|
||
|
检测参数自检
|
||
|
|
||
|
*/
|
||
|
|
||
|
|
||
|
|
||
|
// 电机 自研批检仪
|
||
|
class selfdev_checkself : public selfdev_runtask
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
selfdev_checkself():selfdev_runtask(){
|
||
|
pc_ret_cmd=0;
|
||
|
}
|
||
|
int dolater(int cmd, myarray data);
|
||
|
// pc指令转从机
|
||
|
myarray cmd_pc_to_slave(myarray data);
|
||
|
// pc指令生成从机列表
|
||
|
QList<int> cmd_pc_to_addrs(myarray data){
|
||
|
QList<int> addr_list;
|
||
|
addrs=0;
|
||
|
int len=syscfg()->slave_num;
|
||
|
for(int i=0;i<len;i++){
|
||
|
addr_list.append(i+1);
|
||
|
addrs|=1<<(i);
|
||
|
}
|
||
|
return addr_list;
|
||
|
}
|
||
|
// 从机发起命令
|
||
|
int cmd_slave(){
|
||
|
return 0x20;
|
||
|
}
|
||
|
// pc收到回复,返回0不回复
|
||
|
int cmd_pc_recv(){
|
||
|
return 0;
|
||
|
}
|
||
|
// 生成接收回复到pc
|
||
|
myarray cmd_pc_recv_to_pc(){
|
||
|
myarray r;
|
||
|
return r;
|
||
|
}
|
||
|
// pc回复命令,返回0不回复
|
||
|
int cmd_pc_ret(){
|
||
|
return pc_ret_cmd;
|
||
|
}
|
||
|
// 从机返回转pc
|
||
|
myarray ret_slave_to_pc(QList<myarray> data);
|
||
|
protected:
|
||
|
int addrs;
|
||
|
int pc_ret_cmd;
|
||
|
int subcmd;
|
||
|
signals:
|
||
|
void send_to_m4_signal(myarray data);
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#endif
|
||
|
|
||
|
|