sglite plugin: fixed output of single to respond to input time window #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current develop version of the sqlite plugin function _single(), corresponding to the item function .db() works reasonably accurate as long as the "time between item updates" << "time window called in the .db() function". To keep the processing demand low, the average is calculated in the sql call. This however results in a time resolution equal to time between item updates and causes the calculation error to be significant when "time between item updates" is close to or less than the "time window called in the .db() function".
This pull-request improves the result using 1-2 additional simple sql queries to correct for the parts laying outside of the "time window called in the .db() function".