2013-04-28 19:41:15 +02:00
|
|
|
#ifndef MONITORWIDGET_H
|
|
|
|
#define MONITORWIDGET_H
|
2012-08-03 01:11:18 +02:00
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QGraphicsView>
|
|
|
|
#include <QtSvg/QSvgRenderer>
|
|
|
|
#include <QtSvg/QGraphicsSvgItem>
|
|
|
|
#include <QtCore/QPointer>
|
|
|
|
|
2013-12-02 23:47:27 +01:00
|
|
|
class MonitorWidget : public QGraphicsView {
|
|
|
|
Q_OBJECT
|
2012-08-03 01:11:18 +02:00
|
|
|
public:
|
2013-04-28 19:41:15 +02:00
|
|
|
explicit MonitorWidget(QWidget *parent = 0);
|
|
|
|
~MonitorWidget();
|
2012-08-03 01:11:18 +02:00
|
|
|
|
2013-05-19 16:37:30 +02:00
|
|
|
void setMin(double min)
|
|
|
|
{
|
|
|
|
minValue = min;
|
|
|
|
}
|
2013-04-28 19:41:15 +02:00
|
|
|
|
2013-05-19 16:37:30 +02:00
|
|
|
double getMin()
|
|
|
|
{
|
|
|
|
return minValue;
|
|
|
|
}
|
2013-04-28 19:41:15 +02:00
|
|
|
|
2013-05-19 16:37:30 +02:00
|
|
|
void setMax(double max)
|
|
|
|
{
|
|
|
|
maxValue = max;
|
|
|
|
}
|
2013-04-28 19:41:15 +02:00
|
|
|
|
2013-05-19 16:37:30 +02:00
|
|
|
double getMax()
|
|
|
|
{
|
|
|
|
return maxValue;
|
|
|
|
}
|
2012-08-03 01:11:18 +02:00
|
|
|
|
|
|
|
public slots:
|
2013-04-28 19:41:15 +02:00
|
|
|
void telemetryConnected();
|
|
|
|
void telemetryDisconnected();
|
|
|
|
void telemetryUpdated(double txRate, double rxRate);
|
2012-08-03 01:11:18 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void showEvent(QShowEvent *event);
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
|
|
|
|
private:
|
2013-04-28 19:41:15 +02:00
|
|
|
bool connected;
|
|
|
|
|
|
|
|
double minValue;
|
|
|
|
double maxValue;
|
|
|
|
|
2013-05-19 16:37:30 +02:00
|
|
|
QGraphicsSvgItem *graph;
|
2013-04-28 19:41:15 +02:00
|
|
|
|
2013-05-19 16:37:30 +02:00
|
|
|
QPointer<QGraphicsTextItem> txSpeed;
|
|
|
|
QPointer<QGraphicsTextItem> rxSpeed;
|
|
|
|
|
2013-12-02 23:47:27 +01:00
|
|
|
QList<QGraphicsSvgItem *> txNodes;
|
|
|
|
QList<QGraphicsSvgItem *> rxNodes;
|
2013-06-14 00:15:03 +02:00
|
|
|
|
|
|
|
Qt::AspectRatioMode aspectRatioMode;
|
2012-08-03 01:11:18 +02:00
|
|
|
};
|
|
|
|
|
2013-04-28 19:41:15 +02:00
|
|
|
#endif // MONITORWIDGET_H
|