vehicle_patrol.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef VEHICLE_PATROL_H
  2. #define VEHICLE_PATROL_H
  3. #include <QObject>
  4. #include <QTimer>
  5. #include <QDateTime>
  6. #include <QVector>
  7. #include <QThread>
  8. #include <iostream>
  9. #include <memory>
  10. #include <string>
  11. #include <grpcpp/grpcpp.h>
  12. #include "VehiclePatrol_service.grpc.pb.h"
  13. #include "VehiclePatrol.grpc.pb.h"
  14. #include "modulecommext.h"
  15. using grpc::Channel;
  16. using grpc::ClientContext;
  17. using grpc::Status;
  18. using org::jeecg::defsPatrol::grpc::VehiclePatrolException; ///< service name
  19. using org::jeecg::defsPatrol::grpc::PatrolRequest;
  20. class VehiclePatrolExceptionClient : public QThread{
  21. Q_OBJECT
  22. public:
  23. VehiclePatrolExceptionClient(std::shared_ptr<Channel> channel);
  24. ~VehiclePatrolExceptionClient(void);
  25. std::string uploadVehiclePatrolInfo(void);
  26. void updatePatrolData(void);
  27. protected:
  28. void run();
  29. private:
  30. std::unique_ptr<VehiclePatrolException::Stub> stub_;
  31. std::string id;
  32. bool isTVR; //Traffic Violation Recognition
  33. int32_t violationStatus; //0 no violation 1 overspeed 2 illegal parking 3 direction wrong 4 run the red light
  34. std::string vehicleLicenseNumber;
  35. QByteArray violationImage;
  36. uint64_t violationTime; //time when get violationImage
  37. org::jeecg::defsPatrol::grpc::GPSPoint violationPosition; //positon when get violationImage
  38. bool isFSM; //Fire and Smoke Monitor
  39. int32_t fireStatus; //0 no fire 1 has fire
  40. QByteArray fireImage;
  41. uint64_t fireTime; //time when get fireImage
  42. org::jeecg::defsPatrol::grpc::GPSPoint firePosition; //positon when get fireImage
  43. bool isTSGM; //Turn Stile Gate Monitor
  44. int32_t gateStatus; //0 no gate 1 gate close 2 gate open
  45. QByteArray gateImage;
  46. uint64_t gateTime; //time when get gateImage
  47. org::jeecg::defsPatrol::grpc::GPSPoint gatePosition; //positon when get gateImage
  48. std::string plateNumber;
  49. };
  50. #endif // VEHICLE_PATROL_H