This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
YASMIN/ui/debug/PlotGPS.cpp
k-a-z-u bb974d3871 added c++11 fixes
removed old components
disabled activity (for compiling reasons)
added wifi 2.4ghz hack
2018-07-11 13:23:18 +02:00

39 lines
838 B
C++

#include "../misc/fixc11.h"
#include "PlotGPS.h"
#include <QPainter>
PlotGPS::PlotGPS(QWidget *parent) : QWidget(parent) {
setMinimumWidth(32);
setMinimumHeight(96);
}
void PlotGPS::add(const Timestamp ts, const GPSData& data) {
(void) ts;
this->gpsData = data;
}
void PlotGPS::paintEvent(QPaintEvent* evt) {
(void) evt;
QPainter p(this);
// frame
p.fillRect(0,0,width(),height(),QColor(255,255,255,192));
p.setPen(Qt::black);
p.drawRect(0,0,width()-1,height()-1);
// turn [relative]
const QPen pen(Qt::black);
p.setPen(pen);
p.drawText(4, 1*12, QString::number(gpsData.tsReceived.ms()));
p.drawText(4, 2*12, QString::number(gpsData.lat));
p.drawText(4, 3*12, QString::number(gpsData.lon));
p.drawText(4, 4*12, QString::number(gpsData.alt));
p.drawText(4, 5*12, QString::number(gpsData.accuracy));
p.end();
}