23 #include <QDomElement>
26 #include <QXmlStreamWriter>
43 , bDynamic( _bDynamic )
45 , bSynchronizePosition( false )
46 , bSynchronizeElevation( false )
47 , bSynchronizeTime( false )
48 , bSynchronizeGroundBearing( false )
49 , bSynchronizeGroundSpeed( false )
50 , bSynchronizeGroundSpeedVertical( false )
51 , bSynchronizeApparentBearing( false )
52 , bSynchronizeApparentSpeed( false )
53 , bSynchronizeApparentSpeedVertical( false )
54 , bSynchronizeText( false )
56 QTreeWidgetItem::setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
76 if( __poVesselPointDeviceEditView->exec() == QDialog::Accepted )
showDetail();
77 delete __poVesselPointDeviceEditView;
91 if( !_pqObject || (QObject*)
poDevice != _pqObject )
return;
114 bool _bSynchronizeGroundBearing,
bool _bSynchronizeGroundSpeed,
bool _bSynchronizeGroundSpeedVertical,
115 bool _bSynchronizeApparentBearing,
bool _bSynchronizeApparentSpeed,
bool _bSynchronizeApparentSpeedVertical,
116 bool _bSynchronizeText )
139 if( !__poDevice )
return false;
150 QObject::disconnect(
poDevice, 0,
this, 0 );
197 bool __bVesselSynchronized =
false;
210 && __fdTimeDelta > 0.1 )
224 && __fdTimeDelta > 0.1 )
232 ( ( __fdErrorHorizontal + __poVesselPoint->
getErrorPosition() ) / 10.0 + fabs( __fdErrorHorizontal - __poVesselPoint->
getErrorPosition() ) ) / __fdTimeDelta
233 * ( 1.0 + ( ( __fdErrorTime + __poVesselPoint->
getErrorTime() ) / 10.0 + fabs( __fdErrorTime - __poVesselPoint->
getErrorTime() ) ) / __fdTimeDelta );
238 __bVesselSynchronized =
true;
251 && __fdTimeDelta > 0.1 )
254 __fdGroundSpeedVertical = ( __fdElevation - __poVesselPoint->
getElevation() ) / __fdTimeDelta;
265 && __fdTimeDelta > 0.1 )
272 __fdErrorSpeedVertical =
274 * ( 1.0 + ( ( __fdErrorTime + __poVesselPoint->
getErrorTime() ) / 10.0 + fabs( __fdErrorTime - __poVesselPoint->
getErrorTime() ) ) / __fdTimeDelta );
279 __bVesselSynchronized =
true;
315 if( __fdDistance > 1.0 )
318 atan( ( ( __fdErrorHorizontal + __poVesselPoint->
getErrorPosition() ) / 10.0 + fabs( __fdErrorHorizontal - __poVesselPoint->
getErrorPosition() ) ) / __fdDistance )
326 __bVesselSynchronized =
true;
338 __bVesselSynchronized =
true;
347 __bVesselSynchronized =
true;
356 __bVesselSynchronized =
true;
363 __bVesselSynchronized =
true;
364 __poVesselPoint->
setPosition( __fdLongitude, __fdLatitude );
377 __bVesselSynchronized =
true;
383 __poVesselPoint->
setTime( __fdTime );
385 __bVesselSynchronized =
true;
389 if( !__qsText.isEmpty() )
392 __bVesselSynchronized =
true;
396 if( __bVesselSynchronized )
422 _rqXmlStreamWriter.writeStartElement(
"Device" );
424 if( !
getName().isEmpty() ) _rqXmlStreamWriter.writeAttribute(
"name",
getName() );
430 _rqXmlStreamWriter.writeAttribute(
"synch_time",
bSynchronizeTime ?
"1" :
"0" );
438 _rqXmlStreamWriter.writeEndElement();
void setProjectModified()
Sets the status of the project to modified (data have changed and need saving)
CDataCourse ApparentCourse
Apparent course.
CDataCourse GroundCourse
Ground course.
CDataCourseValidity GroundCourseValidity
Ground course validity.
CDataCourseValidity ApparentCourseValidity
Apparent course validity.
void setValiditySpeed(double _fdTimeLastSpeed, double _fdErrorSpeed, bool _bInvalidSpeed=false)
Sets the horizontal speed's validity parameters.
void setValiditySpeedVertical(double _fdTimeLastSpeedVertical, double _fdErrorSpeedVertical, bool _bInvalidSpeedVertical=false)
Sets the vertical speed's validity parameters.
void setValidityBearing(double _fdTimeLastBearing, double _fdErrorBearing, bool _bInvalidBearing=false)
Sets the bearing's validity parameters.
void setBearing(double _fdBearing)
Sets this course's bearing, in degrees.
double getSpeedVertical() const
Returns this course's vertical speed, in meters per second.
void setSpeed(double _fdSpeed, double _fdSpeedVertical=UNDEFINED_SPEED)
Sets this course's horizontal speed, in meters per second.
static constexpr double UNDEFINED_BEARING
Specific value for an undefined bearing.
static constexpr double UNDEFINED_SPEED
Specific value for an undefined speed.
void setSpeedVertical(double _fdSpeedVertical)
Sets this course's vertical speed, in meters per second.
double getBearing() const
Returns this course's bearing, in degrees.
double getSpeed() const
Returns this course's horizontal speed, in meters per second.
void setValidityElevation(double _fdTimeLastElevation, double _fdErrorElevation, bool _bInvalidElevation=false)
Sets the elevation's validity parameters.
double getErrorElevation() const
Returns the elevation's error, in seconds.
double getErrorPosition() const
Returns the position's error, in seconds.
void setValidityPosition(double _fdTimeLastPosition, double _fdErrorPosition, bool _bInvalidPosition=false)
Sets the position's validity parameters.
double getLongitude() const
Returns this position's longitude, in degrees.
static constexpr double UNDEFINED_LATITUDE
Specific value for an undefined latitude.
double getElevation() const
Returns this position's elevation, in meters.
static double bearingRL(const CDataPosition &_roPosition1, const CDataPosition &_roPosition2)
Returns the rhumb-line (constant) bearing between two points, in degrees.
static double distanceRL(const CDataPosition &_roPosition1, const CDataPosition &_roPosition2)
Returns the rhumb-line distance between two points, in meters.
double getLatitude() const
Returns this position's latitude, in degrees.
static constexpr double UNDEFINED_LONGITUDE
Specific value for an undefined longitude.
void setElevation(double _fdElevation)
Sets the elevation, in meters.
void setPosition(double _fdLongitude, double _fdLatitude, double _fdElevation=UNDEFINED_ELEVATION)
Sets new coordinates.
static constexpr double UNDEFINED_ELEVATION
Specific value for an undefined elevation.
double getErrorTime() const
Returns the time's error, in seconds.
void setValidityTime(double _fdTimeLastTime, double _fdErrorTime, bool _bInvalidTime=false)
Sets the time's validity parameters.
void setTime(double _fdTime)
Sets the time, in seconds from Unix epoch.
double getTime() const
Returns this time's time, in seconds from Unix epoch.
static constexpr double UNDEFINED_TIME
Specific value for an undefined time.
static constexpr double UNDEFINED_VALUE
void setDop(const CDeviceDataDop &_roDeviceDataDop)
Sets (copy) the Dilution-of-Precision (HDOP, VDOP, TDOP) values from other DOP data.
static const CDeviceDataDop UNDEFINED
Specific value for undefined DOP data.
double getDopHorizontal() const
Returns the horizontal position Dilution-of-Precision (HDOP)
double getDopVertical() const
Returns the vertical position Dilution-of-Precision (VDOP)
Fix data [source,time,position,course,DOPs,...].
double getErrorTime() const
Returns the time error, in seconds.
double getErrorVertical() const
Returns the vertical position error, in meters.
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.
QString getText() const
Returns the additional textual data string.
int getType() const
Returns 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.
double getErrorHorizontal() const
Returns the horizontal 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.
int getSourcesUsed() const
Returns the used sources count (most likely satellites)
Sky view data (satellites details)
QString getSourceName() const
Returns the source name.
[UI] Device overlay container
CDevice * pickDevice(const QString &_rqsName)
Returns the device matching the given name (0 if none is found)
Generic navigation device (GPS, speedometer, compass, etc.)
void switchView(EView eView)
Displays the requested container/item details (switching to the appropriate widget)
@ VESSEL_POINT_DEVICE
Vessel point's device.
void switchView(EView eView)
Displays the requested overlay (switching to the appropriate tab)
void setOverlayObject(COverlayObject *_poOverlayObject)
Sets the overlay object to be displayed (and refreshes the underlying widget)
QString getName() const
Returns this object's name.
[UI] Container for the application's settings
double getMinValueSpeedVertical()
[MinValue] Returns the minimum (absolute) vertical speed, in meters per second
double getMinValueSpeed()
[MinValue] Returns the minimum (absolute) horizontal speed, in meters per second
virtual void refreshContent()
Refreshes the content of the underlying widget.
[UI] Vessel point's (item) edit view
bool bSynchronizeElevation
[Flag] Use this device/source 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
virtual void showDetail()
Displays this object's details (in the appropriate widget/view)
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.
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 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)
void disconnectDevice()
Disconnects from the actual device.
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 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
void signalRefreshContent()
Signal emitted when views should refresh this object's corresponding content.
bool bSynchronizeGroundSpeedVertical
[Flag] Use this device/source to synchronize the vessel's ground vertical speed
[UI] Vessel overlay point (item) / vessel
bool isDynamic()
Returns whether the vessel is dynamically generated.
void onDeviceDataFix()
Handled changes triggered by child devices.
void setDopHorizontal(double _fdDopHorizontal)
Sets this vessel point's horizontal Dilution-of-Precision (HDOP)
void setComment(const QString &_rqsComment)
Sets this vessel's comment.
void setDopVertical(double _fdDopVertical)
Sets this vessel point's vertical Dilution-of-Precision (VDOP)
void setFixType(int _eFixType)
Sets this vessel point's fix type.
void setSatelliteCount(int _iSatelliteCount)
Sets this vessel point's satellite count.
static CVesselPointDeviceDetailView * useVesselPointDeviceDetailView()
static COverlayDetailView * useOverlayDetailView()
static CDeviceOverlay * useDeviceOverlay()
static COverlayListView * useOverlayListView()
static CChartTable * useChartTable()
static CSettings * useSettings()
static constexpr double RAD2DEG
double microtime()
Returns the system time with microseconds resolution, in seconds.