def __init__(self, mpstate): self.num_wps_expected = 0 #helps me to know if all my waypoints I'm expecting have arrived self.wps_received = {} self.event_queue = multiproc.Queue() self.event_queue_lock = multiproc.Lock() self.gui_event_queue = multiproc.Queue() self.gui_event_queue_lock = multiproc.Lock() self.close_window = multiproc.Semaphore() self.close_window.acquire() self.child = multiproc.Process(target=self.child_task,args=(self.event_queue,self.event_queue_lock,self.gui_event_queue,self.gui_event_queue_lock,self.close_window)) self.child.start() self.event_thread = MissionEditorEventThread(self, self.event_queue, self.event_queue_lock) self.event_thread.start() self.mpstate = mpstate self.mpstate.miss_editor = self self.last_unload_check_time = time.time() self.unload_check_interval = 0.1 # seconds self.time_to_quit = False self.mavlink_message_queue = multiproc.Queue() self.mavlink_message_queue_handler = threading.Thread(target=self.mavlink_message_queue_handler) self.mavlink_message_queue_handler.start()
def __init__(self, mpstate): self.param_received = {} self.paramchanged = {} self.event_queue = multiproc.Queue() self.event_queue_lock = multiproc.Lock() self.gui_event_queue = multiproc.Queue() self.gui_event_queue_lock = multiproc.Lock() self.close_window = multiproc.Semaphore() self.close_window.acquire() self.mpstate = mpstate self.mpstate.param_editor = self self.needs_unloading = False self.child = multiproc.Process( target=self.child_task, args=(self.event_queue, self.event_queue_lock, self.gui_event_queue, self.gui_event_queue_lock, self.close_window)) self.child.start() self.event_thread = ParamEditorEventThread(self, self.event_queue, self.event_queue_lock) self.event_thread.start() self.last_unload_check_time = time.time() self.unload_check_interval = 0.1 # seconds self.time_to_quit = False self.mavlink_message_queue = multiproc.Queue() self.mavlink_message_queue_handler = threading.Thread( target=self.mavlink_message_queue_handler) self.mavlink_message_queue_handler.start()
def __init__(self, title='SlipMap', lat=-35.362938, lon=149.165085, width=800, height=600, ground_width=1000, tile_delay=0.3, service="MicrosoftSat", max_zoom=19, debug=False, brightness=0, elevation=False, download=True, show_flightmode_legend=True, timelim_pipe=None): self.lat = lat self.lon = lon self.width = width self.height = height self.ground_width = ground_width self.download = download self.service = service self.tile_delay = tile_delay self.debug = debug self.max_zoom = max_zoom self.elevation = elevation self.oldtext = None self.brightness = brightness self.legend = show_flightmode_legend self.timelim_pipe = timelim_pipe self.drag_step = 10 self.title = title self.app_ready = multiproc.Event() self.event_queue = multiproc.Queue() self.object_queue = multiproc.Queue() self.close_window = multiproc.Semaphore() self.close_window.acquire() self.child = multiproc.Process(target=self.child_task) self.child.start() self._callbacks = set() # ensure the map application is ready before returning if not self._wait_ready(timeout=2.0): raise Exception("map not ready")
def __init__(self, title='SlipMap', lat=-35.362938, lon=149.165085, width=800, height=600, ground_width=1000, tile_delay=0.3, service="MicrosoftSat", max_zoom=19, debug=False, brightness=0, elevation=False, download=True, show_flightmode_legend=True): self.lat = lat self.lon = lon self.width = width self.height = height self.ground_width = ground_width self.download = download self.service = service self.tile_delay = tile_delay self.debug = debug self.max_zoom = max_zoom self.elevation = elevation self.oldtext = None self.brightness = brightness self.legend = show_flightmode_legend self.drag_step = 10 self.title = title self.event_queue = multiproc.Queue() self.object_queue = multiproc.Queue() self.close_window = multiproc.Semaphore() self.close_window.acquire() self.child = multiproc.Process(target=self.child_task) self.child.start() self._callbacks = set()