[59] | 1 | #pragma once
|
---|
| 2 | #ifndef __GPS_FRAMES_H__
|
---|
| 3 | #define __GPS_FRAMES_H__
|
---|
| 4 |
|
---|
| 5 | #include "Pacpus/kernel/cstdint.h"
|
---|
| 6 | #include "structure_gps.h"
|
---|
| 7 | #include "Pacpus/kernel/GenericObservable.h"
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | // Export macro for PluginTest DLL for Windows only
|
---|
| 11 | #ifdef WIN32
|
---|
| 12 | # ifdef GPS_EXPORTS
|
---|
| 13 | // make DLL
|
---|
| 14 | # define GPS_FRAMES_API __declspec(dllexport)
|
---|
| 15 | # else
|
---|
| 16 | // use DLL
|
---|
| 17 | # define GPS_FRAMES_API __declspec(dllimport)
|
---|
| 18 | # endif
|
---|
| 19 | #else
|
---|
| 20 | // On other platforms, simply ignore this
|
---|
| 21 | # define GPS_FRAMES_API /* nothing */
|
---|
| 22 | #endif
|
---|
| 23 |
|
---|
| 24 | namespace pacpus {
|
---|
| 25 |
|
---|
| 26 | template <typename T>
|
---|
| 27 | class GpsFrame {
|
---|
| 28 | public:
|
---|
| 29 | T* getFrameData() { return &frame_; }
|
---|
| 30 | const T* getFrameData() const { return &frame_; }
|
---|
| 31 | road_time_t getRoadTime() const { return rdt_; }
|
---|
| 32 | void setRoadTime(road_time_t rdt) { rdt_ = rdt; }
|
---|
| 33 | private:
|
---|
| 34 | T frame_;
|
---|
| 35 | road_time_t rdt_;
|
---|
| 36 | };
|
---|
| 37 |
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 | class GPS_FRAMES_API GpsGgaFrame
|
---|
| 41 | : public GpsFrame<trame_gga_dbl>, public GenericObservable<GpsGgaFrame>
|
---|
| 42 | {
|
---|
| 43 | public:
|
---|
| 44 | typedef trame_gga_dbl frameType;
|
---|
| 45 | typedef GenericObservable<GpsGgaFrame>::ObserverType ObserverType;
|
---|
| 46 | };
|
---|
| 47 |
|
---|
| 48 | class GPS_FRAMES_API GpsGsaFrame
|
---|
| 49 | : public GpsFrame<trame_gsa>, public GenericObservable<GpsGsaFrame>
|
---|
| 50 | {
|
---|
| 51 | public:
|
---|
| 52 | typedef trame_gsa frameType;
|
---|
| 53 | typedef GenericObservable<GpsGsaFrame>::ObserverType ObserverType;
|
---|
| 54 | };
|
---|
| 55 |
|
---|
| 56 | class GPS_FRAMES_API GpsGstFrame
|
---|
| 57 | : public GpsFrame<trame_gst>, public GenericObservable<GpsGstFrame>
|
---|
| 58 | {
|
---|
| 59 | public:
|
---|
| 60 | typedef trame_gst frameType;
|
---|
| 61 | typedef GenericObservable<GpsGstFrame>::ObserverType ObserverType;
|
---|
| 62 | };
|
---|
| 63 |
|
---|
| 64 | class GPS_FRAMES_API GpsGsvFrame
|
---|
| 65 | : public GpsFrame<trame_gsv>, public GenericObservable<GpsGsvFrame>
|
---|
| 66 | {
|
---|
| 67 | public:
|
---|
| 68 | typedef trame_gsv frameType;
|
---|
| 69 | typedef GenericObservable<GpsGsvFrame>::ObserverType ObserverType;
|
---|
| 70 | };
|
---|
| 71 |
|
---|
| 72 | class GPS_FRAMES_API GpsHdtFrame
|
---|
| 73 | : public GpsFrame<trame_hdt>, public GenericObservable<GpsHdtFrame>
|
---|
| 74 | {
|
---|
| 75 | public:
|
---|
| 76 | typedef trame_hdt frameType;
|
---|
| 77 | typedef GenericObservable<GpsHdtFrame>::ObserverType ObserverType;
|
---|
| 78 | };
|
---|
| 79 |
|
---|
| 80 | class GPS_FRAMES_API GpsRmcFrame
|
---|
| 81 | : public GpsFrame<trame_rmc>, public GenericObservable<GpsRmcFrame>
|
---|
| 82 | {
|
---|
| 83 | public:
|
---|
| 84 | typedef trame_rmc frameType;
|
---|
| 85 | typedef GenericObservable<GpsRmcFrame>::ObserverType ObserverType;
|
---|
| 86 | };
|
---|
| 87 |
|
---|
| 88 | class GPS_FRAMES_API GpsRotFrame
|
---|
| 89 | : public GpsFrame<trame_rot>, public GenericObservable<GpsRotFrame>
|
---|
| 90 | {
|
---|
| 91 | public:
|
---|
| 92 | typedef trame_rot frameType;
|
---|
| 93 | typedef GenericObservable<GpsRotFrame>::ObserverType ObserverType;
|
---|
| 94 | };
|
---|
| 95 |
|
---|
| 96 | class GPS_FRAMES_API GpsVtgFrame
|
---|
| 97 | : public GpsFrame<trame_vtg>, public GenericObservable<GpsVtgFrame>
|
---|
| 98 | {
|
---|
| 99 | public:
|
---|
| 100 | typedef trame_vtg frameType;
|
---|
| 101 | typedef GenericObservable<GpsVtgFrame>::ObserverType ObserverType;
|
---|
| 102 | };
|
---|
| 103 |
|
---|
| 104 | class GPS_FRAMES_API GpsZdaFrame
|
---|
| 105 | : public GpsFrame<trame_zda>, public GenericObservable<GpsZdaFrame>
|
---|
| 106 | {
|
---|
| 107 | public:
|
---|
| 108 | typedef trame_zda frameType;
|
---|
| 109 | typedef GenericObservable<GpsZdaFrame>::ObserverType ObserverType;
|
---|
| 110 | };
|
---|
| 111 |
|
---|
| 112 | class GPS_FRAMES_API GpsSynchro
|
---|
| 113 | : public GpsFrame<GpsSynchroFrame>, public GenericObservable<GpsSynchro>
|
---|
| 114 | {
|
---|
| 115 | public:
|
---|
| 116 | typedef GpsSynchroFrame frameType;
|
---|
| 117 | typedef GenericObservable<GpsSynchro>::ObserverType ObserverType;
|
---|
| 118 | };
|
---|
| 119 |
|
---|
| 120 | class GPS_FRAMES_API GpsPps
|
---|
| 121 | : public GpsFrame<uint32_t>, public GenericObservable<GpsPps>
|
---|
| 122 | {
|
---|
| 123 | public:
|
---|
| 124 | typedef uint32_t frameType;
|
---|
| 125 | typedef GenericObservable<GpsPps>::ObserverType ObserverType;
|
---|
| 126 | };
|
---|
| 127 |
|
---|
| 128 | class GpsFrames {
|
---|
| 129 | public:
|
---|
| 130 | GpsGgaFrame ggaFrame;
|
---|
| 131 | GpsGsaFrame gsaFrame;
|
---|
| 132 | GpsGstFrame gstFrame;
|
---|
| 133 | GpsGsvFrame gsvFrame;
|
---|
| 134 | GpsHdtFrame hdtFrame;
|
---|
| 135 | GpsRmcFrame rmcFrame;
|
---|
| 136 | GpsRotFrame rotFrame;
|
---|
| 137 | GpsVtgFrame vtgFrame;
|
---|
| 138 | GpsZdaFrame zdaFrame;
|
---|
| 139 | GpsSynchro synchroFrame;
|
---|
| 140 | GpsPps ppsFrame;
|
---|
| 141 | };
|
---|
| 142 |
|
---|
| 143 | } // pacpus
|
---|
| 144 |
|
---|
| 145 | #endif
|
---|