mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 13:50:35 +08:00
Expand auto-format coverage and tiny style changes
This commit is contained in:
committed by
Mathieu Bresciani
parent
fbdd75da2e
commit
f20726d47f
@@ -43,17 +43,13 @@
|
||||
|
||||
#include <ecl.h>
|
||||
|
||||
void
|
||||
DataValidator::put(uint64_t timestamp, float val, uint64_t error_count_in, int priority_in)
|
||||
{
|
||||
float data[dimensions] = { val }; //sets the first value and all others to 0
|
||||
|
||||
void DataValidator::put(uint64_t timestamp, float val, uint64_t error_count_in, int priority_in) {
|
||||
float data[dimensions] = {val}; // sets the first value and all others to 0
|
||||
put(timestamp, data, error_count_in, priority_in);
|
||||
}
|
||||
|
||||
void
|
||||
DataValidator::put(uint64_t timestamp, const float val[dimensions], uint64_t error_count_in, int priority_in)
|
||||
{
|
||||
void DataValidator::put(uint64_t timestamp, const float val[dimensions], uint64_t error_count_in, int priority_in) {
|
||||
|
||||
_event_count++;
|
||||
|
||||
if (error_count_in > _error_count) {
|
||||
@@ -99,9 +95,8 @@ DataValidator::put(uint64_t timestamp, const float val[dimensions], uint64_t err
|
||||
_time_last = timestamp;
|
||||
}
|
||||
|
||||
float
|
||||
DataValidator::confidence(uint64_t timestamp)
|
||||
{
|
||||
float DataValidator::confidence(uint64_t timestamp) {
|
||||
|
||||
float ret = 1.0f;
|
||||
|
||||
/* check if we have any data */
|
||||
@@ -128,7 +123,6 @@ DataValidator::confidence(uint64_t timestamp)
|
||||
/* cap error density counter at window size */
|
||||
_error_mask |= ERROR_FLAG_HIGH_ERRDENSITY;
|
||||
_error_density = ERROR_DENSITY_WINDOW;
|
||||
|
||||
}
|
||||
|
||||
/* no critical errors */
|
||||
@@ -144,17 +138,14 @@ DataValidator::confidence(uint64_t timestamp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
DataValidator::print()
|
||||
{
|
||||
void DataValidator::print() {
|
||||
if (_time_last == 0) {
|
||||
ECL_INFO("\tno data");
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < dimensions; i++) {
|
||||
ECL_INFO("\tval: %8.4f, lp: %8.4f mean dev: %8.4f RMS: %8.4f conf: %8.4f",
|
||||
(double) _value[i], (double)_lp[i], (double)_mean[i],
|
||||
(double)_rms[i], (double)confidence(ecl_absolute_time()));
|
||||
ECL_INFO("\tval: %8.4f, lp: %8.4f mean dev: %8.4f RMS: %8.4f conf: %8.4f", (double)_value[i],
|
||||
(double)_lp[i], (double)_mean[i], (double)_rms[i], (double)confidence(ecl_absolute_time()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user