Exemplo n.º 1
0
    def initializeGUI(self):
        layout = QtGui.QGridLayout()
        lockwidget = QCustomSwitchChannel('Lock Cal', ('Locked', 'Unlocked'))
        lockwidget.TTLswitch.toggled.connect(self.toggle)

        offsetwidget = QCustomSpinBox('DC offset', (-1.0, 1.0))
        setpointwidget = QCustomSpinBox('Set Point', (811.0, 812.0))
        gainwidget = QCustomSpinBox('Gain', (0.1, 10000.0))

        offsetwidget.setStepSize(0.001)
        setpointwidget.setStepSize(0.000001)
        gainwidget.setStepSize(0.1)

        offsetwidget.spinLevel.setDecimals(3)
        setpointwidget.spinLevel.setDecimals(6)
        gainwidget.spinLevel.setDecimals(1)

        setpointwidget.spinLevel.setValue(self.set)
        gainwidget.spinLevel.setValue(self.gain)

        offsetwidget.spinLevel.valueChanged.connect(self.offset)
        setpointwidget.spinLevel.valueChanged.connect(self.set_point)
        gainwidget.spinLevel.valueChanged.connect(self.set_gain)

        layout.addWidget(lockwidget, 0, 0)
        layout.addWidget(offsetwidget, 0, 1)
        layout.addWidget(setpointwidget, 0, 2)
        layout.addWidget(gainwidget, 0, 3)

        self.setLayout(layout)
Exemplo n.º 2
0
    def initializeGUI(self):
        layout = QtGui.QGridLayout()
        self.shutter_widget = QCustomSwitchChannel('399/Oven/ProtectionBeam',
                                                   ('Open/Oven On', 'Closed/Oven Off'))
        self.shutter_widget.TTLswitch.toggled.connect(self.toggle)
        self.timer_widget = QCustomTimer('Loading Time', show_control=False)
        self.current_widget = QCustomSpinBox("Current ('A')", (0.0, 3.0))

        self.current_widget.setStepSize(0.01)
        self.current_widget.spinLevel.setDecimals(2)
        self.current_widget.spinLevel.valueChanged.connect(self.current_changed)

        if 'oven' in self.settings:
            value = yield self.reg.get('oven')
            self.current_widget.spinLevel.setValue(value)

        if '399 trapshutter' in self.settings:
            value = yield self.reg.get('399 trapshutter')
            value = bool(value)
            self.shutter_widget.TTLswitch.setChecked(value)
        else:
            self.shutter_widget.TTLswitch.setChecked(False)

        layout.addWidget(self.current_widget, 1, 1)
        layout.addWidget(self.shutter_widget, 0, 0)
        layout.addWidget(self.timer_widget, 0, 1)
        self.setLayout(layout)
Exemplo n.º 3
0
    def setup_widget(self):

        self.spinBox = QCustomSpinBox(self.name, (self.minval, self.maxval))
        self.init_voltage = 0.0
        self.spinBox.spinLevel.setValue(0.0)

        self.spinBox.setStepSize(0.0001)
        self.spinBox.spinLevel.setDecimals(4)
Exemplo n.º 4
0
    def initializeGUI(self):
        layout = QtGui.QGridLayout()

        control = QCustomSpinBox("DC value ('V')", (-5.0, 5.0))
        control.setStepSize(0.0001)
        control.spinLevel.setDecimals(4)
        control.spinLevel.valueChanged.connect(self.set_dac)
        layout.addWidget(control)
        self.setLayout(layout)
Exemplo n.º 5
0
    def initializeGUI(self):

        layout = QtGui.QGridLayout()

        qBox = QtGui.QGroupBox('DAC Channels')
        subLayout = QtGui.QGridLayout()
        qBox.setLayout(subLayout)
        layout.addWidget(qBox, 0, 0)

        for v, dac in enumerate(self.dacinfo):
            name = self.dacinfo[dac][0]
            dacchan = self.dacinfo[dac][1]

            widget = QCustomSpinBox(name, (0, 255))
            widget.title.setFixedWidth(120)
            label = QtGui.QLabel('0 V')
            if name + ' dac' in self.settings:
                value = yield self.reg.get(name + ' dac')
                widget.spinLevel.setValue(value)
                self.setvalue(value, [name, dacchan])
            else:
                widget.spinLevel.setValue(0.0)
            widget.setStepSize(1)
            widget.spinLevel.setDecimals(0)
            widget.spinLevel.valueChanged.connect(
                lambda value=widget.spinLevel.value(
                ), ident=[name, dacchan]: self.setvalue(value, ident))
            self.d[dacchan] = widget
            self.e[dacchan] = label
            subLayout.addWidget(self.d[dacchan], v, 1)
            subLayout.addWidget(self.e[dacchan], v, 2)

        self.ezupwidget = QPushButton('Ez increase')
        self.ezdownwidget = QPushButton('Ez decrease')
        self.exupwidget = QPushButton('Ex increase')
        self.exdownwidget = QPushButton('Ex decrease')
        self.eyupwidget = QPushButton('Ey increase')
        self.eydownwidget = QPushButton('Ey decrease')

        self.ezupwidget.clicked.connect(self.ezup)
        self.ezdownwidget.clicked.connect(self.ezdown)
        self.exupwidget.clicked.connect(self.exup)
        self.exdownwidget.clicked.connect(self.exdown)
        self.eyupwidget.clicked.connect(self.eyup)
        self.eydownwidget.clicked.connect(self.eydown)

        subLayout.addWidget(self.ezupwidget, 0, 5)
        subLayout.addWidget(self.ezdownwidget, 1, 5)
        subLayout.addWidget(self.exupwidget, 3, 6)
        subLayout.addWidget(self.exdownwidget, 3, 3)
        subLayout.addWidget(self.eyupwidget, 2, 5)
        subLayout.addWidget(self.eydownwidget, 4, 5)

        self.setLayout(layout)
Exemplo n.º 6
0
    def initializeGUI(self):

        layout = QtGui.QGridLayout()

        self.setWindowTitle('kiethley Control')

        qBox = QtGui.QGroupBox('Kiethley 2230G')
        subLayout = QtGui.QGridLayout()
        qBox.setLayout(subLayout)
        layout.addWidget(qBox, 0, 0)

        self.volt1widget = QCustomSpinBox('Amplitude (Vpp)', (0, 30))
        self.volt2widget = QCustomSpinBox('Amplitude (Vpp)', (0, 30))

        self.volt1widget.spinLevel.valueChanged.connect(
            lambda value=self.volt1widget.spinLevel.value(
            ), chan=1: self.voltchanged(chan, value))
        self.volt2widget.spinLevel.valueChanged.connect(
            lambda value=self.volt2widget.spinLevel.value(
            ), chan=2: self.voltchanged(chan, value))
        subLayout.addWidget(self.volt1widget, 1, 1)
        subLayout.addWidget(self.volt2widget, 1, 3)
        self.setLayout(layout)
Exemplo n.º 7
0
    def initializeGUI(self):
        layout = QtGui.QGridLayout()

        zerowidget = QtGui.QPushButton('Zero')
        self.degreewidget = QCustomSpinBox('Angle', (-10000, 10000.0))
        self.angle_label = QtGui.QLabel('0.0')
        self.degreewidget.setStepSize(1.8)
        self.degreewidget.spinLevel.setDecimals(3)

        self.degreewidget.spinLevel.setValue(self.angle)

        self.degreewidget.spinLevel.valueChanged.connect(self.change_angle)
        zerowidget.clicked.connect(self.zero_scale)

        layout.addWidget(zerowidget, 0, 0)
        layout.addWidget(self.degreewidget, 0, 1)
        layout.addWidget(self.angle_label, 0, 2)

        self.setLayout(layout)
Exemplo n.º 8
0
    def initialize_GUI(self):
        layout = QtGui.QGridLayout()
        self.electrodes = {}
        qBox = QtGui.QGroupBox('DAC Channels')

        subLayout = QtGui.QGridLayout()
        qBox.setLayout(subLayout)
        layout.addWidget(qBox, 0, 0)

        self.electrodeind = ElectrodeIndicator([-12, 12])
        multipole_names = ['Ey', 'Ez', 'Ex', 'M1', 'M2', 'M3', 'M4', 'M5']
        self.multipoles = []
        j = 0
        for i, multipole in enumerate(multipole_names):
            k = i
            if i >= 4:
                j = 1
                i = i - 4
            spinbox = QCustomSpinBox(multipole, (-100, 100))
            spinbox.setStepSize(0.001)
            spinbox.spinLevel.setDecimals(3)
            spinbox.spinLevel.setValue(self.init_multipoles[k])
            spinbox.spinLevel.valueChanged.connect(self.change_multipole)
            layout.addWidget(spinbox, 3 + j, i + 1, 1, 1)
            self.multipoles.append(spinbox)

        layout.addWidget(self.electrodeind, 0, 1, 1, 3)

        for key, channel in self.elec_dict.iteritems():
            electrode = Electrode(channel.dacChannelNumber,
                                  channel.octantNumber,
                                  channel.allowedVoltageRange[0],
                                  channel.allowedVoltageRange[1])
            self.electrodes[electrode.octant] = electrode
            subLayout.addWidget(electrode.spinBox)
            electrode.spinBox.spinLevel.valueChanged.connect(
                lambda value=electrode.spinBox.spinLevel.value(
                ), electrode=electrode: self.update_dac(value, electrode))

        self.change_multipole('dummy value')
        self.setLayout(layout)
Exemplo n.º 9
0
    def initializeGUI(self):

        layout = QtGui.QGridLayout()

        self.setWindowTitle('Rigol DG1022 Control')

        qBox = QtGui.QGroupBox('Rigol DG1022')
        subLayout = QtGui.QGridLayout()
        qBox.setLayout(subLayout)
        layout.addWidget(qBox, 0, 0)

        self.deviceselect = QtGui.QComboBox(self)
        self.updatedevices()

        self.offsetwidget1 = QCustomSpinBox('Offset', (-5, 5))
        self.offsetwidget2 = QCustomSpinBox('Offset', (-5, 5))
        self.volt1widget = QCustomSpinBox('Amplitude (Vpp)', (-10, 10))
        self.freq1widget = QCustomSpinBox('Frequency (Hz)', (0, 40e6))
        self.volt2widget = QCustomSpinBox('Amplitude (Vpp)', (-10, 10))
        self.freq2widget = QCustomSpinBox('Frequency (Hz)', (0, 40e6))
        self.waveselect1 = QtGui.QComboBox(self)
        self.waveselect2 = QtGui.QComboBox(self)
        self.output1 = TextChangingButton(('On', 'Off'))
        self.output2 = TextChangingButton(('On', 'Off'))

        self.waveselect1.addItem("sine")
        self.waveselect1.addItem("square")
        self.waveselect1.addItem("ramp")
        self.waveselect1.addItem("pulse")
        self.waveselect1.addItem("noise")
        self.waveselect1.addItem("DC")
        self.waveselect1.addItem("USER")

        self.waveselect2.addItem("sine")
        self.waveselect2.addItem("square")
        self.waveselect2.addItem("ramp")
        self.waveselect2.addItem("pulse")
        self.waveselect2.addItem("noise")
        self.waveselect2.addItem("DC")
        self.waveselect2.addItem("USER")

        self.output1.toggled.connect(lambda state=self.output1.isDown(), chan=
                                     1, : self.setoutput(chan, state))
        self.output2.toggled.connect(lambda state=self.output1.isDown(), chan=
                                     2, : self.setoutput(chan, state))
        self.volt1widget.spinLevel.valueChanged.connect(
            lambda value=self.volt1widget.spinLevel.value(
            ), chan=1: self.voltchanged(chan, value))
        self.volt2widget.spinLevel.valueChanged.connect(
            lambda value=self.volt2widget.spinLevel.value(
            ), chan=2: self.voltchanged(chan, value))
        self.freq1widget.spinLevel.valueChanged.connect(
            lambda value=self.freq1widget.spinLevel.value(
            ), chan=1: self.freqchanged(chan, value))
        self.freq2widget.spinLevel.valueChanged.connect(
            lambda value=self.freq2widget.spinLevel.value(
            ), chan=2: self.freqchanged(chan, value))
        self.offsetwidget1.spinLevel.valueChanged.connect(
            lambda value=self.offsetwidget1.spinLevel.value(
            ), chan=1: self.offsetchanged(chan, value))
        self.offsetwidget2.spinLevel.valueChanged.connect(
            lambda value=self.offsetwidget2.spinLevel.value(
            ), chan=2: self.offsetchanged(chan, value))
        self.waveselect1.activated[str].connect(
            lambda wave=self.waveselect1.currentText(
            ), chan=1: self.waveselect(chan, wave))
        self.waveselect2.activated[str].connect(
            lambda wave=self.waveselect2.currentText(
            ), chan=2: self.waveselect(chan, wave))
        self.deviceselect.activated[str].connect(self.changedevice)
        subLayout.addWidget(self.freq1widget, 1, 0)
        subLayout.addWidget(self.volt1widget, 1, 1)
        subLayout.addWidget(self.freq2widget, 1, 2)
        subLayout.addWidget(self.volt2widget, 1, 3)
        subLayout.addWidget(self.waveselect1, 2, 0, 1, 2)
        subLayout.addWidget(self.waveselect2, 2, 2, 1, 2)
        subLayout.addWidget(self.offsetwidget1, 3, 0)
        subLayout.addWidget(self.offsetwidget2, 3, 2)
        subLayout.addWidget(self.output1, 3, 1)
        subLayout.addWidget(self.output2, 3, 3)
        subLayout.addWidget(self.deviceselect, 0, 3)

        self.setLayout(layout)