12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #ifndef IVSCHEDULER_H
- #define IVSCHEDULER_H
- #include <QThread>
- #include <QMutex>
- #include <QDateTime>
- #include "scheduler.pb.h"
- #include "gpsimu.pb.h"
- #include "gnss_coordinate_convert.h"
- #include "modulecomm.h"
- class ivscheduler : public QThread
- {
- Q_OBJECT
- public:
- ivscheduler(std::string strmemname = "hcp2_gpsimu",std::string strschedulername = "scheduler");
- public:
- void setscheduler(iv::scheduler * pscheduler);
- void run();
- void GetProcess(int & nProc, int & nProcTotal);
- void GetCycle(int & ncycle, int & ncyclecount);
- signals:
- void updategps(double flon,double flat,double fheading);
- void updatestate(int ncycle,int ncyclecount,int nprocess,int nprocesscount);
- void updatestep(int nstep);
- private:
- iv::scheduler * mpscheduler = 0;
- int mnprocess = 0;
- int mncycle = 0;
- int mncyclecount = 1;
- int mnstep = 0;
- double mfLatInit;
- double mfLonInit;
- double mfHeadingInit;
- double mfLatObj;
- double mfLonObj;
- double mfHeadingObj;
- qint64 mnTimeInit;
- qint64 mnLastSendObj;
- qint64 mnArrivingTime;
- QMutex mMutex;
- std::string mstrmemname;
- std::string mstrschedulername;
- void * mpadst;
- private:
- bool IsVehicleMoving(iv::gps::gpsimu * pgpsimu);
- bool IsVehcileArrivingStation(iv::gps::gpsimu * pgpsimu);
- void SendObj(double flon,double flat);
- };
- #endif // IVSCHEDULER_H
|