Skip to content

Commit

Permalink
mavproxy_param.py: allow manipulation of parameters for sysid
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jun 11, 2024
1 parent fe0997a commit 32aea1b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions MAVProxy/modules/mavproxy_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,9 @@ def check_new_target_system(self):
return
self.add_new_target_system(sysid)

def param_status(self):
sysid = self.get_sysid()
def param_status(self, sysid=None):
if sysid is None:
sysid = self.get_sysid()
pset, pcount = self.pstate[sysid].status(self.master, self.mpstate)
return (pset, pcount)

Expand All @@ -727,6 +728,11 @@ def idle_task(self):
'''handle missing parameters'''
self.check_new_target_system()
sysid = self.get_sysid()
if sysid[0] == 0:
# haven't seen a vehicle yet? Note thecurrent
# implementation of get-sysid() won't return 0 in
# component id.
return
self.pstate[sysid].vehicle_name = self.vehicle_name
self.pstate[sysid].param_help.vehicle_name = self.vehicle_name
self.pstate[sysid].fetch_check(self.master)
Expand All @@ -737,10 +743,11 @@ def idle_task(self):
else:
self.menu_added_console = False

def cmd_param(self, args):
def cmd_param(self, args, sysid=None):
'''control parameters'''
self.check_new_target_system()
sysid = self.get_sysid()
if sysid is None:
sysid = self.get_sysid()
self.pstate[sysid].handle_command(self.master, self.mpstate, args)

def fetch_all(self):
Expand Down

0 comments on commit 32aea1b

Please sign in to comment.