12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #ifndef VEHICLE_UPLOAD_H
- #define VEHICLE_UPLOAD_H
- #include <QObject>
- #include <QTimer>
- #include <QDateTime>
- #include <QVector>
- #include <QThread>
- #include <iostream>
- #include <memory>
- #include <string>
- #include <grpcpp/grpcpp.h>
- #include "VehicleUpload_service.grpc.pb.h"
- #include "VehicleUpload.grpc.pb.h"
- using grpc::Channel;
- using grpc::ClientContext;
- using grpc::Status;
- using org::jeecg::defsDetails::grpc::DataExchange; ///< service name
- using org::jeecg::defsDetails::grpc::UplinkRequest; ///< rpc fuction parameter and return
- using org::jeecg::defsDetails::grpc::ResponseMessage;
- using org::jeecg::defsDetails::grpc::UploadPathRequest;
- using org::jeecg::defsDetails::grpc::VehicleStatus; ///< other enum
- class DataExchangeClient : public QThread{
- Q_OBJECT
- public:
- DataExchangeClient(std::shared_ptr<Channel> channel);
- ~DataExchangeClient(void);
- std::string uploadVehicleInfo(void);
- std::string uploadPath(void);
- void updateData(void);
- void updatePath(std::string pathID,QVector<org::jeecg::defsDetails::grpc::MapPoint> points);
- protected:
- void run();
- private:
- std::unique_ptr<DataExchange::Stub> stub_;
- std::string id;
- uint64_t timeStamp;
- double SOC; //0.0-100.0%
- VehicleStatus statusFeedback = VehicleStatus::STATUS_EMERGENCY_STOP;
- double mileage; // kilometer
- double speed; // m/s
- org::jeecg::defsDetails::grpc::ShiftStatus shiftFeedback;
- double steeringWheelAngleFeedback; //+/-540 degree
- double throttleFeedback;
- double brakeFeedback;
- int32_t GPSRTKStatus; //GPS-RTK status 0-6 6 is best
- org::jeecg::defsDetails::grpc::GPSPoint positionFeedback;
- double pitch;
- double roll;
- double heading;
- QByteArray cameraImageFront;
- QByteArray cameraImageRear;
- QByteArray cameraImageLeft;
- QByteArray cameraImageRight;
- bool sensorStatusGPSIMU; //0 GPS-IMU ok 1 GPS-IMU error
- bool sensorStatusLidar;
- bool sensorStatusRadar;
- bool sensorStatusCamFront;
- bool sensorStatusCamRear;
- bool sensorStatusCamLeft;
- bool sensorStatusCamRight;
- int32_t isArrived; //0 no destination 1 not arrived 2 arrived
- std::string plateNumber;
- org::jeecg::defsDetails::grpc::CtrlMode modeFeedback = org::jeecg::defsDetails::grpc::CtrlMode::CMD_EMERGENCY_STOP; //mode Feedback
- org::jeecg::defsDetails::grpc::GPSPoint destinationPosition;
- std::string patrolPathID;
- QVector<org::jeecg::defsDetails::grpc::MapPoint> pathPoints;
- signals:
- void uploadPath_Finished(std::string pathID);
- public slots:
- void patrolPOI_Recieved_Slot(std::string pathID);
- };
- #endif // VEHICLE_UPLOAD_H
|