From ef7fc1a3046fa7c0ab7c6831b2e8b72ea5d7eeca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Oct 2022 08:55:00 +1100 Subject: [PATCH] DFReader: fixed defaults handling --- DFReader.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/DFReader.py b/DFReader.py index 74416cc5e..f250f917e 100644 --- a/DFReader.py +++ b/DFReader.py @@ -666,14 +666,10 @@ def _add_msg(self, m): self.flightmode = mavutil.mode_string_px4(m.MainState) if type == 'PARM' and getattr(m, 'Name', None) is not None: self.params[m.Name] = m.Value - if hasattr(m,'Default'): + if hasattr(m,'Default') and not math.isnan(m.Default): if not hasattr(self,'param_defaults'): self.param_defaults = {} - if math.isnan(m.Default): - if not m.Name in self.param_defaults: - self.param_defaults[m.Name] = m.Value - else: - self.param_defaults[m.Name] = m.Default + self.param_defaults[m.Name] = m.Default self._set_time(m) def recv_match(self, condition=None, type=None, blocking=False):