summaryrefslogtreecommitdiff
path: root/sensorPlugins/heartrateSensor.cpp
diff options
context:
space:
mode:
authorArseniy-Movshev <dodoradio@outlook.com>2023-03-12 00:33:58 +0000
committerArseniy-Movshev <dodoradio@outlook.com>2023-03-12 11:51:49 +0000
commit55339aacf03642657e1f9c7d087f9b9fd319de4a (patch)
treecabe8dcc069d7d63a4978e22b4baab0df861d41b /sensorPlugins/heartrateSensor.cpp
parent47ed16926ac86295000a51fe1360a0ff9e21d84a (diff)
Change to having one record file per day and rewrite file access infrastructure to serve this.
I believe this is a useful improvement. The main two advantages are that a) it is very cheap to check whether a record exists for a given day - just check for file presence and b) there is a reasonable limit to the size of these files (never more than a few hundred records per day) which means that they can just be loaded into ram for processing without any complex splitting operations Currently, the necessary `~/asteroid-healthloggerd/stepCounter` and `...loggerd/heartrateMonitor` directories are not automatically created and the code just vomits errors into log if it can't write to them.
Diffstat (limited to '')
-rw-r--r--sensorPlugins/heartrateSensor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sensorPlugins/heartrateSensor.cpp b/sensorPlugins/heartrateSensor.cpp
index 3ae18ee..3477e9a 100644
--- a/sensorPlugins/heartrateSensor.cpp
+++ b/sensorPlugins/heartrateSensor.cpp
@@ -48,6 +48,6 @@ void HeartrateSensorPlugin::finishRecording() {
qDebug() << "hrm sensor accuracy insufficient. waiting.";
return;
}
- writeReadingToFile(QString::number(QDateTime::currentSecsSinceEpoch()) + " : " + QString::number(bpm) + "\n", "hrmOut.txt");
+ fileAddRecord(sensorPathPrefix,QString::number(bpm));
hrmSensor->stop();
}