Qt Virtual Chart Table (QVCT)
CDeviceDataFix.hpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 #ifndef QVCT_CDEVICEDATAFIX_HPP
20 #define QVCT_CDEVICEDATAFIX_HPP
21 
22 // QVCT
23 #include "data/CDataTime.hpp"
24 #include "data/CDataPosition.hpp"
25 #include "data/CDataCourse.hpp"
26 #include "data/CDataValidity.hpp"
29 
30 
32 
39 {
40 
41  //------------------------------------------------------------------------------
42  // CONSTANTS / STATIC
43  //------------------------------------------------------------------------------
44 
45 public:
47  enum EType {
48  FIX_NONE = 0,
49  FIX_2D = 1,
50  FIX_3D = 2,
51  FIX_DGPS = 4,
52  FIX_UNDEFINED = 128
53  };
54 
55 public:
56  static QString getTypeString( int _eType );
57 
58 
59  //------------------------------------------------------------------------------
60  // FIELDS
61  //------------------------------------------------------------------------------
62 
63 private:
65 
66  int eType;
68 
71 
74 
75  double fdErrorTime;
77 
80 
83 
86 
87  double fdErrorSpeed;
89 
92 
93  QString qsText;
95 
97 
98 
99  //------------------------------------------------------------------------------
100  // CONSTRUCTORS / DESTRUCTOR
101  //------------------------------------------------------------------------------
102 
103 public:
104  CDeviceDataFix( const QString& _rqsSourceName, int _eType = FIX_UNDEFINED, double _fdTime = CDataValidity::UNDEFINED_VALUE );
105  virtual ~CDeviceDataFix() {};
106 
107 
108  //------------------------------------------------------------------------------
109  // METHODS
110  //------------------------------------------------------------------------------
111 
112  // SETTERS
113 public:
115  void setFix( const CDeviceDataFix& _roDeviceDataFix, bool _bCopyTime = true, bool _bCopyPosition = true, bool _bCopyCourse = true, bool _bCopyDop = true );
117  void setType( int _eType ) { eType = _eType; };
119  void setSources( int _iSourcesSeen, int _iSourcesUsed )
120  { iSourcesSeen = _iSourcesSeen; iSourcesUsed = _iSourcesUsed; };
122  void setErrorTime( double _fdErrorTime ) { fdErrorTime = _fdErrorTime; };
124  void setErrorPosition( double _fdErrorHorizontal, double _fdErrorVertical = CDataValidity::UNDEFINED_VALUE )
125  { fdErrorHorizontal = _fdErrorHorizontal; fdErrorVertical = _fdErrorVertical; };
127  void setErrorBearing( double _fdErrorBearing ) { fdErrorBearing = _fdErrorBearing; };
129  void setErrorSpeed( double _fdErrorSpeed, double _fdErrorSpeedVertical = CDataValidity::UNDEFINED_VALUE )
130  { fdErrorSpeed = _fdErrorSpeed; fdErrorSpeedVertical = _fdErrorSpeedVertical; };
132  void setText( const QString& _rqsText ) { qsText = _rqsText; };
134  void setCourseFromPosition( bool _bCourseFromPosition ) { bCourseFromPosition = _bCourseFromPosition; };
135 
136  // GETTERS
137 public:
139  int getType() const { return eType; };
141  QString getTypeString() const;
143  int getSourcesSeen() const { return iSourcesSeen; };
145  int getSourcesUsed() const { return iSourcesUsed; };
147  double getErrorTime() const { return fdErrorTime; };
149  double getErrorHorizontal() const { return fdErrorHorizontal; };
151  double getErrorVertical() const { return fdErrorVertical; };
153  double getErrorBearing() const { return fdErrorBearing; };
155  double getErrorSpeed() const { return fdErrorSpeed; };
157  double getErrorSpeedVertical() const { return fdErrorSpeedVertical; };
159  QString getText() const { return qsText; };
161  bool isCourseFromPosition() const { return bCourseFromPosition; };
162 
163 };
164 
165 #endif // QVCT_CDEVICEDATAFIX_HPP
(Geographical) Course data [bearing, horizontal/vertical speeds]
Definition: CDataCourse.hpp:34
(Geographical) Position data [long,lat,elev]
Time data.
Definition: CDataTime.hpp:36
static constexpr double UNDEFINED_VALUE
Dilution-of-Precision (DOP) data.
Fix data [source,time,position,course,DOPs,...].
int eType
Fix type.
int getSourcesSeen() const
Returns the seen sources count (most likely satellites)
QString getTypeString() const
Returns the fix type as a human-friendly string.
double fdErrorSpeedVertical
Vertical speed error, in meters per second.
CDeviceDataFix(const QString &_rqsSourceName, int _eType=FIX_UNDEFINED, double _fdTime=CDataValidity::UNDEFINED_VALUE)
double fdErrorTime
Time error, in seconds.
int iSourcesSeen
Seen sources count (most likely satellites)
double fdErrorBearing
Bearing error, in degrees.
double getErrorTime() const
Returns the time error, in seconds.
double getErrorVertical() const
Returns the vertical position error, in meters.
void setText(const QString &_rqsText)
Sets the additional textual data string.
void setErrorPosition(double _fdErrorHorizontal, double _fdErrorVertical=CDataValidity::UNDEFINED_VALUE)
Sets the (horizontal and vertical) position error, in meters.
QString qsText
Additional textual data string.
void setFix(const CDeviceDataFix &_roDeviceDataFix, bool _bCopyTime=true, bool _bCopyPosition=true, bool _bCopyCourse=true, bool _bCopyDop=true)
Sets (copy) the fix data from another instance.
EType
Fix type (2D, 3D, no fix)
QString getText() const
Returns the additional textual data string.
void setErrorSpeed(double _fdErrorSpeed, double _fdErrorSpeedVertical=CDataValidity::UNDEFINED_VALUE)
Sets the (horizontal and vertical) speed error, in meters per second.
bool bCourseFromPosition
Use position to compute course.
int getType() const
Returns the fix type.
virtual ~CDeviceDataFix()
void setErrorBearing(double _fdErrorBearing)
Sets the bearing error, in degrees.
void setType(int _eType)
Sets the fix type.
bool isCourseFromPosition() const
Returns whether position is used to compute course.
double getErrorSpeed() const
Returns the horizontal speed error, in meters per second.
int iSourcesUsed
Used sources count (most likely satellites)
double getErrorHorizontal() const
Returns the horizontal position error, in meters.
void setErrorTime(double _fdErrorTime)
Sets the time error, in seconds.
void setSources(int _iSourcesSeen, int _iSourcesUsed)
Sets the sources count (most likely satellites)
double fdErrorVertical
Vertical position error, in meters.
double getErrorBearing() const
Returns the bearing error, in degrees.
double getErrorSpeedVertical() const
Returns the vertical speed error, in meters per second.
double fdErrorHorizontal
Horizontal position error, in meters.
void setCourseFromPosition(bool _bCourseFromPosition)
Sets whether to use position to compute course.
double fdErrorSpeed
Horizontal speed error, in meters per second.
int getSourcesUsed() const
Returns the used sources count (most likely satellites)
Data source details [name,type].