Exemplo n.º 1
0
class EvokedSettings(CustomSettings):
    def __init__(self, parent, settings):
        super(EvokedSettings, self).__init__(parent, settings)
        
    # Build the settings UI
    def buildUI(self, settings):
        self.layout = QtWidgets.QFormLayout()
        self.eventIDWidget = ExpandingTable("eventIDs", settings)
        self.eventIDWidget.setHorizontalHeaderLabels(["Event ID"])
        #self.layout.addWidget(self.eventIDWidget)
        
        self.setLayout(self.layout)
        
    def genSettings(self):
    
        settings = {}
        vars = {}
        
        settings["settingsFile"] = self.settings["settingsFile"]
        settings["settingsClass"] = self.settings["settingsClass"]
        
        #self.eventIDWidget.getSettings("eventIDs", vars, settings)
        
        self.parent.settings = settings
        self.parent.variables = vars
Exemplo n.º 2
0
 def buildUI(self, settings):
     self.layout = QtWidgets.QFormLayout()
     self.eventIDWidget = ExpandingTable("eventIDs", settings)
     self.eventIDWidget.setHorizontalHeaderLabels(["Event ID"])
     #self.layout.addWidget(self.eventIDWidget)
     
     self.setLayout(self.layout)
Exemplo n.º 3
0
    def buildUI(self, settings):
        self.layout = QtWidgets.QVBoxLayout()

        self.table = ExpandingTable("target", settings)
        self.table.setHorizontalHeaderLabels(["Referencing Target"])
        self.layout.addWidget(self.table)

        addLayout = QtWidgets.QHBoxLayout()

        self.btAdd = QtWidgets.QPushButton("Add")
        self.btAdd.setSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                 QtWidgets.QSizePolicy.Fixed)
        self.btAdd.clicked.connect(self.addRow)
        addLayout.addWidget(self.btAdd)

        self.cbTypes = QtWidgets.QComboBox()
        self.cbTypes.addItems(["Average"])
        addLayout.addWidget(self.cbTypes)

        addLayout.setSpacing(5)
        self.layout.addItem(addLayout)

        # Holds the selected channel so that the first global update can select it
        self.channelHold = ""
        if "reference" in settings.keys():
            self.channelHold = settings["reference"]

        self.setLayout(self.layout)
Exemplo n.º 4
0
 def buildUI(self, settings):
 
     self.layout = QtWidgets.QVBoxLayout()
     
     self.table = ExpandingTable("channel", settings)
     self.table.setHorizontalHeaderLabels(["Channel #s"])
     
     self.layout.addWidget(self.table)
     self.setLayout(self.layout)
Exemplo n.º 5
0
class DropEvokedSettings(CustomSettings):
    def __init__(self, parent, settings):
        super(DropEvokedSettings, self).__init__(parent, settings)
        
    def buildUI(self, settings):
    
        self.layout = QtWidgets.QVBoxLayout()
        
        self.table = ExpandingTable("channel", settings)
        self.table.setHorizontalHeaderLabels(["Channel #s"])
        
        self.layout.addWidget(self.table)
        self.setLayout(self.layout)
        
    def genSettings(self):
        settings = {}
        vars = {}
        settings["settingsFile"] = self.settings["settingsFile"]
        settings["settingsClass"] = self.settings["settingsClass"]
        
        self.table.getSettings(settings, vars)
        
        self.parent.settings = settings
        self.parent.variables = vars
Exemplo n.º 6
0
class RereferenceSettings(CustomSettings):
    def __init__(self, parent, settings):
        super(RereferenceSettings, self).__init__(parent, settings)

    def buildUI(self, settings):
        self.layout = QtWidgets.QVBoxLayout()

        self.table = ExpandingTable("target", settings)
        self.table.setHorizontalHeaderLabels(["Referencing Target"])
        self.layout.addWidget(self.table)

        addLayout = QtWidgets.QHBoxLayout()

        self.btAdd = QtWidgets.QPushButton("Add")
        self.btAdd.setSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                 QtWidgets.QSizePolicy.Fixed)
        self.btAdd.clicked.connect(self.addRow)
        addLayout.addWidget(self.btAdd)

        self.cbTypes = QtWidgets.QComboBox()
        self.cbTypes.addItems(["Average"])
        addLayout.addWidget(self.cbTypes)

        addLayout.setSpacing(5)
        self.layout.addItem(addLayout)

        # Holds the selected channel so that the first global update can select it
        self.channelHold = ""
        if "reference" in settings.keys():
            self.channelHold = settings["reference"]

        self.setLayout(self.layout)

    def addRow(self):
        self.table.setItem(
            self.table.rowCount() - 1, 0,
            QtWidgets.QTableWidgetItem(self.cbTypes.currentText()))

    def genSettings(self):
        settings = {}
        vars = {}

        settings["settingsFile"] = self.settings["settingsFile"]
        settings["settingsClass"] = self.settings["settingsClass"]

        self.table.getSettings("target", vars, settings)

        self.parent.settings = settings
        self.parent.variables = vars

    def updateGlobals(self, globals):

        if "Channel Names" not in globals.keys():
            return

        currentType = self.cbTypes.currentText()
        typeList = ["Average"]
        for ch in globals["Channel Names"]["value"]:
            typeList.append(ch)

        while self.cbTypes.count() > 0:
            self.cbTypes.removeItem(0)

        self.cbTypes.addItems(typeList)

        # Update with saved value when needed
        if self.channelHold != "":
            i = self.cbTypes.findText(self.channelHold)
            # Only update when the value is found
            if (i != -1):
                self.cbTypes.setCurrentIndex(i)
                self.channelHold = ""
        else:
            self.cbTypes.setCurrentText(currentType)