Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef QGCXYPLOT_H
#define QGCXYPLOT_H
#include "QGCToolWidgetItem.h"
#include "MainWindow.h"
namespace Ui
{
class QGCXYPlot;
}
class UASInterface;
class QwtPlot;
class XYPlotCurve;
class QGCXYPlot : public QGCToolWidgetItem
{
Q_OBJECT
public:
explicit QGCXYPlot(QWidget *parent = 0);
~QGCXYPlot();
virtual void setEditMode(bool editMode);
public slots:
void writeSettings(QSettings& settings);
void readSettings(const QSettings& settings);
void readSettings(const QString& pre,const QVariantMap& settings);
void appendData(int uasId, const QString& curve, const QString& unit, const QVariant& variant, quint64 usec);
void clearPlot();
void styleChanged(MainWindow::QGC_MAINWINDOW_STYLE style);
void updateMinMaxSettings();
private:
Ui::QGCXYPlot *ui;
QwtPlot *plot;
XYPlotCurve* xycurve;
int maxElementsToDraw;
double x; /**< Last unused value for the x-coordinate */
quint64 x_timestamp_us; /**< Timestamp that we last recieved a value for x */
bool x_valid; /**< Whether we have recieved an x value but so far no corresponding y value */
double y; /**< Last unused value for the x-coordinate */
quint64 y_timestamp_us; /**< Timestamp that we last recieved a value for x */
bool y_valid; /**< Whether we have recieved an x value but so far no corresponding y value */
int max_timestamp_diff_us; /**< Only combine x and y to a data point if the timestamp for both doesn't differ by more than this */
};
#endif // QGCXYPLOT_H