123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- //
- // Created by zx on 2019/12/27.
- //
- #ifndef TERMINOR_H
- #define TERMINOR_H
- #include "Laser.h"
- #include "ModbusPlc.h"
- #include "Terminor_parameter.pb.h"
- /*
- * 终端指令执行状态,枚举
- * 列举终端指令从进入流程到测量完成过程中的进度状态
- */
- enum TerminorStatu
- {
- TERMINOR_READY=0, //终端空闲
- TERMINOR_WAIT_LASER, //终端收到指令,等待雷达资源
- TERMINOR_SCANNING, //终端指令一启动扫描,扫描中
- TERMINOR_WAIT_MEASURE, //终端指令扫描完成,指令进入等待测量中
- TERMINOR_MEASURING, //终端指令进入测量中
- TERMINOR_UNKNOW //未知状态
- };
- /*
- * 终端指令执行类,执行指令,监控指令执行进度
- * 输入雷达数组,plc对象,测量算法对象,执行扫描测量任务
- */
- class TerminorCommandExecutor
- {
- public:
- /*
- * 构造函数
- * parameter:该终端指令配置参数(待定)
- */
- TerminorCommandExecutor(LidarMeasure::Terminor_parameter parameter);
- /*
- * 获取终端进度状态
- */
- int get_statu(TerminorStatu& statu);
- /*
- * 执行扫描,测量任务,阻塞知道任务完成或超时(单位秒)
- *lasers:需要启动的雷达
- * plc:上传结果工具
- * locater:测量算法对象
- */
- int execute_command(std::vector<Laser*> lasers,ModbusPlc* plc,
- Locater* locater,int timeout=15);
- /*
- * 强制正在执行的中断指令
- */
- int force_stop_command();
- protected:
- };
- #endif //TERMINOR_H
|