* Added: * max altitude * two cursors for time/altitude measurement * Fix if multiple altitude related telemetry items are selected (only put cursors on the first one)
103 lines
2.3 KiB
C++
103 lines
2.3 KiB
C++
#ifndef _LOGSDIALOG_H_
|
|
#define _LOGSDIALOG_H_
|
|
|
|
#include <QtCore>
|
|
#include <QtGui>
|
|
#include "qcustomplot/qcustomplot.h"
|
|
|
|
#define INVALID_MIN 999999
|
|
#define INVALID_MAX -999999
|
|
|
|
enum yaxes_t {
|
|
firstLeft = 0,
|
|
firstRight,
|
|
secondLeft,
|
|
secondRight,
|
|
AXES_LIMIT // = 4
|
|
};
|
|
|
|
struct coords {
|
|
QVector<double> x, y;
|
|
double min_y;
|
|
double max_y;
|
|
yaxes_t yaxis;
|
|
QString name;
|
|
};
|
|
|
|
struct minMax {
|
|
double min;
|
|
double max;
|
|
};
|
|
|
|
struct plotsCollection {
|
|
QVarLengthArray<struct coords> coords;
|
|
double min_x;
|
|
double max_x;
|
|
bool tooManyRanges;
|
|
};
|
|
|
|
namespace Ui {
|
|
class LogsDialog;
|
|
}
|
|
|
|
class LogsDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit LogsDialog(QWidget *parent = 0);
|
|
~LogsDialog();
|
|
|
|
private slots:
|
|
void titleDoubleClick(QMouseEvent *evt, QCPPlotTitle *title);
|
|
void axisLabelDoubleClick(QCPAxis* axis, QCPAxis::SelectablePart part);
|
|
void legendDoubleClick(QCPLegend* legend, QCPAbstractLegendItem* item);
|
|
void selectionChanged();
|
|
void mousePress(QMouseEvent * event);
|
|
void mouseWheel();
|
|
void removeAllGraphs();
|
|
void plotLogs();
|
|
void on_fileOpen_BT_clicked();
|
|
void on_sessions_CB_currentIndexChanged(int index);
|
|
void on_mapsButton_clicked();
|
|
void yAxisChangeRanges(QCPRange range);
|
|
|
|
private:
|
|
QList<QStringList> csvlog;
|
|
Ui::LogsDialog *ui;
|
|
QCPAxisRect *axisRect;
|
|
QCPLegend *rightLegend;
|
|
bool plotLock;
|
|
QString logFilename;
|
|
|
|
QVarLengthArray<Qt::GlobalColor> colors;
|
|
QPen pen;
|
|
|
|
double yAxesRatios[AXES_LIMIT];
|
|
minMax yAxesRanges[AXES_LIMIT];
|
|
|
|
QCPItemTracer * tracerMaxAlt;
|
|
QCPItemTracer * cursorA;
|
|
QCPItemTracer * cursorB;
|
|
QCPItemStraightLine * cursorLine;
|
|
|
|
bool cvsFileParse();
|
|
QList<QStringList> filterGePoints(const QList<QStringList> & input);
|
|
void exportToGoogleEarth();
|
|
QDateTime getRecordTimeStamp(int index);
|
|
QString generateDuration(const QDateTime & start, const QDateTime & end);
|
|
void setFlightSessions();
|
|
|
|
void addMaxAltitudeMarker(const coords & c, QCPGraph * graph);
|
|
void countNumberOfThrows(const coords & c, QCPGraph * graph);
|
|
void addCursor(QCPItemTracer ** cursor, QCPGraph * graph, const QColor & color);
|
|
void addCursorLine(QCPItemStraightLine ** line, QCPGraph * graph, const QColor & color);
|
|
void placeCursor(double x, bool second);
|
|
QString formatTimeDelta(double timeDelta);
|
|
void updateCursorsLabel();
|
|
|
|
|
|
};
|
|
|
|
#endif // _LOGSDIALOG_H_
|