added gps support
added compass support added ui elements for gps and compass added support for writing sensor data
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "../sensors/SensorFactory.h"
|
||||
#include "PlotTurns.h"
|
||||
#include "PlotGPS.h"
|
||||
#include "PlotWiFiScan.h"
|
||||
|
||||
#include "../Settings.h"
|
||||
@@ -196,14 +197,17 @@ SensorDataWidget::SensorDataWidget(QWidget* parent) : QWidget(parent) {
|
||||
plotBaro = new PlotBaro(this);
|
||||
plotTurn = new PlotTurns(this);
|
||||
plotWiFi = new PlotWiFiScan(this);
|
||||
plotGPS = new PlotGPS(this);
|
||||
|
||||
// layout setup
|
||||
lay = new QGridLayout(this);
|
||||
lay->addWidget(plotGyro, 0, 0, 1, 4);
|
||||
lay->addWidget(plotAcc, 1, 0, 1, 4);
|
||||
lay->addWidget(plotBaro, 2, 0, 1, 4);
|
||||
|
||||
lay->addWidget(plotTurn, 3, 0, 1, 1);
|
||||
lay->addWidget(plotWiFi, 3, 1, 1, 3);
|
||||
lay->addWidget(plotGPS, 3, 1, 1, 1);
|
||||
lay->addWidget(plotWiFi, 3, 2, 1, 2);
|
||||
|
||||
// lay->setRowStretch(0, 1);
|
||||
// lay->setRowStretch(1, 1);
|
||||
@@ -221,6 +225,8 @@ SensorDataWidget::SensorDataWidget(QWidget* parent) : QWidget(parent) {
|
||||
SensorFactory::get().getTurns().addListener(this);
|
||||
SensorFactory::get().getWiFi().addListener(this);
|
||||
SensorFactory::get().getActivity().addListener(this);
|
||||
SensorFactory::get().getCompass().addListener(this);
|
||||
SensorFactory::get().getGPS().addListener(this);
|
||||
|
||||
}
|
||||
|
||||
@@ -257,6 +263,16 @@ void SensorDataWidget::onSensorData(Sensor<TurnData>* sensor, const Timestamp ts
|
||||
((PlotTurns*)plotTurn)->add(ts, data);
|
||||
}
|
||||
|
||||
void SensorDataWidget::onSensorData(Sensor<CompassData>* sensor, const Timestamp ts, const CompassData& data) {
|
||||
(void) sensor;
|
||||
((PlotTurns*)plotTurn)->add(ts, data);
|
||||
}
|
||||
|
||||
void SensorDataWidget::onSensorData(Sensor<GPSData>* sensor, const Timestamp ts, const GPSData& data) {
|
||||
(void) sensor;
|
||||
((PlotGPS*)plotGPS)->add(ts, data);
|
||||
}
|
||||
|
||||
void SensorDataWidget::onSensorData(Sensor<WiFiMeasurements>* sensor, const Timestamp ts, const WiFiMeasurements& data) {
|
||||
(void) sensor;
|
||||
((PlotWiFiScan*)plotWiFi)->add(ts, data);
|
||||
|
||||
Reference in New Issue
Block a user