ivscheduler.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef IVSCHEDULER_H
  2. #define IVSCHEDULER_H
  3. #include <QThread>
  4. #include <QMutex>
  5. #include <QDateTime>
  6. #include "scheduler.pb.h"
  7. #include "gpsimu.pb.h"
  8. #include "gnss_coordinate_convert.h"
  9. #include "modulecomm.h"
  10. class ivscheduler : public QThread
  11. {
  12. Q_OBJECT
  13. public:
  14. ivscheduler(std::string strmemname = "hcp2_gpsimu",std::string strschedulername = "scheduler");
  15. public:
  16. void setscheduler(iv::scheduler * pscheduler);
  17. void run();
  18. void GetProcess(int & nProc, int & nProcTotal);
  19. void GetCycle(int & ncycle, int & ncyclecount);
  20. signals:
  21. void updategps(double flon,double flat,double fheading);
  22. void updatestate(int ncycle,int ncyclecount,int nprocess,int nprocesscount);
  23. void updatestep(int nstep);
  24. private:
  25. iv::scheduler * mpscheduler = 0;
  26. int mnprocess = 0;
  27. int mncycle = 0;
  28. int mncyclecount = 1;
  29. int mnstep = 0;
  30. double mfLatInit;
  31. double mfLonInit;
  32. double mfHeadingInit;
  33. double mfLatObj;
  34. double mfLonObj;
  35. double mfHeadingObj;
  36. qint64 mnTimeInit;
  37. qint64 mnLastSendObj;
  38. qint64 mnArrivingTime;
  39. QMutex mMutex;
  40. std::string mstrmemname;
  41. std::string mstrschedulername;
  42. void * mpadst;
  43. private:
  44. bool IsVehicleMoving(iv::gps::gpsimu * pgpsimu);
  45. bool IsVehcileArrivingStation(iv::gps::gpsimu * pgpsimu);
  46. void SendObj(double flon,double flat);
  47. };
  48. #endif // IVSCHEDULER_H