Skip to content

Commit

Permalink
mavproxy_link.py: Add Start Websocket Server button
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 authored and peterbarker committed Nov 17, 2024
1 parent c3fc4c1 commit 335e1c9
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions MAVProxy/modules/mavproxy_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,24 @@ def __init__(self, mpstate):
self.menu_added_console = False
if mp_util.has_wxpython:
self.menu_rm = MPMenuSubMenu('Remove', items=[])
self.menu = MPMenuSubMenu('Link',
items=[MPMenuItem('Add...', 'Add...', '# link add ', handler=MPMenulinkAddDialog()),
self.menu_rm,
MPMenuItem('Ports', 'Ports', '# link ports'),
MPMenuItem('List', 'List', '# link list'),
MPMenuItem('Status', 'Status', '# link')])

items = [
MPMenuItem('Add...', 'Add...', '# link add ', handler=MPMenulinkAddDialog()),
self.menu_rm,
MPMenuItem('Ports', 'Ports', '# link ports'),
MPMenuItem('List', 'List', '# link list'),
MPMenuItem('Status', 'Status', '# link')]
# wsproto is not installed by default.
# Only add the menu if it's available.
try:
import wsproto # noqa: F401
except ImportError:
pass
else:
items.append(
MPMenuItem('Start Websocket Server', 'Start Websocket Server', '# output add wsserver:0.0.0.0:56781'))

self.menu = MPMenuSubMenu('Link', items=items)
self.last_menu_update = 0

def idle_task(self):
Expand Down

0 comments on commit 335e1c9

Please sign in to comment.