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()
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())
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())
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())
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())
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())
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())
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())