summaryrefslogtreecommitdiff
path: root/sensorPlugins/stepCounter.h (unfollow)
AgeCommit message (Collapse)Author
2023-07-21Add filesystem watchers to hrdataloader to update when new data comes inArseniy-Movshev
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
2023-07-21qmlPlugin: make file loading less verboseArseniy-Movshev
This removes a large proportion of the log spam. This was getting a bit too much because UI now loads several graphs at once.
2023-07-12Remove leftover qtpositioning referenceArseniy-Movshev
This was used in testing versions of sensorlogd but got removed, so let's remove it from compilation chain as well
2023-07-12Make sure we return a sane value even if sensor isn't warmed upArseniy-Movshev
it seems that the sensor takes a while to warm up, and until it does, it will return 0. This fixes a check that previously already existed, but was checking the wrong value - if the step offset causes step count to increase, we will be returning erroneous values.
2023-07-12Add a method for getting data over multiple daysArseniy-Movshev
2023-07-02Add a method for adding data points to weightArseniy-Movshev
2023-07-02Add a weight data accessorArseniy-Movshev
this doesn't have a sensor associated with it, as it's meant to be logged manually through UI - but we're still using the same model as the other data sources
2023-07-02Move fileaddrecord to common.h so that it can be used from qml pluginArseniy-Movshev
2023-06-29Return log value if step counter value isn't saneArseniy-Movshev
2023-06-20DataLoaders: switch to qvariant for qml compatibilityArseniy-Movshev
2023-06-20StepsDataLoader: add a property that updates today's live step countArseniy-Movshev
this also changes the behaviour of getTodayTotal()
2023-06-20Compensate for steps when daemon starts up and when date changesArseniy-Movshev
This is a radical new approach where we just scrap all steps that have happened outside of the current day. Theoretically, this should be more robust. Remains to be seen whether it actually does work any better.
2023-06-20Add HrDataLoaderArseniy-Movshev
This provides a similar interface to the step data loader, but doesn't have a 'total' function because that's not really that useful.
2023-06-20Move fileNameForDate to a common header fileArseniy-Movshev
This function shows up in quite a few places so this seems justified. Other functions may get this treatment later
2023-06-20StepsDataLoader: Add a way to get the full day's dataArseniy-Movshev
additionally, this renames the current data access function to 'getTotalForDate()' while the new function gets the old name of 'getDataForDate()'. This naming seems more appropriate. This should allow apps using the QML interface to implement their own graphs
2023-06-11Remove HeartrateGraph QML elementArseniy-Movshev
After making several attempts at integrating this element into asteroid-health, I'm still not happy with the heartrate graph code. The issue is that this element doesn't seem to be usable 'as is', and needs some sort of wrapper around it to make it fit with the style of asteroid-health. Effectively this would split the code in half across the two codebases. I also didn't want to specialise this graph code too much for asteroid-health, as I still wanted it to be somewhat generic and reusable. I've decided that I'm going to move this code to asteroid-health. This would allow that graph code to be much more integrated, and would mean that sensorlogd should become much more generic and much easier to use.:q
2023-06-11StepCounter: revert to an offsets modelArseniy-Movshev
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.
2023-06-05Add a log message to debug failing step counter resetsArseniy-Movshev
2023-06-02Make sure we aren't writing to previous day if today file existsArseniy-Movshev
some other checks should also be put in place to make sure that we aren't decreasing the previous day's step count
2023-06-02settings: add step goal targetArseniy-Movshev
currently this doesn't interface with the daemon in any way, this is added for future use
2023-06-02LoggerSettings: fix wrong default sensor intervalsArseniy-Movshev
This inconsistency suggests that these values should be saved somewhere in a common place
2023-06-01Clean up log messagesArseniy-Movshev
2023-06-01Add a check for whether the daemon is starting the first time this bootArseniy-Movshev
2023-06-01Make sure we open files as readonly when we're reading them so we don't ↵Arseniy-Movshev
create random new files This shouldn't happen anyway, but this change helps avoid error conditions
2023-06-01Trigger a recording when the daemon startsArseniy-Movshev
2023-06-01step counter: Make sure that there's a time for the last record when sensor ↵Arseniy-Movshev
logger is constructed otherwise the next recording would assume that a midnight has passed and write bad values to the sensor
2023-06-01Move to resetting the sensor in hardwareArseniy-Movshev
The step counter is now set in hardware to the previous reading + any changes when the daemon starts This means that the step counter now just records the raw step counter value, and adjusts it correctly when needed This introduces a bug where the step counter will show bad readings if the daemon is restarted without a system reboot: the step counter's current value will be added to the last recorded value, which will cause the number of steps to effectively double in most situations. This might be fixed with some code to detect if a system reboot has passed since the last time the counter started.
2023-05-31Clear the step counter in hardware after midnightArseniy-Movshev
The midnight detection code is basic, it just checks if the date has changed between days. So that the user doesn't lose steps on their midnight outings, we write the current value to the previous day's log file before wiping the counter. This will always be the previous day, even if recordings have been missing for a few days.
2023-05-30Move overnight steps compensation code to the place where it's recordedArseniy-Movshev
2023-05-30Add some useful properties to hrgraphArseniy-Movshev
2023-05-30Make graph points roundArseniy-Movshev
2023-05-30enable antialiasing on itemArseniy-Movshev
2023-05-30Fix incorred height and width usageArseniy-Movshev
2023-05-30Add some more parameters to the heartrate graphArseniy-Movshev
2023-05-30Add heartrate graphArseniy-Movshev
2023-05-29Add a method for daemon recordings to be triggered from qmlArseniy-Movshev
This allows the app to always show an up-to-date value
2023-05-29Make sure step count doesn't duplicateArseniy-Movshev
this works in general, but won't work on devices such as catfish or medaka, which are able to count steps when the step counter isn't active. Those will need custom code in the future.
2023-05-28Make the log path configurableArseniy-Movshev
This also renames it to sensorlogd from the obsolete asteroid-healthtracker and hides it by default
2023-05-28Allow sensorlogd to set up its directory structureArseniy-Movshev
This code sets up all the paths used by sensorlogd before it is started
2023-05-28Add a new LoggerSettings typeArseniy-Movshev
this independently accesses the settings file for the logger, and has a call to reinitialise it (which will cause settings to be reread)
2023-05-28Add a dbus interface to allow reinitialising the loggerArseniy-Movshev
This is to allow the logger to be reinitialised form qml
2023-05-28Fix up the settings implementationArseniy-Movshev
add interval and enabled settings for all sensors get rid of some bad duplicates make sure that application properties are set up before settings are accessed
2023-05-27fix qml accessor:Arseniy-Movshev
- make sure that the reader doesn't create random files - it is unclear why readwrite was used here in the first place, as readonly access is appropriate. - make sure that `line` always has a value even if file is empty
2023-05-26steps: add more useful data fetch methodArseniy-Movshev
2023-05-26Add systemd services and rename executableArseniy-Movshev
2023-05-26Restructure to split to daemon and qml accessorArseniy-Movshev
- add separate subdirs for daemon and qml - add some generic qml boilerplate - add a really lazy 'last value' loader implementation - license the project as gplv3 (add copyright notices and license text)
2023-03-12Rename project to sensorlogdArseniy-Movshev
2023-03-12Change to having one record file per day and rewrite file access ↵Arseniy-Movshev
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.
2023-03-11Step counter: reset every 24 hours, and load offsets from the log file when ↵Arseniy-Movshev
initialising. - This is quite crude - Firstly, we assume that the last record in the file is chronologically the last. This needs more consideration. - we do check if we're on a fresh boot, but we just give up completely if it's not a fresh boot, which may work, but needs testing to figure out how it actually works in practice
2023-03-07Refactor sensors into separate filesArseniy-Movshev
- 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.