diff options
author | Arseniy-Movshev <dodoradio@outlook.com> | 2023-06-07 14:06:18 +0100 |
---|---|---|
committer | Arseniy-Movshev <dodoradio@outlook.com> | 2023-06-11 10:17:45 +0100 |
commit | 2a1363a223cd8a59f08609c18022d09bda5d66df (patch) | |
tree | 0ae16615b214c443e81e552df5f76c99f9aeb481 /daemon/sensorPlugins/stepCounter.h | |
parent | 6e92b73b935fced594ffe5dc7545639225c99b06 (diff) |
StepCounter: revert to an offsets model
It seems that the step counter doesn't actually allow setting the steps value. While setSteps() will cause the reading to change, the step counter may reset back to the previous step count when more steps are taken.
Diffstat (limited to 'daemon/sensorPlugins/stepCounter.h')
-rw-r--r-- | daemon/sensorPlugins/stepCounter.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/daemon/sensorPlugins/stepCounter.h b/daemon/sensorPlugins/stepCounter.h index a6475f5..cb6a7e4 100644 --- a/daemon/sensorPlugins/stepCounter.h +++ b/daemon/sensorPlugins/stepCounter.h @@ -15,14 +15,14 @@ #include <QDateTime> #include <QDBusInterface> #include <QTimer> +#include <QSettings> #include <QtSensors/QStepCounterSensor> -class StepCounterPlugin : public QObject -{ +class StepCounterPlugin : public QObject { Q_OBJECT public: - explicit StepCounterPlugin(QObject *parent = 0, int initInterval = 600000, bool daemonFresh = false); + explicit StepCounterPlugin(QObject* parent = 0, int initInterval = 600000, bool daemonFresh = false); virtual ~StepCounterPlugin() {}; void timeUpdate(); @@ -35,6 +35,8 @@ private: int interval; QTimer *recordIntervalTimer; QStepCounterSensor *stepcounterSensor; + int m_stepsOffset; + QSettings *m_settings; const QString sensorPathPrefix = "stepCounter"; }; |