1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #pragma once
- #include "../common/comm.h"
- #include "../common/notifier.h"
- #include "MqttClient.h"
- #define MAXLEAPS 64 /* max number of leap seconds table */
- static double leaps[MAXLEAPS+1][7]={ /* leap seconds (y,m,d,h,m,s,utc-gpst) */
- {2017,1,1,0,0,0,-18},
- {2015,7,1,0,0,0,-17},
- {2012,7,1,0,0,0,-16},
- {2009,1,1,0,0,0,-15},
- {2006,1,1,0,0,0,-14},
- {1999,1,1,0,0,0,-13},
- {1997,7,1,0,0,0,-12},
- {1996,1,1,0,0,0,-11},
- {1994,7,1,0,0,0,-10},
- {1993,7,1,0,0,0, -9},
- {1992,7,1,0,0,0, -8},
- {1991,1,1,0,0,0, -7},
- {1990,1,1,0,0,0, -6},
- {1988,1,1,0,0,0, -5},
- {1985,7,1,0,0,0, -4},
- {1983,7,1,0,0,0, -3},
- {1982,7,1,0,0,0, -2},
- {1981,7,1,0,0,0, -1},
- {0}
- };
- typedef struct { /* time struct */
- time_t time; /* time (s) expressed by standard time_t */
- double sec; /* fraction of second under 1 s */
- } gtime_t;
- class CMessageQueue;
- class CRtkSensor//:public ISensorNotify
- {
- public:
- CRtkSensor(CMessageQueue* q);
- void Notify(int8_t* buffer, int32_t size);
- void SetSensorSocket(SensorSocket<CRtkSensor>* udp);
- void Start();
- void Stop();
- void Send_ZGJ_status(int Status);//ץ�ֻ�״̬��Ϣ�ϱ�
- // void Send_ZGJ_status(float gpsweek,float gpsTime,int Status);//ץ�ֻ�״̬��Ϣ�ϱ�
- gtime_t timeadd(gtime_t t, double sec);
- double timediff(gtime_t t1, gtime_t t2);
- gtime_t epoch2time(const double *ep);
- gtime_t gpst2utc(gtime_t t);
- private:
- void Run();
- // void Send_ZGJ_Rtk(float headingAngle, float lat, float lon);//ץ�ֻ�λ����Ϣ�ϱ�
- // void Send_ZGJ_Rtk(float headingAngle, float lat, float lon,float loc_status);//ץ�ֻ�λ����Ϣ�ϱ�
- void Send_ZGJ_Rtk(float gpsweek,float gpsTime,float headingAngle,float lat,float lon,float loc_status);
- private:
- CMessageQueue* _message;
- SensorSocket<CRtkSensor>* _socket;
- long long _curTick;
- bool F_SendDate;
- bool _run;
- int32_t _count=0;
- gtime_t rtk_time;
- float gpsweek,gpsTime;
- };
|