Flair
Framework Libre Air
Gps.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 GPS_H
14 #define GPS_H
15 
16 #include <IODevice.h>
17 #include <nmea/nmea.h>
18 
19 namespace flair {
20  namespace core {
21  class cvmatrix;
22  class FrameworkManager;
23  class GeoCoordinate;
24  class Vector3D;
25  class GpsData;
26  }
27  namespace gui {
28  class Layout;
29  class DataPlot1D;
30  class Tab;
31  class TabWidget;
32  class PushButton;
33  class Map;
34  class Label;
35  }
36 }
37 
38 namespace flair {
39 namespace sensor {
40 
45 class Gps : public core::IODevice {
46 public:
51  enum NMEAFlags_t {
52  GGA = 0x01,
53  VTG = 0x02,
54  GST = 0x04,
55  };
56 
66  Gps(const core::FrameworkManager *parent, std::string name,
67  NMEAFlags_t NMEAFlags);
68 
73  ~Gps();
74 
80  const core::GpsData *GetDatas(void) const;
81 
86  void UseDefaultPlot(void);
87 
93  gui::DataPlot1D *EPlot(void) const;
94 
100  gui::DataPlot1D *NPlot(void) const;
101 
107  gui::DataPlot1D *UPlot(void) const;
108 
114  gui::DataPlot1D *VEPlot(void) const;
115 
121  gui::DataPlot1D *VNPlot(void) const;
122 
128  gui::TabWidget *GetTab(void) const;
129 
135  gui::Layout *GetLayout(void) const;
136 
142  gui::Tab *GetPlotTab(void) const;
143 
152  void SetRef(void);
153 
159  void GetENUPosition(core::Vector3D *point);
160 
161 protected:
172  void parseFrame(const char *frame, int frame_size);
173 
174  NMEAFlags_t NMEAFlags;
175 
176 protected:
177  core::GeoCoordinate *position;
178 
184  void GetDatas(core::GpsData **gpsData) const;
185 
186 private:
194  void UpdateFrom(const core::io_data *data){};
195 
196  gui::Tab *main_tab, *sensor_tab;
197  gui::TabWidget *tab;
198  gui::PushButton *button_ref;
199  gui::DataPlot1D *e_plot;
200  gui::DataPlot1D *n_plot;
201  gui::DataPlot1D *u_plot;
202  gui::DataPlot1D *ve_plot;
203  gui::DataPlot1D *vn_plot;
204  gui::Tab *plot_tab;
205  gui::Map *map;
206  gui::Label *nb_sat_label, *fix_label;
207  bool take_ref;
208  nmeaINFO info;
209  nmeaPARSER parser;
210  nmeaGPGGA pack;
211  nmeaPOS pos;
212  double lat_ref, long_ref, alt_ref;
213  core::GpsData* gpsData;
214 
215  // matrix
216  core::cvmatrix *output;
217 };
218 } // end namespace sensor
219 } // end namespace framewor
220 #endif // GPS_H
Abstract class for data types.
Definition: io_data.h:94
gui::DataPlot1D * VNPlot(void) const
North velocity plot.
gui::DataPlot1D * VEPlot(void) const
East velocity plot.
Abstract class for input/ouput system.
Definition: IODevice.h:44
namespace of the flair Framework
Definition: Ahrs.h:19
Base class for GPS.
Definition: Gps.h:45
Class defining a matrix of kind CvMat.
Definition: cvmatrix.h:33
Class defining gps datas.
Definition: GpsData.h:30
Class defining a 3D vector.
Definition: Vector3D.h:28
Definition: Gps.h:53
void parseFrame(const char *frame, int frame_size)
Parse a NMEA frame.
Abstract class for input/ouput system.
gui::DataPlot1D * EPlot(void) const
East plot.
gui::Layout * GetLayout(void) const
Setup Layout.
Class displaying a QPushButton on the ground station.
Definition: PushButton.h:28
gui::DataPlot1D * NPlot(void) const
North plot.
Class displaying a QLabel on the ground station.
Definition: Label.h:28
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
Definition: Gps.h:52
Class displaying a GPS map on the ground station.
Definition: Map.h:33
Definition: Gps.h:54
gui::Tab * GetPlotTab(void) const
Plot tab.
NMEAFlags_t
NMEA flags.
Definition: Gps.h:51
void UseDefaultPlot(void)
Use default plot.
void SetRef(void)
Set reference for ENU coordinates.
Class defining a point by its lla coordinates.
Definition: GeoCoordinate.h:24
gui::DataPlot1D * UPlot(void) const
Up plot.
~Gps()
Destructor.
const core::GpsData * GetDatas(void) const
Get GPS datas.
gui::TabWidget * GetTab(void) const
Main tab.
void GetENUPosition(core::Vector3D *point)
Get ENU position.
Gps(const core::FrameworkManager *parent, std::string name, NMEAFlags_t NMEAFlags)
Constructor.
Class displaying a 1D plot on the ground station.
Definition: DataPlot1D.h:33
Class displaying a QTab on the ground station.
Definition: Tab.h:29