Qt Virtual Chart Table (QVCT)
CVesselPoint.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_CVESSELPOINT_HPP
20 #define QVCT_CVESSELPOINT_HPP
21 
22 // QT
23 #include <QDataStream>
24 #include <QDomElement> // QtXml module
25 #include <QPainter>
26 #include <QPointF>
27 #include <QTreeWidgetItem>
28 #include <QXmlStreamWriter>
29 
30 // QVCT
35 
36 
38 
43 {
44 
45  //------------------------------------------------------------------------------
46  // FIELDS
47  //------------------------------------------------------------------------------
48 
49 private:
51  bool bDynamic;
52 
54  QString qsType;
56  QString qsDescription;
58  QString qsComment;
60 
61  QString qsSymbol;
63  QString qsUrl;
64 
66  int eFixType;
72  double fdDopVertical;
73 
82 
83 
84  //------------------------------------------------------------------------------
85  // CONSTRUCTORS / DESTRUCTOR
86  //------------------------------------------------------------------------------
87 
88 public:
89  CVesselPoint( const QString& _rqsName, bool _bDynamic = false );
90  CVesselPoint( const QString& _rqsName, const CDataPosition& _roDataPosition );
91  virtual ~CVesselPoint();
92 
93 
94  //------------------------------------------------------------------------------
95  // METHODS: COverlayObject (implement/override)
96  //------------------------------------------------------------------------------
97 
98 public:
99  virtual void serialize( QDataStream& _rqDataStream ) const;
100  virtual void unserialize( QDataStream& _rqDataStream );
101 
102 public:
103  virtual COverlay* useOverlay() { return (COverlay*)QTreeWidgetItem::parent()->parent(); };
104 
105 public:
106  virtual void draw( const CChart* _poChart, QPainter* _pqPainter );
107  virtual void showDetail();
108  virtual void showEdit();
109 
110 
111  //------------------------------------------------------------------------------
112  // METHODS: COverlayPoint (implement/override)
113  //------------------------------------------------------------------------------
114 
115 public:
116  virtual bool matchScrPosition( const CChart* _poChart, const QPointF& _rqPointFScrPosition ) const;
117 
118 
119  //------------------------------------------------------------------------------
120  // METHODS: COverlayVisibility (override)
121  //------------------------------------------------------------------------------
122 
123 public:
124  virtual void toggleVisibility();
125 
126 
127  //------------------------------------------------------------------------------
128  // METHODS
129  //------------------------------------------------------------------------------
130 
131  // SETTERS
132 public:
134  void toggleMultiSelected();
136  void setType( const QString& _rqsType ) { qsType = _rqsType; };
138  void setDescription( const QString& _rqsDescription ) { qsDescription = _rqsDescription; };
140  void setComment( const QString& _rqsComment ) { qsComment = _rqsComment; };
142  void setSymbol( const QString& _rqsSymbol ) { qsSymbol = _rqsSymbol; };
144  void setUrl( const QString& _rqsUrl ) { qsUrl = _rqsUrl; };
145 
146 public:
148  void setFixType( int _eFixType ) { eFixType = _eFixType; };
150  void setSatelliteCount( int _iSatelliteCount ) { iSatelliteCount = _iSatelliteCount; };
152  void setDopHorizontal( double _fdDopHorizontal ) { fdDopHorizontal = _fdDopHorizontal; };
154  void setDopVertical( double _fdDopVertical ) { fdDopVertical = _fdDopVertical; };
155 
156 public:
158  void setTrackRecordRate( int _iTrackRecordRate ) { iTrackRecordRate = _iTrackRecordRate; };
160  bool setTrackRecord( bool _bTrackRecord );
161 
162  // GETTERS
163 public:
165  bool isDynamic() { return bDynamic; }
167  bool isDeviceConnected() const;
168 
170  QString getType() const { return qsType; };
172  QString getDescription() const { return qsDescription; };
174  QString getComment() const { return qsComment; };
176  QString getSymbol() const { return qsSymbol; };
178  QString getUrl() const { return qsUrl; };
179 
180 public:
182  int getFixType() { return eFixType; };
186  double getDopHorizontal() { return fdDopHorizontal; };
188  double getDopVertical() { return fdDopVertical; };
189 
190 public:
194  bool isTrackRecording() { return bTrackRecord; };
195 
196  // OTHER
197 public:
198 
199  // OTHER
200 public:
202  void connectDevice();
204  void disconnectDevice();
206  void onDeviceDataFix();
207 
208 public:
210  void parseQVCT( const QDomElement& _rqDomElement );
212  void dumpQVCT( QXmlStreamWriter & _rqXmlStreamWriter ) const;
213 
214 protected:
216 };
217 
218 #endif // QVCT_CVESSELPOINT_HPP
[UI] Chart (view)
Definition: CChart.hpp:44
Ground and apparent geographical courses validity container.
Position data validity.
(Geographical) Position data [long,lat,elev]
Time data validity.
Generic overlay course.
virtual void toggleVisibility(bool _bIncludeCourse, bool _bIncludeRouting)
Toggle the visibility status.
Generic overlay.
Definition: COverlay.hpp:45
[UI] Vessel overlay point (item) / vessel
double getDopVertical()
Sets this vessel point's vertical Dilution-of-Precision (VDOP)
int eFixType
Vessel point's fix type.
void toggleMultiSelected()
Toggles this vessel's selection status.
void disconnectDevice()
Disconnects all children devices.
double fdTrackRecordBearingLast
Vessel's track last recorded bearing.
bool isDynamic()
Returns whether the vessel is dynamically generated.
void setType(const QString &_rqsType)
Sets this vessel's type.
QString getSymbol() const
Returns this vessel's symbol.
bool isDeviceConnected() const
Returns whether this vessel's devices are all connected.
void onDeviceDataFix()
Handled changes triggered by child devices.
double fdTrackRecordTimeLast
Vessel's track last recording time.
virtual ~CVesselPoint()
double fdDopHorizontal
Vessel point's horizontal Dilution-of-Precision (HDOP)
virtual void unserialize(QDataStream &_rqDataStream)
Unserializes (restore) this object's data from binary format.
void setDescription(const QString &_rqsDescription)
Sets this vessel's description.
virtual bool matchScrPosition(const CChart *_poChart, const QPointF &_rqPointFScrPosition) const
Returns whether this point matches the given screen position.
QString getComment() const
Returns this vessel's comment.
bool bTrackRecord
Vessel's track recording status.
double fdDopVertical
Vessel point's vertical Dilution-of-Precision (VDOP)
void dumpQVCT(QXmlStreamWriter &_rqXmlStreamWriter) const
Stores this object's content to the given QVCT destination (file)
int iTrackRecordRate
Vessel's track recording rate, in seconds.
virtual void toggleVisibility()
int iSatelliteCount
Vessel point's satellites count.
QString getUrl() const
Returns this vessel's URL.
void setDopHorizontal(double _fdDopHorizontal)
Sets this vessel point's horizontal Dilution-of-Precision (HDOP)
int getTrackRecordRate()
Returns this vessel's track recording rate, in seconds.
virtual void showEdit()
Displays this object's edit widget/view.
bool isTrackRecording()
Returns this vessel's track recording status.
QString qsUrl
Vessel's URL.
virtual void showDetail()
Displays this object's details (in the appropriate widget/view)
void setComment(const QString &_rqsComment)
Sets this vessel's comment.
virtual COverlay * useOverlay()
Returns this object's (base) overlay.
QString qsComment
Vessel's comment.
void setUrl(const QString &_rqsUrl)
Sets this vessel's URL.
int getFixType()
Sets this vessel point's fix type.
QString qsType
Vessel's type.
void connectDevice()
Connects all children devices.
bool bDynamic
Dynamic flag (vessel automatically generated by a dynamic flotilla)
void setTrackRecordRate(int _iTrackRecordRate)
Sets this vessel's track recording rate, in seconds.
virtual void serialize(QDataStream &_rqDataStream) const
Serializes (store) this object's data to binary format.
void setDopVertical(double _fdDopVertical)
Sets this vessel point's vertical Dilution-of-Precision (VDOP)
QString getDescription() const
Returns this vessel's description.
QString getType() const
Returns this vessel's type.
void setFixType(int _eFixType)
Sets this vessel point's fix type.
int getSatelliteCount()
Sets this vessel point's satellite count.
double getDopHorizontal()
Sets this vessel point's horizontal Dilution-of-Precision (HDOP)
void setSymbol(const QString &_rqsSymbol)
Sets this vessel's symbol.
bool setTrackRecord(bool _bTrackRecord)
Sets this vessel's track recording status.
CVesselPoint(const QString &_rqsName, bool _bDynamic=false)
QString qsDescription
Vessel's description.
virtual void draw(const CChart *_poChart, QPainter *_pqPainter)
Draws this object (itself or its content)
QString qsSymbol
Vessel's symbol.
void parseQVCT(const QDomElement &_rqDomElement)
Retrieves this object's content from the given QVCT source (file)
void setSatelliteCount(int _iSatelliteCount)
Sets this vessel point's satellite count.