20 #include <QHBoxLayout>
22 #include <QPushButton>
23 #include <QScrollArea>
24 #include <QStackedWidget>
25 #include <QVBoxLayout>
43 , bIgnoreUpdate( true )
103 pqPushButtonAddDevice->setToolTip( tr(
"Create a new device to slave this vessel's position and course") );
109 QVBoxLayout* __pqVBoxLayout =
new QVBoxLayout();
113 __qFontHeader.setPixelSize( 16 );
114 __qFontHeader.setBold(
true );
115 QHBoxLayout* __pqHBoxLayoutHeader =
new QHBoxLayout();
116 QLabel* __pqLabelIcon =
new QLabel();
117 __pqLabelIcon->setPixmap( QPixmap(
":icons/32x32/vessel_point.png" ) );
118 __pqLabelIcon->setToolTip( tr(
"Vessel") );
119 __pqHBoxLayoutHeader->addWidget( __pqLabelIcon, 0, Qt::AlignTop );
124 __pqHBoxLayoutHeader->addWidget(
poTextName, 1 );
129 __pqVBoxLayout->addLayout( __pqHBoxLayoutHeader );
133 QTabWidget* __poTabWidget =
new QTabWidget();
134 __poTabWidget->setTabPosition( QTabWidget::South );
135 __poTabWidget->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
138 QWidget* __poWidgetPosition =
new QWidget();
139 QVBoxLayout* __pqVBoxLayoutPosition =
new QVBoxLayout();
140 __qFontData.setPixelSize( 20 );
162 __poWidgetPosition->setLayout( __pqVBoxLayoutPosition );
163 __poTabWidget->addTab( __poWidgetPosition, tr(
"Position") );
166 QWidget* __poWidgetGroundCourse =
new QWidget();
167 QVBoxLayout* __pqVBoxLayoutGroundCourse =
new QVBoxLayout();
168 __qFontData.setPixelSize( 20 );
190 __poWidgetGroundCourse->setLayout( __pqVBoxLayoutGroundCourse );
191 __poTabWidget->addTab( __poWidgetGroundCourse, tr(
"Ground") );
194 QWidget* __poWidgetApparentCourse =
new QWidget();
195 QVBoxLayout* __pqVBoxLayoutApparentCourse =
new QVBoxLayout();
196 __qFontData.setPixelSize( 20 );
218 __poWidgetApparentCourse->setLayout( __pqVBoxLayoutApparentCourse );
219 __poTabWidget->addTab( __poWidgetApparentCourse, tr(
"Apparent") );
222 QWidget* __poWidgetTime =
new QWidget();
223 QVBoxLayout* __pqVBoxLayoutTime =
new QVBoxLayout();
239 poTextTime2->setToolTip( tr(
"Time (alternate timezone)") );
245 __poWidgetTime->setLayout( __pqVBoxLayoutTime );
246 __poTabWidget->addTab( __poWidgetTime, tr(
"Time") );
249 QScrollArea* __poScrollAreaInfo =
new QScrollArea();
250 __poScrollAreaInfo->setStyleSheet(
".QScrollArea, .QWidget { BACKGROUND-COLOR: rgba(0, 0, 0, 0); BORDER: none; }" );
251 __poScrollAreaInfo->setWidgetResizable(
true );
252 QWidget* __poWidgetInfo =
new QWidget();
253 QVBoxLayout* __pqVBoxLayoutInfo =
new QVBoxLayout();
254 __qFontData.setPixelSize( 12 );
255 __qFontData.setBold(
true );
262 __qFontData.setBold(
false );
270 __qFontData.setPixelSize( 10 );
279 poUrl->setToolTip( tr(
"URL") );
280 poUrl->setFont( __qFontData );
281 poUrl->setIndent( 10 );
282 poUrl->setWordWrap(
true );
284 __pqVBoxLayoutInfo->addWidget(
poUrl, 1 );
285 __poWidgetInfo->setLayout( __pqVBoxLayoutInfo );
286 __poScrollAreaInfo->setWidget( __poWidgetInfo );
287 __poTabWidget->addTab( __poScrollAreaInfo, tr(
"Info") );
290 __pqVBoxLayout->addWidget( __poTabWidget, 1 );
293 QFrame* __pqFrameSeparator =
new QFrame();
294 __pqFrameSeparator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
295 __pqVBoxLayout->addWidget( __pqFrameSeparator );
298 QHBoxLayout* __pqHBoxLayoutButtons =
new QHBoxLayout();
308 __pqVBoxLayout->addLayout( __pqHBoxLayoutButtons );
311 COverlayObjectDetailView::setLayout( __pqVBoxLayout );
326 QString __qsSymbol = __poVesselPoint->
getSymbol();
381 double __fdTime = __poVesselPoint->
getTime();
404 pqPushButtonCenterLock->setIcon( QIcon( __bLocked ?
":icons/32x32/center_lock.png" :
":icons/32x32/center_unlock.png" ) );
405 bool __bDynamic = __poVesselPoint->
isDynamic();
410 pqPushButtonTrackRecord->setIcon( QIcon( __bTrackRecord ?
":icons/32x32/track_start.png" :
":icons/32x32/track_stop.png" ) );
478 bool __bVisible = __poVesselPoint->
isVisible();
480 if( __bVisible != __poVesselPoint->
isVisible() )
540 __pqMutexDataChange->lock();
541 __poVesselContainer->removeChild( __poVesselPoint );
542 __pqMutexDataChange->unlock();
543 delete __poVesselPoint;
544 QTreeWidgetItem* __pqTreeWidgetItem = __poVesselOverlay->currentItem();
545 if( __pqTreeWidgetItem ) __poVesselOverlay->
showDetail( __pqTreeWidgetItem );
558 pqPushButtonTrackRecord->setIcon( QIcon( _bTrackRecord ?
":icons/32x32/track_start.png" :
":icons/32x32/track_stop.png" ) );
567 __poVesselPointDeviceCreateView->exec();
568 if( __poVesselPointDevice )
577 delete __poVesselPointDeviceCreateView;
void setProjectModified()
Sets the status of the project to modified (data have changed and need saving)
void setVesselPointSynchronize(CVesselPoint *_poVesselPoint)
Sets the vessel point used to synchronize the chart reference (geographical) position.
CVesselPoint * getVesselPointSynchronize() const
Returns the vessel defined to synchronize the chart reference (geographical) position.
void updateChart()
Update the (current) chart content (on screen)
void setGeoPosition(const CDataPosition &_roGeoPosition, bool _bSkipCurrent=false)
Sets the reference chart (geographical) position.
void resetVesselPointSynchronize()
Resets (clears) the vessel point used to synchronize the chart reference (geographical) position.
CDataCourse ApparentCourse
Apparent course.
CDataCourse GroundCourse
Ground course.
CDataCourseValidity GroundCourseValidity
Ground course validity.
CDataCourseValidity ApparentCourseValidity
Apparent course validity.
bool isValidSpeedVertical() const
Returns the vertical speed's (global) validity status.
bool isValidSpeed() const
Returns the horizontal speed's (global) validity status.
bool isValidBearing() const
Returns the bearing's (global) validity status.
double getSpeedVertical() const
Returns this course's vertical 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.
double getBearing() const
Returns this course's bearing, in degrees.
double getSpeed() const
Returns this course's horizontal speed, in meters per second.
bool isValidPosition() const
Returns the position's (global) validity status.
bool isValidElevation() const
Returns the elevation's (global) validity status.
double getLongitude() const
Returns this position's longitude, in degrees.
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_ELEVATION
Specific value for an undefined elevation.
bool isValidTime() const
Returns the time's (global) validity status.
double getTime() const
Returns this time's time, in seconds from Unix epoch.
static constexpr double UNDEFINED_TIME
Specific value for an undefined time.
[UI] Application main window
QPixmap symbolPixmap(const QString &_rqsSymbol)
Returns pixmap matching the given symbol (loaded from the application's symbol directory)
bool symbolExists(const QString &_rqsSymbol)
Returns whether the given symbol exists (in the application's symbol directory)
[UI] Generic overlay object's detail view
COverlayObject * poOverlayObject
Overlay object being displayed.
QString getName() const
Returns this object's name.
[UI] Overlay-specific text label
void setText(const QString &_rqsText)
[override] QLabel::setText( const QString& )
void resetText()
Resets (clears) the underlying QLabel's text.
[UI] Overlay-specific URL label
void setText(const QString &_rqsText)
bool isVisible() const
Returns the point's (marker) visibility status.
void forceRedraw()
Forces this overlay's rendering (not matter its cache content)
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...
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, EType _eType, 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...
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, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
void setVesselPoint(CVesselPoint *_poVesselPoint)
Sets the vessel used to synchronize the instruments display.
void resetVesselPoint()
Resets (clears) the vessel used to synchronize the instruments display.
[UI] Vessel overlay container / flotilla
[UI] Vessel overlay container
@ VISIBLE
Vessel visibility status.
virtual void showDetail(const QTreeWidgetItem *_pqTreeWidgetItem) const
Displays the given overlay object's details (in the appropriate widget/view)
QPushButton * pqPushButtonAddDevice
[UI:Button] Add new device
COverlayText * poTextDescription
[UI:Label] Description
COverlayText * poTextApparentSpeed
[UI:Label] Apparent horizontal speed
QPushButton * pqPushButtonTrackRecord
[UI:Button] Track recording status
virtual void disableContent()
Disables the content (controls) of the underlying widget.
COverlayText * poTextDate
[UI:Label] Date
void slotPositionCenterLock(bool _bLock)
[UI:Slot] Slot to enable center lock (on this vessel)
void constructLayout()
Constructs the layout of the user-interface.
QPushButton * pqPushButtonEdit
[UI:Button] Edit
COverlayText * poTextApparentSpeedVertical
[UI:Label] Apparent vertical speed
COverlayUrl * poUrl
[UI:Label] URL
void slotTrackRecord(bool _bTrackRecord)
[UI:Slot] Slot to switch track recording status
COverlayText * poTextName
[UI:Label] Name
virtual void enableContent()
Enables the content (controls) of the underlying widget.
void slotEdit()
[UI:Slot] Slot to display edit view
QLabel * pqLabelSymbol
[UI:Label] Symbol
void slotToggleVisible()
[UI:Slot] Slot to modify the visibility status
COverlayText * poTextGroundBearing
[UI:Label] Ground bearing
virtual void resetContent()
Resets (clears) the content of the underlying widget.
COverlayText * poTextLongitude
[UI:Label] Longitude
QPushButton * pqPushButtonCenter
[UI:Button] Center (on chart)
COverlayText * poTextGroundSpeed
[UI:Label] Ground horizontal speed
COverlayText * poTextElevation
[UI:Label] Elevation
COverlayText * poTextTime2
[UI:Label] Time (alternate timezone)
CVesselPointDetailView(QWidget *_pqParent=0)
COverlayText * poTextGroundSpeedVertical
[UI:Label] Ground vertical speed
QPushButton * pqPushButtonCenterLock
[UI:Button] Center (on chart) lock
COverlayText * poTextType
[UI:Label] Type
void slotPositionCenter()
[UI:Slot] Slot to center chart (on item's position)
COverlayText * poTextComment
[UI:Label] Comment
QPushButton * pqPushButtonVisible
[UI:Button] Visibility status
COverlayText * poTextTime
[UI:Label] Time
COverlayText * poTextApparentBearing
[UI:Label] Apparent bearing
bool bIgnoreUpdate
Flag that disables checkable buttons update.
QPushButton * pqPushButtonDelete
[UI:Button] Delete
void slotAddDevice()
[UI:Slot] Slot to add new device
virtual void refreshContent()
Refreshes the content of the underlying widget.
COverlayText * poTextLatitude
[UI:Label] Latitude
void slotDelete()
[UI:Slot] Slot to delete (this item/point)
[UI] Generic overlay object's pick (select) view
virtual void showDetail()
Displays this object's details (in the appropriate widget/view)
bool connectDevice()
Connects to the actual device.
virtual void showEdit()
Displays this object's edit widget/view.
[UI] Vessel overlay point (item) / vessel
bool isDynamic()
Returns whether the vessel is dynamically generated.
QString getSymbol() const
Returns this vessel's symbol.
QString getComment() const
Returns this vessel's comment.
virtual void toggleVisibility()
QString getUrl() const
Returns this vessel's URL.
bool isTrackRecording()
Returns this vessel's track recording status.
virtual COverlay * useOverlay()
Returns this object's (base) overlay.
QString getDescription() const
Returns this vessel's description.
QString getType() const
Returns this vessel's type.
bool setTrackRecord(bool _bTrackRecord)
Sets this vessel's track recording status.
static CVesselPosition * useVesselPosition()
static CVesselCockpit * useVesselCockpit()
static CPointerOverlay * usePointerOverlay()
static CVesselCourse * useVesselCourse()
static CVesselOverlay * useVesselOverlay()
static CVesselTarget * useVesselTarget()
static QMutex * useMutexDataChange()
static CMainWindow * useMainWindow()
static CChartTable * useChartTable()