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
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
235,600
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
235,601
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
235,602
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
235,603
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
235,604
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
235,605
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
235,606
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
235,607
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
235,608
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
235,609
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
235,610
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
235,611
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
235,612
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
235,613
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): """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) == ...
[ "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
235,614
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
235,615
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
235,616
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): """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
[ "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
235,617
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(): """ 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...
[ "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
235,618
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(): """ 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: ...
[ "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
235,619
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): """ 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
[ "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
235,620
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): """ 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) ...
[ "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
235,621
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): """ Select the current bitmap into this wxDC instance """ 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
235,622
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): """ Select a Null bitmasp into this wxDC instance """ 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
235,623
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): """ 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 ...
[ "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
235,624
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): """ 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: ...
[ "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
235,625
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): """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)) ...
[ "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
235,626
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
235,627
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): """ 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...
[ "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
235,628
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): """ 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...
[ "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
235,629
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): """ 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...
[ "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
235,630
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): """ 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...
[ "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
235,631
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
235,632
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): """ 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():...
[ "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
235,633
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): """ 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()
[ "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
235,634
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): """ 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...
[ "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
235,635
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
235,636
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): """Capture key press.""" 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
235,637
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): """Release key.""" 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
235,638
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): """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...
[ "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
235,639
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): """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...
[ "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
235,640
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): """Mouse has left the window.""" 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
235,641
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
235,642
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): """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()
[ "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
235,643
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): """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()) ...
[ "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
235,644
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): """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: ...
[ "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
235,645
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): """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...
[ "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
235,646
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): """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
[ "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
235,647
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): """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])
[ "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
235,648
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): """ 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...
[ "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
235,649
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): """ 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...
[ "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
235,650
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): """ 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...
[ "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
235,651
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
235,652
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
235,653
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
235,654
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
235,655
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
235,656
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
235,657
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
235,658
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
235,659
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
235,660
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
235,661
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
235,662
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
235,663
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
235,664
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
235,665
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
235,666
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
235,667
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
235,668
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
235,669
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
235,670
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
235,671
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
235,672
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
235,673
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
235,674
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
235,675
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
235,676
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
235,677
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
235,678
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
235,679
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
235,680
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
235,681
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
235,682
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
235,683
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
235,684
ArduPilot/MAVProxy
MAVProxy/modules/lib/wxhorizon_ui.py
HorizonFrame.on_idle
def on_idle(self, event): '''To adjust text and positions on rescaling the window when resized.''' # Check for resize self.checkReszie() if self.resized: # Fix Window Scales self.rescaleX() self.calcFontScaling() # Re...
python
def on_idle(self, event): '''To adjust text and positions on rescaling the window when resized.''' # Check for resize self.checkReszie() if self.resized: # Fix Window Scales self.rescaleX() self.calcFontScaling() # Re...
[ "def", "on_idle", "(", "self", ",", "event", ")", ":", "# Check for resize", "self", ".", "checkReszie", "(", ")", "if", "self", ".", "resized", ":", "# Fix Window Scales ", "self", ".", "rescaleX", "(", ")", "self", ".", "calcFontScaling", "(", ")", "# Re...
To adjust text and positions on rescaling the window when resized.
[ "To", "adjust", "text", "and", "positions", "on", "rescaling", "the", "window", "when", "resized", "." ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L520-L567
235,685
ArduPilot/MAVProxy
MAVProxy/modules/lib/wxhorizon_ui.py
HorizonFrame.on_timer
def on_timer(self, event): '''Main Loop.''' state = self.state self.loopStartTime = time.time() if state.close_event.wait(0.001): self.timer.Stop() self.Destroy() return # Check for resizing self.checkReszie() if self.r...
python
def on_timer(self, event): '''Main Loop.''' state = self.state self.loopStartTime = time.time() if state.close_event.wait(0.001): self.timer.Stop() self.Destroy() return # Check for resizing self.checkReszie() if self.r...
[ "def", "on_timer", "(", "self", ",", "event", ")", ":", "state", "=", "self", ".", "state", "self", ".", "loopStartTime", "=", "time", ".", "time", "(", ")", "if", "state", ".", "close_event", ".", "wait", "(", "0.001", ")", ":", "self", ".", "time...
Main Loop.
[ "Main", "Loop", "." ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L569-L675
235,686
ArduPilot/MAVProxy
MAVProxy/modules/lib/wxhorizon_ui.py
HorizonFrame.on_KeyPress
def on_KeyPress(self,event): '''To adjust the distance between pitch markers.''' if event.GetKeyCode() == wx.WXK_UP: self.dist10deg += 0.1 print('Dist per 10 deg: %.1f' % self.dist10deg) elif event.GetKeyCode() == wx.WXK_DOWN: self.dist10deg -= 0.1 ...
python
def on_KeyPress(self,event): '''To adjust the distance between pitch markers.''' if event.GetKeyCode() == wx.WXK_UP: self.dist10deg += 0.1 print('Dist per 10 deg: %.1f' % self.dist10deg) elif event.GetKeyCode() == wx.WXK_DOWN: self.dist10deg -= 0.1 ...
[ "def", "on_KeyPress", "(", "self", ",", "event", ")", ":", "if", "event", ".", "GetKeyCode", "(", ")", "==", "wx", ".", "WXK_UP", ":", "self", ".", "dist10deg", "+=", "0.1", "print", "(", "'Dist per 10 deg: %.1f'", "%", "self", ".", "dist10deg", ")", "...
To adjust the distance between pitch markers.
[ "To", "adjust", "the", "distance", "between", "pitch", "markers", "." ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/wxhorizon_ui.py#L677-L712
235,687
ArduPilot/MAVProxy
MAVProxy/modules/mavproxy_fence.py
FenceModule.fenceloader
def fenceloader(self): '''fence loader by sysid''' if not self.target_system in self.fenceloader_by_sysid: self.fenceloader_by_sysid[self.target_system] = mavwp.MAVFenceLoader() return self.fenceloader_by_sysid[self.target_system]
python
def fenceloader(self): '''fence loader by sysid''' if not self.target_system in self.fenceloader_by_sysid: self.fenceloader_by_sysid[self.target_system] = mavwp.MAVFenceLoader() return self.fenceloader_by_sysid[self.target_system]
[ "def", "fenceloader", "(", "self", ")", ":", "if", "not", "self", ".", "target_system", "in", "self", ".", "fenceloader_by_sysid", ":", "self", ".", "fenceloader_by_sysid", "[", "self", ".", "target_system", "]", "=", "mavwp", ".", "MAVFenceLoader", "(", ")"...
fence loader by sysid
[ "fence", "loader", "by", "sysid" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_fence.py#L51-L55
235,688
ArduPilot/MAVProxy
MAVProxy/modules/mavproxy_fence.py
FenceModule.mavlink_packet
def mavlink_packet(self, m): '''handle and incoming mavlink packet''' if m.get_type() == "FENCE_STATUS": self.last_fence_breach = m.breach_time self.last_fence_status = m.breach_status elif m.get_type() in ['SYS_STATUS']: bits = mavutil.mavlink.MAV_SYS_STATUS_...
python
def mavlink_packet(self, m): '''handle and incoming mavlink packet''' if m.get_type() == "FENCE_STATUS": self.last_fence_breach = m.breach_time self.last_fence_status = m.breach_status elif m.get_type() in ['SYS_STATUS']: bits = mavutil.mavlink.MAV_SYS_STATUS_...
[ "def", "mavlink_packet", "(", "self", ",", "m", ")", ":", "if", "m", ".", "get_type", "(", ")", "==", "\"FENCE_STATUS\"", ":", "self", ".", "last_fence_breach", "=", "m", ".", "breach_time", "self", ".", "last_fence_status", "=", "m", ".", "breach_status",...
handle and incoming mavlink packet
[ "handle", "and", "incoming", "mavlink", "packet" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_fence.py#L66-L103
235,689
ArduPilot/MAVProxy
MAVProxy/modules/mavproxy_fence.py
FenceModule.load_fence
def load_fence(self, filename): '''load fence points from a file''' try: self.fenceloader.target_system = self.target_system self.fenceloader.target_component = self.target_component self.fenceloader.load(filename.strip('"')) except Exception as msg: ...
python
def load_fence(self, filename): '''load fence points from a file''' try: self.fenceloader.target_system = self.target_system self.fenceloader.target_component = self.target_component self.fenceloader.load(filename.strip('"')) except Exception as msg: ...
[ "def", "load_fence", "(", "self", ",", "filename", ")", ":", "try", ":", "self", ".", "fenceloader", ".", "target_system", "=", "self", ".", "target_system", "self", ".", "fenceloader", ".", "target_component", "=", "self", ".", "target_component", "self", "...
load fence points from a file
[ "load", "fence", "points", "from", "a", "file" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_fence.py#L205-L215
235,690
ArduPilot/MAVProxy
MAVProxy/modules/mavproxy_fence.py
FenceModule.list_fence
def list_fence(self, filename): '''list fence points, optionally saving to a file''' self.fenceloader.clear() count = self.get_mav_param('FENCE_TOTAL', 0) if count == 0: print("No geo-fence points") return for i in range(int(count)): p = self.f...
python
def list_fence(self, filename): '''list fence points, optionally saving to a file''' self.fenceloader.clear() count = self.get_mav_param('FENCE_TOTAL', 0) if count == 0: print("No geo-fence points") return for i in range(int(count)): p = self.f...
[ "def", "list_fence", "(", "self", ",", "filename", ")", ":", "self", ".", "fenceloader", ".", "clear", "(", ")", "count", "=", "self", ".", "get_mav_param", "(", "'FENCE_TOTAL'", ",", "0", ")", "if", "count", "==", "0", ":", "print", "(", "\"No geo-fen...
list fence points, optionally saving to a file
[ "list", "fence", "points", "optionally", "saving", "to", "a", "file" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_fence.py#L277-L308
235,691
ArduPilot/MAVProxy
MAVProxy/modules/lib/mp_image.py
MPImage.poll
def poll(self): '''check for events, returning one event''' if self.out_queue.qsize() <= 0: return None evt = self.out_queue.get() while isinstance(evt, win_layout.WinLayout): win_layout.set_layout(evt, self.set_layout) if self.out_queue.qsize() == 0: ...
python
def poll(self): '''check for events, returning one event''' if self.out_queue.qsize() <= 0: return None evt = self.out_queue.get() while isinstance(evt, win_layout.WinLayout): win_layout.set_layout(evt, self.set_layout) if self.out_queue.qsize() == 0: ...
[ "def", "poll", "(", "self", ")", ":", "if", "self", ".", "out_queue", ".", "qsize", "(", ")", "<=", "0", ":", "return", "None", "evt", "=", "self", ".", "out_queue", ".", "get", "(", ")", "while", "isinstance", "(", "evt", ",", "win_layout", ".", ...
check for events, returning one event
[ "check", "for", "events", "returning", "one", "event" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/lib/mp_image.py#L172-L182
235,692
ArduPilot/MAVProxy
MAVProxy/modules/mavproxy_map/mp_slipmap_ui.py
MPSlipMapFrame.find_object
def find_object(self, key, layers): '''find an object to be modified''' state = self.state if layers is None or layers == '': layers = state.layers.keys() for layer in layers: if key in state.layers[layer]: return state.layers[layer][key] ...
python
def find_object(self, key, layers): '''find an object to be modified''' state = self.state if layers is None or layers == '': layers = state.layers.keys() for layer in layers: if key in state.layers[layer]: return state.layers[layer][key] ...
[ "def", "find_object", "(", "self", ",", "key", ",", "layers", ")", ":", "state", "=", "self", ".", "state", "if", "layers", "is", "None", "or", "layers", "==", "''", ":", "layers", "=", "state", ".", "layers", ".", "keys", "(", ")", "for", "layer",...
find an object to be modified
[ "find", "an", "object", "to", "be", "modified" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_map/mp_slipmap_ui.py#L140-L149
235,693
ArduPilot/MAVProxy
MAVProxy/modules/mavproxy_map/mp_slipmap_ui.py
MPSlipMapFrame.add_object
def add_object(self, obj): '''add an object to a layer''' state = self.state if not obj.layer in state.layers: # its a new layer state.layers[obj.layer] = {} state.layers[obj.layer][obj.key] = obj state.need_redraw = True if (not self.legend_checkb...
python
def add_object(self, obj): '''add an object to a layer''' state = self.state if not obj.layer in state.layers: # its a new layer state.layers[obj.layer] = {} state.layers[obj.layer][obj.key] = obj state.need_redraw = True if (not self.legend_checkb...
[ "def", "add_object", "(", "self", ",", "obj", ")", ":", "state", "=", "self", ".", "state", "if", "not", "obj", ".", "layer", "in", "state", ".", "layers", ":", "# its a new layer", "state", ".", "layers", "[", "obj", ".", "layer", "]", "=", "{", "...
add an object to a layer
[ "add", "an", "object", "to", "a", "layer" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_map/mp_slipmap_ui.py#L177-L189
235,694
ArduPilot/MAVProxy
MAVProxy/modules/mavproxy_map/mp_slipmap_ui.py
MPSlipMapPanel.set_ground_width
def set_ground_width(self, ground_width): '''set ground width of view''' state = self.state state.ground_width = ground_width state.panel.re_center(state.width/2, state.height/2, state.lat, state.lon)
python
def set_ground_width(self, ground_width): '''set ground width of view''' state = self.state state.ground_width = ground_width state.panel.re_center(state.width/2, state.height/2, state.lat, state.lon)
[ "def", "set_ground_width", "(", "self", ",", "ground_width", ")", ":", "state", "=", "self", ".", "state", "state", ".", "ground_width", "=", "ground_width", "state", ".", "panel", ".", "re_center", "(", "state", ".", "width", "/", "2", ",", "state", "."...
set ground width of view
[ "set", "ground", "width", "of", "view" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_map/mp_slipmap_ui.py#L387-L391
235,695
ArduPilot/MAVProxy
MAVProxy/modules/mavproxy_map/mp_slipmap_ui.py
MPSlipMapPanel.show_popup
def show_popup(self, selected, pos): '''show popup menu for an object''' state = self.state if selected.popup_menu is not None: import copy popup_menu = selected.popup_menu if state.default_popup is not None and state.default_popup.combine: pop...
python
def show_popup(self, selected, pos): '''show popup menu for an object''' state = self.state if selected.popup_menu is not None: import copy popup_menu = selected.popup_menu if state.default_popup is not None and state.default_popup.combine: pop...
[ "def", "show_popup", "(", "self", ",", "selected", ",", "pos", ")", ":", "state", "=", "self", ".", "state", "if", "selected", ".", "popup_menu", "is", "not", "None", ":", "import", "copy", "popup_menu", "=", "selected", ".", "popup_menu", "if", "state",...
show popup menu for an object
[ "show", "popup", "menu", "for", "an", "object" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/modules/mavproxy_map/mp_slipmap_ui.py#L568-L579
235,696
ArduPilot/MAVProxy
MAVProxy/mavproxy.py
cmd_watch
def cmd_watch(args): '''watch a mavlink packet pattern''' if len(args) == 0: mpstate.status.watch = None return mpstate.status.watch = args print("Watching %s" % mpstate.status.watch)
python
def cmd_watch(args): '''watch a mavlink packet pattern''' if len(args) == 0: mpstate.status.watch = None return mpstate.status.watch = args print("Watching %s" % mpstate.status.watch)
[ "def", "cmd_watch", "(", "args", ")", ":", "if", "len", "(", "args", ")", "==", "0", ":", "mpstate", ".", "status", ".", "watch", "=", "None", "return", "mpstate", ".", "status", ".", "watch", "=", "args", "print", "(", "\"Watching %s\"", "%", "mpsta...
watch a mavlink packet pattern
[ "watch", "a", "mavlink", "packet", "pattern" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/mavproxy.py#L315-L321
235,697
ArduPilot/MAVProxy
MAVProxy/mavproxy.py
load_module
def load_module(modname, quiet=False, **kwargs): '''load a module''' modpaths = ['MAVProxy.modules.mavproxy_%s' % modname, modname] for (m,pm) in mpstate.modules: if m.name == modname and not modname in mpstate.multi_instance: if not quiet: print("module %s already loaded...
python
def load_module(modname, quiet=False, **kwargs): '''load a module''' modpaths = ['MAVProxy.modules.mavproxy_%s' % modname, modname] for (m,pm) in mpstate.modules: if m.name == modname and not modname in mpstate.multi_instance: if not quiet: print("module %s already loaded...
[ "def", "load_module", "(", "modname", ",", "quiet", "=", "False", ",", "*", "*", "kwargs", ")", ":", "modpaths", "=", "[", "'MAVProxy.modules.mavproxy_%s'", "%", "modname", ",", "modname", "]", "for", "(", "m", ",", "pm", ")", "in", "mpstate", ".", "mo...
load a module
[ "load", "a", "module" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/mavproxy.py#L337-L372
235,698
ArduPilot/MAVProxy
MAVProxy/mavproxy.py
process_mavlink
def process_mavlink(slave): '''process packets from MAVLink slaves, forwarding to the master''' try: buf = slave.recv() except socket.error: return try: global mavversion if slave.first_byte and mavversion is None: slave.auto_mavlink_version(buf) msgs ...
python
def process_mavlink(slave): '''process packets from MAVLink slaves, forwarding to the master''' try: buf = slave.recv() except socket.error: return try: global mavversion if slave.first_byte and mavversion is None: slave.auto_mavlink_version(buf) msgs ...
[ "def", "process_mavlink", "(", "slave", ")", ":", "try", ":", "buf", "=", "slave", ".", "recv", "(", ")", "except", "socket", ".", "error", ":", "return", "try", ":", "global", "mavversion", "if", "slave", ".", "first_byte", "and", "mavversion", "is", ...
process packets from MAVLink slaves, forwarding to the master
[ "process", "packets", "from", "MAVLink", "slaves", "forwarding", "to", "the", "master" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/mavproxy.py#L638-L662
235,699
ArduPilot/MAVProxy
MAVProxy/mavproxy.py
log_writer
def log_writer(): '''log writing thread''' while True: mpstate.logfile_raw.write(bytearray(mpstate.logqueue_raw.get())) timeout = time.time() + 10 while not mpstate.logqueue_raw.empty() and time.time() < timeout: mpstate.logfile_raw.write(mpstate.logqueue_raw.get()) w...
python
def log_writer(): '''log writing thread''' while True: mpstate.logfile_raw.write(bytearray(mpstate.logqueue_raw.get())) timeout = time.time() + 10 while not mpstate.logqueue_raw.empty() and time.time() < timeout: mpstate.logfile_raw.write(mpstate.logqueue_raw.get()) w...
[ "def", "log_writer", "(", ")", ":", "while", "True", ":", "mpstate", ".", "logfile_raw", ".", "write", "(", "bytearray", "(", "mpstate", ".", "logqueue_raw", ".", "get", "(", ")", ")", ")", "timeout", "=", "time", ".", "time", "(", ")", "+", "10", ...
log writing thread
[ "log", "writing", "thread" ]
f50bdeff33064876f7dc8dc4683d278ff47f75d5
https://github.com/ArduPilot/MAVProxy/blob/f50bdeff33064876f7dc8dc4683d278ff47f75d5/MAVProxy/mavproxy.py#L677-L688