Skip to content

Commit

Permalink
fleet stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jun 21, 2023
1 parent 9ee565b commit 11332e6
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions MAVProxy/modules/mavproxy_fleet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def cmd_fleet_vehicle_param_setfromclasses(self, args, set_unexpected=False):
self.last_config_change = time.time()

def cmd_fleet_class_status_help(self):
self.print("fleet class status (help|vehicle)")
self.print("fleet class status [UID]")

def cmd_fleet_class_status(self, args):
if len(args) == 0:
Expand All @@ -739,12 +739,15 @@ def cmd_fleet_class_status(self, args):
print(" ".join(out))
return

(cmd, *args) = args
(classname, *args) = args

if cmd == "help":
return self.cmd_fleet_class_status_help()
gotclass = self.get_config_class_by_name(classname)
if gotclass is None:
self.print("bad classname")
return

return self.cmd_fleet_class_status_help()
for (name, value) in gotclass.params.items():
print("%s: %f" % (name, value))

def cmd_fleet_class(self, args):
'''handle "fleet class" commands - manipulation of classes vehicles can be in'''
Expand Down Expand Up @@ -787,6 +790,15 @@ def cmd_fleet_vehicle_status(self, args):
return

(vehicle_uid, *args) = args

try:
vehicle = self.get_config_vehicle_by_uid(vehicle_uid)
except KeyError:
print("No such vehicle")
return

print("Classes: %s" % " ".join(vehicle._classes))

seen_vehicle = self.get_seen_vehicle_by_uid(vehicle_uid)
if seen_vehicle is None:
self.print("%s is not live" % vehicle_uid)
Expand Down Expand Up @@ -1266,6 +1278,7 @@ def oh(thing):
"__Vehicle__": 1,
"uid": thing.uid,
"name": thing.name,
"quicknote": thing.quicknote,
"classes": thing._classes,
}
return ret
Expand Down

0 comments on commit 11332e6

Please sign in to comment.