Beispiel #1
0
    def load_defaults(self):

        self.t_int.setValue(CONF.get("Sweep", "tInt"))
        self.t_settling.setValue(CONF.get("Sweep", "delay"))
        self.sweep_type.setCurrentIndex(int(CONF.get("Sweep", "pulsed")))
        self.smu_gate.setCurrentText(CONF.get("Sweep", "gate"))
        self.smu_drain.setCurrentText(CONF.get("Sweep", "drain"))
Beispiel #2
0
    def _on_accept(self):
        """ Update connection settings, reconnect with new settings."""
        self.instr.visa_library = self.lineEditLibrary.text()
        self.instr.visa_address = self.comboBoxAddress.currentText()

        CONF.set('Connection', 'VISA_LIBRARY', self.instr.visa_library)
        CONF.set('Connection', 'VISA_ADDRESS', self.instr.visa_address)

        # reconnect with new address
        # close and reopen ResourceManager for visa_lib path change to take effect
        if self.instr.connected:
            self.instr.disconnect()

        self.instr.rm.close()

        try:
            self.instr.rm = visa.ResourceManager(self.instr.visa_library)

        except ValueError:
            msg = ('Could not find backend %s.\n' % self.lineEditLibrary.text() +
                   'Using default backend instead.')
            QtWidgets.QMessageBox.information(self, str('error'), msg)

            self.instr.visa_library = ''
            self.instr.rm = visa.ResourceManager()

            self.populate_ui_from_instr()

        self.instr.connect()
Beispiel #3
0
    def restore_geometry(self):
        x = CONF.get("Window", "x")
        y = CONF.get("Window", "y")
        w = CONF.get("Window", "width")
        h = CONF.get("Window", "height")

        self.setGeometry(x, y, w, h)
Beispiel #4
0
    def restore_geometry(self):
        x = CONF.get('Window', 'x')
        y = CONF.get('Window', 'y')
        w = CONF.get('Window', 'width')
        h = CONF.get('Window', 'height')

        self.setGeometry(x, y, w, h)
Beispiel #5
0
def run():

    import sys
    import argparse
    from keithley2600 import Keithley2600

    parser = argparse.ArgumentParser()
    parser.add_argument("-v",
                        "--verbose",
                        help="increase output verbosity",
                        action="store_true")
    args = parser.parse_args()
    if args.verbose:
        import keithley2600
        keithley2600.log_to_screen()

    keithley_address = CONF.get('Connection', 'VISA_ADDRESS')
    visa_library = CONF.get('Connection', 'VISA_LIBRARY')
    keithley = Keithley2600(keithley_address, visa_library)

    app = QtWidgets.QApplication(sys.argv)

    keithley_gui = KeithleyGuiApp(keithley)
    keithley_gui.show()
    app.exec_()
Beispiel #6
0
    def __init__(self, keithley=None):
        super().__init__()
        # load user interface layout from .ui file
        uic.loadUi(MAIN_UI_PATH, self)

        if keithley:
            self.keithley = keithley
        else:
            address = CONF.get("Connection", "VISA_ADDRESS")
            lib = CONF.get("Connection", "VISA_LIBRARY")
            self.keithley = Keithley2600(address, lib)

        self.smu_list = _get_smus(self.keithley)
        self.sweep_data = None

        # create sweep settings panes
        self.transfer_sweep_settings = TransferSweepSettingsWidget()
        self.output_sweep_settings = OutputSweepSettingsWidget()
        self.iv_sweep_settings = IVSweepSettingsWidget(self.keithley)
        self.general_sweep_settings = SweepSettingsWidget(self.keithley)

        self.tabWidgetSweeps.widget(0).layout().addWidget(self.transfer_sweep_settings)
        self.tabWidgetSweeps.widget(1).layout().addWidget(self.output_sweep_settings)
        self.tabWidgetSweeps.widget(2).layout().addWidget(self.iv_sweep_settings)
        self.groupBoxSweepSettings.layout().addWidget(self.general_sweep_settings)

        # create tabs for smu settings
        self.smu_tabs = []
        for smu_name in self.smu_list:
            tab = SMUSettingsWidget(smu_name)
            self.tabWidgetSettings.addTab(tab, smu_name)
            self.smu_tabs.append(tab)

        # create plot widget
        self.canvas = SweepDataPlot()
        self.gridLayout2.addWidget(self.canvas)

        # create LED indicator
        self.led = LedIndicator(self)
        self.statusBar.addPermanentWidget(self.led)
        self.led.setChecked(False)

        # create connection dialog
        self.connectionDialog = ConnectionDialog(self, self.keithley, CONF)

        # restore last position and size
        self.restore_geometry()

        # update GUI status and connect callbacks
        self.actionSaveSweepData.setEnabled(False)
        self.connect_ui_callbacks()
        self.on_load_default()
        self.update_gui_connection()

        # connection update timer: check periodically if keithley is connected
        self.connection_status_update = QtCore.QTimer()
        self.connection_status_update.timeout.connect(self.update_gui_connection)
        self.connection_status_update.start(10000)  # 10 sec
Beispiel #7
0
    def save_defaults(self):

        if self.sense_type.currentIndex() == self.SENSE_LOCAL:
            CONF.set(self.smu_name, "sense", "SENSE_LOCAL")
        elif self.sense_type.currentIndex() == self.SENSE_REMOTE:
            CONF.set(self.smu_name, "sense", "SENSE_REMOTE")

        CONF.set(self.smu_name, "limiti", self.limit_i.value())
        CONF.set(self.smu_name, "limitv", self.limit_v.value())
        CONF.set(self.smu_name, "highc", self.high_c.isChecked())
Beispiel #8
0
    def load_defaults(self):

        if CONF.get(self.smu_name, "sense") == "SENSE_LOCAL":
            self.sense_type.setCurrentIndex(self.SENSE_LOCAL)
        elif CONF.get(self.smu_name, "sense") == "SENSE_REMOTE":
            self.sense_type.setCurrentIndex(self.SENSE_REMOTE)

        self.limit_i.setValue(CONF.get(self.smu_name, "limiti"))
        self.limit_v.setValue(CONF.get(self.smu_name, "limitv"))
        self.high_c.setChecked(CONF.get(self.smu_name, "highc"))
Beispiel #9
0
    def __init__(self, smu_name):
        super(self.__class__, self).__init__()

        self.smu_name = smu_name
        self.setObjectName('tab_%s' % self.smu_name)

        self.gridLayouts = QtWidgets.QGridLayout(self)
        self.gridLayouts.setObjectName('gridLayout')

        self.labelComboBox = QtWidgets.QLabel(self)
        self.labelComboBox.setObjectName('labelComboBox')
        self.labelComboBox.setAlignment(QtCore.Qt.AlignRight)
        self.labelComboBox.setText('Sense type:')
        self.gridLayouts.addWidget(self.labelComboBox, 0, 0, 1, 1)

        self.comboBox = QtWidgets.QComboBox(self)
        self.comboBox.setObjectName('comboBox')
        self.comboBox.setMinimumWidth(150)
        self.comboBox.setMaximumWidth(150)
        self.comboBox.addItems(['local (2-wire)', 'remote (4-wire)'])
        if CONF.get(self.smu_name, 'sense') == 'SENSE_LOCAL':
            self.comboBox.setCurrentIndex(0)
        elif CONF.get(self.smu_name, 'sense') == 'SENSE_REMOTE':
            self.comboBox.setCurrentIndex(1)
        self.gridLayouts.addWidget(self.comboBox, 0, 1, 1, 2)

        self.labelLimI = QtWidgets.QLabel(self)
        self.labelLimI.setObjectName('labelLimI')
        self.labelLimI.setAlignment(QtCore.Qt.AlignRight)
        self.labelLimI.setText('Current limit:')
        self.gridLayouts.addWidget(self.labelLimI, 1, 0, 1, 1)

        self.scienceSpinBoxLimI = ScienDSpinBox(self)
        self.scienceSpinBoxLimI.setObjectName('scienceSpinBoxLimI')
        self.scienceSpinBoxLimI.setMinimumWidth(90)
        self.scienceSpinBoxLimI.setMaximumWidth(90)
        self.scienceSpinBoxLimI.setAlignment(QtCore.Qt.AlignRight)
        self.scienceSpinBoxLimI.setValue(CONF.get(self.smu_name, 'limiti'))
        self.scienceSpinBoxLimI.setSuffix("A")
        self.gridLayouts.addWidget(self.scienceSpinBoxLimI, 1, 1, 1, 1)

        self.labelLimV = QtWidgets.QLabel(self)
        self.labelLimV.setObjectName('labelLimV')
        self.labelLimV.setAlignment(QtCore.Qt.AlignRight)
        self.labelLimV.setText('Voltage limit:')
        self.gridLayouts.addWidget(self.labelLimV, 2, 0, 1, 1)

        self.scienceSpinBoxLimV = ScienDSpinBox(self)
        self.scienceSpinBoxLimV.setObjectName('scienceSpinBoxLimV')
        self.scienceSpinBoxLimV.setMinimumWidth(90)
        self.scienceSpinBoxLimV.setMaximumWidth(90)
        self.scienceSpinBoxLimV.setAlignment(QtCore.Qt.AlignRight)
        self.scienceSpinBoxLimV.setValue(CONF.get(self.smu_name, 'limitv'))
        self.scienceSpinBoxLimV.setSuffix("V")
        self.gridLayouts.addWidget(self.scienceSpinBoxLimV, 2, 1, 1, 1)
Beispiel #10
0
def connect_to_instruments():
    """
    Tries to connect to Keithley, Mercury and Xepr. Uses the visa
    addresses saved in the respective configuration files.

    :returns: Tuple containing instrument instances.
    :rtype: tuple
    """

    from keithley2600 import Keithley2600
    from keithleygui.config.main import CONF as KCONF
    from mercuryitc import MercuryITC
    from mercurygui.config.main import CONF as MCONF

    keithley_address = KCONF.get("Connection", "VISA_ADDRESS")
    keithley_visa_lib = KCONF.get("Connection", "VISA_LIBRARY")
    mercury_address = MCONF.get("Connection", "VISA_ADDRESS")
    mercury_visa_lib = MCONF.get("Connection", "VISA_LIBRARY")

    try:
        # Search for the XeprAPI in the following locations, use the first match:
        # 1) path from environment variable, if given
        # 2) installed python package
        # 3) pre-installed version with Xepr
        sys.path.insert(0, ENVIRON_XEPR_API_PATH)
        sys.path.insert(-1, BRUKER_XEPR_API_PATH)
        from XeprAPI import Xepr

        xepr = Xepr()
    except ImportError:
        logging.info("XeprAPI could not be located.")
        xepr = None
    except IOError:
        logging.info("No running Xepr instance could be found.")
        xepr = None

    mercury = MercuryITC(mercury_address,
                         mercury_visa_lib,
                         open_timeout=1,
                         timeout=5000)
    keithley = Keithley2600(keithley_address,
                            keithley_visa_lib,
                            open_timeout=1,
                            timeout=5000)

    return xepr, mercury, keithley
Beispiel #11
0
    def load_defaults(self):

        if self.smu_name != "--":

            try:
                sense_mode = CONF.get(self.smu_name, "sense")

                if sense_mode == "SENSE_LOCAL":
                    self.sense_type.setCurrentIndex(self.SENSE_LOCAL)
                elif sense_mode == "SENSE_REMOTE":
                    self.sense_type.setCurrentIndex(self.SENSE_REMOTE)

                self.limit_i.setValue(CONF.get(self.smu_name, "limiti"))
                self.limit_v.setValue(CONF.get(self.smu_name, "limitv"))
                self.high_c.setChecked(CONF.get(self.smu_name, "highc"))
            except cp.NoSectionError:
                pass
Beispiel #12
0
 def save_defaults(self):
     CONF.set("Sweep", "VdStart", self.vd_start.value())
     CONF.set("Sweep", "VdStop", self.vd_stop.value())
     CONF.set("Sweep", "VdStep", self.vd_step.value())
     CONF.set("Sweep", "VgList", self.vg_list.value())
Beispiel #13
0
 def save_geometry(self):
     geo = self.geometry()
     CONF.set('Window', 'height', geo.height())
     CONF.set('Window', 'width', geo.width())
     CONF.set('Window', 'x', geo.x())
     CONF.set('Window', 'y', geo.y())
Beispiel #14
0
    def _on_save_default(self):
        """Saves current settings from GUI as defaults."""

        # save transfer settings
        CONF.set('Sweep', 'VgStart', self.scienDSpinBoxVgStart.value())
        CONF.set('Sweep', 'VgStop', self.scienDSpinBoxVgStop.value())
        CONF.set('Sweep', 'VgStep', self.scienDSpinBoxVgStep.value())

        vdlist_str = self.lineEditVdList.text().split(',')
        vd_list = [self._string_to_vd(x) for x in vdlist_str]
        CONF.set('Sweep', 'VdList', vd_list)

        # save output settings
        CONF.set('Sweep', 'VdStart', self.scienDSpinBoxVdStart.value())
        CONF.set('Sweep', 'VdStop', self.scienDSpinBoxVdStop.value())
        CONF.set('Sweep', 'VdStep', self.scienDSpinBoxVdStep.value())

        vglist_str = self.lineEditVgList.text().split(',')
        vg_list = [float(x) for x in vglist_str]
        CONF.set('Sweep', 'VgList', vg_list)

        # save iv settings
        CONF.set('Sweep', 'VStart', self.scienDSpinBoxVStart.value())
        CONF.set('Sweep', 'VStop', self.scienDSpinBoxVStop.value())
        CONF.set('Sweep', 'VStep', self.scienDSpinBoxVStep.value())

        CONF.set('Sweep', 'smu_sweep', self.comboBoxSweepSMU.currentText())

        # save general settings
        CONF.set('Sweep', 'tInt', self.scienDSpinBoxInt.value())
        CONF.set('Sweep', 'delay', self.scienDSpinBoxSettling.value())

        # get combo box status
        idx_pulsed = self.comboBoxSweepType.currentIndex()
        CONF.set('Sweep', 'pulsed', bool(idx_pulsed))

        CONF.set('Sweep', 'gate', self.comboBoxGateSMU.currentText())
        CONF.set('Sweep', 'drain', self.comboBoxDrainSMU.currentText())

        for tab in self.smu_tabs:

            if tab.comboBox.currentIndex() == 0:
                CONF.set(tab.smu_name, 'sense', 'SENSE_LOCAL')
            elif tab.comboBox.currentIndex() == 1:
                CONF.set(tab.smu_name, 'sense', 'SENSE_REMOTE')

            CONF.set(tab.smu_name, 'limiti', tab.scienceSpinBoxLimI.value())
            CONF.set(tab.smu_name, 'limitv', tab.scienceSpinBoxLimV.value())
Beispiel #15
0
 def save_geometry(self):
     geo = self.geometry()
     CONF.set("Window", "height", geo.height())
     CONF.set("Window", "width", geo.width())
     CONF.set("Window", "x", geo.x())
     CONF.set("Window", "y", geo.y())
Beispiel #16
0
    def _on_load_default(self):
        """Load default settings to interface."""

        # Set SMU selection comboBox status
        cmb_list = list(self.smu_list)  # get list of all SMUs

        # transfer curve settings
        self.scienDSpinBoxVgStart.setValue(CONF.get('Sweep', 'VgStart'))
        self.scienDSpinBoxVgStop.setValue(CONF.get('Sweep', 'VgStop'))
        self.scienDSpinBoxVgStep.setValue(CONF.get('Sweep', 'VgStep'))
        txt = str(CONF.get('Sweep', 'VdList')).strip('[]')
        self.lineEditVdList.setText(txt)

        # output curve settings
        self.scienDSpinBoxVdStart.setValue(CONF.get('Sweep', 'VdStart'))
        self.scienDSpinBoxVdStop.setValue(CONF.get('Sweep', 'VdStop'))
        self.scienDSpinBoxVdStep.setValue(CONF.get('Sweep', 'VdStep'))
        txt = str(CONF.get('Sweep', 'VgList')).strip('[]')
        self.lineEditVgList.setText(txt)

        # iv curve settings
        self.scienDSpinBoxVStart.setValue(CONF.get('Sweep', 'VStart'))
        self.scienDSpinBoxVStop.setValue(CONF.get('Sweep', 'VStop'))
        self.scienDSpinBoxVStep.setValue(CONF.get('Sweep', 'VStep'))
        try:
            idx_sweep = cmb_list.index(CONF.get('Sweep', 'smu_sweep'))
        except ValueError:
            idx_sweep = 0
            msg = 'Could not find last used SMUs in Keithley driver.'
            QtWidgets.QMessageBox.information(self, str('error'), msg)

        self.comboBoxGateSMU.setCurrentIndex(idx_sweep)

        # other
        self.scienDSpinBoxInt.setValue(CONF.get('Sweep', 'tInt'))
        self.scienDSpinBoxSettling.setValue(CONF.get('Sweep', 'delay'))

        # set PULSED comboBox index (0 if pulsed == False, 1 if pulsed == True)
        pulsed = CONF.get('Sweep', 'pulsed')
        self.comboBoxSweepType.setCurrentIndex(int(pulsed))

        # We have two comboBoxes. If there are less SMU's, extend list.
        while len(cmb_list) < 2:
            cmb_list.append('--')

        self.comboBoxGateSMU.clear()
        self.comboBoxDrainSMU.clear()
        self.comboBoxSweepSMU.clear()
        self.comboBoxGateSMU.addItems(cmb_list)
        self.comboBoxDrainSMU.addItems(cmb_list)
        self.comboBoxSweepSMU.addItems(self.smu_list)

        try:
            idx_gate = cmb_list.index(CONF.get('Sweep', 'gate'))
            idx_drain = cmb_list.index(CONF.get('Sweep', 'drain'))
            self.comboBoxGateSMU.setCurrentIndex(idx_gate)
            self.comboBoxDrainSMU.setCurrentIndex(idx_drain)
        except ValueError:
            self.comboBoxGateSMU.setCurrentIndex(0)
            self.comboBoxDrainSMU.setCurrentIndex(1)
            msg = 'Could not find last used SMUs in Keithley driver.'
            QtWidgets.QMessageBox.information(self, str('error'), msg)

        for tab in self.smu_tabs:
            sense = CONF.get(tab.smu_name, 'sense')
            if sense == 'SENSE_LOCAL':
                tab.comboBox.setCurrentIndex(0)
            elif sense == 'SENSE_REMOTE':
                tab.comboBox.setCurrentIndex(1)

            tab.scienceSpinBoxLimI.setValue(CONF.get(tab.smu_name, 'limiti'))
            tab.scienceSpinBoxLimV.setValue(CONF.get(tab.smu_name, 'limitv'))
Beispiel #17
0
 def save_defaults(self):
     CONF.set("Sweep", "tInt", self.t_int.value())
     CONF.set("Sweep", "delay", self.t_settling.value())
     CONF.set("Sweep", "gate", self.smu_gate.currentText())
     CONF.set("Sweep", "drain", self.smu_drain.currentText())
Beispiel #18
0
 def save_defaults(self):
     CONF.set("Sweep", "VStart", self.v_start.value())
     CONF.set("Sweep", "VStop", self.v_stop.value())
     CONF.set("Sweep", "VStep", self.v_step.value())
     CONF.set("Sweep", "smu_sweep", self.smu_sweep.currentText())
Beispiel #19
0
    def load_defaults(self):

        self.v_start.setValue(CONF.get("Sweep", "VStart"))
        self.v_stop.setValue(CONF.get("Sweep", "VStop"))
        self.v_step.setValue(CONF.get("Sweep", "VStep"))
        self.smu_sweep.setCurrentText(CONF.get("Sweep", "smu_sweep"))
Beispiel #20
0
    def load_defaults(self):

        self.vd_start.setValue(CONF.get("Sweep", "VdStart"))
        self.vd_stop.setValue(CONF.get("Sweep", "VdStop"))
        self.vd_step.setValue(CONF.get("Sweep", "VdStep"))
        self.vg_list.setValue(CONF.get("Sweep", "VgList"))