Qt Virtual Chart Table (QVCT)
CVesselPointDevice.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_CVESSELPOINTDEVICE_HPP
20 #define QVCT_CVESSELPOINTDEVICE_HPP
21 
22 // QT
23 #include <QDataStream>
24 #include <QDomElement> // QtXml module
25 #include <QPainter>
26 #include <QTreeWidgetItem>
27 #include <QXmlStreamWriter>
28 
29 // QVCT
32 class CChart;
33 class CDevice;
34 class CDeviceDataSkyView;
35 
36 
38 
44 {
45  Q_OBJECT
46 
47  //------------------------------------------------------------------------------
48  // FIELDS
49  //------------------------------------------------------------------------------
50 
51 private:
53  bool bDynamic;
54 
77 
78 
79  //------------------------------------------------------------------------------
80  // CONSTRUCTORS / DESTRUCTOR
81  //------------------------------------------------------------------------------
82 
83 public:
84  CVesselPointDevice( const QString& _rqsName, const QString& _rqsSourceName, bool _bDynamic = false );
85  virtual ~CVesselPointDevice() {};
86 
87 
88  //------------------------------------------------------------------------------
89  // METHODS: COverlayObject (implement/override)
90  //------------------------------------------------------------------------------
91 
92 public:
93  virtual void serialize( QDataStream& _rqDataStream ) const {};
94  virtual void unserialize( QDataStream& _rqDataStream ) {};
95 
96 public:
97  virtual COverlay* useOverlay() { return (COverlay*)QTreeWidgetItem::parent()->parent()->parent(); };
98 
99 public:
100  virtual void draw( const CChart* _poChart, QPainter* _pqPainter ) {};
101  virtual void showDetail();
102  virtual void showEdit();
103 
104 
105  //------------------------------------------------------------------------------
106  // METHODS
107  //------------------------------------------------------------------------------
108 
109  // SIGNALS
110 signals:
113 
114  // SLOTS
115 private slots:
117  void slotDestroyed( QObject* _pqObject );
118 
119 private slots:
121  void slotDataFix( const CDeviceDataFix& _roDeviceDataFix );
123  void slotDataSkyView( const CDeviceDataSkyView& _roDeviceDataSkyView );
124 
125  // SETTERS
126 public:
128  void setSynchronized( bool _bSynchronizePosition, bool _bSynchronizeElevation, bool _bSynchronizeTime,
129  bool _bSynchronizeGroundBearing, bool _bSynchronizeGroundSpeed, bool _bSynchronizeGroundSpeedVertical,
130  bool _bSynchronizeApparentBearing, bool _bSynchronizeApparentSpeed, bool _bSynchronizeApparentSpeedVertical,
131  bool _bSynchronizeText );
132 
133  // GETTERS
134 public:
136  bool isDynamic() { return bDynamic; };
138  bool isDeviceConnected() const { return poDevice; };
139 
160 
161  // OTHER
162 public:
164  bool connectDevice();
166  void disconnectDevice();
168  void syncDataFix( const CDeviceDataFix& _roDeviceDataFix );
169 
170 public:
172  void parseQVCT( const QDomElement& _rqDomElement );
174  void dumpQVCT( QXmlStreamWriter & _rqXmlStreamWriter ) const;
175 
176 };
177 
178 #endif // QVCT_CVESSELPOINTDEVICE_HPP
[UI] Chart (view)
Definition: CChart.hpp:44
Fix data [source,time,position,course,DOPs,...].
Sky view data (satellites details)
Generic navigation device (GPS, speedometer, compass, etc.)
Definition: CDevice.hpp:43
Generic overlay item.
Generic overlay.
Definition: COverlay.hpp:45
[UI] Vessel device
bool bSynchronizeElevation
[Flag] Use this device/source to synchronize the vessel's elevation
bool isSynchronizedElevation()
Returns whether this device/source is used to synchronize the vessel's elevation.
void slotDestroyed(QObject *_pqObject)
Slot to handle object destruction.
void syncDataFix(const CDeviceDataFix &_roDeviceDataFix)
Synchronizes fix data (sent by device)
bool bSynchronizePosition
[Flag] Use this device/source to synchronize the vessel's position
bool isSynchronizedApparentBearing()
Returns whether this device/source is used to synchronize the vessel's apparent bearing.
virtual void draw(const CChart *_poChart, QPainter *_pqPainter)
Draws this object (itself or its content)
bool isDynamic()
Returns whether the device is dynamically generated.
bool isSynchronizedGroundBearing()
Returns whether this device/source is used to synchronize the vessel's ground bearing.
bool isSynchronizedPosition()
Returns whether this device/source is used to synchronize the vessel's position.
virtual void showDetail()
Displays this object's details (in the appropriate widget/view)
virtual COverlay * useOverlay()
Returns this object's (base) overlay.
void setSynchronized(bool _bSynchronizePosition, bool _bSynchronizeElevation, bool _bSynchronizeTime, bool _bSynchronizeGroundBearing, bool _bSynchronizeGroundSpeed, bool _bSynchronizeGroundSpeedVertical, bool _bSynchronizeApparentBearing, bool _bSynchronizeApparentSpeed, bool _bSynchronizeApparentSpeedVertical, bool _bSynchronizeText)
Sets the synchronizazion flags.
bool isDeviceConnected() const
Returns whether the actual device is connected.
bool bDynamic
Dynamic flag (vessel device automatically generated by a dynamic flotilla)
void slotDataSkyView(const CDeviceDataSkyView &_roDeviceDataSkyView)
Slot to handle sky view data (sent by device)
bool bSynchronizeGroundSpeed
[Flag] Use this device/source to synchronize the vessel's ground horizontal speed
CVesselPointDevice(const QString &_rqsName, const QString &_rqsSourceName, bool _bDynamic=false)
CDevice * poDevice
Corresponding device's pointer.
bool isSynchronizedGroundSpeed()
Returns whether this device/source is used to synchronize the vessel's ground horizontal speed.
virtual void serialize(QDataStream &_rqDataStream) const
Serializes (store) this object's data to binary format.
bool bSynchronizeApparentSpeedVertical
[Flag] Use this device/source to synchronize the vessel's apparent vertical speed
void slotDataFix(const CDeviceDataFix &_roDeviceDataFix)
Slot to handle fix data (sent by device)
void parseQVCT(const QDomElement &_rqDomElement)
Retrieves this object's content from the given QVCT source (file)
bool isSynchronizedTime()
Returns whether this device/source is used to synchronize the vessel's time.
void disconnectDevice()
Disconnects from the actual device.
bool isSynchronizedApparentSpeed()
Returns whether this device/source is used to synchronize the vessel's apparent horizontal speed.
bool connectDevice()
Connects to the actual device.
bool bSynchronizeTime
[Flag] Use this device/source to synchronize the vessel's time
bool bSynchronizeApparentSpeed
[Flag] Use this device/source to synchronize the vessel's apparent horizontal speed
void dumpQVCT(QXmlStreamWriter &_rqXmlStreamWriter) const
Stores this object's content to the given QVCT destination (file)
virtual void showEdit()
Displays this object's edit widget/view.
bool isSynchronizedGroundSpeedVertical()
Returns whether this device/source is used to synchronize the vessel's ground vertical speed.
bool bSynchronizeGroundBearing
[Flag] Use this device/source to synchronize the vessel's ground bearing
bool bSynchronizeApparentBearing
[Flag] Use this device/source to synchronize the vessel's apparent bearing
bool bSynchronizeText
[Flag] Use this device/source to synchronize the vessel's additional textual data string
bool isSynchronizedText()
Returns whether this device/source is used to synchronize the vessel's additional textual data string...
void signalRefreshContent()
Signal emitted when views should refresh this object's corresponding content.
bool isSynchronizedApparentSpeedVertical()
Returns whether this device/source is used to synchronize the vessel's apparent vertical speed.
virtual void unserialize(QDataStream &_rqDataStream)
Unserializes (restore) this object's data from binary format.
bool bSynchronizeGroundSpeedVertical
[Flag] Use this device/source to synchronize the vessel's ground vertical speed