Qt Virtual Chart Table (QVCT)
CInstrumentGAChronograph.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_CINSTRUMENTGACHRONOGRAPH_HPP
20 #define QVCT_CINSTRUMENTGACHRONOGRAPH_HPP
21 
22 // QT
23 #include <QTransform>
24 #include <QWidget>
25 
26 // QVCT
28 #include "units/CUnitTimeZone.hpp"
29 class CVesselCockpit;
30 
31 
33 
42 {
43 
44  //------------------------------------------------------------------------------
45  // FIELDS
46  //------------------------------------------------------------------------------
47 private:
51  QPixmap qPixmapBuffer;
52 
58  double fdTime;
59 
68 
69 
70  //------------------------------------------------------------------------------
71  // CONSTRUCTORS / DESTRUCTOR
72  //------------------------------------------------------------------------------
73 
74 public:
75  CInstrumentGAChronograph( CVesselCockpit* _poVesselCockpit );
77 
78 
79  //------------------------------------------------------------------------------
80  // METHODS: QWidget (implement/override)
81  //------------------------------------------------------------------------------
82 
83 protected:
84  virtual void mouseReleaseEvent( QMouseEvent* _pqMouseEvent );
85  virtual void mouseDoubleClickEvent( QMouseEvent* _pqMouseEvent );
86 
87 
88  //------------------------------------------------------------------------------
89  // METHODS: CInstrument (implement/override)
90  //------------------------------------------------------------------------------
91 
92  // OTHER
93 private:
94  virtual void draw();
95 
96 
97  //------------------------------------------------------------------------------
98  // METHODS
99  //------------------------------------------------------------------------------
100 
101  // OTHER
102 private:
103  void drawStatic( CUnitTimeZone::EUnit _eUnit );
104  void drawDynamic( CUnitTimeZone::EUnit _eUnit, double _fdTime );
105 
106 };
107 
108 #endif // QVCT_CINSTRUMENTGACHRONOGRAPH_HPP
General aviation chronograph (instrument)
QPixmap qPixmapBufferBackground
Pixmap buffer used to render and cache the instrument's (static) background.
virtual void draw()
Draws the instrument (resets if the vessel is undefined)
double fdSW2TimeStarted
Stop-watch 2 last started time (stopped if 0)
double fdSW2TimeAccumulated
Stop-watch 2 accumulated time.
double fdSW1TimeAccumulated
Stop-watch 1 accumulated time.
QPixmap qPixmapBuffer
Pixmap buffer used to render and cache the instrument.
virtual void mouseReleaseEvent(QMouseEvent *_pqMouseEvent)
double fdSW1TimeStarted
Stop-watch 1 last started time (stopped if 0)
CUnitTimeZone::EUnit eUnit
Unit for which the last rendering was achieved.
void drawStatic(CUnitTimeZone::EUnit _eUnit)
bool bForceRedraw
Forces the redraw of the instrument (not matter its cache content)
void drawDynamic(CUnitTimeZone::EUnit _eUnit, double _fdTime)
CInstrumentGAChronograph(CVesselCockpit *_poVesselCockpit)
double fdTime
Time at which the last rendering was achieved.
virtual void mouseDoubleClickEvent(QMouseEvent *_pqMouseEvent)
Generic instrument.
Definition: CInstrument.hpp:39
EUnit
Format/unit ID.
[UI] Generic vessel's cockpit view (window)