diff --git a/MAVProxy/modules/lib/mission_item_protocol.py b/MAVProxy/modules/lib/mission_item_protocol.py index 990bc757fd..529a7a76f7 100644 --- a/MAVProxy/modules/lib/mission_item_protocol.py +++ b/MAVProxy/modules/lib/mission_item_protocol.py @@ -59,6 +59,7 @@ def __init__(self, mpstate, name, description, **args): def gui_menu_items(self): return [ + MPMenuItem('FTP', 'FTP', '# %s ftp' % self.command_name()), MPMenuItem('Clear', 'Clear', '# %s clear' % self.command_name()), MPMenuItem('List', 'List', '# %s list' % self.command_name()), MPMenuItem( @@ -863,6 +864,8 @@ def commands(self): print("%s module not available; use old compat modules" % str(self.itemtype())) return return { + "ftp": self.wp_ftp_download, + "ftpload": self.wp_ftp_upload, "clear": self.cmd_clear, "list": self.cmd_list, "load": (self.cmd_load, ["(FILENAME)"]), @@ -962,7 +965,7 @@ def request_list_send(self): mission_type=self.mav_mission_type()) def wp_ftp_download(self, args): - '''Download wpts from vehicle with ftp''' + '''Download items from vehicle with ftp''' ftp = self.mpstate.module('ftp') if ftp is None: print("Need ftp module") @@ -971,7 +974,7 @@ def wp_ftp_download(self, args): ftp.cmd_get([self.mission_ftp_name()], callback=self.ftp_callback, callback_progress=self.ftp_callback_progress) def ftp_callback_progress(self, fh, total_size): - '''progress callback from ftp fetch of mission''' + '''progress callback from ftp fetch of mission items''' if self.ftp_count is None and total_size >= 10: ofs = fh.tell() fh.seek(0) @@ -987,7 +990,7 @@ def ftp_callback_progress(self, fh, total_size): self.mpstate.console.set_status('Mission', 'Mission %u/%u' % (done, self.ftp_count)) def ftp_callback(self, fh): - '''callback from ftp fetch of mission''' + '''callback from ftp fetch of mission items''' if fh is None: print("mission: failed ftp download") return @@ -995,10 +998,10 @@ def ftp_callback(self, fh): data = fh.read() magic2, dtype, options, start, num_items = struct.unpack("