Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DFReader: fixed defaults handling #738

Merged
merged 1 commit into from
Oct 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions DFReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down