5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _LOGSDIALOG_H_
22 #define _LOGSDIALOG_H_
26 #include "qcustomplot.h"
28 #define INVALID_MIN 999999
29 #define INVALID_MAX -999999
35 class LogsDialog
: public QDialog
60 struct plotsCollection
{
61 QVarLengthArray
<coords_t
> coords
;
68 explicit LogsDialog(QWidget
*parent
= 0);
72 void titleDoubleClick(QMouseEvent
*evt
, QCPPlotTitle
*title
);
73 void axisLabelDoubleClick(QCPAxis
* axis
, QCPAxis::SelectablePart part
);
74 void legendDoubleClick(QCPLegend
* legend
, QCPAbstractLegendItem
* item
);
75 void selectionChanged();
76 void mousePress(QMouseEvent
* event
);
78 void removeAllGraphs();
80 void on_fileOpen_BT_clicked();
82 void on_sessions_CB_currentIndexChanged(int index
);
83 void on_mapsButton_clicked();
84 void yAxisChangeRanges(QCPRange range
);
87 QList
<QStringList
> csvlog
;
89 QCPAxisRect
*axisRect
;
90 QCPLegend
*rightLegend
;
94 QVarLengthArray
<Qt::GlobalColor
> colors
;
97 double yAxesRatios
[AXES_LIMIT
];
98 minMax_t yAxesRanges
[AXES_LIMIT
];
100 QCPItemTracer
* tracerMaxAlt
;
101 QCPItemTracer
* cursorA
;
102 QCPItemTracer
* cursorB
;
103 QCPItemStraightLine
* cursorLine
;
106 QList
<QStringList
> filterGePoints(const QList
<QStringList
> & input
);
107 void exportToGoogleEarth();
108 QDateTime
getRecordTimeStamp(int index
);
109 QString
generateDuration(const QDateTime
& start
, const QDateTime
& end
);
110 void setFlightSessions();
112 void addMaxAltitudeMarker(const coords_t
& c
, QCPGraph
* graph
);
113 void countNumberOfThrows(const coords_t
& c
, QCPGraph
* graph
);
114 void addCursor(QCPItemTracer
** cursor
, QCPGraph
* graph
, const QColor
& color
);
115 void addCursorLine(QCPItemStraightLine
** line
, QCPGraph
* graph
, const QColor
& color
);
116 void placeCursor(double x
, bool second
);
117 QString
formatTimeDelta(double timeDelta
);
118 void updateCursorsLabel();
123 #endif // _LOGSDIALOG_H_