コード例 #1
0
    def __init__(self):        
        'Initial method to generate the "SigCon_interface" menu'

        # ============== Variable Declaration ==============
        blue = '#466289'
        lblue = '#A0AEC1'
        orange = '#FA6121'
        large_font = 'Trebuchet 16'
        font = "Trebuchet 14"
        sigcon_menu, CheckBoxLabel, RadioLabel = [], [], []
        ##-- Out data from SigCon_menu class
        self.sigcon_output = ['', ['Monopolar', ''], '', 'off', 'off', ['off', 'off']]
        
        # ========= SigCon_interface tab creation ==========        
        # (1) TABLE: Widget container
        ## --14 x 6 table creation
        self.table = gtk.Table(14, 6, True)

        # (2) LABEL: Window title
        titulo = Label(' BCI System - Signal Processing', 'Neuropol 20', blue, 0, 0.5)
        self.table.attach(titulo, 0, 5, 0, 1)
        subtitulo = Label(' A VE Plataform for Simulated BCI-Enabled Independent Living', \
                          'Neuropol 18', orange, 0, 0.5)
        self.table.attach(subtitulo, 0, 5, 1, 2)

        # (3) IMAGES: General menu & EEG layout
        url = 'Images\\minilogo.jpg'
        logo = Image(url)
        logo.set_alignment(xalign=0.5, yalign=0.5)
        self.table.attach(logo, 5, 6, 0, 2)
        url = 'Images\\layout.png'
        eeg = Image(url)
        eeg.set_alignment(xalign=0.8, yalign=0)
        self.table.attach(eeg, 2, 6, 2, 14)

        # (4) LABEL & TEXT-ENTRY: downsampling rate submenu 
        tempo = Label('DOWNSAMPLE RATE', large_font, 'black', 1, 0.5)
        self.table.attach(tempo, 0, 2, 2, 3)
        icon = Image('Images\\downsampling.png') 
        icon.set_alignment(xalign=0.2, yalign=0)
        self.table.attach(icon, 2, 3, 2, 4)
        tempo = TextEntry(self.read_text, [0])
        self.table.attach(tempo, 1, 2, 3, 4)
        sigcon_menu.append(tempo)
        
        # (5) LABEL, RADIO BUTTONS & TEXT-ENTRY: spatial filtering submenu
        tempo = Label('SPATIAL FILTERING', large_font, 'black', 1, 0.5)
        self.table.attach(tempo, 0, 2, 4, 5)
        icon = Image('Images\\filter.png') 
        icon.set_alignment(xalign=0.2, yalign=0)
        self.table.attach(icon, 2, 3, 4, 6)
        ##-- monopolar referencing
        tempo, label = Radio_Button(None, 'Monopolar', font, 'black')
        RadioLabel.append(label)
        tempo.connect("toggled", self.Monopolar, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 5, 6)
        ##-- bipolar referencing
        tempo, label = Radio_Button(tempo, 'Bipolar', font, lblue)
        RadioLabel.append(label)
        tempo.connect("toggled", self.Bipolar, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 6, 7)
        ##-- small Laplace referencing
        tempo, label = Radio_Button(tempo, 'Small Laplacian', font, lblue)
        RadioLabel.append(label)
        tempo.connect("toggled", self.SLaplace, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 7, 8)
        ##-- large Laplace referencing
        tempo, label = Radio_Button(tempo, 'Large Laplacian', font, lblue)
        RadioLabel.append(label)
        tempo.connect("toggled", self.LLaplace, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 8, 9)
        ##-- CAR referencing
        tempo, label = Radio_Button(tempo, 'Common average', font, lblue)
        RadioLabel.append(label)
        tempo.connect("toggled", self.CAR, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 9, 10)
        ##-- positive electrodes
        tempo = Label('+ Channels', font, 'black', 0.5, 0.5)
        self.table.attach(tempo, 1, 2, 6, 7)
        tempo = TextEntry(self.read_text, [2])
        tempo.set_editable(True)
        self.table.attach(tempo, 1, 2, 7, 8)
        sigcon_menu.append(tempo)
        ##-- negative electrodes
        tempo = Label('- Channels', font, 'black', 0.5, 0.5)
        self.table.attach(tempo, 1, 2, 8, 9)
        tempo = TextEntry(self.read_text, [1,1])
        tempo.set_editable(True)
        self.table.attach(tempo, 1, 2, 9, 10)
        sigcon_menu.append(tempo)


        # (6) LABEL, CHECK BUTTONS & TEXTENTRY: spectral filtering submenu
        tempo = Label('SPECTRAL FILTERING', large_font, 'black', 1, 0.5)
        self.table.attach(tempo, 0, 2, 10, 11)
        icon = Image('Images\\filter.png') 
        icon.set_alignment(xalign=0.2, yalign=0)
        self.table.attach(icon, 2, 3, 10, 12)
        ##-- 50Hz rejection
        button, label = Check_Button(' 50Hz-rejection', font, lblue)
        button.connect("toggled", self.Rejection, CheckBoxLabel)
        self.table.attach(button, 0, 1, 11, 12)
        CheckBoxLabel.append(label)
        ##-- DC removal
        button, label = Check_Button(' DC removal', font, lblue)
        button.connect("toggled", self.DCRemoval, CheckBoxLabel)
        self.table.attach(button, 0, 1, 12, 13)
        CheckBoxLabel.append(label)
        ##-- bandwidth
        button, label = Check_Button(' Bandwidth(fH:fL)', font, lblue)
        button.connect("toggled", self.bandwidth, sigcon_menu, CheckBoxLabel)
        self.table.attach(button, 0, 1, 13, 14)
        CheckBoxLabel.append(label)
        tempo = TextEntry(self.read_text, [5,1])
        tempo.set_editable(False)
        self.table.attach(tempo, 1, 2, 13, 14)
        sigcon_menu.append(tempo)

        self.table.show()
コード例 #2
0
    def __init__(self):
        'Initial method to generate the "SigCon_interface" menu'

        # ============== Variable Declaration ==============
        blue = '#466289'
        lblue = '#A0AEC1'
        orange = '#FA6121'
        large_font = 'Trebuchet 16'
        font = "Trebuchet 14"
        sigcon_menu, CheckBoxLabel, RadioLabel = [], [], []
        ##-- Out data from SigCon_menu class
        self.sigcon_output = [
            '', ['Monopolar', ''], '', 'off', 'off', ['off', 'off']
        ]

        # ========= SigCon_interface tab creation ==========
        # (1) TABLE: Widget container
        ## --14 x 6 table creation
        self.table = gtk.Table(14, 6, True)

        # (2) LABEL: Window title
        titulo = Label(' BCI System - Signal Processing', 'Neuropol 20', blue,
                       0, 0.5)
        self.table.attach(titulo, 0, 5, 0, 1)
        subtitulo = Label(' A VE Plataform for Simulated BCI-Enabled Independent Living', \
                          'Neuropol 18', orange, 0, 0.5)
        self.table.attach(subtitulo, 0, 5, 1, 2)

        # (3) IMAGES: General menu & EEG layout
        url = 'Images\\minilogo.jpg'
        logo = Image(url)
        logo.set_alignment(xalign=0.5, yalign=0.5)
        self.table.attach(logo, 5, 6, 0, 2)
        url = 'Images\\layout.png'
        eeg = Image(url)
        eeg.set_alignment(xalign=0.8, yalign=0)
        self.table.attach(eeg, 2, 6, 2, 14)

        # (4) LABEL & TEXT-ENTRY: downsampling rate submenu
        tempo = Label('DOWNSAMPLE RATE', large_font, 'black', 1, 0.5)
        self.table.attach(tempo, 0, 2, 2, 3)
        icon = Image('Images\\downsampling.png')
        icon.set_alignment(xalign=0.2, yalign=0)
        self.table.attach(icon, 2, 3, 2, 4)
        tempo = TextEntry(self.read_text, [0])
        self.table.attach(tempo, 1, 2, 3, 4)
        sigcon_menu.append(tempo)

        # (5) LABEL, RADIO BUTTONS & TEXT-ENTRY: spatial filtering submenu
        tempo = Label('SPATIAL FILTERING', large_font, 'black', 1, 0.5)
        self.table.attach(tempo, 0, 2, 4, 5)
        icon = Image('Images\\filter.png')
        icon.set_alignment(xalign=0.2, yalign=0)
        self.table.attach(icon, 2, 3, 4, 6)
        ##-- monopolar referencing
        tempo, label = Radio_Button(None, 'Monopolar', font, 'black')
        RadioLabel.append(label)
        tempo.connect("toggled", self.Monopolar, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 5, 6)
        ##-- bipolar referencing
        tempo, label = Radio_Button(tempo, 'Bipolar', font, lblue)
        RadioLabel.append(label)
        tempo.connect("toggled", self.Bipolar, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 6, 7)
        ##-- small Laplace referencing
        tempo, label = Radio_Button(tempo, 'Small Laplacian', font, lblue)
        RadioLabel.append(label)
        tempo.connect("toggled", self.SLaplace, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 7, 8)
        ##-- large Laplace referencing
        tempo, label = Radio_Button(tempo, 'Large Laplacian', font, lblue)
        RadioLabel.append(label)
        tempo.connect("toggled", self.LLaplace, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 8, 9)
        ##-- CAR referencing
        tempo, label = Radio_Button(tempo, 'Common average', font, lblue)
        RadioLabel.append(label)
        tempo.connect("toggled", self.CAR, sigcon_menu, RadioLabel)
        self.table.attach(tempo, 0, 1, 9, 10)
        ##-- positive electrodes
        tempo = Label('+ Channels', font, 'black', 0.5, 0.5)
        self.table.attach(tempo, 1, 2, 6, 7)
        tempo = TextEntry(self.read_text, [2])
        tempo.set_editable(True)
        self.table.attach(tempo, 1, 2, 7, 8)
        sigcon_menu.append(tempo)
        ##-- negative electrodes
        tempo = Label('- Channels', font, 'black', 0.5, 0.5)
        self.table.attach(tempo, 1, 2, 8, 9)
        tempo = TextEntry(self.read_text, [1, 1])
        tempo.set_editable(True)
        self.table.attach(tempo, 1, 2, 9, 10)
        sigcon_menu.append(tempo)

        # (6) LABEL, CHECK BUTTONS & TEXTENTRY: spectral filtering submenu
        tempo = Label('SPECTRAL FILTERING', large_font, 'black', 1, 0.5)
        self.table.attach(tempo, 0, 2, 10, 11)
        icon = Image('Images\\filter.png')
        icon.set_alignment(xalign=0.2, yalign=0)
        self.table.attach(icon, 2, 3, 10, 12)
        ##-- 50Hz rejection
        button, label = Check_Button(' 50Hz-rejection', font, lblue)
        button.connect("toggled", self.Rejection, CheckBoxLabel)
        self.table.attach(button, 0, 1, 11, 12)
        CheckBoxLabel.append(label)
        ##-- DC removal
        button, label = Check_Button(' DC removal', font, lblue)
        button.connect("toggled", self.DCRemoval, CheckBoxLabel)
        self.table.attach(button, 0, 1, 12, 13)
        CheckBoxLabel.append(label)
        ##-- bandwidth
        button, label = Check_Button(' Bandwidth(fH:fL)', font, lblue)
        button.connect("toggled", self.bandwidth, sigcon_menu, CheckBoxLabel)
        self.table.attach(button, 0, 1, 13, 14)
        CheckBoxLabel.append(label)
        tempo = TextEntry(self.read_text, [5, 1])
        tempo.set_editable(False)
        self.table.attach(tempo, 1, 2, 13, 14)
        sigcon_menu.append(tempo)

        self.table.show()