#pragma once #include #include "common.h" #include "./modbus/PLCMonitor.h" #include "./src/CalibParam.pb.h" #include "laser/LivoxLaser.h" #include "laser/Sick511FileLaser.h" #include "src/measuretask.h" #include "qtmessagedef.h" class CProcess :public QObject { Q_OBJECT public: CProcess(Automatic::stCalibParam param,void* mainWnd=NULL); bool Init(); std::string LastError() { return m_last_error; } void PushTask(uint16_t param , int action_type,bool test=false); size_t TaskQueueSize() { return m_thread_queue->TaskCount(); } virtual ~CProcess(); protected: // after received command from plc static void action_callback(bool bOn, uint16_t param, void* pointer, int action_type); // send info to UI static void monitor_callback(QtMessageData data,void* pointer); static void create_mat_param(Automatic::stLaserCalibParam laser, double*); protected: signals: void MainWndSignal(QVariant data); protected: static void result_callback(void* data,void* pointer); public: // pointer of laser handles CLaser** m_laser; modbus::CPLCMonitor m_monitor; protected: tq::IQueue* m_thread_queue; // 激光标定参数 Automatic::stCalibParam m_laser_calib_param; std::string m_last_error; public: ////获取最近结果 mutable std::mutex m_mutex; void* m_main_wnd; int m_plate_index; }; std::string Error_string(ERROR_CODE code);