Files
edgetx-gx12/companion/src/logsdialog.h
T
Max PapernoandBertrand Songis f018425e12 [Companion] Qualify all translation strings (#5557)
* [Companion] Qualify all remaining QObject translations with proper class/object names; Centralize some common strings into constants.h.

* [Companion] Replace all instances of some common strings with macros from constants.h.

* [Companion] Fix translation warnings from lupdate.
2017-12-25 13:36:34 +01:00

124 lines
3.1 KiB
C++

/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _LOGSDIALOG_H_
#define _LOGSDIALOG_H_
#include <QtCore>
#include <QDialog>
#include "qcustomplot.h"
#define INVALID_MIN 999999
#define INVALID_MAX -999999
namespace Ui {
class LogsDialog;
}
class LogsDialog : public QDialog
{
Q_OBJECT
enum yaxes_t {
firstLeft = 0,
firstRight,
secondLeft,
secondRight,
AXES_LIMIT // = 4
};
struct coords_t {
QVector<double> x, y;
double min_y;
double max_y;
yaxes_t yaxis;
QString name;
};
struct minMax_t {
double min;
double max;
};
struct plotsCollection {
QVarLengthArray<coords_t> coords;
double min_x;
double max_x;
bool tooManyRanges;
};
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_saveSession_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_t 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_t & c, QCPGraph * graph);
void countNumberOfThrows(const coords_t & 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_