Esempio n. 1
0
    def __init__(self, canvas, panel, settings, callBackHideOverlay):
        self.panel = panel
        self.settings = settings
        self.callbackHide = callBackHideOverlay
        self.plot = None
        self.extraTools = []
        self.panPos = None

        NavigationToolbar2WxAgg.__init__(self, canvas)
        if matplotlib.__version__ >= '1.2':
            panId = self.wx_ids['Pan']
        else:
            panId = self.FindById(self._NTB2_PAN).GetId()

        self.ToggleTool(panId, True)
        self.pan()

        self.__add_spacer(False)

        liveId = wx.NewId()
        self.AddCheckTool(liveId,
                          load_bitmap('auto_refresh'),
                          shortHelp='Real time plotting\n(slow and buggy)')
        self.ToggleTool(liveId, settings.liveUpdate)
        wx.EVT_TOOL(self, liveId, self.__on_check_update)

        gridId = wx.NewId()
        self.AddCheckTool(gridId,
                          load_bitmap('grid'),
                          shortHelp='Toggle plot_line grid')
        self.ToggleTool(gridId, settings.grid)
        wx.EVT_TOOL(self, gridId, self.__on_check_grid)

        self.peakId = wx.NewId()
        self.peaksId = None

        self.autoFId = None
        self.autoLId = None
        self.autoTId = None

        self.maxId = None
        self.minId = None
        self.avgId = None
        self.varId = None
        self.smoothId = None
        self.diffId = None
        self.deltaId = None

        self.colourId = None
Esempio n. 2
0
    def __init__(self, parent, log):
        self.controls = [None] * 5
        self.timeStart = None
        self.log = log

        wx.StatusBar.__init__(self, parent, -1)
        self.SetFieldsCount(len(self.controls))

        self.controls[0] = wx.StaticText(self, label=self.TEXT_GENERAL,
                                         style=wx.ST_NO_AUTORESIZE)
        self.controls[1] = wx.StaticText(self, label=self.TEXT_INFO,
                                         style=wx.ST_NO_AUTORESIZE)
        self.controls[2] = Led(self, label=self.TEXT_GPS)
        self.controls[3] = wx.Gauge(self, -1,
                                    style=wx.GA_HORIZONTAL | wx.GA_SMOOTH)
        animation = Animation(load_bitmap('busy', False, 'gif'))
        busy = AnimationCtrl(self, anim=animation)
        busy.SetToolTipString('Updating plot')
        self.controls[4] = busy

        self.controls[3].Hide()
        self.controls[4].Hide()

        self.SetStatusWidths([-1, -1, -1, -1, busy.GetSize()[0] * 4])

        self.Bind(wx.EVT_SIZE, self.__on_size)
        wx.CallAfter(self.__on_size, None)

        self.Fit()
Esempio n. 3
0
    def __init__(self, parent):
        wx.Dialog.__init__(self, parent=parent, title="About")

        bitmapIcon = wx.StaticBitmap(self, bitmap=load_bitmap('icon'))
        textAbout = wx.StaticText(self, label="A simple spectrum analyser for "
                                  "scanning\n with a RTL-SDR compatible USB "
                                  "device", style=wx.ALIGN_CENTRE)
        textLink = wx.HyperlinkCtrl(self, wx.ID_ANY,
                                    label="http://eartoearoak.com/software/rtlsdr-scanner",
                                    url="http://eartoearoak.com/software/rtlsdr-scanner")
        textTimestamp = wx.StaticText(self,
                                      label="Updated: " + get_version_timestamp())
        buttonOk = wx.Button(self, wx.ID_OK)

        grid = wx.GridBagSizer(10, 10)
        grid.Add(bitmapIcon, pos=(0, 0), span=(3, 1),
                 flag=wx.ALIGN_LEFT | wx.ALL, border=10)
        grid.Add(textAbout, pos=(0, 1), span=(1, 2),
                 flag=wx.ALIGN_CENTRE | wx.ALL, border=10)
        grid.Add(textLink, pos=(1, 1), span=(1, 2),
                 flag=wx.ALIGN_CENTRE | wx.ALL, border=10)
        grid.Add(textTimestamp, pos=(2, 1), span=(1, 2),
                 flag=wx.ALIGN_CENTRE | wx.ALL, border=10)
        grid.Add(buttonOk, pos=(3, 2),
                 flag=wx.ALIGN_RIGHT | wx.ALL, border=10)

        self.SetSizerAndFit(grid)
        self.Centre()
Esempio n. 4
0
    def __init__(self, canvas, panel, settings, callBackHideOverlay):
        self.panel = panel
        self.settings = settings
        self.callbackHide = callBackHideOverlay
        self.plot = None
        self.extraTools = []
        self.panPos = None

        NavigationToolbar2WxAgg.__init__(self, canvas)
        if matplotlib.__version__ >= '1.2':
            panId = self.wx_ids['Pan']
        else:
            panId = self.FindById(self._NTB2_PAN).GetId()

        self.ToggleTool(panId, True)
        self.pan()

        self.__add_spacer(False)

        liveId = wx.NewId()
        self.AddCheckTool(liveId, load_bitmap('auto_refresh'),
                          shortHelp='Real time plotting\n(slow and buggy)')
        self.ToggleTool(liveId, settings.liveUpdate)
        wx.EVT_TOOL(self, liveId, self.__on_check_update)

        gridId = wx.NewId()
        self.AddCheckTool(gridId, load_bitmap('grid'),
                          shortHelp='Toggle plot_line grid')
        self.ToggleTool(gridId, settings.grid)
        wx.EVT_TOOL(self, gridId, self.__on_check_grid)

        self.peakId = wx.NewId()
        self.peaksId = None

        self.autoFId = None
        self.autoLId = None
        self.autoTId = None

        self.maxId = None
        self.minId = None
        self.avgId = None
        self.varId = None
        self.smoothId = None
        self.diffId = None
        self.deltaId = None

        self.colourId = None
Esempio n. 5
0
 def __add_check_tool(self, bitmap, toolTip, callback, setting=None, toolId=None):
     if toolId is None:
         toolId = wx.NewId()
     self.AddCheckTool(toolId, load_bitmap(bitmap), shortHelp=toolTip)
     wx.EVT_TOOL(self, toolId, callback)
     if setting is not None:
         self.ToggleTool(toolId, setting)
     self.extraTools.append(toolId)
Esempio n. 6
0
 def __add_check_tool(self, bitmap, toolTip, callback, setting=None, toolId=None):
     if toolId is None:
         toolId = wx.NewId()
     self.AddCheckTool(toolId, load_bitmap(bitmap), shortHelp=toolTip)
     wx.EVT_TOOL(self, toolId, callback)
     if setting is not None:
         self.ToggleTool(toolId, setting)
     self.extraTools.append(toolId)
Esempio n. 7
0
    def __send_png(self):
        self.send_response(200)
        self.send_header('Content-type', 'image/png')
        self.end_headers()

        filename = load_bitmap('crosshair', False)
        f = open(filename, 'rb')
        self.wfile.write(f.read())
        f.close()
Esempio n. 8
0
    def __send_png(self):
        self.send_response(200)
        self.send_header('Content-type', 'image/png')
        self.end_headers()

        filename = load_bitmap('crosshair', False)
        f = open(filename, 'rb')
        self.wfile.write(f.read())
        f.close()
Esempio n. 9
0
    def __init__(self, panel):
        NavigationToolbar2WxAgg.__init__(self, panel.get_canvas())
        self.panel = panel

        self.AddSeparator()

        gridId = wx.NewId()
        self.AddCheckTool(gridId, load_bitmap('grid'), shortHelp='Toggle grid')
        self.ToggleTool(gridId, True)
        wx.EVT_TOOL(self, gridId, self.__on_check_grid)
Esempio n. 10
0
    def __init__(self, panel):
        NavigationToolbar2WxAgg.__init__(self, panel.get_canvas())
        self.panel = panel

        self.AddSeparator()

        gridId = wx.NewId()
        self.AddCheckTool(gridId, load_bitmap('grid'),
                          shortHelp='Toggle grid')
        self.ToggleTool(gridId, True)
        wx.EVT_TOOL(self, gridId, self.__on_check_grid)
Esempio n. 11
0
    def __init__(self, parent):
        wx.Dialog.__init__(self, parent=parent, title="About")

        bitmapIcon = wx.StaticBitmap(self, bitmap=load_bitmap('icon'))
        textAbout = wx.StaticText(self,
                                  label="A simple spectrum analyser for "
                                  "scanning\n with a RTL-SDR compatible USB "
                                  "device",
                                  style=wx.ALIGN_CENTRE)
        textLink = wx.HyperlinkCtrl(
            self,
            wx.ID_ANY,
            label="http://eartoearoak.com/software/rtlsdr-scanner",
            url="http://eartoearoak.com/software/rtlsdr-scanner")
        textTimestamp = wx.StaticText(self,
                                      label="Updated: " +
                                      get_version_timestamp())
        buttonOk = wx.Button(self, wx.ID_OK)

        grid = wx.GridBagSizer(10, 10)
        grid.Add(bitmapIcon,
                 pos=(0, 0),
                 span=(3, 1),
                 flag=wx.ALIGN_LEFT | wx.ALL,
                 border=10)
        grid.Add(textAbout,
                 pos=(0, 1),
                 span=(1, 2),
                 flag=wx.ALIGN_CENTRE | wx.ALL,
                 border=10)
        grid.Add(textLink,
                 pos=(1, 1),
                 span=(1, 2),
                 flag=wx.ALIGN_CENTRE | wx.ALL,
                 border=10)
        grid.Add(textTimestamp,
                 pos=(2, 1),
                 span=(1, 2),
                 flag=wx.ALIGN_CENTRE | wx.ALL,
                 border=10)
        grid.Add(buttonOk, pos=(3, 2), flag=wx.ALIGN_RIGHT | wx.ALL, border=10)

        self.SetSizerAndFit(grid)
        self.Centre()
Esempio n. 12
0
 def __add_spacer(self, temp=True):
     sepId = wx.NewId()
     self.AddCheckTool(sepId, load_bitmap('spacer'))
     self.EnableTool(sepId, False)
     if temp:
         self.extraTools.append(sepId)
Esempio n. 13
0
 def __add_spacer(self, temp=True):
     sepId = wx.NewId()
     self.AddCheckTool(sepId, load_bitmap('spacer'))
     self.EnableTool(sepId, False)
     if temp:
         self.extraTools.append(sepId)