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 <nmea/nmea.h>
18 
19 namespace flair {
20  namespace core {
21  class FrameworkManager;
22  class GeoCoordinate;
23  class Vector3D;
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  };
56 
66  NmeaGps(const core::FrameworkManager *parent, std::string name,
67  NMEAFlags_t NMEAFlags);
68 
78  NmeaGps(const core::IODevice *parent, std::string name);
79 
84  ~NmeaGps();
85 
91  const core::GpsData *GetDatas(void) const;
92 
97  void UseDefaultPlot(void);
98 
104  gui::DataPlot1D *EPlot(void) const;
105 
111  gui::DataPlot1D *NPlot(void) const;
112 
118  gui::DataPlot1D *UPlot(void) const;
119 
125  gui::DataPlot1D *VEPlot(void) const;
126 
132  gui::DataPlot1D *VNPlot(void) const;
133 
139  gui::TabWidget *GetTab(void) const;
140 
146  gui::Layout *GetLayout(void) const;
147 
153  gui::Tab *GetPlotTab(void) const;
154 
163  void SetRef(void);
164 
170  void GetEnu(core::Vector3D *point);
171 
172 protected:
183  void parseFrame(const char *frame, int frame_size);
184 
185  NMEAFlags_t NMEAFlags;
186 
192  void GetDatas(core::GpsData **gpsData) const;
193 
199  gui::GroupBox *GetGroupBox(void) const;
200 
201 private:
202  gui::Tab *mainTab, *sensorTab;
203  gui::TabWidget *tab;
204  gui::GroupBox *setupGroupbox;
205  gui::PushButton *buttonRef;
206  gui::DataPlot1D *ePlot;
207  gui::DataPlot1D *nPlot;
208  gui::DataPlot1D *uPlot;
209  gui::DataPlot1D *vePlot;
210  gui::DataPlot1D *vnPlot;
211  gui::Tab *plotTab;
212  gui::Map *map;
213  gui::Label *nbSatLabel, *fixLabel;
214  core::GeoCoordinate *position;
215  bool takeRef;
216  nmeaINFO info;
217  nmeaPARSER parser;
218  nmeaGPGGA pack;
219  nmeaPOS pos;
220  double latRef, longRef, altRef;
221  core::GpsData* gpsData;
222 };
223 } // end namespace sensor
224 } // end namespace framewor
225 #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:31
Class defining a 3D vector.
Definition: Vector3D.h:28
Class displaying a QGroupBox on the ground station.
Definition: GroupBox.h:27
gui::DataPlot1D * NPlot(void) const
North plot.
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.
gui::Layout * GetLayout(void) const
Setup Layout.
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
NmeaGps(const core::FrameworkManager *parent, std::string name, NMEAFlags_t NMEAFlags)
Constructor.
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
Main class of the Framework library.
Definition: FrameworkManager.h:45
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 GetEnu(core::Vector3D *point)
Get ENU position.
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