Qt Virtual Chart Table (QVCT)
CVesselPointEditView.cpp
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 // QT
20 #include <QCheckBox>
21 #include <QDialogButtonBox>
22 #include <QFormLayout>
23 #include <QHBoxLayout>
24 #include <QLabel>
25 #include <QLineEdit>
26 #include <QTextEdit>
27 #include <QVBoxLayout>
28 
29 // QVCT
30 #include "QVCTRuntime.hpp"
33 
34 
35 //------------------------------------------------------------------------------
36 // CONSTRUCTORS / DESTRUCTOR
37 //------------------------------------------------------------------------------
38 
40  : COverlayObjectEditView( _poVesselPoint )
41 {
43 }
44 
46 {
47  // Create layout
48  QVBoxLayout* __pqVBoxLayout = new QVBoxLayout();
49 
50  // Add header
51  QFont __qFontHeader;
52  __qFontHeader.setPixelSize( 16 );
53  __qFontHeader.setBold( true );
54  QHBoxLayout* __pqHBoxLayoutHeader = new QHBoxLayout();
55  QLabel* __pqLabelIcon = new QLabel();
56  __pqLabelIcon->setPixmap( QPixmap( ":icons/32x32/vessel_point.png" ) );
57  __pqHBoxLayoutHeader->addWidget( __pqLabelIcon, 0, Qt::AlignTop );
58  QLabel* __pqLabelEdit = new QLabel( tr("Edit")+"..." );
59  __pqLabelEdit->setFont( __qFontHeader );
60  __pqHBoxLayoutHeader->addWidget( __pqLabelEdit, 1 );
61  // ... [end]
62  __pqVBoxLayout->addLayout( __pqHBoxLayoutHeader );
63 
64  // Add data
65  CVesselPoint* __poVesselPoint = (CVesselPoint*)poOverlayObject;
66  QFormLayout* __pqFormLayout = new QFormLayout();
67 
68  // ... name
69  pqLineEditName = new QLineEdit();
70  pqLineEditName->setToolTip( tr("Name") );
71  pqLineEditName->setText( __poVesselPoint->getName() );
72  __pqFormLayout->addRow( tr("Name")+":", pqLineEditName );
73  bool __bPositionDefined = __poVesselPoint->CDataPosition::operator!=( CDataPosition::UNDEFINED );
74 
75  // ... position
76  QHBoxLayout* __pqHBoxLayoutPosition = new QHBoxLayout();
77  pqLineEditLongitude = new QLineEdit();
78  pqLineEditLongitude->setToolTip( tr("Longitude") );
79  if( __bPositionDefined ) pqLineEditLongitude->setText( CUnitPosition::toString( __poVesselPoint->getLongitude(), CUnitPosition::LONGITUDE ) );
80  __pqHBoxLayoutPosition->addWidget( pqLineEditLongitude );
81  pqLineEditLatitude = new QLineEdit();
82  pqLineEditLatitude->setToolTip( tr("Latitude") );
83  if( __bPositionDefined ) pqLineEditLatitude->setText( CUnitPosition::toString( __poVesselPoint->getLatitude(), CUnitPosition::LATITUDE ) );
84  __pqHBoxLayoutPosition->addWidget( pqLineEditLatitude );
85  pqCheckBoxValidityPosition = new QCheckBox();
86  pqCheckBoxValidityPosition->setToolTip( tr("Position Validity") );
87  pqCheckBoxValidityPosition->setTristate( true );
88  pqCheckBoxValidityPosition->setCheckState( Qt::PartiallyChecked );
89  __pqHBoxLayoutPosition->addWidget( pqCheckBoxValidityPosition );
90  pqLineEditElevation = new QLineEdit();
91  pqLineEditElevation->setToolTip( tr("Elevation") );
92  if( __poVesselPoint->getElevation() != CDataPosition::UNDEFINED_ELEVATION ) pqLineEditElevation->setText( CUnitElevation::toString( __poVesselPoint->getElevation() ) );
93  __pqHBoxLayoutPosition->addWidget( pqLineEditElevation );
94  pqCheckBoxValidityElevation = new QCheckBox();
95  pqCheckBoxValidityElevation->setToolTip( tr("Elevation Validity") );
96  pqCheckBoxValidityElevation->setTristate( true );
97  pqCheckBoxValidityElevation->setCheckState( Qt::PartiallyChecked );
98  __pqHBoxLayoutPosition->addWidget( pqCheckBoxValidityElevation );
99  __pqFormLayout->addRow( tr("Position")+":", __pqHBoxLayoutPosition );
100 
101  // ... date/time
102  QHBoxLayout* __pqHBoxLayoutDate = new QHBoxLayout();
103  pqLineEditDate = new QLineEdit();
104  pqLineEditDate->setToolTip( tr("Date") );
105  if( __poVesselPoint->getTime() != CDataTime::UNDEFINED_TIME ) pqLineEditDate->setText( CUnitDate::toString( __poVesselPoint->getTime() ) );
106  __pqHBoxLayoutDate->addWidget( pqLineEditDate );
107  pqLineEditTime = new QLineEdit();
108  pqLineEditTime->setToolTip( tr("Time") );
109  if( __poVesselPoint->getTime() != CDataTime::UNDEFINED_TIME ) pqLineEditTime->setText( CUnitTime::toString( __poVesselPoint->getTime() ) );
110  __pqHBoxLayoutDate->addWidget( pqLineEditTime );
111  pqCheckBoxValidityTime = new QCheckBox();
112  pqCheckBoxValidityTime->setToolTip( tr("Time Validity") );
113  pqCheckBoxValidityTime->setTristate( true );
114  pqCheckBoxValidityTime->setCheckState( Qt::PartiallyChecked );
115  __pqHBoxLayoutDate->addWidget( pqCheckBoxValidityTime );
116  __pqFormLayout->addRow( tr("Date & Time")+":", __pqHBoxLayoutDate );
117 
118  // ... ground course
119  QHBoxLayout* __pqHBoxLayoutGroundCourse = new QHBoxLayout();
120  pqLineEditGroundBearing = new QLineEdit();
121  pqLineEditGroundBearing->setToolTip( tr("Bearing") );
123  __pqHBoxLayoutGroundCourse->addWidget( pqLineEditGroundBearing );
124  pqCheckBoxValidityGroundBearing = new QCheckBox();
125  pqCheckBoxValidityGroundBearing->setToolTip( tr("Ground Bearing Validity") );
126  pqCheckBoxValidityGroundBearing->setTristate( true );
127  pqCheckBoxValidityGroundBearing->setCheckState( Qt::PartiallyChecked );
128  __pqHBoxLayoutGroundCourse->addWidget( pqCheckBoxValidityGroundBearing );
129  pqLineEditGroundSpeed = new QLineEdit();
130  pqLineEditGroundSpeed->setToolTip( tr("Speed (horizontal)") );
131  if( __poVesselPoint->GroundCourse.getSpeed() != CDataCourse::UNDEFINED_SPEED ) pqLineEditGroundSpeed->setText( CUnitSpeed::toString( __poVesselPoint->GroundCourse.getSpeed() ) );
132  __pqHBoxLayoutGroundCourse->addWidget( pqLineEditGroundSpeed );
133  pqCheckBoxValidityGroundSpeed = new QCheckBox();
134  pqCheckBoxValidityGroundSpeed->setToolTip( tr("Ground Speed Validity (horizontal)") );
135  pqCheckBoxValidityGroundSpeed->setTristate( true );
136  pqCheckBoxValidityGroundSpeed->setCheckState( Qt::PartiallyChecked );
137  __pqHBoxLayoutGroundCourse->addWidget( pqCheckBoxValidityGroundSpeed );
138  pqLineEditGroundSpeedVertical = new QLineEdit();
139  pqLineEditGroundSpeedVertical->setToolTip( tr("Speed (vertical)") );
141  __pqHBoxLayoutGroundCourse->addWidget( pqLineEditGroundSpeedVertical );
142  pqCheckBoxValidityGroundSpeedVertical = new QCheckBox();
143  pqCheckBoxValidityGroundSpeedVertical->setToolTip( tr("Ground Speed Validity (vertical)") );
144  pqCheckBoxValidityGroundSpeedVertical->setTristate( true );
145  pqCheckBoxValidityGroundSpeedVertical->setCheckState( Qt::PartiallyChecked );
146  __pqHBoxLayoutGroundCourse->addWidget( pqCheckBoxValidityGroundSpeedVertical );
147  __pqFormLayout->addRow( tr("Ground Course")+":", __pqHBoxLayoutGroundCourse );
148 
149  // ... apparent course
150  QHBoxLayout* __pqHBoxLayoutApparentCourse = new QHBoxLayout();
151  pqLineEditApparentBearing = new QLineEdit();
152  pqLineEditApparentBearing->setToolTip( tr("Bearing") );
154  __pqHBoxLayoutApparentCourse->addWidget( pqLineEditApparentBearing );
155  pqCheckBoxValidityApparentBearing = new QCheckBox();
156  pqCheckBoxValidityApparentBearing->setToolTip( tr("Apparent Bearing Validity") );
157  pqCheckBoxValidityApparentBearing->setTristate( true );
158  pqCheckBoxValidityApparentBearing->setCheckState( Qt::PartiallyChecked );
159  __pqHBoxLayoutApparentCourse->addWidget( pqCheckBoxValidityApparentBearing );
160  pqLineEditApparentSpeed = new QLineEdit();
161  pqLineEditApparentSpeed->setToolTip( tr("Speed (horizontal)") );
163  __pqHBoxLayoutApparentCourse->addWidget( pqLineEditApparentSpeed );
164  pqCheckBoxValidityApparentSpeed = new QCheckBox();
165  pqCheckBoxValidityApparentSpeed->setToolTip( tr("Apparent Speed Validity (horizontal)") );
166  pqCheckBoxValidityApparentSpeed->setTristate( true );
167  pqCheckBoxValidityApparentSpeed->setCheckState( Qt::PartiallyChecked );
168  __pqHBoxLayoutApparentCourse->addWidget( pqCheckBoxValidityApparentSpeed );
169  pqLineEditApparentSpeedVertical = new QLineEdit();
170  pqLineEditApparentSpeedVertical->setToolTip( tr("Speed (vertical)") );
172  __pqHBoxLayoutApparentCourse->addWidget( pqLineEditApparentSpeedVertical );
173  pqCheckBoxValidityApparentSpeedVertical = new QCheckBox();
174  pqCheckBoxValidityApparentSpeedVertical->setToolTip( tr("Apparent Speed Validity (vertical)") );
175  pqCheckBoxValidityApparentSpeedVertical->setTristate( true );
176  pqCheckBoxValidityApparentSpeedVertical->setCheckState( Qt::PartiallyChecked );
177  __pqHBoxLayoutApparentCourse->addWidget( pqCheckBoxValidityApparentSpeedVertical );
178  __pqFormLayout->addRow( tr("Apparent Course")+":", __pqHBoxLayoutApparentCourse );
179 
180  // ... type/symbol
181  QHBoxLayout* __pqHBoxLayoutTypeSymbol = new QHBoxLayout();
182  pqLineEditType = new QLineEdit();
183  pqLineEditType->setToolTip( tr("Type") );
184  pqLineEditType->setText( __poVesselPoint->getType() );
185  __pqHBoxLayoutTypeSymbol->addWidget( pqLineEditType );
186  pqLineEditSymbol = new QLineEdit();
187  pqLineEditSymbol->setToolTip( tr("Symbol") );
188  pqLineEditSymbol->setText( __poVesselPoint->getSymbol() );
189  __pqHBoxLayoutTypeSymbol->addWidget( pqLineEditSymbol );
190  __pqFormLayout->addRow( tr("Type & Symbol")+":", __pqHBoxLayoutTypeSymbol );
191 
192  // ... description
193  pqTextEditDescription = new QTextEdit();
194  pqTextEditDescription->setToolTip( tr("Comment") );
195  pqTextEditDescription->setAcceptRichText( false );
196  pqTextEditDescription->setPlainText( __poVesselPoint->getDescription() );
197  __pqFormLayout->addRow( tr("Description")+":", pqTextEditDescription );
198 
199  // ... comment
200  pqTextEditComment = new QTextEdit();
201  pqTextEditComment->setToolTip( tr("Comment") );
202  pqTextEditComment->setAcceptRichText( false );
203  pqTextEditComment->setPlainText( __poVesselPoint->getComment() );
204  __pqFormLayout->addRow( tr("Comment")+":", pqTextEditComment );
205 
206  // ... url
207  pqLineEditUrl = new QLineEdit();
208  pqLineEditUrl->setToolTip( tr("URL") );
209  pqLineEditUrl->setText( __poVesselPoint->getUrl() );
210  __pqFormLayout->addRow( tr("URL")+":", pqLineEditUrl );
211 
212  // ... track recording
213  pqSpinBoxTrackRecordRate = new QSpinBox();
214  pqSpinBoxTrackRecordRate->setRange( 1, 300 );
215  pqSpinBoxTrackRecordRate->setToolTip( tr("Track Recording Rate [seconds]") );
216  pqSpinBoxTrackRecordRate->setValue( __poVesselPoint->getTrackRecordRate() );
217  __pqFormLayout->addRow( tr("Track Recording Rate")+":", pqSpinBoxTrackRecordRate );
218 
219  // ... [end]
220  __pqVBoxLayout->addLayout( __pqFormLayout );
221 
222  // Add buttons
223  QDialogButtonBox* __pqDialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Cancel|QDialogButtonBox::Save, Qt::Horizontal );
224  QDialog::connect( __pqDialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()) );
225  QDialog::connect( __pqDialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()) );
226  __pqVBoxLayout->addWidget( __pqDialogButtonBox );
227 
228  // Set the layout
229  COverlayObjectEditView::setLayout( __pqVBoxLayout );
230 
231 }
232 
233 
234 //------------------------------------------------------------------------------
235 // METHODS: QDialog (override)
236 //------------------------------------------------------------------------------
237 
239 {
240  CVesselPoint* __poVesselPoint = (CVesselPoint*)poOverlayObject;
241 
242  // Check data
243  bool __bOK;
244 
245  // ... position
246  double __fdLongitude = CDataPosition::UNDEFINED_LONGITUDE;
247  double __fdLatitude = CDataPosition::UNDEFINED_LATITUDE;
248  double __fdElevation = CDataPosition::UNDEFINED_ELEVATION;
249  if( !pqLineEditLongitude->text().isEmpty() && !pqLineEditLatitude->text().isEmpty() )
250  {
251  __fdLongitude = CUnitPosition::fromString( pqLineEditLongitude->text(), &__bOK );
252  if( !__bOK )
253  {
255  return;
256  }
257  __fdLatitude = CUnitPosition::fromString( pqLineEditLatitude->text(), &__bOK );
258  if( !__bOK )
259  {
261  return;
262  }
263  }
264  if( !pqLineEditElevation->text().isEmpty() )
265  {
266  __fdElevation = CUnitElevation::fromString( pqLineEditElevation->text(), &__bOK );
267  if( !__bOK )
268  {
270  return;
271  }
272  }
273 
274  // ... time
275  double __fdTime = CDataTime::UNDEFINED_TIME;
276  double __fdDate = CDataTime::UNDEFINED_TIME;
277  if( !pqLineEditDate->text().isEmpty() )
278  {
279  __fdDate = CUnitDate::fromString( pqLineEditDate->text(), &__bOK );
280  if( !__bOK )
281  {
283  return;
284  }
285  }
286  if( __fdDate != CDataTime::UNDEFINED_TIME && !pqLineEditTime->text().isEmpty() )
287  {
288  __fdTime = CUnitTime::fromString( pqLineEditTime->text(), __fdDate, &__bOK );
289  if( !__bOK )
290  {
292  return;
293  }
294  }
295 
296  // ... course
297  double __fdGroundBearing = CDataCourse::UNDEFINED_BEARING;
298  double __fdGroundSpeed = CDataCourse::UNDEFINED_SPEED;
299  double __fdGroundSpeedVertical = CDataCourse::UNDEFINED_SPEED;
300  double __fdApparentBearing = CDataCourse::UNDEFINED_BEARING;
301  double __fdApparentSpeed = CDataCourse::UNDEFINED_SPEED;
302  double __fdApparentSpeedVertical = CDataCourse::UNDEFINED_SPEED;
303  if( !pqLineEditGroundBearing->text().isEmpty() )
304  {
305  __fdGroundBearing = CUnitBearing::fromString( pqLineEditGroundBearing->text(), &__bOK );
306  if( !__bOK )
307  {
309  return;
310  }
311  }
312  if( !pqLineEditGroundSpeed->text().isEmpty() )
313  {
314  __fdGroundSpeed = CUnitSpeed::fromString( pqLineEditGroundSpeed->text(), &__bOK );
315  if( !__bOK )
316  {
318  return;
319  }
320  }
321  if( !pqLineEditGroundSpeedVertical->text().isEmpty() )
322  {
323  __fdGroundSpeedVertical = CUnitSpeedVertical::fromString( pqLineEditGroundSpeedVertical->text(), &__bOK );
324  if( !__bOK )
325  {
327  return;
328  }
329  }
330  if( !pqLineEditApparentBearing->text().isEmpty() )
331  {
332  __fdApparentBearing = CUnitBearing::fromString( pqLineEditApparentBearing->text(), &__bOK );
333  if( !__bOK )
334  {
336  return;
337  }
338  }
339  if( !pqLineEditApparentSpeed->text().isEmpty() )
340  {
341  __fdApparentSpeed = CUnitSpeed::fromString( pqLineEditApparentSpeed->text(), &__bOK );
342  if( !__bOK )
343  {
345  return;
346  }
347  }
348  if( !pqLineEditApparentSpeedVertical->text().isEmpty() )
349  {
350  __fdApparentSpeedVertical = CUnitSpeedVertical::fromString( pqLineEditApparentSpeedVertical->text(), &__bOK );
351  if( !__bOK )
352  {
354  return;
355  }
356  }
357 
358  // Set data
359  // ... system time
360  double __fdSystemTime = microtime();
361  // ... name
362  __poVesselPoint->setText( CVesselOverlay::NAME, pqLineEditName->text() ); // NOTE: Item's name will be updated via QTreeWidget::itemChanged()
363  // ... position
364  __poVesselPoint->setPosition( __fdLongitude, __fdLatitude, __fdElevation );
365  if( pqCheckBoxValidityPosition->checkState() != Qt::PartiallyChecked )
366  __poVesselPoint->setValidityPosition( __fdSystemTime, CDataPositionValidity::UNDEFINED_VALUE, pqCheckBoxValidityPosition->checkState() == Qt::Unchecked );
367  if( pqCheckBoxValidityElevation->checkState() != Qt::PartiallyChecked )
368  __poVesselPoint->setValidityElevation( __fdSystemTime, CDataPositionValidity::UNDEFINED_VALUE, pqCheckBoxValidityElevation->checkState() == Qt::Unchecked );
369  // ... time
370  __poVesselPoint->setTime( __fdTime );
371  if( pqCheckBoxValidityTime->checkState() != Qt::PartiallyChecked )
372  __poVesselPoint->setValidityTime( __fdSystemTime, CDataTimeValidity::UNDEFINED_VALUE, pqCheckBoxValidityTime->checkState() == Qt::Unchecked );
373  // ... course
374  __poVesselPoint->GroundCourse.setCourse( __fdGroundBearing, __fdGroundSpeed, __fdGroundSpeedVertical );
375  if( pqCheckBoxValidityGroundBearing->checkState() != Qt::PartiallyChecked )
376  __poVesselPoint->GroundCourseValidity.setValidityBearing( __fdSystemTime, CDataCourseValidity::UNDEFINED_VALUE, pqCheckBoxValidityGroundBearing->checkState() == Qt::Unchecked );
377  if( pqCheckBoxValidityGroundSpeed->checkState() != Qt::PartiallyChecked )
378  __poVesselPoint->GroundCourseValidity.setValiditySpeed( __fdSystemTime, CDataCourseValidity::UNDEFINED_VALUE, pqCheckBoxValidityGroundSpeed->checkState() == Qt::Unchecked );
379  if( pqCheckBoxValidityGroundSpeedVertical-> checkState() != Qt::PartiallyChecked )
380  __poVesselPoint->GroundCourseValidity.setValiditySpeedVertical( __fdSystemTime, CDataCourseValidity::UNDEFINED_VALUE, pqCheckBoxValidityGroundSpeedVertical->checkState() == Qt::Unchecked );
381  __poVesselPoint->ApparentCourse.setCourse( __fdApparentBearing, __fdApparentSpeed, __fdApparentSpeedVertical );
382  if( pqCheckBoxValidityApparentBearing->checkState() != Qt::PartiallyChecked )
383  __poVesselPoint->ApparentCourseValidity.setValidityBearing( __fdSystemTime, CDataCourseValidity::UNDEFINED_VALUE, pqCheckBoxValidityApparentBearing->checkState() == Qt::Unchecked );
384  if( pqCheckBoxValidityApparentSpeed->checkState() != Qt::PartiallyChecked )
385  __poVesselPoint->ApparentCourseValidity.setValiditySpeed( __fdSystemTime, CDataCourseValidity::UNDEFINED_VALUE, pqCheckBoxValidityApparentSpeed->checkState() == Qt::Unchecked );
386  if( pqCheckBoxValidityApparentSpeedVertical-> checkState() != Qt::PartiallyChecked )
388  // ... type
389  __poVesselPoint->setType( pqLineEditType->text() );
390  // ... description
391  __poVesselPoint->setDescription( pqTextEditDescription->toPlainText() );
392  // ... comment
393  __poVesselPoint->setComment( pqTextEditComment->toPlainText() );
394  // ... symbol
395  __poVesselPoint->setSymbol( pqLineEditSymbol->text() );
396  // ... url
397  __poVesselPoint->setUrl( pqLineEditUrl->text() );
398  // ... track recording
399  __poVesselPoint->setTrackRecordRate( pqSpinBoxTrackRecordRate->value() );
400 
401  // Done
402  QDialog::accept();
403 }
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.
double getSpeedVertical() const
Returns this course's vertical speed, in meters per second.
static constexpr double UNDEFINED_BEARING
Specific value for an undefined bearing.
Definition: CDataCourse.hpp:42
static constexpr double UNDEFINED_SPEED
Specific value for an undefined speed.
Definition: CDataCourse.hpp:44
void setCourse(double _fdBearing, double _fdSpeed, double _fdSpeedVertical=UNDEFINED_SPEED)
Sets course values.
Definition: CDataCourse.cpp:72
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.
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.
double getLatitude() const
Returns this position's latitude, in degrees.
static const CDataPosition UNDEFINED
Specific value for an undefined position.
static constexpr double UNDEFINED_LONGITUDE
Specific value for an undefined longitude.
void setPosition(double _fdLongitude, double _fdLatitude, double _fdElevation=UNDEFINED_ELEVATION)
Sets new coordinates.
static constexpr double UNDEFINED_ELEVATION
Specific value for an undefined elevation.
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.
Definition: CDataTime.cpp:60
double getTime() const
Returns this time's time, in seconds from Unix epoch.
Definition: CDataTime.hpp:89
static constexpr double UNDEFINED_TIME
Specific value for an undefined time.
Definition: CDataTime.hpp:44
static constexpr double UNDEFINED_VALUE
void parseError(const QString &_rqsString)
Displays a generic error message for an invalid parsing operation.
[UI] Generic overlay object's edit view
const COverlayObject * poOverlayObject
Overlay object being edited.
QString getName() const
Returns this object's name.
static double fromString(const QString &_rqString, EUnit _eUnit=UNDEFINED, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
static QString toString(double _fdValue, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static QString toString(double _fdValue, CUnitTimeZone::EUnit _eUnitTimeZone, EUnit _eUnit)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
Definition: CUnitDate.cpp:71
static double fromString(const QString &_rqString, CUnitTimeZone::EUnit _eUnitTimeZone, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
Definition: CUnitDate.cpp:99
static QString toString(double _fdValue, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static double fromString(const QString &_rqString, EUnit _eUnit=UNDEFINED, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
static QString toString(double _fdValue, EType _eType, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static double fromString(const QString &_rqString, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
static double fromString(const QString &_rqString, EUnit _eUnit, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
static QString toString(double _fdValue, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static QString toString(double _fdValue, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
Definition: CUnitSpeed.cpp:78
static double fromString(const QString &_rqString, EUnit _eUnit, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
Definition: CUnitSpeed.cpp:96
static double fromString(const QString &_rqString, double _fdDate, CUnitTimeZone::EUnit _eUnitTimeZone, bool *_pbOK=0)
Returns the numeric value corresponding (parsed) from the string.
Definition: CUnitTime.cpp:122
static QString toString(double _fdValue, CUnitTimeZone::EUnit _eUnitTimeZone, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
Definition: CUnitTime.cpp:79
@ NAME
Vessel name.
QCheckBox * pqCheckBoxValidityApparentBearing
[UI:CheckBox] Apparent bearing validity
QLineEdit * pqLineEditType
[UI:LineEdit] Type
QLineEdit * pqLineEditGroundSpeedVertical
[UI:LineEdit] Ground vertical speed
QLineEdit * pqLineEditGroundBearing
[UI:LineEdit] Ground bearing
QLineEdit * pqLineEditApparentBearing
[UI:LineEdit] Apparent bearing
QCheckBox * pqCheckBoxValidityGroundSpeed
[UI:CheckBox] Ground horizontal speed validity
QCheckBox * pqCheckBoxValidityTime
[UI:CheckBox] Time validity
QCheckBox * pqCheckBoxValidityApparentSpeed
[UI:CheckBox] Apparent horizontal speed validity
CVesselPointEditView(CVesselPoint *_poVesselPoint)
QLineEdit * pqLineEditSymbol
[UI:LineEdit] Symbol
QCheckBox * pqCheckBoxValidityPosition
[UI:CheckBox] Position validity
QCheckBox * pqCheckBoxValidityElevation
[UI:CheckBox] Elevation validity
QLineEdit * pqLineEditTime
[UI:LineEdit] Time
QCheckBox * pqCheckBoxValidityGroundSpeedVertical
[UI:CheckBox] Ground vertical speed validity
QLineEdit * pqLineEditName
[UI:LineEdit] Name
QLineEdit * pqLineEditLatitude
[UI:LineEdit] Latitude
QCheckBox * pqCheckBoxValidityApparentSpeedVertical
[UI:CheckBox] Apparent vertical speed validity
QLineEdit * pqLineEditUrl
[UI:LineEdit] URL
QCheckBox * pqCheckBoxValidityGroundBearing
[UI:CheckBox] Ground bearing validity
void constructLayout()
Constructs the layout of the user-interface.
QTextEdit * pqTextEditComment
[UI:TextEdit] Comment
QLineEdit * pqLineEditApparentSpeed
[UI:LineEdit] Apparent horizontal speed
QLineEdit * pqLineEditGroundSpeed
[UI:LineEdit] Ground horizontal speed
QSpinBox * pqSpinBoxTrackRecordRate
[UI:SpinBox] Track recroding rate
QLineEdit * pqLineEditApparentSpeedVertical
[UI:LineEdit] Apparent vertical speed
QTextEdit * pqTextEditDescription
[UI:TextEdit] Description
QLineEdit * pqLineEditElevation
[UI:LineEdit] Elevation
QLineEdit * pqLineEditDate
[UI:LineEdit] Date
QLineEdit * pqLineEditLongitude
[UI:LineEdit] Longitude
[UI] Vessel overlay point (item) / vessel
void setType(const QString &_rqsType)
Sets this vessel's type.
QString getSymbol() const
Returns this vessel's symbol.
void setDescription(const QString &_rqsDescription)
Sets this vessel's description.
QString getComment() const
Returns this vessel's comment.
QString getUrl() const
Returns this vessel's URL.
int getTrackRecordRate()
Returns this vessel's track recording rate, in seconds.
void setComment(const QString &_rqsComment)
Sets this vessel's comment.
void setUrl(const QString &_rqsUrl)
Sets this vessel's URL.
void setTrackRecordRate(int _iTrackRecordRate)
Sets this vessel's track recording rate, in seconds.
QString getDescription() const
Returns this vessel's description.
QString getType() const
Returns this vessel's type.
void setSymbol(const QString &_rqsSymbol)
Sets this vessel's symbol.
static CMainWindow * useMainWindow()
double microtime()
Returns the system time with microseconds resolution, in seconds.
Definition: main.cpp:30