Ejemplo n.º 1
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
        # TODO: this needs testing
        if self.instr.connected:
            self.instr.disconnect()
            time.sleep(0.2)  # wait for pending comminication to finish

        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()
Ejemplo n.º 2
0
    def _on_accept(self):
        self.modNumbers['temperature'] = self.temp_modules[self.comboBox.currentIndex()]
        self.modNumbers['gasflow'] = self.gas_modules[self.comboBox_2.currentIndex()]
        self.modNumbers['heater'] = self.heat_modules[self.comboBox_3.currentIndex()]

        # update default modules
        CONF.set('MercuryFeed', 'temperature_module', self.comboBox.currentIndex())
        CONF.set('MercuryFeed', 'gasflow_module', self.comboBox_2.currentIndex())
        CONF.set('MercuryFeed', 'heater_module', self.comboBox_3.currentIndex())

        self.accepted.emit(self.modNumbers)
Ejemplo n.º 3
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())