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 
171  void GetEnu(core::Vector3Df *point);
172 
173 protected:
184  void parseFrame(const char *frame, int frame_size);
185 
186  NMEAFlags_t NMEAFlags;
187 
193  void GetDatas(core::GpsData **gpsData) const;
194 
200  gui::GroupBox *GetGroupBox(void) const;
201 
202 private:
203  gui::Tab *mainTab, *sensorTab;
204  gui::TabWidget *tab;
205  gui::GroupBox *setupGroupbox;
206  gui::PushButton *buttonRef;
207  gui::DataPlot1D *ePlot;
208  gui::DataPlot1D *nPlot;
209  gui::DataPlot1D *uPlot;
210  gui::DataPlot1D *vePlot;
211  gui::DataPlot1D *vnPlot;
212  gui::Tab *plotTab;
213  gui::Map *map;
214  gui::Label *nbSatLabel, *fixLabel;
215  core::GeoCoordinate *position;
216  bool takeRef;
217  nmeaINFO info;
218  nmeaPARSER parser;
219  nmeaGPGGA pack;
220  nmeaPOS pos;
221  double latRef, longRef, altRef;
222  core::GpsData* gpsData;
223 };
224 } // end namespace sensor
225 } // end namespace flair
226 #endif // NMEAGPS_H
Abstract class for input/ouput system.
Definition: IODevice.h:45
namespace of the flair Framework
Definition: Ahrs.h:19
void GetEnu(core::Vector3Df *point)
Get ENU position.
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