Flair
Framework Libre Air
NmeaGps.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef NMEAGPS_H
14 #define NMEAGPS_H
15 
16 #include <IODevice.h>
17 #include <Vector3D.h>
18 #include <nmea/nmea.h>
19 
20 namespace flair {
21  namespace core {
22  class FrameworkManager;
23  class GeoCoordinate;
24  class GpsData;
25  }
26  namespace gui {
27  class Layout;
28  class DataPlot1D;
29  class Tab;
30  class TabWidget;
31  class PushButton;
32  class Map;
33  class Label;
34  class GroupBox;
35  }
36 }
37 
38 namespace flair {
39 namespace sensor {
40 
45 class NmeaGps : public core::IODevice {
46 public:
51  enum NMEAFlags_t {
52  GGA = 0x01,
53  VTG = 0x02,
54  GST = 0x04,
55  GSA = 0x08,
56  };
57 
67  NmeaGps(std::string name,
68  NMEAFlags_t NMEAFlags);
69 
79  NmeaGps(const core::IODevice *parent, std::string name);
80 
85  ~NmeaGps();
86 
92  const core::GpsData *GetDatas(void) const;
93 
98  void UseDefaultPlot(void);
99 
105  gui::DataPlot1D *EPlot(void) const;
106 
112  gui::DataPlot1D *NPlot(void) const;
113 
119  gui::DataPlot1D *UPlot(void) const;
120 
126  gui::DataPlot1D *VEPlot(void) const;
127 
133  gui::DataPlot1D *VNPlot(void) const;
134 
140  gui::TabWidget *GetTab(void) const;
141 
147  gui::Layout *GetLayout(void) const;
148 
154  gui::Tab *GetPlotTab(void) const;
155 
164  void SetRef(void);
165 
166 protected:
177  void parseFrame(const char *frame, int frame_size);
178 
179  NMEAFlags_t NMEAFlags;
180 
186  void GetDatas(core::GpsData **gpsData) const;
187 
193  gui::GroupBox *GetGroupBox(void) const;
194 
195 private:
196  gui::Tab *mainTab, *sensorTab;
197  gui::TabWidget *tab;
198  gui::GroupBox *setupGroupbox;
199  gui::PushButton *buttonRef;
200  gui::DataPlot1D *ePlot;
201  gui::DataPlot1D *nPlot;
202  gui::DataPlot1D *uPlot;
203  gui::DataPlot1D *vePlot;
204  gui::DataPlot1D *vnPlot;
205  gui::Tab *plotTab;
206  gui::Map *map;
207  gui::Label *nbSatLabel, *fixLabel;
208  core::GeoCoordinate *position;
209  bool takeRef;
210  nmeaINFO info;
211  nmeaPARSER parser;
212  nmeaGPGGA pack;
213  nmeaPOS pos;
214  double latRef, longRef, altRef;
215  core::GpsData* gpsData;
216 };
217 } // end namespace sensor
218 } // end namespace flair
219 #endif // NMEAGPS_H
Abstract class for input/ouput system.
Definition: IODevice.h:45
namespace of the flair Framework
Definition: Ahrs.h:19
gui::GroupBox * GetGroupBox(void) const
Setup GroupBox.
Class defining gps datas.
Definition: GpsData.h:30
Class displaying a QGroupBox on the ground station.
Definition: GroupBox.h:27
gui::DataPlot1D * NPlot(void) const
North plot.
NmeaGps(std::string name, NMEAFlags_t NMEAFlags)
Constructor.
Definition: NmeaGps.h:52
const core::GpsData * GetDatas(void) const
Get GPS datas.
void parseFrame(const char *frame, int frame_size)
Parse a NMEA frame.
Definition: NmeaGps.h:55
gui::Layout * GetLayout(void) const
Setup Layout.
Class defining a 3D vector.
void SetRef(void)
Set reference for ENU coordinates.
Abstract class for input/ouput system.
Base class for GPS using NMEA sentances.
Definition: NmeaGps.h:45
Class displaying a QPushButton on the ground station.
Definition: PushButton.h:28
gui::DataPlot1D * VEPlot(void) const
East velocity plot.
NMEAFlags_t
NMEA flags.
Definition: NmeaGps.h:51
Definition: NmeaGps.h:53
Class displaying a QLabel on the ground station.
Definition: Label.h:28
gui::DataPlot1D * VNPlot(void) const
North velocity plot.
Abstract class to display a layout on the ground station.
Definition: Layout.h:33
Class displaying a QTabWidget on the ground station.
Definition: TabWidget.h:29
~NmeaGps()
Destructor.
Class displaying a GPS map on the ground station.
Definition: Map.h:33
Class defining a point by its lla coordinates.
Definition: GeoCoordinate.h:24
void UseDefaultPlot(void)
Use default plot.
Definition: NmeaGps.h:54
gui::DataPlot1D * UPlot(void) const
Up plot.
gui::DataPlot1D * EPlot(void) const
East plot.
gui::Tab * GetPlotTab(void) const
Plot tab.
Class displaying a 1D plot on the ground station.
Definition: DataPlot1D.h:33
gui::TabWidget * GetTab(void) const
Main tab.
Class displaying a QTab on the ground station.
Definition: Tab.h:29