#ifndef VEHICLE_CONTROL_H #define VEHICLE_CONTROL_H #include #include #include #include #include #include #include #include #include #include "VehicleControl_service.grpc.pb.h" #include "VehicleControl.grpc.pb.h" #include "modulecommext.h" #include "remotectrl.pb.h" using grpc::Channel; using grpc::ClientContext; using grpc::Status; using org::jeecg::defsControl::grpc::VehicleControl; ///< service name using org::jeecg::defsControl::grpc::ControlReply; ///< rpc fuction parameter and return using org::jeecg::defsControl::grpc::UploadMapReply; using org::jeecg::defsControl::grpc::CtrlModeReply; class VehicleControlClient : public QThread{ Q_OBJECT public: VehicleControlClient(std::shared_ptr channel); ~VehicleControlClient(void); std::string vehicleControl(void); void updateControlData(void); void VehicleControlClientSend(); iv::modulecommext::modulecommmsg * mpa; protected: void run(); private: std::unique_ptr stub_; org::jeecg::defsControl::grpc::ShiftStatus shiftCMD = org::jeecg::defsControl::grpc::ShiftStatus::SHIFT_PARKING; double steeringWheelAngleCMD = 0; double throttleCMD = 0; double brakeCMD = 0; org::jeecg::defsControl::grpc::CtrlMode modeCMD = org::jeecg::defsControl::grpc::CtrlMode::CMD_EMERGENCY_STOP; ///< update by slot function public slots: void ctrlMode_Changed_Slot(org::jeecg::defsControl::grpc::CtrlMode ctrlMode); }; class VehicleChangeCtrlModeClient : public QThread{ Q_OBJECT public: VehicleChangeCtrlModeClient(std::shared_ptr channel); ~VehicleChangeCtrlModeClient(void); std::string changeCtrlMode(void); void updateCtrolMode(void); protected: void run(); private: std::unique_ptr stub_; org::jeecg::defsControl::grpc::CtrlMode modeCMD = org::jeecg::defsControl::grpc::CtrlMode::CMD_EMERGENCY_STOP; signals: void ctrlMode_Changed(org::jeecg::defsControl::grpc::CtrlMode ctrlMode); }; class VehicleUploadMapClient : public QThread{ Q_OBJECT public: VehicleUploadMapClient(std::shared_ptr channel); ~VehicleUploadMapClient(void); std::string uploadMap(void); void updateMapPOIData(void); protected: void run(); private: std::unique_ptr stub_; bool isNeedMap = false; std::string patrolPathID; QVector POIPoints; signals: void patrolPOI_Recieved(std::string pathID); public slots: void uploadPath_Finished_Slot(std::string pathID); }; #endif // VEHICLE_CONTROL_H