summaryrefslogtreecommitdiff
path: root/common.cpp
diff options
context:
space:
mode:
authorArseniy-Movshev <dodoradio@outlook.com>2023-07-21 11:51:27 +0100
committerArseniy-Movshev <dodoradio@outlook.com>2023-07-21 13:44:08 +0100
commitd69ab590c71fabc0135b2b07a8859a80e556cdf5 (patch)
treee1e7d9dd5a7f869628cad5d17576c13fb3ce2037 /common.cpp
parent439c082257448309073c312f008888568628323b (diff)
Add filesystem watchers to hrdataloader to update when new data comes in
When data for a specific file is requested, that file is added to the watch list. Currently these files aren't ever removed from the watch list, hopefully we won't be loading enough files to cause problems, at least for now
Diffstat (limited to 'common.cpp')
-rw-r--r--common.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/common.cpp b/common.cpp
index 4c0f252..10c18d4 100644
--- a/common.cpp
+++ b/common.cpp
@@ -19,6 +19,11 @@ QString fileNameForDate(QDate date, QString prefix) {
return settings.value("loggerRootPath", QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.asteroid-sensorlogd/").toString() + prefix + "/" + date.toString("yyyy-MM-dd.log");
}
+QString sensorDirPath(QString prefix) {
+ QSettings settings("asteroid", "sensorlogd"); // this should be moved out of here at some point TODO
+ return settings.value("loggerRootPath", QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.asteroid-sensorlogd/").toString() + prefix + "/";
+}
+
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));