sns: zero threshold check does not trigger report

This commit is contained in:
Maxim Prokhorov
2024-08-09 13:45:02 +03:00
parent fc8ef5a298
commit 018db60fbc

View File

@@ -4219,9 +4219,6 @@ bool ready_to_report(ValuePair& out, const ValuePair& processed, const Magnitude
const bool check_max_threshold { !std::isnan(magnitude.max_threshold) };
report = report || check_max_threshold;
// Figure out whether report value is zero or not
const bool check_zero_threshold { !std::isnan(magnitude.zero_threshold) };
report = report || check_zero_threshold;
if (report) {
if (magnitude.filter->ready()) {
@@ -4234,7 +4231,8 @@ bool ready_to_report(ValuePair& out, const ValuePair& processed, const Magnitude
out = processed;
}
if (check_zero_threshold && out.value < magnitude.zero_threshold) {
// Figure out whether report value should be zero or not
if (!std::isnan(magnitude.zero_threshold) && out.value < magnitude.zero_threshold) {
out.value = 0.0;
}