Updraft  1.0
Open source glider flight visualisation tool.
Updraft::IgcViewer::PlotWidget Class Reference

Widget that shows the plot with flight data. More...

#include <plotwidget.h>

Collaboration diagram for Updraft::IgcViewer::PlotWidget:

List of all members.

Signals

void updateCurrentInfo (const QString &text)
 Sends text statistics of the fix the mouse is pointing at.
void updateText ()
 Send a signal that the vectors with the statistics texts (for points and segments) has been changed.
void fixWasPicked (int index)
 A signal when a user pickes out a fix.
void fixIsPointedAt (int index)
 A signal upon mouse move over fix.
void clearMarkers ()
 A signal when the users clears the picked fixes.

Public Member Functions

 PlotWidget (SegmentInfo *segmentInfo, FixInfo *altitudeInfo, FixInfo *verticalSpeedInfo, FixInfo *groundSpeedInfo)
void addPickedFix (int index)
 A fix of given index was picked.
void addPickedLine (int x)
 User clicked on position x on the graph, and picked one of the fixes that is at that position.
QList< QString > * getSegmentsStatTexts ()
QList< QString > * getPointsStatTexts ()

Private Member Functions

void paintEvent (QPaintEvent *paintEvent)
void mouseMoveEvent (QMouseEvent *mouseEvent)
void mousePressEvent (QMouseEvent *mouseEvent)
void leaveEvent (QEvent *leaveEvent)
void resizeEvent (QResizeEvent *resizeEvent)
QSize sizeHint () const
void redrawGraphPicture ()
QString createPointStatText (int xLine, int fixListIndex)
QString createSegmentStatText (int startPointIndex, int endPointIndex)
void updatePickedTexts (int i)
 Update picked texts when a new fix was added at the position `i` in the `pickedFixes` list.
void resetStats ()
 Resets the statistics to the default version.
QTime getTimeFromSecs (int timeInSecs)
 Create time from secs. The value of secs can be bigger than 24*3600.
int chooseFixIndex (int start, int end)
 Pick out which fix of the fixes at given pixel should be picked out.

Private Attributes

int xLine
 The coordinate to draw the vertical line where the mouse points.
QList< PickDatapickedFixes
 The set of picked fixes.
QList< int > pickedPositions
 Ordered list of the x coordinates of the picked positions.
QList< QString > segmentsStatTexts
 Statistics texts for picked fixes.
QList< QString > pickedFixesStatTexts
 Statistics texts for segments between picked fixes.
QImage * graphPicture
QVector< Label * > labels
PickedLabelpickedLabel
PlotAxesaltitudeAxes
PlotAxesverticalSpeedAxes
PlotAxesgroundSpeedAxes
AltitudePlotPainteraltitudePlotPainter
VerticalSpeedPlotPainterverticalSpeedPlotPainter
GroundSpeedPlotPaintergroundSpeedPlotPainter
SegmentInfosegmentInfo
FixInfoaltitudeInfo
FixInfoverticalSpeedInfo
FixInfogroundSpeedInfo
bool mouseOver
 Whether the mouse if over the graph(!) - not widget.

Static Private Attributes

static const int OFFSET_X = 15
 Offset from the window border.
static const int OFFSET_Y = 10
static const QColor BG_COLOR = QColor(Qt::black)
static const QPen ALTITUDE_PEN = QPen(Qt::red)
static const QPen VERTICAL_SPEED_PEN = QPen(Qt::blue)
static const QPen GROUND_SPEED_PEN = QPen(Qt::yellow)
static const QPen MOUSE_LINE_PEN = QPen(QColor(150, 150, 150))
static const QPen MOUSE_LINE_PICKED_PEN = QPen(QColor(200, 200, 200))

Detailed Description

Widget that shows the plot with flight data.


Constructor & Destructor Documentation

Updraft::IgcViewer::PlotWidget::PlotWidget ( SegmentInfo segmentInfo,
FixInfo altitudeInfo,
FixInfo verticalSpeedInfo,
FixInfo groundSpeedInfo 
)

Member Function Documentation

A fix of given index was picked.

User clicked on position x on the graph, and picked one of the fixes that is at that position.

Which fix is picked if multiple fixes are on that position is decided by the method chooseFixIndex(int start, int end);

int Updraft::IgcViewer::PlotWidget::chooseFixIndex ( int  start,
int  end 
) [private]

Pick out which fix of the fixes at given pixel should be picked out.

A signal when the users clears the picked fixes.

QString Updraft::IgcViewer::PlotWidget::createPointStatText ( int  xLine,
int  fixListIndex 
) [private]
QString Updraft::IgcViewer::PlotWidget::createSegmentStatText ( int  startPointIndex,
int  endPointIndex 
) [private]
void Updraft::IgcViewer::PlotWidget::fixIsPointedAt ( int  index) [signal]

A signal upon mouse move over fix.

void Updraft::IgcViewer::PlotWidget::fixWasPicked ( int  index) [signal]

A signal when a user pickes out a fix.

QTime Updraft::IgcViewer::PlotWidget::getTimeFromSecs ( int  timeInSecs) [private]

Create time from secs. The value of secs can be bigger than 24*3600.

void Updraft::IgcViewer::PlotWidget::leaveEvent ( QEvent *  leaveEvent) [private]
void Updraft::IgcViewer::PlotWidget::mouseMoveEvent ( QMouseEvent *  mouseEvent) [private]
void Updraft::IgcViewer::PlotWidget::mousePressEvent ( QMouseEvent *  mouseEvent) [private]
void Updraft::IgcViewer::PlotWidget::paintEvent ( QPaintEvent *  paintEvent) [private]

Resets the statistics to the default version.

void Updraft::IgcViewer::PlotWidget::resizeEvent ( QResizeEvent *  resizeEvent) [private]
QSize Updraft::IgcViewer::PlotWidget::sizeHint ( ) const [private]
void Updraft::IgcViewer::PlotWidget::updateCurrentInfo ( const QString &  text) [signal]

Sends text statistics of the fix the mouse is pointing at.

Update picked texts when a new fix was added at the position `i` in the `pickedFixes` list.

Send a signal that the vectors with the statistics texts (for points and segments) has been changed.


Member Data Documentation

const QPen Updraft::IgcViewer::PlotWidget::ALTITUDE_PEN = QPen(Qt::red) [static, private]
const QColor Updraft::IgcViewer::PlotWidget::BG_COLOR = QColor(Qt::black) [static, private]
const QPen Updraft::IgcViewer::PlotWidget::GROUND_SPEED_PEN = QPen(Qt::yellow) [static, private]
const QPen Updraft::IgcViewer::PlotWidget::MOUSE_LINE_PEN = QPen(QColor(150, 150, 150)) [static, private]
const QPen Updraft::IgcViewer::PlotWidget::MOUSE_LINE_PICKED_PEN = QPen(QColor(200, 200, 200)) [static, private]

Whether the mouse if over the graph(!) - not widget.

const int Updraft::IgcViewer::PlotWidget::OFFSET_X = 15 [static, private]

Offset from the window border.

const int Updraft::IgcViewer::PlotWidget::OFFSET_Y = 10 [static, private]

The set of picked fixes.

Statistics texts for segments between picked fixes.

Ordered list of the x coordinates of the picked positions.

Statistics texts for picked fixes.

const QPen Updraft::IgcViewer::PlotWidget::VERTICAL_SPEED_PEN = QPen(Qt::blue) [static, private]

The coordinate to draw the vertical line where the mouse points.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines