Ejemplo n.º 1
0
    def _build_subpanel(self, vbox_arg):
        # build a secondary information panel (sometimes hidden)

        # FIXME figure out how to have this be a subpanel that is always
        # created, but has its visibility controlled by foo.Show(True/False)

        if not (self.show_debug_info):
            return

        panel = self.panel
        vbox = vbox_arg
        myform = self.myform

        # panel = wx.Panel(self.panel, -1)
        # vbox = wx.BoxSizer(wx.VERTICAL)

        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add((5, 0), 0)
        myform["decim"] = form.static_float_field(parent=panel, sizer=hbox, label="Decim")

        hbox.Add((5, 0), 1)
        myform["fs@usb"] = form.static_float_field(parent=panel, sizer=hbox, label="Fs@USB")

        hbox.Add((5, 0), 1)
        myform["dbname"] = form.static_text_field(parent=panel, sizer=hbox)

        hbox.Add((5, 0), 1)
        myform["baseband"] = form.static_float_field(parent=panel, sizer=hbox, label="Analog BB")

        hbox.Add((5, 0), 1)
        myform["ddc"] = form.static_float_field(parent=panel, sizer=hbox, label="DDC")

        hbox.Add((5, 0), 0)
        vbox.Add(hbox, 0, wx.EXPAND)
Ejemplo n.º 2
0
    def _build_subpanel(self, vbox_arg):
        # build a secondary information panel (sometimes hidden)

        # FIXME figure out how to have this be a subpanel that is always
        # created, but has its visibility controlled by foo.Show(True/False)
        
        def _form_set_samp_rate(kv):
            return self.set_samp_rate(kv['samprate'])

        if not(self.show_debug_info):
            return

        panel = self.panel
        vbox = vbox_arg
        myform = self.myform

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        hbox.Add((5,0), 0)
        myform['samprate'] = form.float_field(
            parent=panel, sizer=hbox, label="Sample Rate",
            callback=myform.check_input_and_call(_form_set_samp_rate,
                                                 self._set_status_msg))

        hbox.Add((5,0), 1)
        myform['rffreq'] = form.static_float_field(
            parent=panel, sizer=hbox, label="RF Freq.")

        hbox.Add((5,0), 1)
        myform['dspfreq'] = form.static_float_field(
            parent=panel, sizer=hbox, label="DSP Freq.")

        hbox.Add((5,0), 0)
        vbox.Add(hbox, 0, wx.EXPAND)
 def _build_subpanel(self, vbox_arg):
     # build a secondary information panel (sometimes hidden)
     # FIXME figure out how to have this be a subpanel that is always
     # created, but has its visibility controlled by foo.Show(True/False)
     def _form_set_decim(kv):
         return self.set_decim(kv['decim'])
     if not(self.show_debug_info):
         return
     panel = self.panel
     vbox = vbox_arg
     myform = self.myform
     #panel = wx.Panel(self.panel, -1)
     #vbox = wx.BoxSizer(wx.VERTICAL)
     hbox = wx.BoxSizer(wx.HORIZONTAL)
     hbox.Add((5,0), 0)
     myform['decim'] = form.int_field(
             parent=panel, sizer=hbox, label="Decim",
             callback=myform.check_input_and_call(_form_set_decim, self._set_status_msg))
     hbox.Add((5,0), 1)
     myform['fs@usb'] = form.static_float_field(
             parent=panel, sizer=hbox, label="Fs@USB")
     hbox.Add((5,0), 1)
     myform['dbname'] = form.static_text_field(
             parent=panel, sizer=hbox)
     hbox.Add((5,0), 1)
     myform['baseband'] = form.static_float_field(
             parent=panel, sizer=hbox, label="Analog BB")
     hbox.Add((5,0), 1)
     myform['ddc'] = form.static_float_field(
             parent=panel, sizer=hbox, label="DDC")
     hbox.Add((5,0), 0)
     vbox.Add(hbox, 0, wx.EXPAND)
Ejemplo n.º 4
0
    def _build_subpanel(self, vbox_arg):
        # build a secondary information panel (sometimes hidden)

        # FIXME figure out how to have this be a subpanel that is always
        # created, but has its visibility controlled by foo.Show(True/False)

        def _form_set_decim(kv):
            return self.set_decim(kv['decim'])

        if not (self.show_debug_info):
            return

        panel = self.panel
        vbox = vbox_arg
        myform = self.myform

        #panel = wx.Panel(self.panel, -1)
        #vbox = wx.BoxSizer(wx.VERTICAL)

        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add((5, 0), 0)

        myform['decim'] = form.int_field(parent=panel,
                                         sizer=hbox,
                                         label="Decim",
                                         callback=myform.check_input_and_call(
                                             _form_set_decim,
                                             self._set_status_msg))

        hbox.Add((5, 0), 1)
        myform['fs@usb'] = form.static_float_field(parent=panel,
                                                   sizer=hbox,
                                                   label="Fs@USB")

        hbox.Add((5, 0), 1)
        myform['dbname'] = form.static_text_field(parent=panel, sizer=hbox)

        hbox.Add((5, 0), 1)
        myform['baseband'] = form.static_float_field(parent=panel,
                                                     sizer=hbox,
                                                     label="Analog BB")

        hbox.Add((5, 0), 1)
        myform['ddc'] = form.static_float_field(parent=panel,
                                                sizer=hbox,
                                                label="DDC")
        if self.num_inputs == 2:
            hbox.Add((1, 0), 1)
            myform['baseband2'] = form.static_float_field(parent=panel,
                                                          sizer=hbox,
                                                          label="BB2")
            hbox.Add((1, 0), 1)
            myform['ddc2'] = form.static_float_field(parent=panel,
                                                     sizer=hbox,
                                                     label="DDC2")

        hbox.Add((5, 0), 0)
        vbox.Add(hbox, 0, wx.EXPAND)
Ejemplo n.º 5
0
    def _build_subpanel(self, vbox_arg):
        # build a secondary information panel (sometimes hidden)

        # FIXME figure out how to have this be a subpanel that is always
        # created, but has its visibility controlled by foo.Show(True/False)

        def _form_set_samp_rate(kv):
            return self.set_samp_rate(kv['samprate'])

        if not (self.show_debug_info):
            return

        panel = self.panel
        vbox = vbox_arg
        myform = self.myform

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        hbox.Add((5, 0), 0)
        myform['samprate'] = form.float_field(
            parent=panel,
            sizer=hbox,
            label="Sample Rate",
            callback=myform.check_input_and_call(_form_set_samp_rate,
                                                 self._set_status_msg))

        hbox.Add((5, 0), 1)
        myform['fs@gbe'] = form.static_float_field(parent=panel,
                                                   sizer=hbox,
                                                   label="Fs@GbE")

        hbox.Add((5, 0), 1)
        myform['baseband'] = form.static_float_field(parent=panel,
                                                     sizer=hbox,
                                                     label="Analog BB")

        hbox.Add((5, 0), 1)
        myform['ddc'] = form.static_float_field(parent=panel,
                                                sizer=hbox,
                                                label="DDC")

        hbox.Add((5, 0), 0)
        vbox.Add(hbox, 0, wx.EXPAND)
Ejemplo n.º 6
0
    def _build_subpanel(self, vbox_arg):
        # build a secondary information panel (sometimes hidden)

        # FIXME figure out how to have this be a subpanel that is always
        # created, but has its visibility controlled by foo.Show(True/False)

        if not (self.show_debug_info):
            return

        panel = self.panel
        vbox = vbox_arg
        myform = self.myform

        #panel = wx.Panel(self.panel, -1)
        #vbox = wx.BoxSizer(wx.VERTICAL)

        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add((5, 0), 0)
        myform['decim'] = form.static_float_field(parent=panel,
                                                  sizer=hbox,
                                                  label="Decim")

        hbox.Add((5, 0), 1)
        myform['fs@usb'] = form.static_float_field(parent=panel,
                                                   sizer=hbox,
                                                   label="Fs@USB")

        hbox.Add((5, 0), 1)
        myform['dbname'] = form.static_text_field(parent=panel, sizer=hbox)

        hbox.Add((5, 0), 1)
        myform['baseband'] = form.static_float_field(parent=panel,
                                                     sizer=hbox,
                                                     label="Analog BB")

        hbox.Add((5, 0), 1)
        myform['ddc'] = form.static_float_field(parent=panel,
                                                sizer=hbox,
                                                label="DDC")

        hbox.Add((5, 0), 0)
        vbox.Add(hbox, 0, wx.EXPAND)
Ejemplo n.º 7
0
    def build_gui(self):
        self.myform = myform = form.form()

        # Baseband controls
        bb_sbox = wx.StaticBox(parent=self.panel, label="Baseband Modulation")
        bb_vbox = wx.StaticBoxSizer(
            bb_sbox, wx.VERTICAL)  # Holds all baseband controls as unit

        # First row of baseband controls (modulation type)
        mod_hbox = wx.BoxSizer(wx.HORIZONTAL)
        mod_hbox.Add((10, 0), 0, 0)
        myform['type'] = form.radiobox_field(
            parent=self.panel,
            label="Type",
            sizer=mod_hbox,
            value=None,
            callback=self.evt_set_waveform_type,
            weight=1,
            major_dimension=0,
            choices=usrp2_siggen.waveforms.values())
        bb_vbox.Add((0, 10), 0, 0)
        bb_vbox.Add(mod_hbox, 0, wx.EXPAND)

        # Second row of baseband controls (frequencies)
        bbf_hbox = wx.BoxSizer(wx.HORIZONTAL)
        bbf_hbox.Add((10, 0), 0, 0)
        myform['w1freq'] = form.float_field(
            parent=self.panel,
            sizer=bbf_hbox,
            label="Frequency 1 (Hz)",
            weight=1,
            callback=myform.check_input_and_call(self.evt_set_freq1,
                                                 self.evt_set_status_msg))
        bbf_hbox.Add((10, 0), 0, 0)
        myform['w2freq'] = form.float_field(
            parent=self.panel,
            sizer=bbf_hbox,
            label="Frequency 2 (Hz)",
            weight=1,
            callback=myform.check_input_and_call(self.evt_set_freq2,
                                                 self.evt_set_status_msg))
        bbf_hbox.Add((10, 0), 0, 0)

        bb_vbox.Add((0, 10), 0, 0)
        bb_vbox.Add(bbf_hbox, 0, wx.EXPAND)

        # Add baseband controls to top window sizer
        self.vbox.Add((0, 10), 0, 0)
        self.vbox.Add(bb_vbox, 0, wx.EXPAND)

        # Frequency controls
        fc_sbox = wx.StaticBox(parent=self.panel, label="Center Frequency")
        fc_vbox = wx.StaticBoxSizer(
            fc_sbox, wx.VERTICAL)  # Holds all frequency controls as unit

        # First row of frequency controls (center frequency)
        freq_hbox = wx.BoxSizer(wx.HORIZONTAL)
        freq_hbox.Add((10, 0), 0, 0)
        myform['freq'] = form.float_field(parent=self.panel,
                                          sizer=freq_hbox,
                                          label=None,
                                          weight=1,
                                          callback=myform.check_input_and_call(
                                              self.evt_set_freq,
                                              self.evt_set_status_msg))
        freq_hbox.Add((10, 0), 0, 0)
        myform['freq_slider'] = form.quantized_slider_field(
            parent=self.panel,
            sizer=freq_hbox,
            label="Min-Max",
            weight=4,
            range=(self.min_freq, self.max_freq, self.freq_step),
            callback=self.evt_set_freq)
        freq_hbox.Add((10, 0), 0, 0)

        fc_vbox.Add((10, 0), 0, 0)
        fc_vbox.Add(freq_hbox, 0, wx.EXPAND)

        # Second row of frequency controls (results)
        tr_hbox = wx.BoxSizer(wx.HORIZONTAL)
        tr_hbox.Add((10, 0), 0, 0)
        myform['analog'] = form.static_float_field(parent=self.panel,
                                                   sizer=tr_hbox,
                                                   label="Daughterboard: (Hz)",
                                                   weight=1)
        tr_hbox.Add((10, 0), 0, 0)
        myform['DDC'] = form.static_float_field(parent=self.panel,
                                                sizer=tr_hbox,
                                                label="USRP2 DDC (Hz)",
                                                weight=1)
        tr_hbox.Add((10, 0), 0, 0)
        fc_vbox.Add(tr_hbox, 0, wx.EXPAND)

        # Add frequency controls to top window sizer
        self.vbox.Add((0, 10), 0, 0)
        self.vbox.Add(fc_vbox, 0, wx.EXPAND)

        # Amplitude row
        amp_sbox = wx.StaticBox(parent=self.panel, label="Amplitude")
        amp_hbox = wx.StaticBoxSizer(amp_sbox, wx.HORIZONTAL)
        amp_hbox.Add((10, 0), 0, 0)
        myform['amp'] = form.float_field(parent=self.panel,
                                         sizer=amp_hbox,
                                         label="Linear\n(0.0-1.0)",
                                         weight=1,
                                         callback=myform.check_input_and_call(
                                             self.evt_set_amplitude,
                                             self.evt_set_status_msg))
        amp_hbox.Add((10, 0), 0, 0)
        myform['amp_slider'] = form.quantized_slider_field(
            parent=self.panel,
            sizer=amp_hbox,
            label="dB Full Scale\n(-100-0)",
            weight=4,
            range=(-100.0, 0.0, 1),
            callback=self.evt_set_amplitude)
        amp_hbox.Add((10, 0), 0, 0)
        self.vbox.Add((0, 10), 0, 0)
        self.vbox.Add(amp_hbox, 0, wx.EXPAND)

        # Sample rate row
        sam_sbox = wx.StaticBox(parent=self.panel, label="Sample Rate")
        sam_hbox = wx.StaticBoxSizer(sam_sbox, wx.HORIZONTAL)
        sam_hbox.Add((10, 0), 0, 0)
        myform['interp'] = form.int_field(parent=self.panel,
                                          sizer=sam_hbox,
                                          label="Interpolation",
                                          weight=1,
                                          callback=self.evt_set_interp)
        sam_hbox.Add((10, 0), 0, 0)
        myform['eth'] = form.static_float_field(parent=self.panel,
                                                sizer=sam_hbox,
                                                label="Sample Rate (sps)",
                                                weight=1)
        sam_hbox.Add((10, 0), 0, 0)
        myform['gbe'] = form.static_float_field(parent=self.panel,
                                                sizer=sam_hbox,
                                                label="GbE Rate (bits/sec)",
                                                weight=1)
        sam_hbox.Add((10, 0), 0, 0)
        self.vbox.Add((0, 10), 0, 0)
        self.vbox.Add(sam_hbox, 0, wx.EXPAND)

        # USRP2 row
        u2_sbox = wx.StaticBox(parent=self.panel, label="USRP2 Hardware")
        u2_hbox = wx.StaticBoxSizer(u2_sbox, wx.HORIZONTAL)
        u2_hbox.Add((10, 0), 0, 0)
        myform['ifc'] = form.static_text_field(parent=self.panel,
                                               sizer=u2_hbox,
                                               label="Interface",
                                               weight=2)
        u2_hbox.Add((10, 0), 0, 0)
        myform['mac'] = form.static_text_field(parent=self.panel,
                                               sizer=u2_hbox,
                                               label="MAC Address",
                                               weight=2)
        u2_hbox.Add((10, 0), 0, 0)
        myform['dbid'] = form.static_text_field(parent=self.panel,
                                                sizer=u2_hbox,
                                                label="Daughterboard ID",
                                                weight=1)
        self.vbox.Add((0, 10), 0, 0)
        self.vbox.Add(u2_hbox, 0, wx.EXPAND)
        self.vbox.Add((0, 20), 0, 0)
Ejemplo n.º 8
0
    def build_gui(self):
        self.myform = myform = form.form()

        # Baseband controls
        bb_sbox = wx.StaticBox(parent=self.panel, label="Baseband Modulation")
        bb_vbox = wx.StaticBoxSizer(bb_sbox, wx.VERTICAL) # Holds all baseband controls as unit

        # First row of baseband controls (modulation type)
        mod_hbox = wx.BoxSizer(wx.HORIZONTAL)
        mod_hbox.Add((10,0), 0, 0)
        myform['type'] = form.radiobox_field(
            parent=self.panel, label="Type", sizer=mod_hbox, value=None,
            callback=self.evt_set_waveform_type, weight=1, major_dimension=0,
            choices=usrp2_siggen.waveforms.values() )
        bb_vbox.Add((0,10), 0, 0)
        bb_vbox.Add(mod_hbox, 0, wx.EXPAND)

        # Second row of baseband controls (frequencies)
        bbf_hbox = wx.BoxSizer(wx.HORIZONTAL)
        bbf_hbox.Add((10,0), 0, 0)
        myform['w1freq'] = form.float_field(
            parent=self.panel, sizer=bbf_hbox, label="Frequency 1 (Hz)", weight=1,
            callback=myform.check_input_and_call(self.evt_set_freq1, self.evt_set_status_msg) )
        bbf_hbox.Add((10,0), 0, 0)
        myform['w2freq'] = form.float_field(
            parent=self.panel, sizer=bbf_hbox, label="Frequency 2 (Hz)", weight=1,
            callback=myform.check_input_and_call(self.evt_set_freq2, self.evt_set_status_msg) )
        bbf_hbox.Add((10,0), 0, 0)
        
        bb_vbox.Add((0,10), 0, 0)
        bb_vbox.Add(bbf_hbox, 0, wx.EXPAND)

        # Add baseband controls to top window sizer
        self.vbox.Add((0,10), 0, 0)
        self.vbox.Add(bb_vbox, 0, wx.EXPAND)

        # Frequency controls
        fc_sbox = wx.StaticBox(parent=self.panel, label="Center Frequency")
        fc_vbox = wx.StaticBoxSizer(fc_sbox, wx.VERTICAL) # Holds all frequency controls as unit

        # First row of frequency controls (center frequency)
        freq_hbox = wx.BoxSizer(wx.HORIZONTAL)
        freq_hbox.Add((10,0), 0, 0)
        myform['freq'] = form.float_field(
            parent=self.panel, sizer=freq_hbox, label=None, weight=1,
            callback=myform.check_input_and_call(self.evt_set_freq, self.evt_set_status_msg) )
        freq_hbox.Add((10,0), 0, 0)
        myform['freq_slider'] = form.quantized_slider_field(
            parent=self.panel, sizer=freq_hbox, label="Min-Max", weight=4,
            range = (self.min_freq, self.max_freq, self.freq_step),
            callback=self.evt_set_freq)
        freq_hbox.Add((10,0), 0, 0)

        fc_vbox.Add((10,0), 0, 0)
        fc_vbox.Add(freq_hbox, 0, wx.EXPAND)

        # Second row of frequency controls (results)
        tr_hbox = wx.BoxSizer(wx.HORIZONTAL)
        tr_hbox.Add((10,0), 0, 0)
        myform['analog'] = form.static_float_field(
            parent=self.panel, sizer=tr_hbox, label="Daughterboard: (Hz)", weight=1)
        tr_hbox.Add((10,0), 0, 0)
        myform['DDC'] = form.static_float_field(
            parent=self.panel, sizer=tr_hbox, label="USRP2 DDC (Hz)", weight=1)
        tr_hbox.Add((10,0), 0, 0)
        fc_vbox.Add(tr_hbox, 0, wx.EXPAND)

        # Add frequency controls to top window sizer
        self.vbox.Add((0,10), 0, 0)
        self.vbox.Add(fc_vbox, 0, wx.EXPAND)

        # Amplitude row
        amp_sbox = wx.StaticBox(parent=self.panel, label="Amplitude")
        amp_hbox = wx.StaticBoxSizer(amp_sbox, wx.HORIZONTAL)
        amp_hbox.Add((10,0), 0, 0)
        myform['amp'] = form.float_field(
            parent=self.panel, sizer=amp_hbox, label="Linear\n(0.0-1.0)", weight=1,
            callback=myform.check_input_and_call(self.evt_set_amplitude, self.evt_set_status_msg) )
        amp_hbox.Add((10,0), 0, 0)
        myform['amp_slider'] = form.quantized_slider_field(
            parent=self.panel, sizer=amp_hbox, label="dB Full Scale\n(-100-0)", weight=4,
            range=(-100.0, 0.0, 1), callback=self.evt_set_amplitude)
        amp_hbox.Add((10,0), 0, 0)
        self.vbox.Add((0,10), 0, 0)
        self.vbox.Add(amp_hbox, 0, wx.EXPAND)

        # Sample rate row
        sam_sbox = wx.StaticBox(parent=self.panel, label="Sample Rate")
        sam_hbox = wx.StaticBoxSizer(sam_sbox, wx.HORIZONTAL)
        sam_hbox.Add((10,0), 0, 0)
        myform['interp'] = form.int_field(
            parent=self.panel, sizer=sam_hbox, label="Interpolation", weight=1,
            callback=self.evt_set_interp)
        sam_hbox.Add((10,0), 0, 0)
        myform['eth'] = form.static_float_field(
            parent=self.panel, sizer=sam_hbox, label="Sample Rate (sps)", weight=1)
        sam_hbox.Add((10,0), 0, 0)
        myform['gbe'] = form.static_float_field(
            parent=self.panel, sizer=sam_hbox, label="GbE Rate (bits/sec)", weight=1)
        sam_hbox.Add((10,0), 0, 0)
        self.vbox.Add((0,10), 0, 0)
        self.vbox.Add(sam_hbox, 0, wx.EXPAND)

        # USRP2 row
        u2_sbox = wx.StaticBox(parent=self.panel, label="USRP2 Hardware")
        u2_hbox = wx.StaticBoxSizer(u2_sbox, wx.HORIZONTAL)
        u2_hbox.Add((10,0), 0, 0)
        myform['ifc'] = form.static_text_field(parent=self.panel, sizer=u2_hbox, 
                                               label="Interface", weight=2)
        u2_hbox.Add((10,0), 0, 0)
        myform['mac'] = form.static_text_field(parent=self.panel, sizer=u2_hbox, 
                                               label="MAC Address", weight=2)
        u2_hbox.Add((10,0), 0, 0)
        myform['dbid'] = form.static_text_field(parent=self.panel, sizer=u2_hbox, 
                                                label="Daughterboard ID", weight=1)
        self.vbox.Add((0,10), 0, 0)
        self.vbox.Add(u2_hbox, 0, wx.EXPAND)
        self.vbox.Add((0,20), 0, 0)