Пример #1
0
def _str_factory(entry, name, value, tooltip):
    options = options_enum(entry.get('options', None))
    if options is not None:
        p = guiparams.Enum(name, value, options, tooltip=tooltip)
    else:
        p = guiparams.String(name, value, tooltip=tooltip)
    return p
Пример #2
0
def _int_factory(entry, name, value, tooltip):
    options = entry.get('options', None)
    if options is None:
        return None  # todo
    if callable(options):
        options = options_enum(options)
    if isinstance(options, collections.abc.Sequence):
        return guiparams.Enum(name, value, options, tooltip=tooltip)
    else:
        # todo range
        return None
Пример #3
0
 def init(self):
     io_voltages = options_enum(
         self._cmdp.preferences.definition_options(
             'Device/parameter/io_voltage'))
     io_voltage = self._cmdp['Device/parameter/io_voltage']
     comboBoxConfig(self.ui.voltageComboBox, io_voltages, io_voltage)
     self.ui.voltageComboBox.currentIndexChanged.connect(
         self._on_voltage_combobox)
     self.ui.output0Button.toggled.connect(self._on_output0_button)
     self.ui.output1Button.toggled.connect(self._on_output1_button)
     self.ui.input0CheckBox.toggled.connect(self._on_input0_button)
     self.ui.input1CheckBox.toggled.connect(self._on_input1_button)