Implemented terminal command processing, data post processing, data filters, and refresh rate tracking#66
Conversation
annhypen
commented
Apr 11, 2026
- Added terminal command processing
- Added data post-processing methods that can be called from the terminal (setOffset, setScale, reset)
- Added moving average filter
- Added a refresh rate tracker to monitor and print data received per second when running with ./run.sh -noesp -bitrate
…ow they can be called through terminal
…ow they can be called through terminal
…ow they can be called through terminal
| @@ -0,0 +1,28 @@ | |||
| #include "client/data_filters.hpp"; | |||
There was a problem hiding this comment.
The ; at the end of this line should be removed
| return data*currentScaleFactor + currentOffset; | ||
| } | ||
|
|
||
| void PostProcessing::addOffset(float offset) { |
There was a problem hiding this comment.
This isn't anything major, but just want to leave a comment as an "FYI" :) , but this method sets the values, so a better name for this method could be setOffset instead of addOffset
|
|
||
| #ifdef BENCHMARK | ||
| // track bitrate | ||
| std::time_t prevRefresh_ = std::time(nullptr); |
There was a problem hiding this comment.
It might be better to use std::chrono::steady_clock and duration_cast<milliseconds> for rate measurements - leaving this as a reference for potential future improvement :)
| //get the parameters from command | ||
| size_t firstSpace = command.find(' '); | ||
| size_t secondSpace = command.find(' ', firstSpace + 1); | ||
| std::string firstParameter = command.substr(firstSpace + 1, secondSpace - firstSpace - 1); | ||
| std::string secondParameter = command.substr(secondSpace + 1); | ||
|
|
There was a problem hiding this comment.
Just adding a note here:
If there are no spaces between the two arguments, or maybe even entering "exit", firstParameter may become the full string
aexzhou
left a comment
There was a problem hiding this comment.
Great work! Glad to see everything all coming together!
We can merge this PR for now if y'all prefer, and keep a note of some of the comments I've left and make additional PRs from new branches to patch those - but I'll let yall decide!