Qt Virtual Chart Table (QVCT)
CVesselCockpitGeneralAviation.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 <QGridLayout>
21 #include <QDockWidget>
22 #include <QPalette>
23 #include <QPointF>
24 #include <QSizeF>
25 #include <QWidget>
26 
27 // QVCT
28 #include "QVCTRuntime.hpp"
36 
37 
38 //------------------------------------------------------------------------------
39 // CONSTRUCTORS / DESTRUCTOR
40 //------------------------------------------------------------------------------
41 
43  : CVesselCockpit( "QVCT - "+tr("General Aviation Cockpit"), _pqParent )
44 {
45  QPalette __qPalette( QWidget::palette() );
46  __qPalette.setColor( QPalette::Background, Qt::black );
47  QWidget::setPalette( __qPalette );
48  QWidget::setAutoFillBackground(true);
50  QWidget::resize( 600, 400 );
51 }
52 
54 {
55  // Add instruments
56  poSpeed = new CInstrumentGASpeed( this );
57  pqGridLayout->addWidget( poSpeed, 1, 1 );
59  pqGridLayout->addWidget( poArtificialHorizon, 1, 2 );
60  poAltimeter = new CInstrumentGAAltimeter( this );
61  pqGridLayout->addWidget( poAltimeter, 1, 3 );
63  pqGridLayout->addWidget( poChronograph, 2, 1 );
65  pqGridLayout->addWidget( poHorizontalSituation, 2, 2 );
67  pqGridLayout->addWidget( poSpeedVertical, 2, 3 );
68 }
69 
70 //------------------------------------------------------------------------------
71 // METHODS: CVesselWidget (implement/override)
72 //------------------------------------------------------------------------------
73 
75 {
76  if( !QWidget::isVisible() ) return;
77  if( poVesselPoint )
78  {
79  poSpeed->update();
80  poArtificialHorizon->update();
81  poAltimeter->update();
82  poHorizontalSituation->update();
83  poSpeedVertical->update();
84  }
85  poChronograph->update();
86 }
87 
89 {
90  poSpeed->update();
91  poArtificialHorizon->update();
92  poAltimeter->update();
93  poChronograph->update();
94  poHorizontalSituation->update();
95  poSpeedVertical->update();
96 }
General aviation altimeter (instrument)
General aviation artificial horizon / AH (instrument)
General aviation chronograph (instrument)
General aviation horizontal situation indicator / HSI (instrument)
General aviation vertical speed (instrument)
General aviation speed (instrument)
CInstrumentGAAltimeter * poAltimeter
Instrument: altimeter (ALT)
void constructLayout()
Constructs the layout of the user-interface.
CInstrumentGAHorizontalSituation * poHorizontalSituation
Instrument: horizontal situation indicator (HSI)
CInstrumentGAChronograph * poChronograph
Instrument: chronograph (TIME)
virtual void refreshContent()
Refreshes the content of the underlying widget.
CInstrumentGASpeedVertical * poSpeedVertical
Instrument: vertical speed indicator (VSI)
virtual void resetContent()
Resets (clears) the content of the underlying widget.
CInstrumentGAArtificialHorizon * poArtificialHorizon
Instrument: artificial horizon (AH)
CInstrumentGASpeed * poSpeed
Instrument: horizontal speed indicator (GS)
[UI] Generic vessel's cockpit view (window)
CVesselPoint * poVesselPoint
Overlay course being displayed.
QGridLayout * pqGridLayout
[UI:Layout] Layout