Пример #1
0
    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()
Пример #2
0
def cmd_map(args):
    '''map command'''
    import mavflightview
    #mestate.mlog.reduce_by_flightmodes(mestate.flightmode_selections)
    #setup and process the map
    options = mavflightview.mavflightview_options()
    options.condition = mestate.settings.condition
    options._flightmodes = mestate.mlog._flightmodes
    options.show_flightmode_legend = mestate.settings.show_flightmode
    options.colour_source='flightmode'
    options.nkf_sample = 1
    if len(args) > 0:
        options.types = ','.join(args)
        if len(options.types) > 1:
            options.colour_source='type'
    [path, wp, fen, used_flightmodes, mav_type, instances] = mavflightview.mavflightview_mav(mestate.mlog, options, mestate.flightmode_selections)
    global map_timelim_pipes
    timelim_pipe = multiproc.Pipe()
    child = multiproc.Process(target=mavflightview.mavflightview_show, args=[path, wp, fen, used_flightmodes, mav_type, options, instances, None, timelim_pipe])
    map_timelim_pipes.append(timelim_pipe)
    global last_xlim
    if last_xlim is not None and mestate.settings.sync_xmap:
        try:
            timelim_pipe[0].send(last_xlim)
        except Exception:
            pass
    child.start()
    mestate.mlog.rewind()
Пример #3
0
 def __init__(self, mestate):
     self.mestate = mestate
     self.xlim = None
     global graph_count
     self.count = graph_count
     graph_count += 1
     self.xlim_pipe = multiproc.Pipe()
Пример #4
0
 def __init__(self, title='MAVProxy: console'):
     textconsole.SimpleConsole.__init__(self)
     self.title = title
     self.menu_callback = None
     self.parent_pipe_recv, self.child_pipe_send = multiproc.Pipe(
         duplex=False)
     self.child_pipe_recv, self.parent_pipe_send = multiproc.Pipe(
         duplex=False)
     self.close_event = multiproc.Event()
     self.close_event.clear()
     self.child = multiproc.Process(target=self.child_task)
     self.child.start()
     self.child_pipe_send.close()
     self.child_pipe_recv.close()
     t = threading.Thread(target=self.watch_thread)
     t.daemon = True
     t.start()
Пример #5
0
    def start_background_capture(self):
        # create pipe
        self.parent_conn, imgcap_conn = multiproc.Pipe()

        # create and start the sub process and pass it it's end of the pipe
        self.proc = multiproc.Process(target=self.image_capture_background,
                                      args=(imgcap_conn, ))
        self.proc.start()
Пример #6
0
 def __init__(self,title='MAVProxy: Horizon Indicator'):
     self.title  = title
     # Create Pipe to send attitude information from module to UI
     self.child_pipe_recv,self.parent_pipe_send = multiproc.Pipe()
     self.close_event = multiproc.Event()
     self.close_event.clear()
     self.child = multiproc.Process(target=self.child_task)
     self.child.start()
     self.child_pipe_recv.close()
Пример #7
0
 def __init__(self, title='MAVProxy: Checklist'):
     import threading
     self.title = title
     self.menu_callback = None
     self.parent_pipe, self.child_pipe = multiproc.Pipe()
     self.close_event = multiproc.Event()
     self.close_event.clear()
     self.child = multiproc.Process(target=self.child_task)
     self.child.start()
Пример #8
0
 def __init__(self, parmsToShow, title='MAVProxy: Swarm Control', takeoffalt=10):
     self.title = title
     self.parmsToShow = parmsToShow
     self.takeoffalt = takeoffalt
     self.parent_pipe, self.child_pipe = multiproc.Pipe()
     self.close_event = multiproc.Event()
     self.close_event.clear()
     self.child = multiproc.Process(target=self.child_task)
     self.child.start()
Пример #9
0
 def __init__(self, settings):
     self.settings = settings
     self.parent_pipe, self.child_pipe = multiproc.Pipe()
     self.close_event = multiproc.Event()
     self.close_event.clear()
     self.child = multiproc.Process(target=self.child_task)
     self.child.start()
     t = threading.Thread(target=self.watch_thread)
     t.daemon = True
     t.start()
Пример #10
0
    def __init__(self, title="MAVProxy: Sailing Dashboard"):
        self.title = title

        # create a pipe for communication from the module to the GUI
        self.child_pipe_recv, self.parent_pipe_send = multiproc.Pipe(
            duplex=False)
        self.close_event = multiproc.Event()
        self.close_event.clear()

        # create and start the child process
        self.child = multiproc.Process(target=self.child_task)
        self.child.start()

        # prevent the parent from using the child connection
        self.child_pipe_recv.close()
Пример #11
0
    def __init__(self, mpstate):
        super(MagicalModule, self).__init__(mpstate, 'magical')
        self.add_command(
            'magical_ui',
            self.cmd_magical_ui,
            'open the GUI for compass calibration',
        )

        self.mpstate = mpstate
        self.parent_pipe, self.child_pipe = multiproc.Pipe()
        self.ui_process = None
        self.progress_msgs = {}
        self.report_msgs = {}
        self.attitude_msg = None
        self.raw_imu_msg = None
        self.running = False
        self.last_ui_msgs = {}
Пример #12
0
 def __init__(self,
              fields,
              title='MAVProxy: LiveGraph',
              timespan=20.0,
              tickresolution=0.2,
              colors=[
                  'red', 'green', 'blue', 'orange', 'olive', 'cyan',
                  'magenta', 'brown', 'violet', 'purple', 'grey', 'black'
              ]):
     self.fields = fields
     self.colors = colors
     self.title = title
     self.timespan = timespan
     self.tickresolution = tickresolution
     self.values = [None] * len(self.fields)
     self.parent_pipe, self.child_pipe = multiproc.Pipe()
     self.close_graph = multiproc.Event()
     self.close_graph.clear()
     self.child = multiproc.Process(target=self.child_task)
     self.child.start()
Пример #13
0
 def __init__(self):
     self.parent_pipe, self.child_pipe = multiproc.Pipe()
     self.close_event = multiproc.Event()
     self.close_event.clear()
     self.child = multiproc.Process(target=self.child_task)
     self.child.start()
Пример #14
0
 def kill_ui(self):
     self.ui_process.terminate()
     self.parent_pipe, self.child_pipe = multiproc.Pipe()
Пример #15
0
 def __init__(self, *args, **kwargs):
     self._child_pipe_recv, self._parent_pipe_send = multiproc.Pipe(duplex=False)
     self._close_event = multiproc.Event()
     self._close_event.clear()
     self._child = None