#ifndef SENSORDATAWIDGET_H
#define SENSORDATAWIDGET_H

#include "../misc/fixc11.h"
#include "plot/PlottWidget.h"

#include <QWidget>

#include "../sensors/AccelerometerSensor.h"
#include "../sensors/GyroscopeSensor.h"
#include "../sensors/BarometerSensor.h"
#include "../sensors/StepSensor.h"
#include "../sensors/TurnSensor.h"
#include "../sensors/WiFiSensor.h"
#include "../sensors/ActivitySensor.h"

class PlotWidget;
class QGridLayout;

/** debug display for sensor data */
class SensorDataWidget :
		public QWidget,
		public SensorListener<AccelerometerData>,
		public SensorListener<GyroscopeData>,
		public SensorListener<BarometerData>,
		public SensorListener<ActivityData>,
		public SensorListener<StepData>,
		public SensorListener<TurnData>,
		public SensorListener<WiFiMeasurements> {


	Q_OBJECT


public:

	SensorDataWidget(QWidget* parent);

	void onSensorData(Sensor<AccelerometerData>* sensor, const Timestamp ts, const AccelerometerData& data) override;
	void onSensorData(Sensor<GyroscopeData>* sensor, const Timestamp ts, const GyroscopeData& data) override;
	void onSensorData(Sensor<BarometerData>* sensor, const Timestamp ts, const BarometerData& data) override;
	void onSensorData(Sensor<StepData>* sensor, const Timestamp ts, const StepData& data) override;
	void onSensorData(Sensor<TurnData>* sensor, const Timestamp ts, const TurnData& data) override;
	void onSensorData(Sensor<WiFiMeasurements>* sensor, const Timestamp ts, const WiFiMeasurements& data) override;
	void onSensorData(Sensor<ActivityData>* sensor, const Timestamp ts, const ActivityData& data) override;

private:

	PlotWidget* plotGyro;
	PlotWidget* plotAcc;
	PlotWidget* plotBaro;
	QWidget* plotTurn;
	QWidget* plotWiFi;

	QGridLayout* lay;


};

#endif // SENSORDATAWIDGET_H
