ivdetection_radar.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef IVDETECTION_RADAR_H
  2. #define IVDETECTION_RADAR_H
  3. #include "ivdetection.h"
  4. #include "modulecomm.h"
  5. #include <QMutex>
  6. #include <QWaitCondition>
  7. #include "canmsg.pb.h"
  8. #include "canraw.pb.h"
  9. #include "radarobjectarray.pb.h"
  10. namespace iv {
  11. class ivdetection_radar : public ivdetection
  12. {
  13. public:
  14. ivdetection_radar();
  15. public:
  16. void setcanmsgname(const std::string str);
  17. void setradarmsgname(const std::string str);
  18. private:
  19. void UpdateCANMsg(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
  20. void ShareRadarMsg(void * pa,iv::radar::radarobjectarray * pradar);
  21. public:
  22. virtual int DecodeCANMsg(iv::radar::radarobjectarray & xradar,iv::can::canraw *prawmsg) = 0;
  23. public:
  24. virtual void modulerun();
  25. private:
  26. void * mpmsgcan;
  27. void * mpmsgradar;
  28. std::string mstrcanmsgname;
  29. std::string mstrradarmsgname;
  30. bool mbUpdateCANMsg = false;
  31. iv::can::canmsg mCANMsg;
  32. QMutex mMutex;
  33. QMutex mWaitMutex;
  34. QWaitCondition mwc;
  35. };
  36. }
  37. #endif // IVDETECTION_RADAR_H