id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 51 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
249,400 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_map/__init__.py | MapModule.cmd_follow | def cmd_follow(self, args):
'''control following of vehicle'''
if len(args) < 2:
print("map follow 0|1")
return
follow = int(args[1])
self.map.set_follow(follow) | python | def cmd_follow(self, args):
'''control following of vehicle'''
if len(args) < 2:
print("map follow 0|1")
return
follow = int(args[1])
self.map.set_follow(follow) | [
"def",
"cmd_follow",
"(",
"self",
",",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"<",
"2",
":",
"print",
"(",
"\"map follow 0|1\"",
")",
"return",
"follow",
"=",
"int",
"(",
"args",
"[",
"1",
"]",
")",
"self",
".",
"map",
".",
"set_follow",
... | control following of vehicle | [
"control",
"following",
"of",
"vehicle"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_map/__init__.py#L607-L613 |
249,401 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_map/__init__.py | MapModule.set_secondary_vehicle_position | def set_secondary_vehicle_position(self, m):
'''show 2nd vehicle on map'''
if m.get_type() != 'GLOBAL_POSITION_INT':
return
(lat, lon, heading) = (m.lat*1.0e-7, m.lon*1.0e-7, m.hdg*0.01)
if abs(lat) < 1.0e-3 and abs(lon) > 1.0e-3:
return
# hack for OBC2016... | python | def set_secondary_vehicle_position(self, m):
'''show 2nd vehicle on map'''
if m.get_type() != 'GLOBAL_POSITION_INT':
return
(lat, lon, heading) = (m.lat*1.0e-7, m.lon*1.0e-7, m.hdg*0.01)
if abs(lat) < 1.0e-3 and abs(lon) > 1.0e-3:
return
# hack for OBC2016... | [
"def",
"set_secondary_vehicle_position",
"(",
"self",
",",
"m",
")",
":",
"if",
"m",
".",
"get_type",
"(",
")",
"!=",
"'GLOBAL_POSITION_INT'",
":",
"return",
"(",
"lat",
",",
"lon",
",",
"heading",
")",
"=",
"(",
"m",
".",
"lat",
"*",
"1.0e-7",
",",
... | show 2nd vehicle on map | [
"show",
"2nd",
"vehicle",
"on",
"map"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_map/__init__.py#L615-L627 |
249,402 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_kmlread.py | KmlReadModule.cmd_param | def cmd_param(self, args):
'''control kml reading'''
usage = "Usage: kml <clear | load (filename) | layers | toggle (layername) | fence (layername)>"
if len(args) < 1:
print(usage)
return
elif args[0] == "clear":
self.clearkml()
elif args[0] ==... | python | def cmd_param(self, args):
'''control kml reading'''
usage = "Usage: kml <clear | load (filename) | layers | toggle (layername) | fence (layername)>"
if len(args) < 1:
print(usage)
return
elif args[0] == "clear":
self.clearkml()
elif args[0] ==... | [
"def",
"cmd_param",
"(",
"self",
",",
"args",
")",
":",
"usage",
"=",
"\"Usage: kml <clear | load (filename) | layers | toggle (layername) | fence (layername)>\"",
"if",
"len",
"(",
"args",
")",
"<",
"1",
":",
"print",
"(",
"usage",
")",
"return",
"elif",
"args",
... | control kml reading | [
"control",
"kml",
"reading"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_kmlread.py#L48-L74 |
249,403 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_kmlread.py | KmlReadModule.cmd_snap_wp | def cmd_snap_wp(self, args):
'''snap waypoints to KML'''
threshold = 10.0
if len(args) > 0:
threshold = float(args[0])
wpmod = self.module('wp')
wploader = wpmod.wploader
changed = False
for i in range(1,wploader.count()):
w = wploader.wp(i... | python | def cmd_snap_wp(self, args):
'''snap waypoints to KML'''
threshold = 10.0
if len(args) > 0:
threshold = float(args[0])
wpmod = self.module('wp')
wploader = wpmod.wploader
changed = False
for i in range(1,wploader.count()):
w = wploader.wp(i... | [
"def",
"cmd_snap_wp",
"(",
"self",
",",
"args",
")",
":",
"threshold",
"=",
"10.0",
"if",
"len",
"(",
"args",
")",
">",
"0",
":",
"threshold",
"=",
"float",
"(",
"args",
"[",
"0",
"]",
")",
"wpmod",
"=",
"self",
".",
"module",
"(",
"'wp'",
")",
... | snap waypoints to KML | [
"snap",
"waypoints",
"to",
"KML"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_kmlread.py#L76-L108 |
249,404 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_kmlread.py | KmlReadModule.cmd_snap_fence | def cmd_snap_fence(self, args):
'''snap fence to KML'''
threshold = 10.0
if len(args) > 0:
threshold = float(args[0])
fencemod = self.module('fence')
loader = fencemod.fenceloader
changed = False
for i in range(0,loader.count()):
fp = loade... | python | def cmd_snap_fence(self, args):
'''snap fence to KML'''
threshold = 10.0
if len(args) > 0:
threshold = float(args[0])
fencemod = self.module('fence')
loader = fencemod.fenceloader
changed = False
for i in range(0,loader.count()):
fp = loade... | [
"def",
"cmd_snap_fence",
"(",
"self",
",",
"args",
")",
":",
"threshold",
"=",
"10.0",
"if",
"len",
"(",
"args",
")",
">",
"0",
":",
"threshold",
"=",
"float",
"(",
"args",
"[",
"0",
"]",
")",
"fencemod",
"=",
"self",
".",
"module",
"(",
"'fence'",... | snap fence to KML | [
"snap",
"fence",
"to",
"KML"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_kmlread.py#L110-L139 |
249,405 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_kmlread.py | KmlReadModule.fencekml | def fencekml(self, layername):
'''set a layer as the geofence'''
#Strip quotation marks if neccessary
if layername.startswith('"') and layername.endswith('"'):
layername = layername[1:-1]
#for each point in the layer, add it in
for layer in self.allayers:
... | python | def fencekml(self, layername):
'''set a layer as the geofence'''
#Strip quotation marks if neccessary
if layername.startswith('"') and layername.endswith('"'):
layername = layername[1:-1]
#for each point in the layer, add it in
for layer in self.allayers:
... | [
"def",
"fencekml",
"(",
"self",
",",
"layername",
")",
":",
"#Strip quotation marks if neccessary",
"if",
"layername",
".",
"startswith",
"(",
"'\"'",
")",
"and",
"layername",
".",
"endswith",
"(",
"'\"'",
")",
":",
"layername",
"=",
"layername",
"[",
"1",
"... | set a layer as the geofence | [
"set",
"a",
"layer",
"as",
"the",
"geofence"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_kmlread.py#L141-L165 |
249,406 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_kmlread.py | KmlReadModule.togglekml | def togglekml(self, layername):
'''toggle the display of a kml'''
#Strip quotation marks if neccessary
if layername.startswith('"') and layername.endswith('"'):
layername = layername[1:-1]
#toggle layer off (plus associated text element)
if layername in self.curlayers... | python | def togglekml(self, layername):
'''toggle the display of a kml'''
#Strip quotation marks if neccessary
if layername.startswith('"') and layername.endswith('"'):
layername = layername[1:-1]
#toggle layer off (plus associated text element)
if layername in self.curlayers... | [
"def",
"togglekml",
"(",
"self",
",",
"layername",
")",
":",
"#Strip quotation marks if neccessary",
"if",
"layername",
".",
"startswith",
"(",
"'\"'",
")",
"and",
"layername",
".",
"endswith",
"(",
"'\"'",
")",
":",
"layername",
"=",
"layername",
"[",
"1",
... | toggle the display of a kml | [
"toggle",
"the",
"display",
"of",
"a",
"kml"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_kmlread.py#L209-L235 |
249,407 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_kmlread.py | KmlReadModule.clearkml | def clearkml(self):
'''Clear the kmls from the map'''
#go through all the current layers and remove them
for layer in self.curlayers:
self.mpstate.map.remove_object(layer)
for layer in self.curtextlayers:
self.mpstate.map.remove_object(layer)
self.allayers... | python | def clearkml(self):
'''Clear the kmls from the map'''
#go through all the current layers and remove them
for layer in self.curlayers:
self.mpstate.map.remove_object(layer)
for layer in self.curtextlayers:
self.mpstate.map.remove_object(layer)
self.allayers... | [
"def",
"clearkml",
"(",
"self",
")",
":",
"#go through all the current layers and remove them",
"for",
"layer",
"in",
"self",
".",
"curlayers",
":",
"self",
".",
"mpstate",
".",
"map",
".",
"remove_object",
"(",
"layer",
")",
"for",
"layer",
"in",
"self",
".",... | Clear the kmls from the map | [
"Clear",
"the",
"kmls",
"from",
"the",
"map"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_kmlread.py#L237-L248 |
249,408 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_kmlread.py | KmlReadModule.loadkml | def loadkml(self, filename):
'''Load a kml from file and put it on the map'''
#Open the zip file
nodes = self.readkmz(filename)
self.snap_points = []
#go through each object in the kml...
for n in nodes:
point = self.readObject(n)
#and plac... | python | def loadkml(self, filename):
'''Load a kml from file and put it on the map'''
#Open the zip file
nodes = self.readkmz(filename)
self.snap_points = []
#go through each object in the kml...
for n in nodes:
point = self.readObject(n)
#and plac... | [
"def",
"loadkml",
"(",
"self",
",",
"filename",
")",
":",
"#Open the zip file",
"nodes",
"=",
"self",
".",
"readkmz",
"(",
"filename",
")",
"self",
".",
"snap_points",
"=",
"[",
"]",
"#go through each object in the kml...",
"for",
"n",
"in",
"nodes",
":",
"p... | Load a kml from file and put it on the map | [
"Load",
"a",
"kml",
"from",
"file",
"and",
"put",
"it",
"on",
"the",
"map"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_kmlread.py#L250-L286 |
249,409 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_kmlread.py | KmlReadModule.idle_task | def idle_task(self):
'''handle GUI elements'''
if not self.menu_needs_refreshing:
return
if self.module('map') is not None and not self.menu_added_map:
self.menu_added_map = True
self.module('map').add_menu(self.menu)
#(re)create the menu
if mp... | python | def idle_task(self):
'''handle GUI elements'''
if not self.menu_needs_refreshing:
return
if self.module('map') is not None and not self.menu_added_map:
self.menu_added_map = True
self.module('map').add_menu(self.menu)
#(re)create the menu
if mp... | [
"def",
"idle_task",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"menu_needs_refreshing",
":",
"return",
"if",
"self",
".",
"module",
"(",
"'map'",
")",
"is",
"not",
"None",
"and",
"not",
"self",
".",
"menu_added_map",
":",
"self",
".",
"menu_added_m... | handle GUI elements | [
"handle",
"GUI",
"elements"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_kmlread.py#L289-L313 |
249,410 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_kmlread.py | KmlReadModule.readkmz | def readkmz(self, filename):
'''reads in a kmz file and returns xml nodes'''
#Strip quotation marks if neccessary
filename.strip('"')
#Open the zip file (as applicable)
if filename[-4:] == '.kml':
fo = open(filename, "r")
fstring = fo.read()
... | python | def readkmz(self, filename):
'''reads in a kmz file and returns xml nodes'''
#Strip quotation marks if neccessary
filename.strip('"')
#Open the zip file (as applicable)
if filename[-4:] == '.kml':
fo = open(filename, "r")
fstring = fo.read()
... | [
"def",
"readkmz",
"(",
"self",
",",
"filename",
")",
":",
"#Strip quotation marks if neccessary",
"filename",
".",
"strip",
"(",
"'\"'",
")",
"#Open the zip file (as applicable) ",
"if",
"filename",
"[",
"-",
"4",
":",
"]",
"==",
"'.kml'",
":",
"fo",
"=",
"... | reads in a kmz file and returns xml nodes | [
"reads",
"in",
"a",
"kmz",
"file",
"and",
"returns",
"xml",
"nodes"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_kmlread.py#L318-L344 |
249,411 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_asterix.py | AsterixModule.cmd_asterix | def cmd_asterix(self, args):
'''asterix command parser'''
usage = "usage: asterix <set|start|stop|restart|status>"
if len(args) == 0:
print(usage)
return
if args[0] == "set":
self.asterix_settings.command(args[1:])
elif args[0] == "start":
... | python | def cmd_asterix(self, args):
'''asterix command parser'''
usage = "usage: asterix <set|start|stop|restart|status>"
if len(args) == 0:
print(usage)
return
if args[0] == "set":
self.asterix_settings.command(args[1:])
elif args[0] == "start":
... | [
"def",
"cmd_asterix",
"(",
"self",
",",
"args",
")",
":",
"usage",
"=",
"\"usage: asterix <set|start|stop|restart|status>\"",
"if",
"len",
"(",
"args",
")",
"==",
"0",
":",
"print",
"(",
"usage",
")",
"return",
"if",
"args",
"[",
"0",
"]",
"==",
"\"set\"",... | asterix command parser | [
"asterix",
"command",
"parser"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_asterix.py#L99-L117 |
249,412 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_asterix.py | AsterixModule.start_listener | def start_listener(self):
'''start listening for packets'''
if self.sock is not None:
self.sock.close()
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.sock.bind(('',... | python | def start_listener(self):
'''start listening for packets'''
if self.sock is not None:
self.sock.close()
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.sock.bind(('',... | [
"def",
"start_listener",
"(",
"self",
")",
":",
"if",
"self",
".",
"sock",
"is",
"not",
"None",
":",
"self",
".",
"sock",
".",
"close",
"(",
")",
"self",
".",
"sock",
"=",
"socket",
".",
"socket",
"(",
"socket",
".",
"AF_INET",
",",
"socket",
".",
... | start listening for packets | [
"start",
"listening",
"for",
"packets"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_asterix.py#L119-L127 |
249,413 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_asterix.py | AsterixModule.stop_listener | def stop_listener(self):
'''stop listening for packets'''
if self.sock is not None:
self.sock.close()
self.sock = None
self.tracks = {} | python | def stop_listener(self):
'''stop listening for packets'''
if self.sock is not None:
self.sock.close()
self.sock = None
self.tracks = {} | [
"def",
"stop_listener",
"(",
"self",
")",
":",
"if",
"self",
".",
"sock",
"is",
"not",
"None",
":",
"self",
".",
"sock",
".",
"close",
"(",
")",
"self",
".",
"sock",
"=",
"None",
"self",
".",
"tracks",
"=",
"{",
"}"
] | stop listening for packets | [
"stop",
"listening",
"for",
"packets"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_asterix.py#L129-L134 |
249,414 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_asterix.py | AsterixModule.set_secondary_vehicle_position | def set_secondary_vehicle_position(self, m):
'''store second vehicle position for filtering purposes'''
if m.get_type() != 'GLOBAL_POSITION_INT':
return
(lat, lon, heading) = (m.lat*1.0e-7, m.lon*1.0e-7, m.hdg*0.01)
if abs(lat) < 1.0e-3 and abs(lon) < 1.0e-3:
retu... | python | def set_secondary_vehicle_position(self, m):
'''store second vehicle position for filtering purposes'''
if m.get_type() != 'GLOBAL_POSITION_INT':
return
(lat, lon, heading) = (m.lat*1.0e-7, m.lon*1.0e-7, m.hdg*0.01)
if abs(lat) < 1.0e-3 and abs(lon) < 1.0e-3:
retu... | [
"def",
"set_secondary_vehicle_position",
"(",
"self",
",",
"m",
")",
":",
"if",
"m",
".",
"get_type",
"(",
")",
"!=",
"'GLOBAL_POSITION_INT'",
":",
"return",
"(",
"lat",
",",
"lon",
",",
"heading",
")",
"=",
"(",
"m",
".",
"lat",
"*",
"1.0e-7",
",",
... | store second vehicle position for filtering purposes | [
"store",
"second",
"vehicle",
"position",
"for",
"filtering",
"purposes"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_asterix.py#L136-L143 |
249,415 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_asterix.py | AsterixModule.could_collide_hor | def could_collide_hor(self, vpos, adsb_pkt):
'''return true if vehicle could come within filter_dist_xy meters of adsb vehicle in timeout seconds'''
margin = self.asterix_settings.filter_dist_xy
timeout = self.asterix_settings.filter_time
alat = adsb_pkt.lat * 1.0e-7
alon = adsb_... | python | def could_collide_hor(self, vpos, adsb_pkt):
'''return true if vehicle could come within filter_dist_xy meters of adsb vehicle in timeout seconds'''
margin = self.asterix_settings.filter_dist_xy
timeout = self.asterix_settings.filter_time
alat = adsb_pkt.lat * 1.0e-7
alon = adsb_... | [
"def",
"could_collide_hor",
"(",
"self",
",",
"vpos",
",",
"adsb_pkt",
")",
":",
"margin",
"=",
"self",
".",
"asterix_settings",
".",
"filter_dist_xy",
"timeout",
"=",
"self",
".",
"asterix_settings",
".",
"filter_time",
"alat",
"=",
"adsb_pkt",
".",
"lat",
... | return true if vehicle could come within filter_dist_xy meters of adsb vehicle in timeout seconds | [
"return",
"true",
"if",
"vehicle",
"could",
"come",
"within",
"filter_dist_xy",
"meters",
"of",
"adsb",
"vehicle",
"in",
"timeout",
"seconds"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_asterix.py#L145-L158 |
249,416 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_asterix.py | AsterixModule.could_collide_ver | def could_collide_ver(self, vpos, adsb_pkt):
'''return true if vehicle could come within filter_dist_z meters of adsb vehicle in timeout seconds'''
if adsb_pkt.emitter_type < 100 or adsb_pkt.emitter_type > 104:
return True
margin = self.asterix_settings.filter_dist_z
vtype = ... | python | def could_collide_ver(self, vpos, adsb_pkt):
'''return true if vehicle could come within filter_dist_z meters of adsb vehicle in timeout seconds'''
if adsb_pkt.emitter_type < 100 or adsb_pkt.emitter_type > 104:
return True
margin = self.asterix_settings.filter_dist_z
vtype = ... | [
"def",
"could_collide_ver",
"(",
"self",
",",
"vpos",
",",
"adsb_pkt",
")",
":",
"if",
"adsb_pkt",
".",
"emitter_type",
"<",
"100",
"or",
"adsb_pkt",
".",
"emitter_type",
">",
"104",
":",
"return",
"True",
"margin",
"=",
"self",
".",
"asterix_settings",
".... | return true if vehicle could come within filter_dist_z meters of adsb vehicle in timeout seconds | [
"return",
"true",
"if",
"vehicle",
"could",
"come",
"within",
"filter_dist_z",
"meters",
"of",
"adsb",
"vehicle",
"in",
"timeout",
"seconds"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_asterix.py#L160-L180 |
249,417 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_asterix.py | AsterixModule.mavlink_packet | def mavlink_packet(self, m):
'''get time from mavlink ATTITUDE'''
if m.get_type() == 'GLOBAL_POSITION_INT':
if abs(m.lat) < 1000 and abs(m.lon) < 1000:
return
self.vehicle_pos = VehiclePos(m) | python | def mavlink_packet(self, m):
'''get time from mavlink ATTITUDE'''
if m.get_type() == 'GLOBAL_POSITION_INT':
if abs(m.lat) < 1000 and abs(m.lon) < 1000:
return
self.vehicle_pos = VehiclePos(m) | [
"def",
"mavlink_packet",
"(",
"self",
",",
"m",
")",
":",
"if",
"m",
".",
"get_type",
"(",
")",
"==",
"'GLOBAL_POSITION_INT'",
":",
"if",
"abs",
"(",
"m",
".",
"lat",
")",
"<",
"1000",
"and",
"abs",
"(",
"m",
".",
"lon",
")",
"<",
"1000",
":",
... | get time from mavlink ATTITUDE | [
"get",
"time",
"from",
"mavlink",
"ATTITUDE"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_asterix.py#L300-L305 |
249,418 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_link.py | LinkModule.complete_serial_ports | def complete_serial_ports(self, text):
'''return list of serial ports'''
ports = mavutil.auto_detect_serial(preferred_list=preferred_ports)
return [ p.device for p in ports ] | python | def complete_serial_ports(self, text):
'''return list of serial ports'''
ports = mavutil.auto_detect_serial(preferred_list=preferred_ports)
return [ p.device for p in ports ] | [
"def",
"complete_serial_ports",
"(",
"self",
",",
"text",
")",
":",
"ports",
"=",
"mavutil",
".",
"auto_detect_serial",
"(",
"preferred_list",
"=",
"preferred_ports",
")",
"return",
"[",
"p",
".",
"device",
"for",
"p",
"in",
"ports",
"]"
] | return list of serial ports | [
"return",
"list",
"of",
"serial",
"ports"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_link.py#L77-L80 |
249,419 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_link.py | LinkModule.complete_links | def complete_links(self, text):
'''return list of links'''
try:
ret = [ m.address for m in self.mpstate.mav_master ]
for m in self.mpstate.mav_master:
ret.append(m.address)
if hasattr(m, 'label'):
ret.append(m.label)
... | python | def complete_links(self, text):
'''return list of links'''
try:
ret = [ m.address for m in self.mpstate.mav_master ]
for m in self.mpstate.mav_master:
ret.append(m.address)
if hasattr(m, 'label'):
ret.append(m.label)
... | [
"def",
"complete_links",
"(",
"self",
",",
"text",
")",
":",
"try",
":",
"ret",
"=",
"[",
"m",
".",
"address",
"for",
"m",
"in",
"self",
".",
"mpstate",
".",
"mav_master",
"]",
"for",
"m",
"in",
"self",
".",
"mpstate",
".",
"mav_master",
":",
"ret"... | return list of links | [
"return",
"list",
"of",
"links"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_link.py#L82-L92 |
249,420 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_link.py | LinkModule.cmd_link_attributes | def cmd_link_attributes(self, args):
'''change optional link attributes'''
link = args[0]
attributes = args[1]
print("Setting link %s attributes (%s)" % (link, attributes))
self.link_attributes(link, attributes) | python | def cmd_link_attributes(self, args):
'''change optional link attributes'''
link = args[0]
attributes = args[1]
print("Setting link %s attributes (%s)" % (link, attributes))
self.link_attributes(link, attributes) | [
"def",
"cmd_link_attributes",
"(",
"self",
",",
"args",
")",
":",
"link",
"=",
"args",
"[",
"0",
"]",
"attributes",
"=",
"args",
"[",
"1",
"]",
"print",
"(",
"\"Setting link %s attributes (%s)\"",
"%",
"(",
"link",
",",
"attributes",
")",
")",
"self",
".... | change optional link attributes | [
"change",
"optional",
"link",
"attributes"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_link.py#L242-L247 |
249,421 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_link.py | LinkModule.find_link | def find_link(self, device):
'''find a device based on number, name or label'''
for i in range(len(self.mpstate.mav_master)):
conn = self.mpstate.mav_master[i]
if (str(i) == device or
conn.address == device or
getattr(conn, 'label', None) == device... | python | def find_link(self, device):
'''find a device based on number, name or label'''
for i in range(len(self.mpstate.mav_master)):
conn = self.mpstate.mav_master[i]
if (str(i) == device or
conn.address == device or
getattr(conn, 'label', None) == device... | [
"def",
"find_link",
"(",
"self",
",",
"device",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"mpstate",
".",
"mav_master",
")",
")",
":",
"conn",
"=",
"self",
".",
"mpstate",
".",
"mav_master",
"[",
"i",
"]",
"if",
"(",
"str... | find a device based on number, name or label | [
"find",
"a",
"device",
"based",
"on",
"number",
"name",
"or",
"label"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_link.py#L255-L263 |
249,422 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_link.py | LinkModule.cmd_link_remove | def cmd_link_remove(self, args):
'''remove an link'''
device = args[0]
if len(self.mpstate.mav_master) <= 1:
print("Not removing last link")
return
i = self.find_link(device)
if i is None:
return
conn = self.mpstate.mav_master[i]
... | python | def cmd_link_remove(self, args):
'''remove an link'''
device = args[0]
if len(self.mpstate.mav_master) <= 1:
print("Not removing last link")
return
i = self.find_link(device)
if i is None:
return
conn = self.mpstate.mav_master[i]
... | [
"def",
"cmd_link_remove",
"(",
"self",
",",
"args",
")",
":",
"device",
"=",
"args",
"[",
"0",
"]",
"if",
"len",
"(",
"self",
".",
"mpstate",
".",
"mav_master",
")",
"<=",
"1",
":",
"print",
"(",
"\"Not removing last link\"",
")",
"return",
"i",
"=",
... | remove an link | [
"remove",
"an",
"link"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_link.py#L265-L290 |
249,423 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_link.py | LinkModule.master_send_callback | def master_send_callback(self, m, master):
'''called on sending a message'''
if self.status.watch is not None:
for msg_type in self.status.watch:
if fnmatch.fnmatch(m.get_type().upper(), msg_type.upper()):
self.mpstate.console.writeln('> '+ str(m))
... | python | def master_send_callback(self, m, master):
'''called on sending a message'''
if self.status.watch is not None:
for msg_type in self.status.watch:
if fnmatch.fnmatch(m.get_type().upper(), msg_type.upper()):
self.mpstate.console.writeln('> '+ str(m))
... | [
"def",
"master_send_callback",
"(",
"self",
",",
"m",
",",
"master",
")",
":",
"if",
"self",
".",
"status",
".",
"watch",
"is",
"not",
"None",
":",
"for",
"msg_type",
"in",
"self",
".",
"status",
".",
"watch",
":",
"if",
"fnmatch",
".",
"fnmatch",
"(... | called on sending a message | [
"called",
"on",
"sending",
"a",
"message"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_link.py#L296-L308 |
249,424 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_link.py | LinkModule.handle_msec_timestamp | def handle_msec_timestamp(self, m, master):
'''special handling for MAVLink packets with a time_boot_ms field'''
if m.get_type() == 'GLOBAL_POSITION_INT':
# this is fix time, not boot time
return
msec = m.time_boot_ms
if msec + 30000 < master.highest_msec:
... | python | def handle_msec_timestamp(self, m, master):
'''special handling for MAVLink packets with a time_boot_ms field'''
if m.get_type() == 'GLOBAL_POSITION_INT':
# this is fix time, not boot time
return
msec = m.time_boot_ms
if msec + 30000 < master.highest_msec:
... | [
"def",
"handle_msec_timestamp",
"(",
"self",
",",
"m",
",",
"master",
")",
":",
"if",
"m",
".",
"get_type",
"(",
")",
"==",
"'GLOBAL_POSITION_INT'",
":",
"# this is fix time, not boot time",
"return",
"msec",
"=",
"m",
".",
"time_boot_ms",
"if",
"msec",
"+",
... | special handling for MAVLink packets with a time_boot_ms field | [
"special",
"handling",
"for",
"MAVLink",
"packets",
"with",
"a",
"time_boot_ms",
"field"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_link.py#L310-L334 |
249,425 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_link.py | LinkModule.report_altitude | def report_altitude(self, altitude):
'''possibly report a new altitude'''
master = self.master
if getattr(self.console, 'ElevationMap', None) is not None and self.mpstate.settings.basealt != 0:
lat = master.field('GLOBAL_POSITION_INT', 'lat', 0)*1.0e-7
lon = master.field(... | python | def report_altitude(self, altitude):
'''possibly report a new altitude'''
master = self.master
if getattr(self.console, 'ElevationMap', None) is not None and self.mpstate.settings.basealt != 0:
lat = master.field('GLOBAL_POSITION_INT', 'lat', 0)*1.0e-7
lon = master.field(... | [
"def",
"report_altitude",
"(",
"self",
",",
"altitude",
")",
":",
"master",
"=",
"self",
".",
"master",
"if",
"getattr",
"(",
"self",
".",
"console",
",",
"'ElevationMap'",
",",
"None",
")",
"is",
"not",
"None",
"and",
"self",
".",
"mpstate",
".",
"set... | possibly report a new altitude | [
"possibly",
"report",
"a",
"new",
"altitude"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_link.py#L354-L371 |
249,426 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_link.py | LinkModule.cmd_vehicle | def cmd_vehicle(self, args):
'''handle vehicle commands'''
if len(args) < 1:
print("Usage: vehicle SYSID[:COMPID]")
return
a = args[0].split(':')
self.mpstate.settings.target_system = int(a[0])
if len(a) > 1:
self.mpstate.settings.target_compon... | python | def cmd_vehicle(self, args):
'''handle vehicle commands'''
if len(args) < 1:
print("Usage: vehicle SYSID[:COMPID]")
return
a = args[0].split(':')
self.mpstate.settings.target_system = int(a[0])
if len(a) > 1:
self.mpstate.settings.target_compon... | [
"def",
"cmd_vehicle",
"(",
"self",
",",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"<",
"1",
":",
"print",
"(",
"\"Usage: vehicle SYSID[:COMPID]\"",
")",
"return",
"a",
"=",
"args",
"[",
"0",
"]",
".",
"split",
"(",
"':'",
")",
"self",
".",
"... | handle vehicle commands | [
"handle",
"vehicle",
"commands"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_link.py#L635-L659 |
249,427 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_devop.py | DeviceOpModule.devop_read | def devop_read(self, args, bustype):
'''read from device'''
if len(args) < 5:
print("Usage: devop read <spi|i2c> name bus address regstart count")
return
name = args[0]
bus = int(args[1],base=0)
address = int(args[2],base=0)
reg = int(args[3],base=... | python | def devop_read(self, args, bustype):
'''read from device'''
if len(args) < 5:
print("Usage: devop read <spi|i2c> name bus address regstart count")
return
name = args[0]
bus = int(args[1],base=0)
address = int(args[2],base=0)
reg = int(args[3],base=... | [
"def",
"devop_read",
"(",
"self",
",",
"args",
",",
"bustype",
")",
":",
"if",
"len",
"(",
"args",
")",
"<",
"5",
":",
"print",
"(",
"\"Usage: devop read <spi|i2c> name bus address regstart count\"",
")",
"return",
"name",
"=",
"args",
"[",
"0",
"]",
"bus",
... | read from device | [
"read",
"from",
"device"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_devop.py#L37-L56 |
249,428 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_devop.py | DeviceOpModule.devop_write | def devop_write(self, args, bustype):
'''write to a device'''
usage = "Usage: devop write <spi|i2c> name bus address regstart count <bytes>"
if len(args) < 5:
print(usage)
return
name = args[0]
bus = int(args[1],base=0)
address = int(args[2],base=0... | python | def devop_write(self, args, bustype):
'''write to a device'''
usage = "Usage: devop write <spi|i2c> name bus address regstart count <bytes>"
if len(args) < 5:
print(usage)
return
name = args[0]
bus = int(args[1],base=0)
address = int(args[2],base=0... | [
"def",
"devop_write",
"(",
"self",
",",
"args",
",",
"bustype",
")",
":",
"usage",
"=",
"\"Usage: devop write <spi|i2c> name bus address regstart count <bytes>\"",
"if",
"len",
"(",
"args",
")",
"<",
"5",
":",
"print",
"(",
"usage",
")",
"return",
"name",
"=",
... | write to a device | [
"write",
"to",
"a",
"device"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_devop.py#L58-L86 |
249,429 | ArduPilot/MAVProxy | MAVProxy/modules/lib/ANUGA/geo_reference.py | Geo_reference.get_absolute | def get_absolute(self, points):
"""Given a set of points geo referenced to this instance,
return the points as absolute values.
"""
# remember if we got a list
is_list = isinstance(points, list)
points = ensure_numeric(points, num.float)
if len(points.shape) == ... | python | def get_absolute(self, points):
# remember if we got a list
is_list = isinstance(points, list)
points = ensure_numeric(points, num.float)
if len(points.shape) == 1:
# One point has been passed
msg = 'Single point must have two elements'
if not len(poi... | [
"def",
"get_absolute",
"(",
"self",
",",
"points",
")",
":",
"# remember if we got a list",
"is_list",
"=",
"isinstance",
"(",
"points",
",",
"list",
")",
"points",
"=",
"ensure_numeric",
"(",
"points",
",",
"num",
".",
"float",
")",
"if",
"len",
"(",
"poi... | Given a set of points geo referenced to this instance,
return the points as absolute values. | [
"Given",
"a",
"set",
"of",
"points",
"geo",
"referenced",
"to",
"this",
"instance",
"return",
"the",
"points",
"as",
"absolute",
"values",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/ANUGA/geo_reference.py#L295-L327 |
249,430 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_cameraview.py | CameraViewModule.cmd_cameraview | def cmd_cameraview(self, args):
'''camera view commands'''
state = self
if args and args[0] == 'set':
if len(args) < 3:
state.view_settings.show_all()
else:
state.view_settings.set(args[1], args[2])
state.update_col()
... | python | def cmd_cameraview(self, args):
'''camera view commands'''
state = self
if args and args[0] == 'set':
if len(args) < 3:
state.view_settings.show_all()
else:
state.view_settings.set(args[1], args[2])
state.update_col()
... | [
"def",
"cmd_cameraview",
"(",
"self",
",",
"args",
")",
":",
"state",
"=",
"self",
"if",
"args",
"and",
"args",
"[",
"0",
"]",
"==",
"'set'",
":",
"if",
"len",
"(",
"args",
")",
"<",
"3",
":",
"state",
".",
"view_settings",
".",
"show_all",
"(",
... | camera view commands | [
"camera",
"view",
"commands"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_cameraview.py#L50-L60 |
249,431 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_cameraview.py | CameraViewModule.scale_rc | def scale_rc(self, servo, min, max, param):
'''scale a PWM value'''
# default to servo range of 1000 to 2000
min_pwm = self.get_mav_param('%s_MIN' % param, 0)
max_pwm = self.get_mav_param('%s_MAX' % param, 0)
if min_pwm == 0 or max_pwm == 0:
return 0
if ma... | python | def scale_rc(self, servo, min, max, param):
'''scale a PWM value'''
# default to servo range of 1000 to 2000
min_pwm = self.get_mav_param('%s_MIN' % param, 0)
max_pwm = self.get_mav_param('%s_MAX' % param, 0)
if min_pwm == 0 or max_pwm == 0:
return 0
if ma... | [
"def",
"scale_rc",
"(",
"self",
",",
"servo",
",",
"min",
",",
"max",
",",
"param",
")",
":",
"# default to servo range of 1000 to 2000",
"min_pwm",
"=",
"self",
".",
"get_mav_param",
"(",
"'%s_MIN'",
"%",
"param",
",",
"0",
")",
"max_pwm",
"=",
"self",
".... | scale a PWM value | [
"scale",
"a",
"PWM",
"value"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_cameraview.py#L66-L82 |
249,432 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | raise_msg_to_str | def raise_msg_to_str(msg):
"""msg is a return arg from a raise. Join with new lines"""
if not is_string_like(msg):
msg = '\n'.join(map(str, msg))
return msg | python | def raise_msg_to_str(msg):
if not is_string_like(msg):
msg = '\n'.join(map(str, msg))
return msg | [
"def",
"raise_msg_to_str",
"(",
"msg",
")",
":",
"if",
"not",
"is_string_like",
"(",
"msg",
")",
":",
"msg",
"=",
"'\\n'",
".",
"join",
"(",
"map",
"(",
"str",
",",
"msg",
")",
")",
"return",
"msg"
] | msg is a return arg from a raise. Join with new lines | [
"msg",
"is",
"a",
"return",
"arg",
"from",
"a",
"raise",
".",
"Join",
"with",
"new",
"lines"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L162-L166 |
249,433 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | _create_wx_app | def _create_wx_app():
"""
Creates a wx.App instance if it has not been created sofar.
"""
wxapp = wx.GetApp()
if wxapp is None:
wxapp = wx.App(False)
wxapp.SetExitOnFrameDelete(True)
# retain a reference to the app object so it does not get garbage
# collected and cau... | python | def _create_wx_app():
wxapp = wx.GetApp()
if wxapp is None:
wxapp = wx.App(False)
wxapp.SetExitOnFrameDelete(True)
# retain a reference to the app object so it does not get garbage
# collected and cause segmentation faults
_create_wx_app.theWxApp = wxapp | [
"def",
"_create_wx_app",
"(",
")",
":",
"wxapp",
"=",
"wx",
".",
"GetApp",
"(",
")",
"if",
"wxapp",
"is",
"None",
":",
"wxapp",
"=",
"wx",
".",
"App",
"(",
"False",
")",
"wxapp",
".",
"SetExitOnFrameDelete",
"(",
"True",
")",
"# retain a reference to the... | Creates a wx.App instance if it has not been created sofar. | [
"Creates",
"a",
"wx",
".",
"App",
"instance",
"if",
"it",
"has",
"not",
"been",
"created",
"sofar",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1241-L1251 |
249,434 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | draw_if_interactive | def draw_if_interactive():
"""
This should be overriden in a windowing environment if drawing
should be done in interactive python mode
"""
DEBUG_MSG("draw_if_interactive()", 1, None)
if matplotlib.is_interactive():
figManager = Gcf.get_active()
if figManager is not None:
... | python | def draw_if_interactive():
DEBUG_MSG("draw_if_interactive()", 1, None)
if matplotlib.is_interactive():
figManager = Gcf.get_active()
if figManager is not None:
figManager.canvas.draw_idle() | [
"def",
"draw_if_interactive",
"(",
")",
":",
"DEBUG_MSG",
"(",
"\"draw_if_interactive()\"",
",",
"1",
",",
"None",
")",
"if",
"matplotlib",
".",
"is_interactive",
"(",
")",
":",
"figManager",
"=",
"Gcf",
".",
"get_active",
"(",
")",
"if",
"figManager",
"is",... | This should be overriden in a windowing environment if drawing
should be done in interactive python mode | [
"This",
"should",
"be",
"overriden",
"in",
"a",
"windowing",
"environment",
"if",
"drawing",
"should",
"be",
"done",
"in",
"interactive",
"python",
"mode"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1254-L1265 |
249,435 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | RendererWx.new_gc | def new_gc(self):
"""
Return an instance of a GraphicsContextWx, and sets the current gc copy
"""
DEBUG_MSG('new_gc()', 2, self)
self.gc = GraphicsContextWx(self.bitmap, self)
self.gc.select()
self.gc.unselect()
return self.gc | python | def new_gc(self):
DEBUG_MSG('new_gc()', 2, self)
self.gc = GraphicsContextWx(self.bitmap, self)
self.gc.select()
self.gc.unselect()
return self.gc | [
"def",
"new_gc",
"(",
"self",
")",
":",
"DEBUG_MSG",
"(",
"'new_gc()'",
",",
"2",
",",
"self",
")",
"self",
".",
"gc",
"=",
"GraphicsContextWx",
"(",
"self",
".",
"bitmap",
",",
"self",
")",
"self",
".",
"gc",
".",
"select",
"(",
")",
"self",
".",
... | Return an instance of a GraphicsContextWx, and sets the current gc copy | [
"Return",
"an",
"instance",
"of",
"a",
"GraphicsContextWx",
"and",
"sets",
"the",
"current",
"gc",
"copy"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L392-L400 |
249,436 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | RendererWx.get_wx_font | def get_wx_font(self, s, prop):
"""
Return a wx font. Cache instances in a font dictionary for
efficiency
"""
DEBUG_MSG("get_wx_font()", 1, self)
key = hash(prop)
fontprop = prop
fontname = fontprop.get_name()
font = self.fontd.get(key)
... | python | def get_wx_font(self, s, prop):
DEBUG_MSG("get_wx_font()", 1, self)
key = hash(prop)
fontprop = prop
fontname = fontprop.get_name()
font = self.fontd.get(key)
if font is not None:
return font
# Allow use of platform independent and dependent font n... | [
"def",
"get_wx_font",
"(",
"self",
",",
"s",
",",
"prop",
")",
":",
"DEBUG_MSG",
"(",
"\"get_wx_font()\"",
",",
"1",
",",
"self",
")",
"key",
"=",
"hash",
"(",
"prop",
")",
"fontprop",
"=",
"prop",
"fontname",
"=",
"fontprop",
".",
"get_name",
"(",
"... | Return a wx font. Cache instances in a font dictionary for
efficiency | [
"Return",
"a",
"wx",
"font",
".",
"Cache",
"instances",
"in",
"a",
"font",
"dictionary",
"for",
"efficiency"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L411-L446 |
249,437 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | GraphicsContextWx.select | def select(self):
"""
Select the current bitmap into this wxDC instance
"""
if sys.platform=='win32':
self.dc.SelectObject(self.bitmap)
self.IsSelected = True | python | def select(self):
if sys.platform=='win32':
self.dc.SelectObject(self.bitmap)
self.IsSelected = True | [
"def",
"select",
"(",
"self",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"self",
".",
"dc",
".",
"SelectObject",
"(",
"self",
".",
"bitmap",
")",
"self",
".",
"IsSelected",
"=",
"True"
] | Select the current bitmap into this wxDC instance | [
"Select",
"the",
"current",
"bitmap",
"into",
"this",
"wxDC",
"instance"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L505-L512 |
249,438 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | GraphicsContextWx.unselect | def unselect(self):
"""
Select a Null bitmasp into this wxDC instance
"""
if sys.platform=='win32':
self.dc.SelectObject(wx.NullBitmap)
self.IsSelected = False | python | def unselect(self):
if sys.platform=='win32':
self.dc.SelectObject(wx.NullBitmap)
self.IsSelected = False | [
"def",
"unselect",
"(",
"self",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"self",
".",
"dc",
".",
"SelectObject",
"(",
"wx",
".",
"NullBitmap",
")",
"self",
".",
"IsSelected",
"=",
"False"
] | Select a Null bitmasp into this wxDC instance | [
"Select",
"a",
"Null",
"bitmasp",
"into",
"this",
"wxDC",
"instance"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L514-L520 |
249,439 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | GraphicsContextWx.set_linewidth | def set_linewidth(self, w):
"""
Set the line width.
"""
DEBUG_MSG("set_linewidth()", 1, self)
self.select()
if w>0 and w<1: w = 1
GraphicsContextBase.set_linewidth(self, w)
lw = int(self.renderer.points_to_pixels(self._linewidth))
if lw==0: lw = 1
... | python | def set_linewidth(self, w):
DEBUG_MSG("set_linewidth()", 1, self)
self.select()
if w>0 and w<1: w = 1
GraphicsContextBase.set_linewidth(self, w)
lw = int(self.renderer.points_to_pixels(self._linewidth))
if lw==0: lw = 1
self._pen.SetWidth(lw)
self.gfx_ctx.... | [
"def",
"set_linewidth",
"(",
"self",
",",
"w",
")",
":",
"DEBUG_MSG",
"(",
"\"set_linewidth()\"",
",",
"1",
",",
"self",
")",
"self",
".",
"select",
"(",
")",
"if",
"w",
">",
"0",
"and",
"w",
"<",
"1",
":",
"w",
"=",
"1",
"GraphicsContextBase",
"."... | Set the line width. | [
"Set",
"the",
"line",
"width",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L554-L566 |
249,440 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | GraphicsContextWx.set_linestyle | def set_linestyle(self, ls):
"""
Set the line style to be one of
"""
DEBUG_MSG("set_linestyle()", 1, self)
self.select()
GraphicsContextBase.set_linestyle(self, ls)
try:
self._style = GraphicsContextWx._dashd_wx[ls]
except KeyError:
... | python | def set_linestyle(self, ls):
DEBUG_MSG("set_linestyle()", 1, self)
self.select()
GraphicsContextBase.set_linestyle(self, ls)
try:
self._style = GraphicsContextWx._dashd_wx[ls]
except KeyError:
self._style = wx.LONG_DASH# Style not used elsewhere...
... | [
"def",
"set_linestyle",
"(",
"self",
",",
"ls",
")",
":",
"DEBUG_MSG",
"(",
"\"set_linestyle()\"",
",",
"1",
",",
"self",
")",
"self",
".",
"select",
"(",
")",
"GraphicsContextBase",
".",
"set_linestyle",
"(",
"self",
",",
"ls",
")",
"try",
":",
"self",
... | Set the line style to be one of | [
"Set",
"the",
"line",
"style",
"to",
"be",
"one",
"of"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L590-L608 |
249,441 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | GraphicsContextWx.get_wxcolour | def get_wxcolour(self, color):
"""return a wx.Colour from RGB format"""
DEBUG_MSG("get_wx_color()", 1, self)
if len(color) == 3:
r, g, b = color
r *= 255
g *= 255
b *= 255
return wx.Colour(red=int(r), green=int(g), blue=int(b))
... | python | def get_wxcolour(self, color):
DEBUG_MSG("get_wx_color()", 1, self)
if len(color) == 3:
r, g, b = color
r *= 255
g *= 255
b *= 255
return wx.Colour(red=int(r), green=int(g), blue=int(b))
else:
r, g, b, a = color
... | [
"def",
"get_wxcolour",
"(",
"self",
",",
"color",
")",
":",
"DEBUG_MSG",
"(",
"\"get_wx_color()\"",
",",
"1",
",",
"self",
")",
"if",
"len",
"(",
"color",
")",
"==",
"3",
":",
"r",
",",
"g",
",",
"b",
"=",
"color",
"r",
"*=",
"255",
"g",
"*=",
... | return a wx.Colour from RGB format | [
"return",
"a",
"wx",
".",
"Colour",
"from",
"RGB",
"format"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L610-L625 |
249,442 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx.Copy_to_Clipboard | def Copy_to_Clipboard(self, event=None):
"copy bitmap of canvas to system clipboard"
bmp_obj = wx.BitmapDataObject()
bmp_obj.SetBitmap(self.bitmap)
if not wx.TheClipboard.IsOpened():
open_success = wx.TheClipboard.Open()
if open_success:
wx.TheClipboa... | python | def Copy_to_Clipboard(self, event=None):
"copy bitmap of canvas to system clipboard"
bmp_obj = wx.BitmapDataObject()
bmp_obj.SetBitmap(self.bitmap)
if not wx.TheClipboard.IsOpened():
open_success = wx.TheClipboard.Open()
if open_success:
wx.TheClipboa... | [
"def",
"Copy_to_Clipboard",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"bmp_obj",
"=",
"wx",
".",
"BitmapDataObject",
"(",
")",
"bmp_obj",
".",
"SetBitmap",
"(",
"self",
".",
"bitmap",
")",
"if",
"not",
"wx",
".",
"TheClipboard",
".",
"IsOpened",
... | copy bitmap of canvas to system clipboard | [
"copy",
"bitmap",
"of",
"canvas",
"to",
"system",
"clipboard"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L776-L786 |
249,443 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx.draw_idle | def draw_idle(self):
"""
Delay rendering until the GUI is idle.
"""
DEBUG_MSG("draw_idle()", 1, self)
self._isDrawn = False # Force redraw
# Create a timer for handling draw_idle requests
# If there are events pending when the timer is
# complete, reset t... | python | def draw_idle(self):
DEBUG_MSG("draw_idle()", 1, self)
self._isDrawn = False # Force redraw
# Create a timer for handling draw_idle requests
# If there are events pending when the timer is
# complete, reset the timer and continue. The
# alternative approach, binding to ... | [
"def",
"draw_idle",
"(",
"self",
")",
":",
"DEBUG_MSG",
"(",
"\"draw_idle()\"",
",",
"1",
",",
"self",
")",
"self",
".",
"_isDrawn",
"=",
"False",
"# Force redraw",
"# Create a timer for handling draw_idle requests",
"# If there are events pending when the timer is",
"# c... | Delay rendering until the GUI is idle. | [
"Delay",
"rendering",
"until",
"the",
"GUI",
"is",
"idle",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L788-L802 |
249,444 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx.draw | def draw(self, drawDC=None):
"""
Render the figure using RendererWx instance renderer, or using a
previously defined renderer if none is specified.
"""
DEBUG_MSG("draw()", 1, self)
self.renderer = RendererWx(self.bitmap, self.figure.dpi)
self.figure.draw(self.rend... | python | def draw(self, drawDC=None):
DEBUG_MSG("draw()", 1, self)
self.renderer = RendererWx(self.bitmap, self.figure.dpi)
self.figure.draw(self.renderer)
self._isDrawn = True
self.gui_repaint(drawDC=drawDC) | [
"def",
"draw",
"(",
"self",
",",
"drawDC",
"=",
"None",
")",
":",
"DEBUG_MSG",
"(",
"\"draw()\"",
",",
"1",
",",
"self",
")",
"self",
".",
"renderer",
"=",
"RendererWx",
"(",
"self",
".",
"bitmap",
",",
"self",
".",
"figure",
".",
"dpi",
")",
"self... | Render the figure using RendererWx instance renderer, or using a
previously defined renderer if none is specified. | [
"Render",
"the",
"figure",
"using",
"RendererWx",
"instance",
"renderer",
"or",
"using",
"a",
"previously",
"defined",
"renderer",
"if",
"none",
"is",
"specified",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L816-L825 |
249,445 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx.start_event_loop | def start_event_loop(self, timeout=0):
"""
Start an event loop. This is used to start a blocking event
loop so that interactive functions, such as ginput and
waitforbuttonpress, can wait for events. This should not be
confused with the main GUI event loop, which is always runni... | python | def start_event_loop(self, timeout=0):
if hasattr(self, '_event_loop'):
raise RuntimeError("Event loop already running")
id = wx.NewId()
timer = wx.Timer(self, id=id)
if timeout > 0:
timer.Start(timeout*1000, oneShot=True)
bind(self, wx.EVT_TIMER, self... | [
"def",
"start_event_loop",
"(",
"self",
",",
"timeout",
"=",
"0",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'_event_loop'",
")",
":",
"raise",
"RuntimeError",
"(",
"\"Event loop already running\"",
")",
"id",
"=",
"wx",
".",
"NewId",
"(",
")",
"timer",... | Start an event loop. This is used to start a blocking event
loop so that interactive functions, such as ginput and
waitforbuttonpress, can wait for events. This should not be
confused with the main GUI event loop, which is always running
and has nothing to do with this.
Call s... | [
"Start",
"an",
"event",
"loop",
".",
"This",
"is",
"used",
"to",
"start",
"a",
"blocking",
"event",
"loop",
"so",
"that",
"interactive",
"functions",
"such",
"as",
"ginput",
"and",
"waitforbuttonpress",
"can",
"wait",
"for",
"events",
".",
"This",
"should",
... | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L846-L875 |
249,446 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx.stop_event_loop | def stop_event_loop(self, event=None):
"""
Stop an event loop. This is used to stop a blocking event
loop so that interactive functions, such as ginput and
waitforbuttonpress, can wait for events.
Call signature::
stop_event_loop_default(self)
"""
if ha... | python | def stop_event_loop(self, event=None):
if hasattr(self,'_event_loop'):
if self._event_loop.IsRunning():
self._event_loop.Exit()
del self._event_loop | [
"def",
"stop_event_loop",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'_event_loop'",
")",
":",
"if",
"self",
".",
"_event_loop",
".",
"IsRunning",
"(",
")",
":",
"self",
".",
"_event_loop",
".",
"Exit",
"(",
... | Stop an event loop. This is used to stop a blocking event
loop so that interactive functions, such as ginput and
waitforbuttonpress, can wait for events.
Call signature::
stop_event_loop_default(self) | [
"Stop",
"an",
"event",
"loop",
".",
"This",
"is",
"used",
"to",
"stop",
"a",
"blocking",
"event",
"loop",
"so",
"that",
"interactive",
"functions",
"such",
"as",
"ginput",
"and",
"waitforbuttonpress",
"can",
"wait",
"for",
"events",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L877-L890 |
249,447 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx._get_imagesave_wildcards | def _get_imagesave_wildcards(self):
'return the wildcard string for the filesave dialog'
default_filetype = self.get_default_filetype()
filetypes = self.get_supported_filetypes_grouped()
sorted_filetypes = filetypes.items()
sorted_filetypes.sort()
wildcards = []
e... | python | def _get_imagesave_wildcards(self):
'return the wildcard string for the filesave dialog'
default_filetype = self.get_default_filetype()
filetypes = self.get_supported_filetypes_grouped()
sorted_filetypes = filetypes.items()
sorted_filetypes.sort()
wildcards = []
e... | [
"def",
"_get_imagesave_wildcards",
"(",
"self",
")",
":",
"default_filetype",
"=",
"self",
".",
"get_default_filetype",
"(",
")",
"filetypes",
"=",
"self",
".",
"get_supported_filetypes_grouped",
"(",
")",
"sorted_filetypes",
"=",
"filetypes",
".",
"items",
"(",
"... | return the wildcard string for the filesave dialog | [
"return",
"the",
"wildcard",
"string",
"for",
"the",
"filesave",
"dialog"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L893-L910 |
249,448 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx.gui_repaint | def gui_repaint(self, drawDC=None):
"""
Performs update of the displayed image on the GUI canvas, using the
supplied device context. If drawDC is None, a ClientDC will be used to
redraw the image.
"""
DEBUG_MSG("gui_repaint()", 1, self)
if self.IsShownOnScreen():... | python | def gui_repaint(self, drawDC=None):
DEBUG_MSG("gui_repaint()", 1, self)
if self.IsShownOnScreen():
if drawDC is None:
drawDC=wx.ClientDC(self)
#drawDC.BeginDrawing()
drawDC.DrawBitmap(self.bitmap, 0, 0)
#drawDC.EndDrawing()
#wx... | [
"def",
"gui_repaint",
"(",
"self",
",",
"drawDC",
"=",
"None",
")",
":",
"DEBUG_MSG",
"(",
"\"gui_repaint()\"",
",",
"1",
",",
"self",
")",
"if",
"self",
".",
"IsShownOnScreen",
"(",
")",
":",
"if",
"drawDC",
"is",
"None",
":",
"drawDC",
"=",
"wx",
"... | Performs update of the displayed image on the GUI canvas, using the
supplied device context. If drawDC is None, a ClientDC will be used to
redraw the image. | [
"Performs",
"update",
"of",
"the",
"displayed",
"image",
"on",
"the",
"GUI",
"canvas",
"using",
"the",
"supplied",
"device",
"context",
".",
"If",
"drawDC",
"is",
"None",
"a",
"ClientDC",
"will",
"be",
"used",
"to",
"redraw",
"the",
"image",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L912-L928 |
249,449 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx._onPaint | def _onPaint(self, evt):
"""
Called when wxPaintEvt is generated
"""
DEBUG_MSG("_onPaint()", 1, self)
drawDC = wx.PaintDC(self)
if not self._isDrawn:
self.draw(drawDC=drawDC)
else:
self.gui_repaint(drawDC=drawDC)
evt.Skip() | python | def _onPaint(self, evt):
DEBUG_MSG("_onPaint()", 1, self)
drawDC = wx.PaintDC(self)
if not self._isDrawn:
self.draw(drawDC=drawDC)
else:
self.gui_repaint(drawDC=drawDC)
evt.Skip() | [
"def",
"_onPaint",
"(",
"self",
",",
"evt",
")",
":",
"DEBUG_MSG",
"(",
"\"_onPaint()\"",
",",
"1",
",",
"self",
")",
"drawDC",
"=",
"wx",
".",
"PaintDC",
"(",
"self",
")",
"if",
"not",
"self",
".",
"_isDrawn",
":",
"self",
".",
"draw",
"(",
"drawD... | Called when wxPaintEvt is generated | [
"Called",
"when",
"wxPaintEvt",
"is",
"generated"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1021-L1032 |
249,450 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx._onSize | def _onSize(self, evt):
"""
Called when wxEventSize is generated.
In this application we attempt to resize to fit the window, so it
is better to take the performance hit and redraw the whole window.
"""
DEBUG_MSG("_onSize()", 2, self)
# Create a new, correctly s... | python | def _onSize(self, evt):
DEBUG_MSG("_onSize()", 2, self)
# Create a new, correctly sized bitmap
self._width, self._height = self.GetClientSize()
self.bitmap =wx.EmptyBitmap(self._width, self._height)
self._isDrawn = False
if self._width <= 1 or self._height <= 1: return #... | [
"def",
"_onSize",
"(",
"self",
",",
"evt",
")",
":",
"DEBUG_MSG",
"(",
"\"_onSize()\"",
",",
"2",
",",
"self",
")",
"# Create a new, correctly sized bitmap",
"self",
".",
"_width",
",",
"self",
".",
"_height",
"=",
"self",
".",
"GetClientSize",
"(",
")",
"... | Called when wxEventSize is generated.
In this application we attempt to resize to fit the window, so it
is better to take the performance hit and redraw the whole window. | [
"Called",
"when",
"wxEventSize",
"is",
"generated",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1041-L1066 |
249,451 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx._onIdle | def _onIdle(self, evt):
'a GUI idle event'
evt.Skip()
FigureCanvasBase.idle_event(self, guiEvent=evt) | python | def _onIdle(self, evt):
'a GUI idle event'
evt.Skip()
FigureCanvasBase.idle_event(self, guiEvent=evt) | [
"def",
"_onIdle",
"(",
"self",
",",
"evt",
")",
":",
"evt",
".",
"Skip",
"(",
")",
"FigureCanvasBase",
".",
"idle_event",
"(",
"self",
",",
"guiEvent",
"=",
"evt",
")"
] | a GUI idle event | [
"a",
"GUI",
"idle",
"event"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1090-L1093 |
249,452 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx._onKeyDown | def _onKeyDown(self, evt):
"""Capture key press."""
key = self._get_key(evt)
evt.Skip()
FigureCanvasBase.key_press_event(self, key, guiEvent=evt) | python | def _onKeyDown(self, evt):
key = self._get_key(evt)
evt.Skip()
FigureCanvasBase.key_press_event(self, key, guiEvent=evt) | [
"def",
"_onKeyDown",
"(",
"self",
",",
"evt",
")",
":",
"key",
"=",
"self",
".",
"_get_key",
"(",
"evt",
")",
"evt",
".",
"Skip",
"(",
")",
"FigureCanvasBase",
".",
"key_press_event",
"(",
"self",
",",
"key",
",",
"guiEvent",
"=",
"evt",
")"
] | Capture key press. | [
"Capture",
"key",
"press",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1095-L1099 |
249,453 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx._onKeyUp | def _onKeyUp(self, evt):
"""Release key."""
key = self._get_key(evt)
#print 'release key', key
evt.Skip()
FigureCanvasBase.key_release_event(self, key, guiEvent=evt) | python | def _onKeyUp(self, evt):
key = self._get_key(evt)
#print 'release key', key
evt.Skip()
FigureCanvasBase.key_release_event(self, key, guiEvent=evt) | [
"def",
"_onKeyUp",
"(",
"self",
",",
"evt",
")",
":",
"key",
"=",
"self",
".",
"_get_key",
"(",
"evt",
")",
"#print 'release key', key",
"evt",
".",
"Skip",
"(",
")",
"FigureCanvasBase",
".",
"key_release_event",
"(",
"self",
",",
"key",
",",
"guiEvent",
... | Release key. | [
"Release",
"key",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1101-L1106 |
249,454 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx._onLeftButtonUp | def _onLeftButtonUp(self, evt):
"""End measuring on an axis."""
x = evt.GetX()
y = self.figure.bbox.height - evt.GetY()
#print 'release button', 1
evt.Skip()
if self.HasCapture(): self.ReleaseMouse()
FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=ev... | python | def _onLeftButtonUp(self, evt):
x = evt.GetX()
y = self.figure.bbox.height - evt.GetY()
#print 'release button', 1
evt.Skip()
if self.HasCapture(): self.ReleaseMouse()
FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=evt) | [
"def",
"_onLeftButtonUp",
"(",
"self",
",",
"evt",
")",
":",
"x",
"=",
"evt",
".",
"GetX",
"(",
")",
"y",
"=",
"self",
".",
"figure",
".",
"bbox",
".",
"height",
"-",
"evt",
".",
"GetY",
"(",
")",
"#print 'release button', 1",
"evt",
".",
"Skip",
"... | End measuring on an axis. | [
"End",
"measuring",
"on",
"an",
"axis",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1148-L1155 |
249,455 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx._onMouseWheel | def _onMouseWheel(self, evt):
"""Translate mouse wheel events into matplotlib events"""
# Determine mouse location
x = evt.GetX()
y = self.figure.bbox.height - evt.GetY()
# Convert delta/rotation/rate into a floating point step size
delta = evt.GetWheelDelta()
r... | python | def _onMouseWheel(self, evt):
# Determine mouse location
x = evt.GetX()
y = self.figure.bbox.height - evt.GetY()
# Convert delta/rotation/rate into a floating point step size
delta = evt.GetWheelDelta()
rotation = evt.GetWheelRotation()
rate = evt.GetLinesPerActi... | [
"def",
"_onMouseWheel",
"(",
"self",
",",
"evt",
")",
":",
"# Determine mouse location",
"x",
"=",
"evt",
".",
"GetX",
"(",
")",
"y",
"=",
"self",
".",
"figure",
".",
"bbox",
".",
"height",
"-",
"evt",
".",
"GetY",
"(",
")",
"# Convert delta/rotation/rat... | Translate mouse wheel events into matplotlib events | [
"Translate",
"mouse",
"wheel",
"events",
"into",
"matplotlib",
"events"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1183-L1212 |
249,456 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureCanvasWx._onLeave | def _onLeave(self, evt):
"""Mouse has left the window."""
evt.Skip()
FigureCanvasBase.leave_notify_event(self, guiEvent = evt) | python | def _onLeave(self, evt):
evt.Skip()
FigureCanvasBase.leave_notify_event(self, guiEvent = evt) | [
"def",
"_onLeave",
"(",
"self",
",",
"evt",
")",
":",
"evt",
".",
"Skip",
"(",
")",
"FigureCanvasBase",
".",
"leave_notify_event",
"(",
"self",
",",
"guiEvent",
"=",
"evt",
")"
] | Mouse has left the window. | [
"Mouse",
"has",
"left",
"the",
"window",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1222-L1226 |
249,457 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | FigureManagerWx.resize | def resize(self, width, height):
'Set the canvas size in pixels'
self.canvas.SetInitialSize(wx.Size(width, height))
self.window.GetSizer().Fit(self.window) | python | def resize(self, width, height):
'Set the canvas size in pixels'
self.canvas.SetInitialSize(wx.Size(width, height))
self.window.GetSizer().Fit(self.window) | [
"def",
"resize",
"(",
"self",
",",
"width",
",",
"height",
")",
":",
"self",
".",
"canvas",
".",
"SetInitialSize",
"(",
"wx",
".",
"Size",
"(",
"width",
",",
"height",
")",
")",
"self",
".",
"window",
".",
"GetSizer",
"(",
")",
".",
"Fit",
"(",
"... | Set the canvas size in pixels | [
"Set",
"the",
"canvas",
"size",
"in",
"pixels"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1443-L1446 |
249,458 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | MenuButtonWx._onMenuButton | def _onMenuButton(self, evt):
"""Handle menu button pressed."""
x, y = self.GetPositionTuple()
w, h = self.GetSizeTuple()
self.PopupMenuXY(self._menu, x, y+h-4)
# When menu returned, indicate selection in button
evt.Skip() | python | def _onMenuButton(self, evt):
x, y = self.GetPositionTuple()
w, h = self.GetSizeTuple()
self.PopupMenuXY(self._menu, x, y+h-4)
# When menu returned, indicate selection in button
evt.Skip() | [
"def",
"_onMenuButton",
"(",
"self",
",",
"evt",
")",
":",
"x",
",",
"y",
"=",
"self",
".",
"GetPositionTuple",
"(",
")",
"w",
",",
"h",
"=",
"self",
".",
"GetSizeTuple",
"(",
")",
"self",
".",
"PopupMenuXY",
"(",
"self",
".",
"_menu",
",",
"x",
... | Handle menu button pressed. | [
"Handle",
"menu",
"button",
"pressed",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1513-L1519 |
249,459 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | MenuButtonWx._handleSelectAllAxes | def _handleSelectAllAxes(self, evt):
"""Called when the 'select all axes' menu item is selected."""
if len(self._axisId) == 0:
return
for i in range(len(self._axisId)):
self._menu.Check(self._axisId[i], True)
self._toolbar.set_active(self.getActiveAxes())
... | python | def _handleSelectAllAxes(self, evt):
if len(self._axisId) == 0:
return
for i in range(len(self._axisId)):
self._menu.Check(self._axisId[i], True)
self._toolbar.set_active(self.getActiveAxes())
evt.Skip() | [
"def",
"_handleSelectAllAxes",
"(",
"self",
",",
"evt",
")",
":",
"if",
"len",
"(",
"self",
".",
"_axisId",
")",
"==",
"0",
":",
"return",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"_axisId",
")",
")",
":",
"self",
".",
"_menu",
".... | Called when the 'select all axes' menu item is selected. | [
"Called",
"when",
"the",
"select",
"all",
"axes",
"menu",
"item",
"is",
"selected",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1521-L1528 |
249,460 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | MenuButtonWx._handleInvertAxesSelected | def _handleInvertAxesSelected(self, evt):
"""Called when the invert all menu item is selected"""
if len(self._axisId) == 0: return
for i in range(len(self._axisId)):
if self._menu.IsChecked(self._axisId[i]):
self._menu.Check(self._axisId[i], False)
else:
... | python | def _handleInvertAxesSelected(self, evt):
if len(self._axisId) == 0: return
for i in range(len(self._axisId)):
if self._menu.IsChecked(self._axisId[i]):
self._menu.Check(self._axisId[i], False)
else:
self._menu.Check(self._axisId[i], True)
... | [
"def",
"_handleInvertAxesSelected",
"(",
"self",
",",
"evt",
")",
":",
"if",
"len",
"(",
"self",
".",
"_axisId",
")",
"==",
"0",
":",
"return",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"_axisId",
")",
")",
":",
"if",
"self",
".",
... | Called when the invert all menu item is selected | [
"Called",
"when",
"the",
"invert",
"all",
"menu",
"item",
"is",
"selected"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1530-L1539 |
249,461 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | MenuButtonWx._onMenuItemSelected | def _onMenuItemSelected(self, evt):
"""Called whenever one of the specific axis menu items is selected"""
current = self._menu.IsChecked(evt.GetId())
if current:
new = False
else:
new = True
self._menu.Check(evt.GetId(), new)
# Lines above would be... | python | def _onMenuItemSelected(self, evt):
current = self._menu.IsChecked(evt.GetId())
if current:
new = False
else:
new = True
self._menu.Check(evt.GetId(), new)
# Lines above would be deleted based on svn tracker ID 2841525;
# not clear whether this mat... | [
"def",
"_onMenuItemSelected",
"(",
"self",
",",
"evt",
")",
":",
"current",
"=",
"self",
".",
"_menu",
".",
"IsChecked",
"(",
"evt",
".",
"GetId",
"(",
")",
")",
"if",
"current",
":",
"new",
"=",
"False",
"else",
":",
"new",
"=",
"True",
"self",
".... | Called whenever one of the specific axis menu items is selected | [
"Called",
"whenever",
"one",
"of",
"the",
"specific",
"axis",
"menu",
"items",
"is",
"selected"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1541-L1552 |
249,462 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | MenuButtonWx.getActiveAxes | def getActiveAxes(self):
"""Return a list of the selected axes."""
active = []
for i in range(len(self._axisId)):
if self._menu.IsChecked(self._axisId[i]):
active.append(i)
return active | python | def getActiveAxes(self):
active = []
for i in range(len(self._axisId)):
if self._menu.IsChecked(self._axisId[i]):
active.append(i)
return active | [
"def",
"getActiveAxes",
"(",
"self",
")",
":",
"active",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"_axisId",
")",
")",
":",
"if",
"self",
".",
"_menu",
".",
"IsChecked",
"(",
"self",
".",
"_axisId",
"[",
"i",
"]",
... | Return a list of the selected axes. | [
"Return",
"a",
"list",
"of",
"the",
"selected",
"axes",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1570-L1576 |
249,463 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | MenuButtonWx.updateButtonText | def updateButtonText(self, lst):
"""Update the list of selected axes in the menu button"""
axis_txt = ''
for e in lst:
axis_txt += '%d,' % (e+1)
# remove trailing ',' and add to button string
self.SetLabel("Axes: %s" % axis_txt[:-1]) | python | def updateButtonText(self, lst):
axis_txt = ''
for e in lst:
axis_txt += '%d,' % (e+1)
# remove trailing ',' and add to button string
self.SetLabel("Axes: %s" % axis_txt[:-1]) | [
"def",
"updateButtonText",
"(",
"self",
",",
"lst",
")",
":",
"axis_txt",
"=",
"''",
"for",
"e",
"in",
"lst",
":",
"axis_txt",
"+=",
"'%d,'",
"%",
"(",
"e",
"+",
"1",
")",
"# remove trailing ',' and add to button string",
"self",
".",
"SetLabel",
"(",
"\"A... | Update the list of selected axes in the menu button | [
"Update",
"the",
"list",
"of",
"selected",
"axes",
"in",
"the",
"menu",
"button"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1578-L1584 |
249,464 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | NavigationToolbarWx._create_menu | def _create_menu(self):
"""
Creates the 'menu' - implemented as a button which opens a
pop-up menu since wxPython does not allow a menu as a control
"""
DEBUG_MSG("_create_menu()", 1, self)
self._menu = MenuButtonWx(self)
self.AddControl(self._menu)
self.A... | python | def _create_menu(self):
DEBUG_MSG("_create_menu()", 1, self)
self._menu = MenuButtonWx(self)
self.AddControl(self._menu)
self.AddSeparator() | [
"def",
"_create_menu",
"(",
"self",
")",
":",
"DEBUG_MSG",
"(",
"\"_create_menu()\"",
",",
"1",
",",
"self",
")",
"self",
".",
"_menu",
"=",
"MenuButtonWx",
"(",
"self",
")",
"self",
".",
"AddControl",
"(",
"self",
".",
"_menu",
")",
"self",
".",
"AddS... | Creates the 'menu' - implemented as a button which opens a
pop-up menu since wxPython does not allow a menu as a control | [
"Creates",
"the",
"menu",
"-",
"implemented",
"as",
"a",
"button",
"which",
"opens",
"a",
"pop",
"-",
"up",
"menu",
"since",
"wxPython",
"does",
"not",
"allow",
"a",
"menu",
"as",
"a",
"control"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1795-L1803 |
249,465 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | NavigationToolbarWx._create_controls | def _create_controls(self, can_kill):
"""
Creates the button controls, and links them to event handlers
"""
DEBUG_MSG("_create_controls()", 1, self)
# Need the following line as Windows toolbars default to 15x16
self.SetToolBitmapSize(wx.Size(16,16))
self.AddSimp... | python | def _create_controls(self, can_kill):
DEBUG_MSG("_create_controls()", 1, self)
# Need the following line as Windows toolbars default to 15x16
self.SetToolBitmapSize(wx.Size(16,16))
self.AddSimpleTool(_NTB_X_PAN_LEFT, _load_bitmap('stock_left.xpm'),
'Left', 'Sc... | [
"def",
"_create_controls",
"(",
"self",
",",
"can_kill",
")",
":",
"DEBUG_MSG",
"(",
"\"_create_controls()\"",
",",
"1",
",",
"self",
")",
"# Need the following line as Windows toolbars default to 15x16",
"self",
".",
"SetToolBitmapSize",
"(",
"wx",
".",
"Size",
"(",
... | Creates the button controls, and links them to event handlers | [
"Creates",
"the",
"button",
"controls",
"and",
"links",
"them",
"to",
"event",
"handlers"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1805-L1847 |
249,466 | ArduPilot/MAVProxy | MAVProxy/modules/lib/MacOS/backend_wx.py | NavigationToolbarWx.set_active | def set_active(self, ind):
"""
ind is a list of index numbers for the axes which are to be made active
"""
DEBUG_MSG("set_active()", 1, self)
self._ind = ind
if ind != None:
self._active = [ self._axes[i] for i in self._ind ]
else:
self._ac... | python | def set_active(self, ind):
DEBUG_MSG("set_active()", 1, self)
self._ind = ind
if ind != None:
self._active = [ self._axes[i] for i in self._ind ]
else:
self._active = []
# Now update button text wit active axes
self._menu.updateButtonText(ind) | [
"def",
"set_active",
"(",
"self",
",",
"ind",
")",
":",
"DEBUG_MSG",
"(",
"\"set_active()\"",
",",
"1",
",",
"self",
")",
"self",
".",
"_ind",
"=",
"ind",
"if",
"ind",
"!=",
"None",
":",
"self",
".",
"_active",
"=",
"[",
"self",
".",
"_axes",
"[",
... | ind is a list of index numbers for the axes which are to be made active | [
"ind",
"is",
"a",
"list",
"of",
"index",
"numbers",
"for",
"the",
"axes",
"which",
"are",
"to",
"be",
"made",
"active"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/MacOS/backend_wx.py#L1849-L1860 |
249,467 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_map/srtm.py | SRTMDownloader.getURIWithRedirect | def getURIWithRedirect(self, url):
'''fetch a URL with redirect handling'''
tries = 0
while tries < 5:
conn = httplib.HTTPConnection(self.server)
conn.request("GET", url)
r1 = conn.getresponse()
if r1.status in [301, 302, 303, 307]:... | python | def getURIWithRedirect(self, url):
'''fetch a URL with redirect handling'''
tries = 0
while tries < 5:
conn = httplib.HTTPConnection(self.server)
conn.request("GET", url)
r1 = conn.getresponse()
if r1.status in [301, 302, 303, 307]:... | [
"def",
"getURIWithRedirect",
"(",
"self",
",",
"url",
")",
":",
"tries",
"=",
"0",
"while",
"tries",
"<",
"5",
":",
"conn",
"=",
"httplib",
".",
"HTTPConnection",
"(",
"self",
".",
"server",
")",
"conn",
".",
"request",
"(",
"\"GET\"",
",",
"url",
")... | fetch a URL with redirect handling | [
"fetch",
"a",
"URL",
"with",
"redirect",
"handling"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_map/srtm.py#L133-L155 |
249,468 | ArduPilot/MAVProxy | MAVProxy/modules/mavproxy_rc.py | RCModule.cmd_rc | def cmd_rc(self, args):
'''handle RC value override'''
if len(args) != 2:
print("Usage: rc <channel|all> <pwmvalue>")
return
value = int(args[1])
if value > 65535 or value < -1:
raise ValueError("PWM value must be a positive integer between 0 and 65535... | python | def cmd_rc(self, args):
'''handle RC value override'''
if len(args) != 2:
print("Usage: rc <channel|all> <pwmvalue>")
return
value = int(args[1])
if value > 65535 or value < -1:
raise ValueError("PWM value must be a positive integer between 0 and 65535... | [
"def",
"cmd_rc",
"(",
"self",
",",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"!=",
"2",
":",
"print",
"(",
"\"Usage: rc <channel|all> <pwmvalue>\"",
")",
"return",
"value",
"=",
"int",
"(",
"args",
"[",
"1",
"]",
")",
"if",
"value",
">",
"6553... | handle RC value override | [
"handle",
"RC",
"value",
"override"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_rc.py#L86-L106 |
249,469 | ArduPilot/MAVProxy | MAVProxy/modules/lib/rline.py | complete_variable | def complete_variable(text):
'''complete a MAVLink variable or expression'''
if text == '':
return list(rline_mpstate.status.msgs.keys())
if text.endswith(":2"):
suffix = ":2"
text = text[:-2]
else:
suffix = ''
try:
if mavutil.evaluate_expression(text, rline... | python | def complete_variable(text):
'''complete a MAVLink variable or expression'''
if text == '':
return list(rline_mpstate.status.msgs.keys())
if text.endswith(":2"):
suffix = ":2"
text = text[:-2]
else:
suffix = ''
try:
if mavutil.evaluate_expression(text, rline... | [
"def",
"complete_variable",
"(",
"text",
")",
":",
"if",
"text",
"==",
"''",
":",
"return",
"list",
"(",
"rline_mpstate",
".",
"status",
".",
"msgs",
".",
"keys",
"(",
")",
")",
"if",
"text",
".",
"endswith",
"(",
"\":2\"",
")",
":",
"suffix",
"=",
... | complete a MAVLink variable or expression | [
"complete",
"a",
"MAVLink",
"variable",
"or",
"expression"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/rline.py#L94-L136 |
249,470 | ArduPilot/MAVProxy | MAVProxy/modules/lib/rline.py | complete_rule | def complete_rule(rule, cmd):
'''complete using one rule'''
global rline_mpstate
rule_components = rule.split(' ')
# complete the empty string (e.g "graph <TAB><TAB>")
if len(cmd) == 0:
return rule_expand(rule_components[0], "")
# check it matches so far
for i in range(len(cmd)-1)... | python | def complete_rule(rule, cmd):
'''complete using one rule'''
global rline_mpstate
rule_components = rule.split(' ')
# complete the empty string (e.g "graph <TAB><TAB>")
if len(cmd) == 0:
return rule_expand(rule_components[0], "")
# check it matches so far
for i in range(len(cmd)-1)... | [
"def",
"complete_rule",
"(",
"rule",
",",
"cmd",
")",
":",
"global",
"rline_mpstate",
"rule_components",
"=",
"rule",
".",
"split",
"(",
"' '",
")",
"# complete the empty string (e.g \"graph <TAB><TAB>\")",
"if",
"len",
"(",
"cmd",
")",
"==",
"0",
":",
"return"... | complete using one rule | [
"complete",
"using",
"one",
"rule"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/rline.py#L156-L172 |
249,471 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createPlotPanel | def createPlotPanel(self):
'''Creates the figure and axes for the plotting panel.'''
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
self.canvas = FigureCanvas(self,-1,self.figure)
self.canvas.SetSize(wx.Size(300,300))
self.axes.axis('off')
self.fi... | python | def createPlotPanel(self):
'''Creates the figure and axes for the plotting panel.'''
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
self.canvas = FigureCanvas(self,-1,self.figure)
self.canvas.SetSize(wx.Size(300,300))
self.axes.axis('off')
self.fi... | [
"def",
"createPlotPanel",
"(",
"self",
")",
":",
"self",
".",
"figure",
"=",
"Figure",
"(",
")",
"self",
".",
"axes",
"=",
"self",
".",
"figure",
".",
"add_subplot",
"(",
"111",
")",
"self",
".",
"canvas",
"=",
"FigureCanvas",
"(",
"self",
",",
"-",
... | Creates the figure and axes for the plotting panel. | [
"Creates",
"the",
"figure",
"and",
"axes",
"for",
"the",
"plotting",
"panel",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L135-L146 |
249,472 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.rescaleX | def rescaleX(self):
'''Rescales the horizontal axes to make the lengthscales equal.'''
self.ratio = self.figure.get_size_inches()[0]/float(self.figure.get_size_inches()[1])
self.axes.set_xlim(-self.ratio,self.ratio)
self.axes.set_ylim(-1,1) | python | def rescaleX(self):
'''Rescales the horizontal axes to make the lengthscales equal.'''
self.ratio = self.figure.get_size_inches()[0]/float(self.figure.get_size_inches()[1])
self.axes.set_xlim(-self.ratio,self.ratio)
self.axes.set_ylim(-1,1) | [
"def",
"rescaleX",
"(",
"self",
")",
":",
"self",
".",
"ratio",
"=",
"self",
".",
"figure",
".",
"get_size_inches",
"(",
")",
"[",
"0",
"]",
"/",
"float",
"(",
"self",
".",
"figure",
".",
"get_size_inches",
"(",
")",
"[",
"1",
"]",
")",
"self",
"... | Rescales the horizontal axes to make the lengthscales equal. | [
"Rescales",
"the",
"horizontal",
"axes",
"to",
"make",
"the",
"lengthscales",
"equal",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L148-L152 |
249,473 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.calcFontScaling | def calcFontScaling(self):
'''Calculates the current font size and left position for the current window.'''
self.ypx = self.figure.get_size_inches()[1]*self.figure.dpi
self.xpx = self.figure.get_size_inches()[0]*self.figure.dpi
self.fontSize = self.vertSize*(self.ypx/2.0)
self.le... | python | def calcFontScaling(self):
'''Calculates the current font size and left position for the current window.'''
self.ypx = self.figure.get_size_inches()[1]*self.figure.dpi
self.xpx = self.figure.get_size_inches()[0]*self.figure.dpi
self.fontSize = self.vertSize*(self.ypx/2.0)
self.le... | [
"def",
"calcFontScaling",
"(",
"self",
")",
":",
"self",
".",
"ypx",
"=",
"self",
".",
"figure",
".",
"get_size_inches",
"(",
")",
"[",
"1",
"]",
"*",
"self",
".",
"figure",
".",
"dpi",
"self",
".",
"xpx",
"=",
"self",
".",
"figure",
".",
"get_size... | Calculates the current font size and left position for the current window. | [
"Calculates",
"the",
"current",
"font",
"size",
"and",
"left",
"position",
"for",
"the",
"current",
"window",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L154-L160 |
249,474 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.checkReszie | def checkReszie(self):
'''Checks if the window was resized.'''
if not self.resized:
oldypx = self.ypx
oldxpx = self.xpx
self.ypx = self.figure.get_size_inches()[1]*self.figure.dpi
self.xpx = self.figure.get_size_inches()[0]*self.figure.dpi
if (... | python | def checkReszie(self):
'''Checks if the window was resized.'''
if not self.resized:
oldypx = self.ypx
oldxpx = self.xpx
self.ypx = self.figure.get_size_inches()[1]*self.figure.dpi
self.xpx = self.figure.get_size_inches()[0]*self.figure.dpi
if (... | [
"def",
"checkReszie",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"resized",
":",
"oldypx",
"=",
"self",
".",
"ypx",
"oldxpx",
"=",
"self",
".",
"xpx",
"self",
".",
"ypx",
"=",
"self",
".",
"figure",
".",
"get_size_inches",
"(",
")",
"[",
"1",... | Checks if the window was resized. | [
"Checks",
"if",
"the",
"window",
"was",
"resized",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L162-L172 |
249,475 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createHeadingPointer | def createHeadingPointer(self):
'''Creates the pointer for the current heading.'''
self.headingTri = patches.RegularPolygon((0.0,0.80),3,0.05,color='k',zorder=4)
self.axes.add_patch(self.headingTri)
self.headingText = self.axes.text(0.0,0.675,'0',color='k',size=self.fontSize,horizontalal... | python | def createHeadingPointer(self):
'''Creates the pointer for the current heading.'''
self.headingTri = patches.RegularPolygon((0.0,0.80),3,0.05,color='k',zorder=4)
self.axes.add_patch(self.headingTri)
self.headingText = self.axes.text(0.0,0.675,'0',color='k',size=self.fontSize,horizontalal... | [
"def",
"createHeadingPointer",
"(",
"self",
")",
":",
"self",
".",
"headingTri",
"=",
"patches",
".",
"RegularPolygon",
"(",
"(",
"0.0",
",",
"0.80",
")",
",",
"3",
",",
"0.05",
",",
"color",
"=",
"'k'",
",",
"zorder",
"=",
"4",
")",
"self",
".",
"... | Creates the pointer for the current heading. | [
"Creates",
"the",
"pointer",
"for",
"the",
"current",
"heading",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L174-L178 |
249,476 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.adjustHeadingPointer | def adjustHeadingPointer(self):
'''Adjust the value of the heading pointer.'''
self.headingText.set_text(str(self.heading))
self.headingText.set_size(self.fontSize) | python | def adjustHeadingPointer(self):
'''Adjust the value of the heading pointer.'''
self.headingText.set_text(str(self.heading))
self.headingText.set_size(self.fontSize) | [
"def",
"adjustHeadingPointer",
"(",
"self",
")",
":",
"self",
".",
"headingText",
".",
"set_text",
"(",
"str",
"(",
"self",
".",
"heading",
")",
")",
"self",
".",
"headingText",
".",
"set_size",
"(",
"self",
".",
"fontSize",
")"
] | Adjust the value of the heading pointer. | [
"Adjust",
"the",
"value",
"of",
"the",
"heading",
"pointer",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L180-L183 |
249,477 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createNorthPointer | def createNorthPointer(self):
'''Creates the north pointer relative to current heading.'''
self.headingNorthTri = patches.RegularPolygon((0.0,0.80),3,0.05,color='k',zorder=4)
self.axes.add_patch(self.headingNorthTri)
self.headingNorthText = self.axes.text(0.0,0.675,'N',color='k',size=sel... | python | def createNorthPointer(self):
'''Creates the north pointer relative to current heading.'''
self.headingNorthTri = patches.RegularPolygon((0.0,0.80),3,0.05,color='k',zorder=4)
self.axes.add_patch(self.headingNorthTri)
self.headingNorthText = self.axes.text(0.0,0.675,'N',color='k',size=sel... | [
"def",
"createNorthPointer",
"(",
"self",
")",
":",
"self",
".",
"headingNorthTri",
"=",
"patches",
".",
"RegularPolygon",
"(",
"(",
"0.0",
",",
"0.80",
")",
",",
"3",
",",
"0.05",
",",
"color",
"=",
"'k'",
",",
"zorder",
"=",
"4",
")",
"self",
".",
... | Creates the north pointer relative to current heading. | [
"Creates",
"the",
"north",
"pointer",
"relative",
"to",
"current",
"heading",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L185-L189 |
249,478 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.adjustNorthPointer | def adjustNorthPointer(self):
'''Adjust the position and orientation of
the north pointer.'''
self.headingNorthText.set_size(self.fontSize)
headingRotate = mpl.transforms.Affine2D().rotate_deg_around(0.0,0.0,self.heading)+self.axes.transData
self.headingNorthText.set_transform(h... | python | def adjustNorthPointer(self):
'''Adjust the position and orientation of
the north pointer.'''
self.headingNorthText.set_size(self.fontSize)
headingRotate = mpl.transforms.Affine2D().rotate_deg_around(0.0,0.0,self.heading)+self.axes.transData
self.headingNorthText.set_transform(h... | [
"def",
"adjustNorthPointer",
"(",
"self",
")",
":",
"self",
".",
"headingNorthText",
".",
"set_size",
"(",
"self",
".",
"fontSize",
")",
"headingRotate",
"=",
"mpl",
".",
"transforms",
".",
"Affine2D",
"(",
")",
".",
"rotate_deg_around",
"(",
"0.0",
",",
"... | Adjust the position and orientation of
the north pointer. | [
"Adjust",
"the",
"position",
"and",
"orientation",
"of",
"the",
"north",
"pointer",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L191-L207 |
249,479 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createRPYText | def createRPYText(self):
'''Creates the text for roll, pitch and yaw.'''
self.rollText = self.axes.text(self.leftPos+(self.vertSize/10.0),-0.97+(2*self.vertSize)-(self.vertSize/10.0),'Roll: %.2f' % self.roll,color='w',size=self.fontSize)
self.pitchText = self.axes.text(self.leftPos+(self.vertS... | python | def createRPYText(self):
'''Creates the text for roll, pitch and yaw.'''
self.rollText = self.axes.text(self.leftPos+(self.vertSize/10.0),-0.97+(2*self.vertSize)-(self.vertSize/10.0),'Roll: %.2f' % self.roll,color='w',size=self.fontSize)
self.pitchText = self.axes.text(self.leftPos+(self.vertS... | [
"def",
"createRPYText",
"(",
"self",
")",
":",
"self",
".",
"rollText",
"=",
"self",
".",
"axes",
".",
"text",
"(",
"self",
".",
"leftPos",
"+",
"(",
"self",
".",
"vertSize",
"/",
"10.0",
")",
",",
"-",
"0.97",
"+",
"(",
"2",
"*",
"self",
".",
... | Creates the text for roll, pitch and yaw. | [
"Creates",
"the",
"text",
"for",
"roll",
"pitch",
"and",
"yaw",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L217-L224 |
249,480 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.updateRPYLocations | def updateRPYLocations(self):
'''Update the locations of roll, pitch, yaw text.'''
# Locations
self.rollText.set_position((self.leftPos+(self.vertSize/10.0),-0.97+(2*self.vertSize)-(self.vertSize/10.0)))
self.pitchText.set_position((self.leftPos+(self.vertSize/10.0),-0.97+self.vertSize-(... | python | def updateRPYLocations(self):
'''Update the locations of roll, pitch, yaw text.'''
# Locations
self.rollText.set_position((self.leftPos+(self.vertSize/10.0),-0.97+(2*self.vertSize)-(self.vertSize/10.0)))
self.pitchText.set_position((self.leftPos+(self.vertSize/10.0),-0.97+self.vertSize-(... | [
"def",
"updateRPYLocations",
"(",
"self",
")",
":",
"# Locations",
"self",
".",
"rollText",
".",
"set_position",
"(",
"(",
"self",
".",
"leftPos",
"+",
"(",
"self",
".",
"vertSize",
"/",
"10.0",
")",
",",
"-",
"0.97",
"+",
"(",
"2",
"*",
"self",
".",... | Update the locations of roll, pitch, yaw text. | [
"Update",
"the",
"locations",
"of",
"roll",
"pitch",
"yaw",
"text",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L226-L235 |
249,481 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.updateRPYText | def updateRPYText(self):
'Updates the displayed Roll, Pitch, Yaw Text'
self.rollText.set_text('Roll: %.2f' % self.roll)
self.pitchText.set_text('Pitch: %.2f' % self.pitch)
self.yawText.set_text('Yaw: %.2f' % self.yaw) | python | def updateRPYText(self):
'Updates the displayed Roll, Pitch, Yaw Text'
self.rollText.set_text('Roll: %.2f' % self.roll)
self.pitchText.set_text('Pitch: %.2f' % self.pitch)
self.yawText.set_text('Yaw: %.2f' % self.yaw) | [
"def",
"updateRPYText",
"(",
"self",
")",
":",
"self",
".",
"rollText",
".",
"set_text",
"(",
"'Roll: %.2f'",
"%",
"self",
".",
"roll",
")",
"self",
".",
"pitchText",
".",
"set_text",
"(",
"'Pitch: %.2f'",
"%",
"self",
".",
"pitch",
")",
"self",
".",
... | Updates the displayed Roll, Pitch, Yaw Text | [
"Updates",
"the",
"displayed",
"Roll",
"Pitch",
"Yaw",
"Text"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L237-L241 |
249,482 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createCenterPointMarker | def createCenterPointMarker(self):
'''Creates the center pointer in the middle of the screen.'''
self.axes.add_patch(patches.Rectangle((-0.75,-self.thick),0.5,2.0*self.thick,facecolor='orange',zorder=3))
self.axes.add_patch(patches.Rectangle((0.25,-self.thick),0.5,2.0*self.thick,facecolor='orang... | python | def createCenterPointMarker(self):
'''Creates the center pointer in the middle of the screen.'''
self.axes.add_patch(patches.Rectangle((-0.75,-self.thick),0.5,2.0*self.thick,facecolor='orange',zorder=3))
self.axes.add_patch(patches.Rectangle((0.25,-self.thick),0.5,2.0*self.thick,facecolor='orang... | [
"def",
"createCenterPointMarker",
"(",
"self",
")",
":",
"self",
".",
"axes",
".",
"add_patch",
"(",
"patches",
".",
"Rectangle",
"(",
"(",
"-",
"0.75",
",",
"-",
"self",
".",
"thick",
")",
",",
"0.5",
",",
"2.0",
"*",
"self",
".",
"thick",
",",
"f... | Creates the center pointer in the middle of the screen. | [
"Creates",
"the",
"center",
"pointer",
"in",
"the",
"middle",
"of",
"the",
"screen",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L243-L247 |
249,483 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createHorizonPolygons | def createHorizonPolygons(self):
'''Creates the two polygons to show the sky and ground.'''
# Sky Polygon
vertsTop = [[-1,0],[-1,1],[1,1],[1,0],[-1,0]]
self.topPolygon = Polygon(vertsTop,facecolor='dodgerblue',edgecolor='none')
self.axes.add_patch(self.topPolygon)
# Groun... | python | def createHorizonPolygons(self):
'''Creates the two polygons to show the sky and ground.'''
# Sky Polygon
vertsTop = [[-1,0],[-1,1],[1,1],[1,0],[-1,0]]
self.topPolygon = Polygon(vertsTop,facecolor='dodgerblue',edgecolor='none')
self.axes.add_patch(self.topPolygon)
# Groun... | [
"def",
"createHorizonPolygons",
"(",
"self",
")",
":",
"# Sky Polygon",
"vertsTop",
"=",
"[",
"[",
"-",
"1",
",",
"0",
"]",
",",
"[",
"-",
"1",
",",
"1",
"]",
",",
"[",
"1",
",",
"1",
"]",
",",
"[",
"1",
",",
"0",
"]",
",",
"[",
"-",
"1",
... | Creates the two polygons to show the sky and ground. | [
"Creates",
"the",
"two",
"polygons",
"to",
"show",
"the",
"sky",
"and",
"ground",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L249-L258 |
249,484 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.calcHorizonPoints | def calcHorizonPoints(self):
'''Updates the verticies of the patches for the ground and sky.'''
ydiff = math.tan(math.radians(-self.roll))*float(self.ratio)
pitchdiff = self.dist10deg*(self.pitch/10.0)
# Sky Polygon
vertsTop = [(-self.ratio,ydiff-pitchdiff),(-self.ratio,1),(self.... | python | def calcHorizonPoints(self):
'''Updates the verticies of the patches for the ground and sky.'''
ydiff = math.tan(math.radians(-self.roll))*float(self.ratio)
pitchdiff = self.dist10deg*(self.pitch/10.0)
# Sky Polygon
vertsTop = [(-self.ratio,ydiff-pitchdiff),(-self.ratio,1),(self.... | [
"def",
"calcHorizonPoints",
"(",
"self",
")",
":",
"ydiff",
"=",
"math",
".",
"tan",
"(",
"math",
".",
"radians",
"(",
"-",
"self",
".",
"roll",
")",
")",
"*",
"float",
"(",
"self",
".",
"ratio",
")",
"pitchdiff",
"=",
"self",
".",
"dist10deg",
"*"... | Updates the verticies of the patches for the ground and sky. | [
"Updates",
"the",
"verticies",
"of",
"the",
"patches",
"for",
"the",
"ground",
"and",
"sky",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L260-L269 |
249,485 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createPitchMarkers | def createPitchMarkers(self):
'''Creates the rectangle patches for the pitch indicators.'''
self.pitchPatches = []
# Major Lines (multiple of 10 deg)
for i in [-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9]:
width = self.calcPitchMarkerWidth(i)
currPatch = patche... | python | def createPitchMarkers(self):
'''Creates the rectangle patches for the pitch indicators.'''
self.pitchPatches = []
# Major Lines (multiple of 10 deg)
for i in [-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9]:
width = self.calcPitchMarkerWidth(i)
currPatch = patche... | [
"def",
"createPitchMarkers",
"(",
"self",
")",
":",
"self",
".",
"pitchPatches",
"=",
"[",
"]",
"# Major Lines (multiple of 10 deg)",
"for",
"i",
"in",
"[",
"-",
"9",
",",
"-",
"8",
",",
"-",
"7",
",",
"-",
"6",
",",
"-",
"5",
",",
"-",
"4",
",",
... | Creates the rectangle patches for the pitch indicators. | [
"Creates",
"the",
"rectangle",
"patches",
"for",
"the",
"pitch",
"indicators",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L271-L290 |
249,486 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.adjustPitchmarkers | def adjustPitchmarkers(self):
'''Adjusts the location and orientation of pitch markers.'''
pitchdiff = self.dist10deg*(self.pitch/10.0)
rollRotate = mpl.transforms.Affine2D().rotate_deg_around(0.0,-pitchdiff,self.roll)+self.axes.transData
j=0
for i in [-9,-8,-7,-6,-5,-4,-3,-2,-1,... | python | def adjustPitchmarkers(self):
'''Adjusts the location and orientation of pitch markers.'''
pitchdiff = self.dist10deg*(self.pitch/10.0)
rollRotate = mpl.transforms.Affine2D().rotate_deg_around(0.0,-pitchdiff,self.roll)+self.axes.transData
j=0
for i in [-9,-8,-7,-6,-5,-4,-3,-2,-1,... | [
"def",
"adjustPitchmarkers",
"(",
"self",
")",
":",
"pitchdiff",
"=",
"self",
".",
"dist10deg",
"*",
"(",
"self",
".",
"pitch",
"/",
"10.0",
")",
"rollRotate",
"=",
"mpl",
".",
"transforms",
".",
"Affine2D",
"(",
")",
".",
"rotate_deg_around",
"(",
"0.0"... | Adjusts the location and orientation of pitch markers. | [
"Adjusts",
"the",
"location",
"and",
"orientation",
"of",
"pitch",
"markers",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L304-L325 |
249,487 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createAARText | def createAARText(self):
'''Creates the text for airspeed, altitude and climb rate.'''
self.airspeedText = self.axes.text(self.rightPos-(self.vertSize/10.0),-0.97+(2*self.vertSize)-(self.vertSize/10.0),'AS: %.1f m/s' % self.airspeed,color='w',size=self.fontSize,ha='right')
self.altitudeText = ... | python | def createAARText(self):
'''Creates the text for airspeed, altitude and climb rate.'''
self.airspeedText = self.axes.text(self.rightPos-(self.vertSize/10.0),-0.97+(2*self.vertSize)-(self.vertSize/10.0),'AS: %.1f m/s' % self.airspeed,color='w',size=self.fontSize,ha='right')
self.altitudeText = ... | [
"def",
"createAARText",
"(",
"self",
")",
":",
"self",
".",
"airspeedText",
"=",
"self",
".",
"axes",
".",
"text",
"(",
"self",
".",
"rightPos",
"-",
"(",
"self",
".",
"vertSize",
"/",
"10.0",
")",
",",
"-",
"0.97",
"+",
"(",
"2",
"*",
"self",
".... | Creates the text for airspeed, altitude and climb rate. | [
"Creates",
"the",
"text",
"for",
"airspeed",
"altitude",
"and",
"climb",
"rate",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L327-L334 |
249,488 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.updateAARLocations | def updateAARLocations(self):
'''Update the locations of airspeed, altitude and Climb rate.'''
# Locations
self.airspeedText.set_position((self.rightPos-(self.vertSize/10.0),-0.97+(2*self.vertSize)-(self.vertSize/10.0)))
self.altitudeText.set_position((self.rightPos-(self.vertSize/10.0),... | python | def updateAARLocations(self):
'''Update the locations of airspeed, altitude and Climb rate.'''
# Locations
self.airspeedText.set_position((self.rightPos-(self.vertSize/10.0),-0.97+(2*self.vertSize)-(self.vertSize/10.0)))
self.altitudeText.set_position((self.rightPos-(self.vertSize/10.0),... | [
"def",
"updateAARLocations",
"(",
"self",
")",
":",
"# Locations",
"self",
".",
"airspeedText",
".",
"set_position",
"(",
"(",
"self",
".",
"rightPos",
"-",
"(",
"self",
".",
"vertSize",
"/",
"10.0",
")",
",",
"-",
"0.97",
"+",
"(",
"2",
"*",
"self",
... | Update the locations of airspeed, altitude and Climb rate. | [
"Update",
"the",
"locations",
"of",
"airspeed",
"altitude",
"and",
"Climb",
"rate",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L336-L345 |
249,489 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.updateAARText | def updateAARText(self):
'Updates the displayed airspeed, altitude, climb rate Text'
self.airspeedText.set_text('AR: %.1f m/s' % self.airspeed)
self.altitudeText.set_text('ALT: %.1f m ' % self.relAlt)
self.climbRateText.set_text('CR: %.1f m/s' % self.climbRate) | python | def updateAARText(self):
'Updates the displayed airspeed, altitude, climb rate Text'
self.airspeedText.set_text('AR: %.1f m/s' % self.airspeed)
self.altitudeText.set_text('ALT: %.1f m ' % self.relAlt)
self.climbRateText.set_text('CR: %.1f m/s' % self.climbRate) | [
"def",
"updateAARText",
"(",
"self",
")",
":",
"self",
".",
"airspeedText",
".",
"set_text",
"(",
"'AR: %.1f m/s'",
"%",
"self",
".",
"airspeed",
")",
"self",
".",
"altitudeText",
".",
"set_text",
"(",
"'ALT: %.1f m '",
"%",
"self",
".",
"relAlt",
")",
... | Updates the displayed airspeed, altitude, climb rate Text | [
"Updates",
"the",
"displayed",
"airspeed",
"altitude",
"climb",
"rate",
"Text"
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L347-L351 |
249,490 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createBatteryBar | def createBatteryBar(self):
'''Creates the bar to display current battery percentage.'''
self.batOutRec = patches.Rectangle((self.rightPos-(1.3+self.rOffset)*self.batWidth,1.0-(0.1+1.0+(2*0.075))*self.batHeight),self.batWidth*1.3,self.batHeight*1.15,facecolor='darkgrey',edgecolor='none')
self.ba... | python | def createBatteryBar(self):
'''Creates the bar to display current battery percentage.'''
self.batOutRec = patches.Rectangle((self.rightPos-(1.3+self.rOffset)*self.batWidth,1.0-(0.1+1.0+(2*0.075))*self.batHeight),self.batWidth*1.3,self.batHeight*1.15,facecolor='darkgrey',edgecolor='none')
self.ba... | [
"def",
"createBatteryBar",
"(",
"self",
")",
":",
"self",
".",
"batOutRec",
"=",
"patches",
".",
"Rectangle",
"(",
"(",
"self",
".",
"rightPos",
"-",
"(",
"1.3",
"+",
"self",
".",
"rOffset",
")",
"*",
"self",
".",
"batWidth",
",",
"1.0",
"-",
"(",
... | Creates the bar to display current battery percentage. | [
"Creates",
"the",
"bar",
"to",
"display",
"current",
"battery",
"percentage",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L353-L365 |
249,491 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.updateBatteryBar | def updateBatteryBar(self):
'''Updates the position and values of the battery bar.'''
# Bar
self.batOutRec.set_xy((self.rightPos-(1.3+self.rOffset)*self.batWidth,1.0-(0.1+1.0+(2*0.075))*self.batHeight))
self.batInRec.set_xy((self.rightPos-(self.rOffset+1+0.15)*self.batWidth,1.0-(0.1+1+0.... | python | def updateBatteryBar(self):
'''Updates the position and values of the battery bar.'''
# Bar
self.batOutRec.set_xy((self.rightPos-(1.3+self.rOffset)*self.batWidth,1.0-(0.1+1.0+(2*0.075))*self.batHeight))
self.batInRec.set_xy((self.rightPos-(self.rOffset+1+0.15)*self.batWidth,1.0-(0.1+1+0.... | [
"def",
"updateBatteryBar",
"(",
"self",
")",
":",
"# Bar",
"self",
".",
"batOutRec",
".",
"set_xy",
"(",
"(",
"self",
".",
"rightPos",
"-",
"(",
"1.3",
"+",
"self",
".",
"rOffset",
")",
"*",
"self",
".",
"batWidth",
",",
"1.0",
"-",
"(",
"0.1",
"+"... | Updates the position and values of the battery bar. | [
"Updates",
"the",
"position",
"and",
"values",
"of",
"the",
"battery",
"bar",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L367-L391 |
249,492 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createStateText | def createStateText(self):
'''Creates the mode and arm state text.'''
self.modeText = self.axes.text(self.leftPos+(self.vertSize/10.0),0.97,'UNKNOWN',color='grey',size=1.5*self.fontSize,ha='left',va='top')
self.modeText.set_path_effects([PathEffects.withStroke(linewidth=self.fontSize/10.0,foregr... | python | def createStateText(self):
'''Creates the mode and arm state text.'''
self.modeText = self.axes.text(self.leftPos+(self.vertSize/10.0),0.97,'UNKNOWN',color='grey',size=1.5*self.fontSize,ha='left',va='top')
self.modeText.set_path_effects([PathEffects.withStroke(linewidth=self.fontSize/10.0,foregr... | [
"def",
"createStateText",
"(",
"self",
")",
":",
"self",
".",
"modeText",
"=",
"self",
".",
"axes",
".",
"text",
"(",
"self",
".",
"leftPos",
"+",
"(",
"self",
".",
"vertSize",
"/",
"10.0",
")",
",",
"0.97",
",",
"'UNKNOWN'",
",",
"color",
"=",
"'g... | Creates the mode and arm state text. | [
"Creates",
"the",
"mode",
"and",
"arm",
"state",
"text",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L393-L396 |
249,493 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.updateStateText | def updateStateText(self):
'''Updates the mode and colours red or green depending on arm state.'''
self.modeText.set_position((self.leftPos+(self.vertSize/10.0),0.97))
self.modeText.set_text(self.mode)
self.modeText.set_size(1.5*self.fontSize)
if self.armed:
self.mode... | python | def updateStateText(self):
'''Updates the mode and colours red or green depending on arm state.'''
self.modeText.set_position((self.leftPos+(self.vertSize/10.0),0.97))
self.modeText.set_text(self.mode)
self.modeText.set_size(1.5*self.fontSize)
if self.armed:
self.mode... | [
"def",
"updateStateText",
"(",
"self",
")",
":",
"self",
".",
"modeText",
".",
"set_position",
"(",
"(",
"self",
".",
"leftPos",
"+",
"(",
"self",
".",
"vertSize",
"/",
"10.0",
")",
",",
"0.97",
")",
")",
"self",
".",
"modeText",
".",
"set_text",
"("... | Updates the mode and colours red or green depending on arm state. | [
"Updates",
"the",
"mode",
"and",
"colours",
"red",
"or",
"green",
"depending",
"on",
"arm",
"state",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L398-L414 |
249,494 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createWPText | def createWPText(self):
'''Creates the text for the current and final waypoint,
and the distance to the new waypoint.'''
self.wpText = self.axes.text(self.leftPos+(1.5*self.vertSize/10.0),0.97-(1.5*self.vertSize)+(0.5*self.vertSize/10.0),'0/0\n(0 m, 0 s)',color='w',size=self.fontSize,ha='left',v... | python | def createWPText(self):
'''Creates the text for the current and final waypoint,
and the distance to the new waypoint.'''
self.wpText = self.axes.text(self.leftPos+(1.5*self.vertSize/10.0),0.97-(1.5*self.vertSize)+(0.5*self.vertSize/10.0),'0/0\n(0 m, 0 s)',color='w',size=self.fontSize,ha='left',v... | [
"def",
"createWPText",
"(",
"self",
")",
":",
"self",
".",
"wpText",
"=",
"self",
".",
"axes",
".",
"text",
"(",
"self",
".",
"leftPos",
"+",
"(",
"1.5",
"*",
"self",
".",
"vertSize",
"/",
"10.0",
")",
",",
"0.97",
"-",
"(",
"1.5",
"*",
"self",
... | Creates the text for the current and final waypoint,
and the distance to the new waypoint. | [
"Creates",
"the",
"text",
"for",
"the",
"current",
"and",
"final",
"waypoint",
"and",
"the",
"distance",
"to",
"the",
"new",
"waypoint",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L416-L420 |
249,495 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.updateWPText | def updateWPText(self):
'''Updates the current waypoint and distance to it.'''
self.wpText.set_position((self.leftPos+(1.5*self.vertSize/10.0),0.97-(1.5*self.vertSize)+(0.5*self.vertSize/10.0)))
self.wpText.set_size(self.fontSize)
if type(self.nextWPTime) is str:
self.wpText... | python | def updateWPText(self):
'''Updates the current waypoint and distance to it.'''
self.wpText.set_position((self.leftPos+(1.5*self.vertSize/10.0),0.97-(1.5*self.vertSize)+(0.5*self.vertSize/10.0)))
self.wpText.set_size(self.fontSize)
if type(self.nextWPTime) is str:
self.wpText... | [
"def",
"updateWPText",
"(",
"self",
")",
":",
"self",
".",
"wpText",
".",
"set_position",
"(",
"(",
"self",
".",
"leftPos",
"+",
"(",
"1.5",
"*",
"self",
".",
"vertSize",
"/",
"10.0",
")",
",",
"0.97",
"-",
"(",
"1.5",
"*",
"self",
".",
"vertSize",... | Updates the current waypoint and distance to it. | [
"Updates",
"the",
"current",
"waypoint",
"and",
"distance",
"to",
"it",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L422-L429 |
249,496 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createWPPointer | def createWPPointer(self):
'''Creates the waypoint pointer relative to current heading.'''
self.headingWPTri = patches.RegularPolygon((0.0,0.55),3,0.05,facecolor='lime',zorder=4,ec='k')
self.axes.add_patch(self.headingWPTri)
self.headingWPText = self.axes.text(0.0,0.45,'1',color='lime',s... | python | def createWPPointer(self):
'''Creates the waypoint pointer relative to current heading.'''
self.headingWPTri = patches.RegularPolygon((0.0,0.55),3,0.05,facecolor='lime',zorder=4,ec='k')
self.axes.add_patch(self.headingWPTri)
self.headingWPText = self.axes.text(0.0,0.45,'1',color='lime',s... | [
"def",
"createWPPointer",
"(",
"self",
")",
":",
"self",
".",
"headingWPTri",
"=",
"patches",
".",
"RegularPolygon",
"(",
"(",
"0.0",
",",
"0.55",
")",
",",
"3",
",",
"0.05",
",",
"facecolor",
"=",
"'lime'",
",",
"zorder",
"=",
"4",
",",
"ec",
"=",
... | Creates the waypoint pointer relative to current heading. | [
"Creates",
"the",
"waypoint",
"pointer",
"relative",
"to",
"current",
"heading",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L431-L436 |
249,497 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.adjustWPPointer | def adjustWPPointer(self):
'''Adjust the position and orientation of
the waypoint pointer.'''
self.headingWPText.set_size(self.fontSize)
headingRotate = mpl.transforms.Affine2D().rotate_deg_around(0.0,0.0,-self.wpBearing+self.heading)+self.axes.transData
self.headingWPText.set_t... | python | def adjustWPPointer(self):
'''Adjust the position and orientation of
the waypoint pointer.'''
self.headingWPText.set_size(self.fontSize)
headingRotate = mpl.transforms.Affine2D().rotate_deg_around(0.0,0.0,-self.wpBearing+self.heading)+self.axes.transData
self.headingWPText.set_t... | [
"def",
"adjustWPPointer",
"(",
"self",
")",
":",
"self",
".",
"headingWPText",
".",
"set_size",
"(",
"self",
".",
"fontSize",
")",
"headingRotate",
"=",
"mpl",
".",
"transforms",
".",
"Affine2D",
"(",
")",
".",
"rotate_deg_around",
"(",
"0.0",
",",
"0.0",
... | Adjust the position and orientation of
the waypoint pointer. | [
"Adjust",
"the",
"position",
"and",
"orientation",
"of",
"the",
"waypoint",
"pointer",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L438-L453 |
249,498 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.createAltHistoryPlot | def createAltHistoryPlot(self):
'''Creates the altitude history plot.'''
self.altHistRect = patches.Rectangle((self.leftPos+(self.vertSize/10.0),-0.25),0.5,0.5,facecolor='grey',edgecolor='none',alpha=0.4,zorder=4)
self.axes.add_patch(self.altHistRect)
self.altPlot, = self.axes.plot([self... | python | def createAltHistoryPlot(self):
'''Creates the altitude history plot.'''
self.altHistRect = patches.Rectangle((self.leftPos+(self.vertSize/10.0),-0.25),0.5,0.5,facecolor='grey',edgecolor='none',alpha=0.4,zorder=4)
self.axes.add_patch(self.altHistRect)
self.altPlot, = self.axes.plot([self... | [
"def",
"createAltHistoryPlot",
"(",
"self",
")",
":",
"self",
".",
"altHistRect",
"=",
"patches",
".",
"Rectangle",
"(",
"(",
"self",
".",
"leftPos",
"+",
"(",
"self",
".",
"vertSize",
"/",
"10.0",
")",
",",
"-",
"0.25",
")",
",",
"0.5",
",",
"0.5",
... | Creates the altitude history plot. | [
"Creates",
"the",
"altitude",
"history",
"plot",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L455-L461 |
249,499 | ArduPilot/MAVProxy | MAVProxy/modules/lib/wxhorizon_ui.py | HorizonFrame.updateAltHistory | def updateAltHistory(self):
'''Updates the altitude history plot.'''
self.altHist.append(self.relAlt)
self.timeHist.append(self.relAltTime)
# Delete entries older than x seconds
histLim = 10
currentTime = time.time()
point = 0
for i in range(0,len... | python | def updateAltHistory(self):
'''Updates the altitude history plot.'''
self.altHist.append(self.relAlt)
self.timeHist.append(self.relAltTime)
# Delete entries older than x seconds
histLim = 10
currentTime = time.time()
point = 0
for i in range(0,len... | [
"def",
"updateAltHistory",
"(",
"self",
")",
":",
"self",
".",
"altHist",
".",
"append",
"(",
"self",
".",
"relAlt",
")",
"self",
".",
"timeHist",
".",
"append",
"(",
"self",
".",
"relAltTime",
")",
"# Delete entries older than x seconds",
"histLim",
"=",
"1... | Updates the altitude history plot. | [
"Updates",
"the",
"altitude",
"history",
"plot",
"."
] | f50bdeff33064876f7dc8dc4683d278ff47f75d5 | https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L463-L517 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.