# Path: rtlsdr_scanner/events.py
# def post_event(destination, status):
#     if isinstance(destination, Queue.Queue):
#         destination.put(status)
#     elif isinstance(destination, wx.EvtHandler):
#         wx.PostEvent(destination, status)
# 
# class EventThread(wx.PyEvent):
#     def __init__(self, status, arg1=None, arg2=None):
#         wx.PyEvent.__init__(self)
#         self.SetEventType(EVENT_THREAD)
#         self.data = Status(status, arg1, arg2)
# 
# class Event(object):
#     STARTING, STEPS, INFO, DATA, STOPPED, ERROR, FINISHED, PROCESSED, \
#         CAL, LEVEL, UPDATED, DRAW, \
#         DELAY_COUNT, DELAY_START, \
#         LOC, LOC_RAW, LOC_WARN, LOC_ERR, LOC_SAT = range(19)


import threading
import time
from matplotlib.ticker import ScalarFormatter, AutoMinorLocator
from rtlsdr_scanner.events import post_event, EventThread, Event
from rtlsdr_scanner.utils_mpl import utc_to_mpl, set_date_ticks

        return self.threadPlot

    def redraw_plot(self):
        if self.figure is not None:
            post_event(self.notify, EventThread(Event.DRAW))

    def clear_plots(self):
        set_date_ticks(self.axes.xaxis, False)
        children = self.axes.get_children()
        for child in children:
            if child.get_gid() is not None:
                if child.get_gid() == 'plot':
                    child.remove()

    def set_grid(self, on):
        self.axes.grid(on)
        self.redraw_plot()

    def set_axes(self, on):
        if on:
            self.axes.set_axis_on()
        else:
            self.axes.set_axis_off()

    def close(self):
        self.figure.clear()
        self.figure = None



# Path: rtlsdr_scanner/events.py
# def post_event(destination, status):
#     if isinstance(destination, Queue.Queue):
#         destination.put(status)
#     elif isinstance(destination, wx.EvtHandler):
#         wx.PostEvent(destination, status)
# 
# class EventThread(wx.PyEvent):
#     def __init__(self, status, arg1=None, arg2=None):
#         wx.PyEvent.__init__(self)
#         self.SetEventType(EVENT_THREAD)
#         self.data = Status(status, arg1, arg2)
# 
# class Event(object):
#     STARTING, STEPS, INFO, DATA, STOPPED, ERROR, FINISHED, PROCESSED, \
#         CAL, LEVEL, UPDATED, DRAW, \
#         DELAY_COUNT, DELAY_START, \
#         LOC, LOC_RAW, LOC_WARN, LOC_ERR, LOC_SAT = range(19)


# Path: rtlsdr_scanner/plot_time.py
import threading
import time
from matplotlib.ticker import ScalarFormatter, AutoMinorLocator
from rtlsdr_scanner.events import post_event, EventThread, Event
from rtlsdr_scanner.utils_mpl import utc_to_mpl, set_date_ticks


        return self.threadPlot

    def redraw_plot(self):
        if self.figure is not None:
            post_event(self.notify, EventThread(Event.DRAW))

    def clear_plots(self):
        set_date_ticks(self.axes.xaxis, False)
        children = self.axes.get_children()
        for child in children:
            if child.get_gid() is not None:
                if child.get_gid() == 'plot':
                    child.remove()

    def set_grid(self, on):
        self.axes.grid(on)
        self.redraw_plot()

    def set_axes(self, on):
        if on:
            self.axes.set_axis_on()
        else:
            self.axes.set_axis_off()

    def close(self):
        self.figure.clear()
        self.figure = None



class ThreadPlot(threading.Thread):