source: pacpussensors/trunk/Gps/GpsFrames.h@ 87

Last change on this file since 87 was 59, checked in by DHERBOMEZ Gérald, 10 years ago

Integration of new modules:

  • GPS NMEA0183 decoder
  • Span CPT Decoder

Update of:

File size: 3.6 KB
Line 
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
24namespace pacpus {
25
26template <typename T>
27class GpsFrame {
28public:
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; }
33private:
34 T frame_;
35 road_time_t rdt_;
36};
37
38
39
40class GPS_FRAMES_API GpsGgaFrame
41 : public GpsFrame<trame_gga_dbl>, public GenericObservable<GpsGgaFrame>
42{
43public:
44 typedef trame_gga_dbl frameType;
45 typedef GenericObservable<GpsGgaFrame>::ObserverType ObserverType;
46};
47
48class GPS_FRAMES_API GpsGsaFrame
49 : public GpsFrame<trame_gsa>, public GenericObservable<GpsGsaFrame>
50{
51public:
52 typedef trame_gsa frameType;
53 typedef GenericObservable<GpsGsaFrame>::ObserverType ObserverType;
54};
55
56class GPS_FRAMES_API GpsGstFrame
57 : public GpsFrame<trame_gst>, public GenericObservable<GpsGstFrame>
58{
59public:
60 typedef trame_gst frameType;
61 typedef GenericObservable<GpsGstFrame>::ObserverType ObserverType;
62};
63
64class GPS_FRAMES_API GpsGsvFrame
65 : public GpsFrame<trame_gsv>, public GenericObservable<GpsGsvFrame>
66{
67public:
68 typedef trame_gsv frameType;
69 typedef GenericObservable<GpsGsvFrame>::ObserverType ObserverType;
70};
71
72class GPS_FRAMES_API GpsHdtFrame
73 : public GpsFrame<trame_hdt>, public GenericObservable<GpsHdtFrame>
74{
75public:
76 typedef trame_hdt frameType;
77 typedef GenericObservable<GpsHdtFrame>::ObserverType ObserverType;
78};
79
80class GPS_FRAMES_API GpsRmcFrame
81 : public GpsFrame<trame_rmc>, public GenericObservable<GpsRmcFrame>
82{
83public:
84 typedef trame_rmc frameType;
85 typedef GenericObservable<GpsRmcFrame>::ObserverType ObserverType;
86};
87
88class GPS_FRAMES_API GpsRotFrame
89 : public GpsFrame<trame_rot>, public GenericObservable<GpsRotFrame>
90{
91public:
92 typedef trame_rot frameType;
93 typedef GenericObservable<GpsRotFrame>::ObserverType ObserverType;
94};
95
96class GPS_FRAMES_API GpsVtgFrame
97 : public GpsFrame<trame_vtg>, public GenericObservable<GpsVtgFrame>
98{
99public:
100 typedef trame_vtg frameType;
101 typedef GenericObservable<GpsVtgFrame>::ObserverType ObserverType;
102};
103
104class GPS_FRAMES_API GpsZdaFrame
105 : public GpsFrame<trame_zda>, public GenericObservable<GpsZdaFrame>
106{
107public:
108 typedef trame_zda frameType;
109 typedef GenericObservable<GpsZdaFrame>::ObserverType ObserverType;
110};
111
112class GPS_FRAMES_API GpsSynchro
113 : public GpsFrame<GpsSynchroFrame>, public GenericObservable<GpsSynchro>
114{
115public:
116 typedef GpsSynchroFrame frameType;
117 typedef GenericObservable<GpsSynchro>::ObserverType ObserverType;
118};
119
120class GPS_FRAMES_API GpsPps
121 : public GpsFrame<uint32_t>, public GenericObservable<GpsPps>
122{
123public:
124 typedef uint32_t frameType;
125 typedef GenericObservable<GpsPps>::ObserverType ObserverType;
126};
127
128class GpsFrames {
129public:
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
Note: See TracBrowser for help on using the repository browser.