def __init__(self): self.input_queue = multiproc.Queue() self.rl = None self.console = wxconsole.MessageConsole(title='MAVExplorer') self.exit = False self.status = MEStatus() self.settings = MPSettings([ MPSetting('marker', str, '+', 'data marker', tab='Graph'), MPSetting('condition', str, None, 'condition'), MPSetting('xaxis', str, None, 'xaxis'), MPSetting('linestyle', str, None, 'linestyle'), MPSetting('show_flightmode', bool, True, 'show flightmode'), MPSetting('sync_xzoom', bool, True, 'sync X-axis zoom'), MPSetting('sync_xmap', bool, True, 'sync X-axis zoom for map'), MPSetting('legend', str, 'upper left', 'legend position'), MPSetting('legend2', str, 'upper right', 'legend2 position'), MPSetting('title', str, None, 'Graph title'), MPSetting('debug', int, 0, 'debug level'), MPSetting('paramdocs', bool, True, 'show param docs'), ]) self.mlog = None self.mav_param = None self.filename = None self.command_map = command_map self.completions = { "set": ["(SETTING)"], "condition": ["(VARIABLE)"], "graph": [ '(VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE)' ], "map": ['(VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE) (VARIABLE)'], "param": ['download', 'check', 'help (PARAMETER)'], } self.aliases = {} self.graphs = [] self.flightmode_selections = [] self.last_graph = GraphDefinition(self.settings.title, '', '', [], None) #pipe to the wxconsole for any child threads (such as the save dialog box) self.parent_pipe_recv_console, self.child_pipe_send_console = multiproc.Pipe( duplex=False) #pipe for creating graphs (such as from the save dialog box) self.parent_pipe_recv_graph, self.child_pipe_send_graph = multiproc.Pipe( duplex=False) self.param_help = param_help.ParamHelp() tConsoleWrite = threading.Thread(target=self.pipeRecvConsole) tConsoleWrite.daemon = True tConsoleWrite.start() tGraphWrite = threading.Thread(target=self.pipeRecvGraph) tGraphWrite.daemon = True tGraphWrite.start()
def __init__(self, mav_param, logdir, vehicle_name, parm_file, mpstate, sysid): self.mav_param_set = set() self.mav_param_count = 0 self.param_period = mavutil.periodic_event(1) self.fetch_one = dict() self.mav_param = mav_param self.logdir = logdir self.vehicle_name = vehicle_name self.parm_file = parm_file self.fetch_set = None self.new_sysid_timestamp = time.time() self.autopilot_type_by_sysid = {} self.param_types = {} self.ftp_failed = False self.ftp_started = False self.ftp_count = None self.ftp_send_param = None self.mpstate = mpstate self.sysid = sysid self.param_help = param_help.ParamHelp() self.param_help.vehicle_name = vehicle_name