summaryrefslogtreecommitdiff
path: root/daemon/logger.cpp
diff options
context:
space:
mode:
authorArseniy-Movshev <dodoradio@outlook.com>2023-05-29 16:30:31 +0100
committerArseniy-Movshev <dodoradio@outlook.com>2023-05-29 18:06:51 +0100
commitfd718937e22c22e716a951e2bb58ac1bc624f70e (patch)
tree88b7ebd962c1224dbfb4daacf578084a79fd17cc /daemon/logger.cpp
parent66e8fe3ba76cf72a71a8fece1532fb9597813e0a (diff)
Add a method for daemon recordings to be triggered from qml
This allows the app to always show an up-to-date value
Diffstat (limited to 'daemon/logger.cpp')
-rw-r--r--daemon/logger.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/daemon/logger.cpp b/daemon/logger.cpp
index 984ae33..4488a03 100644
--- a/daemon/logger.cpp
+++ b/daemon/logger.cpp
@@ -78,6 +78,16 @@ void Logger::displayOn(QString displayState) {
}
}
+void Logger::triggerRecording() {
+ if (heartrateSensorEnabled) {
+ m_heartrateSensor->triggerRecording();
+ }
+
+ if (stepCounterEnabled) {
+ m_stepCounter->triggerRecording();
+ }
+}
+
void fileAddRecord(QString sensorPrefix, QString logdata, QDateTime recordTime) { //adds a record to today's log file for the given sensor
qDebug() << fileNameForDate(recordTime.date(), sensorPrefix);
QFile file(fileNameForDate(recordTime.date(), sensorPrefix));