From 222f776d9f9d1f362038d26f835c96918a7af5fe Mon Sep 17 00:00:00 2001 From: Arseniy-Movshev Date: Mon, 6 Mar 2023 20:59:36 +0000 Subject: Refactor sensors into separate files - this should make things a lot easier to maintain. instead of having everything in the same file, each sensor provides a constructor that sets it up correctly etc. - this should also get the step counter running when the service starts, which is necessary, since the sensor won't count on most devices unless the service is running. - this also temporarily removes the gps module from the service. it's not implemented right now anyway. --- sensorPlugins/stepCounter.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sensorPlugins/stepCounter.h (limited to 'sensorPlugins/stepCounter.h') diff --git a/sensorPlugins/stepCounter.h b/sensorPlugins/stepCounter.h new file mode 100644 index 0000000..aff0917 --- /dev/null +++ b/sensorPlugins/stepCounter.h @@ -0,0 +1,30 @@ +#ifndef STEPCOUNTER_H +#define STEPCOUNTER_H + +#include +#include +#include +#include + +#include + +class StepCounterPlugin : public QObject +{ + Q_OBJECT +public: + explicit StepCounterPlugin(QObject *parent = 0, int initInterval = 600000); + virtual ~StepCounterPlugin() {}; + + void timeUpdate(); + +public slots: + void triggerRecording(); + +private: + QDateTime lastRecordTime; + int interval; + QTimer *recordIntervalTimer; + QStepCounterSensor *stepcounterSensor; +}; + +#endif // STEPCOUNTER_H -- cgit v1.2.3-54-g00ecf