All Classes Files Functions Enumerations Enumerator Macros
qfi_PFD.h
Go to the documentation of this file.
/***************************************************************************/
#ifndef QFI_PFD_H
#define QFI_PFD_H
#include <QGraphicsView>
#include <QGraphicsSvgItem>
class qfi_PFD : public QGraphicsView
{
Q_OBJECT
public:
enum PressureUnit
{
STD = 0,
MB,
IN
};
explicit qfi_PFD( QWidget *parent = 0 );
~qfi_PFD();
void reinit();
void update();
inline void setRoll( float roll )
{
m_adi->setRoll( roll );
}
inline void setPitch( float pitch )
{
m_adi->setPitch( pitch );
}
inline void setFlightPathMarker( float aoa, float sideslip, bool visible = true )
{
m_adi->setFlightPathMarker( aoa, sideslip, visible );
}
inline void setSlipSkid( float slipSkid )
{
m_adi->setSlipSkid( slipSkid );
}
inline void setTurnRate( float turnRate )
{
m_adi->setTurnRate( turnRate );
}
inline void setBarH( float barH, bool visible = true )
{
m_adi->setBarH( barH, visible );
}
inline void setBarV( float barV, bool visible = true )
{
m_adi->setBarV( barV, visible );
}
inline void setDotH( float dotH, bool visible = true )
{
m_adi->setDotH( dotH, visible );
}
inline void setDotV( float dotV, bool visible = true )
{
m_adi->setDotV( dotV, visible );
}
inline void setAltitude( float altitude )
{
m_alt->setAltitude( altitude );
}
inline void setPressure( float pressure, PressureUnit pressureUnit )
{
m_alt->setPressure( pressure, pressureUnit );
}
inline void setAirspeed( float airspeed )
{
m_asi->setAirspeed( airspeed );
}
inline void setMachNo( float machNo )
{
m_asi->setMachNo( machNo );
}
inline void setHeading( float heading )
{
m_hsi->setHeading( heading );
}
inline void setClimbRate( float climbRate )
{
m_vsi->setClimbRate( climbRate );
}
protected:
void resizeEvent( QResizeEvent *event );
private:
class ADI
{
public:
ADI( QGraphicsScene *scene );
void init( float scaleX, float scaleY );
void update( float scaleX, float scaleY );
void setRoll( float roll );
void setPitch( float pitch );
void setFlightPathMarker( float aoa, float sideslip, bool visible = true );
void setSlipSkid( float slipSkid );
void setTurnRate( float turnRate );
void setBarH( float barH, bool visible = true );
void setBarV( float barV, bool visible = true );
void setDotH( float dotH, bool visible = true );
void setDotV( float dotV, bool visible = true );
private:
QGraphicsScene *m_scene;
QGraphicsSvgItem *m_itemBack;
QGraphicsSvgItem *m_itemLadd;
QGraphicsSvgItem *m_itemRoll;
QGraphicsSvgItem *m_itemSlip;
QGraphicsSvgItem *m_itemTurn;
QGraphicsSvgItem *m_itemPath;
QGraphicsSvgItem *m_itemMark;
QGraphicsSvgItem *m_itemBarH;
QGraphicsSvgItem *m_itemBarV;
QGraphicsSvgItem *m_itemDotH;
QGraphicsSvgItem *m_itemDotV;
QGraphicsSvgItem *m_itemMask;
QGraphicsSvgItem *m_itemScaleH;
QGraphicsSvgItem *m_itemScaleV;
float m_roll;
float m_pitch;
float m_angleOfAttack;
float m_sideslipAngle;
float m_slipSkid;
float m_turnRate;
float m_barH;
float m_barV;
float m_dotH;
float m_dotV;
bool m_pathValid;
bool m_pathVisible;
bool m_barHVisible;
bool m_barVVisible;
bool m_dotHVisible;
bool m_dotVVisible;
float m_laddDeltaX_new;
float m_laddDeltaX_old;
float m_laddBackDeltaX_new;
float m_laddBackDeltaX_old;
float m_laddBackDeltaY_new;
float m_laddBackDeltaY_old;
float m_laddDeltaY_new;
float m_laddDeltaY_old;
float m_slipDeltaX_new;
float m_slipDeltaX_old;
float m_slipDeltaY_new;
float m_slipDeltaY_old;
float m_turnDeltaX_new;
float m_turnDeltaX_old;
float m_pathDeltaX_new;
float m_pathDeltaX_old;
float m_pathDeltaY_new;
float m_pathDeltaY_old;
float m_markDeltaX_new;
float m_markDeltaX_old;
float m_markDeltaY_new;
float m_markDeltaY_old;
float m_barHDeltaX_new;
float m_barHDeltaX_old;
float m_barVDeltaY_new;
float m_barVDeltaY_old;
float m_dotHDeltaX_new;
float m_dotHDeltaX_old;
float m_dotVDeltaY_new;
float m_dotVDeltaY_old;
float m_scaleX;
float m_scaleY;
const float m_originalPixPerDeg;
const float m_deltaLaddBack_max;
const float m_deltaLaddBack_min;
const float m_maxSlipDeflection;
const float m_maxTurnDeflection;
const float m_maxBarsDeflection;
const float m_maxDotsDeflection;
QPointF m_originalAdiCtr;
QPointF m_originalBackPos;
QPointF m_originalLaddPos;
QPointF m_originalRollPos;
QPointF m_originalSlipPos;
QPointF m_originalTurnPos;
QPointF m_originalPathPos;
QPointF m_originalBarHPos;
QPointF m_originalBarVPos;
QPointF m_originalDotHPos;
QPointF m_originalDotVPos;
QPointF m_originalScaleHPos;
QPointF m_originalScaleVPos;
const int m_backZ;
const int m_laddZ;
const int m_rollZ;
const int m_slipZ;
const int m_pathZ;
const int m_barsZ;
const int m_dotsZ;
const int m_scalesZ;
const int m_maskZ;
const int m_turnZ;
void reset();
void updateLadd( float delta, float sinRoll, float cosRoll );
void updateLaddBack( float delta, float sinRoll, float cosRoll );
void updateRoll();
void updateSlipSkid( float sinRoll, float cosRoll );
void updateTurnRate();
void updateFlightPath();
void updateBars();
void updateDots();
};
class ALT
{
public:
ALT( QGraphicsScene *scene );
void init( float scaleX, float scaleY );
void update( float scaleX, float scaleY );
void setAltitude( float altitude );
void setPressure( float pressure, int pressureUnit );
private:
QGraphicsScene *m_scene;
QGraphicsSvgItem *m_itemBack;
QGraphicsSvgItem *m_itemScale1;
QGraphicsSvgItem *m_itemScale2;
QGraphicsTextItem *m_itemLabel1;
QGraphicsTextItem *m_itemLabel2;
QGraphicsTextItem *m_itemLabel3;
QGraphicsSvgItem *m_itemGround;
QGraphicsSvgItem *m_itemFrame;
QGraphicsTextItem *m_itemAltitude;
QGraphicsTextItem *m_itemPressure;
QColor m_frameTextColor;
QColor m_pressTextColor;
QColor m_labelsColor;
QFont m_frameTextFont;
QFont m_labelsFont;
float m_altitude;
float m_pressure;
int m_pressureUnit;
float m_scale1DeltaY_new;
float m_scale1DeltaY_old;
float m_scale2DeltaY_new;
float m_scale2DeltaY_old;
float m_groundDeltaY_new;
float m_groundDeltaY_old;
float m_labelsDeltaY_new;
float m_labelsDeltaY_old;
float m_scaleX;
float m_scaleY;
const float m_originalPixPerAlt;
const float m_originalScaleHeight;
const float m_originalLabelsX;
const float m_originalLabel1Y;
const float m_originalLabel2Y;
const float m_originalLabel3Y;
QPointF m_originalBackPos;
QPointF m_originalScale1Pos;
QPointF m_originalScale2Pos;
QPointF m_originalGroundPos;
QPointF m_originalFramePos;
QPointF m_originalAltitudeCtr;
QPointF m_originalPressureCtr;
const int m_backZ;
const int m_scaleZ;
const int m_labelsZ;
const int m_groundZ;
const int m_frameZ;
const int m_frameTextZ;
void reset();
void updateAltitude();
void updatePressure();
void updateScale();
void updateScaleLabels();
};
class ASI
{
public:
ASI( QGraphicsScene *scene );
void init( float scaleX, float scaleY );
void update( float scaleX, float scaleY );
void setAirspeed( float airspeed );
void setMachNo( float machNo );
private:
QGraphicsScene *m_scene;
QGraphicsSvgItem *m_itemBack;
QGraphicsSvgItem *m_itemScale1;
QGraphicsSvgItem *m_itemScale2;
QGraphicsTextItem *m_itemLabel1;
QGraphicsTextItem *m_itemLabel2;
QGraphicsTextItem *m_itemLabel3;
QGraphicsTextItem *m_itemLabel4;
QGraphicsTextItem *m_itemLabel5;
QGraphicsTextItem *m_itemLabel6;
QGraphicsTextItem *m_itemLabel7;
QGraphicsSvgItem *m_itemFrame;
QGraphicsTextItem *m_itemAirspeed;
QGraphicsTextItem *m_itemMachNo;
QColor m_frameTextColor;
QColor m_labelsColor;
QFont m_frameTextFont;
QFont m_labelsFont;
float m_airspeed;
float m_machNo;
float m_scale1DeltaY_new;
float m_scale1DeltaY_old;
float m_scale2DeltaY_new;
float m_scale2DeltaY_old;
float m_labelsDeltaY_new;
float m_labelsDeltaY_old;
float m_scaleX;
float m_scaleY;
const float m_originalPixPerSpd;
const float m_originalScaleHeight;
const float m_originalLabelsX;
const float m_originalLabel1Y;
const float m_originalLabel2Y;
const float m_originalLabel3Y;
const float m_originalLabel4Y;
const float m_originalLabel5Y;
const float m_originalLabel6Y;
const float m_originalLabel7Y;
QPointF m_originalBackPos;
QPointF m_originalScale1Pos;
QPointF m_originalScale2Pos;
QPointF m_originalFramePos;
QPointF m_originalAirspeedCtr;
QPointF m_originalMachNoCtr;
const int m_backZ;
const int m_scaleZ;
const int m_labelsZ;
const int m_frameZ;
const int m_frameTextZ;
void reset();
void updateAirspeed();
void updateScale();
void updateScaleLabels();
};
class HSI
{
public:
HSI( QGraphicsScene *scene );
void init( float scaleX, float scaleY );
void update( float scaleX, float scaleY );
void setHeading( float heading );
private:
QGraphicsScene *m_scene;
QGraphicsSvgItem *m_itemBack;
QGraphicsSvgItem *m_itemFace;
QGraphicsSvgItem *m_itemMarks;
QGraphicsTextItem *m_itemFrameText;
QColor m_frameTextColor;
QFont m_frameTextFont;
float m_heading;
float m_scaleX;
float m_scaleY;
QPointF m_originalHsiCtr;
QPointF m_originalBackPos;
QPointF m_originalFacePos;
QPointF m_originalMarksPos;
QPointF m_originalFrameTextCtr;
const int m_backZ;
const int m_faceZ;
const int m_marksZ;
const int m_frameTextZ;
void reset();
void updateHeading();
};
class VSI
{
public:
VSI( QGraphicsScene *scene );
void init( float scaleX, float scaleY );
void update( float scaleX, float scaleY );
void setClimbRate( float climbRate );
private:
QGraphicsScene *m_scene;
QGraphicsSvgItem *m_itemScale;
QGraphicsSvgItem *m_itemArrow;
float m_climbRate;
float m_arrowDeltaY_new;
float m_arrowDeltaY_old;
float m_scaleX;
float m_scaleY;
const float m_originalMarkeHeight;
const float m_originalPixPerSpd1;
const float m_originalPixPerSpd2;
const float m_originalPixPerSpd4;
QPointF m_originalScalePos;
QPointF m_originalArrowPos;
const int m_scaleZ;
const int m_arrowZ;
void reset();
void updateVSI();
};
QGraphicsScene *m_scene;
ADI *m_adi;
ALT *m_alt;
ASI *m_asi;
HSI *m_hsi;
VSI *m_vsi;
QGraphicsSvgItem *m_itemBack;
QGraphicsSvgItem *m_itemMask;
float m_scaleX;
float m_scaleY;
const int m_originalHeight;
const int m_originalWidth;
const int m_backZ;
const int m_maskZ;
void init();
void reset();
void updateView();
};
#endif // QFI_PFD_H
qfi_PFD::setFlightPathMarker
void setFlightPathMarker(float aoa, float sideslip, bool visible=true)
Definition: qfi_PFD.h:101
qfi_PFD::resizeEvent
void resizeEvent(QResizeEvent *event)
Definition: qfi_PFD.cpp:151
qfi_PFD::~qfi_PFD
~qfi_PFD()
Definition: qfi_PFD.cpp:112
qfi_PFD::setAltitude
void setAltitude(float altitude)
Definition: qfi_PFD.h:153
qfi_PFD::setPitch
void setPitch(float pitch)
Definition: qfi_PFD.h:92
qfi_PFD::reinit
void reinit()
Definition: qfi_PFD.cpp:132
qfi_PFD
Definition: qfi_PFD.h:59
qfi_PFD::setBarH
void setBarH(float barH, bool visible=true)
Definition: qfi_PFD.h:123
qfi_PFD::setRoll
void setRoll(float roll)
Definition: qfi_PFD.h:86
qfi_PFD::MB
milibars
Definition: qfi_PFD.h:69
qfi_PFD::setDotH
void setDotH(float dotH, bool visible=true)
Definition: qfi_PFD.h:139
qfi_PFD::setTurnRate
void setTurnRate(float turnRate)
Definition: qfi_PFD.h:115
qfi_PFD::setPressure
void setPressure(float pressure, PressureUnit pressureUnit)
Definition: qfi_PFD.h:161
qfi_PFD::setAirspeed
void setAirspeed(float airspeed)
Definition: qfi_PFD.h:167
qfi_PFD::setClimbRate
void setClimbRate(float climbRate)
Definition: qfi_PFD.h:185
qfi_PFD::setHeading
void setHeading(float heading)
Definition: qfi_PFD.h:179
qfi_PFD::setMachNo
void setMachNo(float machNo)
Definition: qfi_PFD.h:173
qfi_PFD::update
void update()
Definition: qfi_PFD.cpp:144
qfi_PFD::setBarV
void setBarV(float barV, bool visible=true)
Definition: qfi_PFD.h:131
qfi_PFD::STD
standard (displays STD instead of numerical value)
Definition: qfi_PFD.h:68
qfi_PFD::PressureUnit
PressureUnit
Definition: qfi_PFD.h:66
qfi_PFD::setDotV
void setDotV(float dotV, bool visible=true)
Definition: qfi_PFD.h:147
qfi_PFD::IN
inches of mercury
Definition: qfi_PFD.h:70
qfi_PFD::qfi_PFD
qfi_PFD(QWidget *parent=0)
Definition: qfi_PFD.cpp:71
qfi_PFD::setSlipSkid
void setSlipSkid(float slipSkid)
Definition: qfi_PFD.h:107