mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-15 04:37:07 +01:00
sns: zero threshold check does not trigger report
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user