def _update(self, result_future): super(CheckBoxParameterBinding, self)._update(result_future) try: with util.block_signals(self.target): self.target.setChecked(int(result_future)) except Exception: pass
def _update(self, rf): super(ComboBoxParameterBinding, self)._update(rf) try: with util.block_signals(self.target): self.target.setCurrentIndex(int(rf.result())) except Exception: pass
def _update(self, rf): super(SliderParameterBinding, self)._update(rf) value = int(rf.result()) if self.unit is not None: value = self.unit.unit_value(value) with util.block_signals(self.target): self.target.setValue(value)
def _populate(self): with util.block_signals(self.text_edit): try: notes = self.device.get_extension('user_notes') if self.get_plain_text() != notes: self.text_edit.setPlainText(notes) except KeyError: self.text_edit.clear() self.text_edit.document().setModified(False)
def _update(self, rf): try: with util.block_signals(self.target): self.target.button(int(rf.result())).setChecked(True) for b in self.target.buttons(): b.setToolTip(self._get_tooltip(rf)) b.setStatusTip(b.toolTip()) except Exception: pass
def _update(self, result_future): if self.editing_observer.editing: log.debug("DoubleSpinBoxParameterBinding: _update: early return as editing in progress") self.editing_observer.last_result_future = result_future return super(DoubleSpinBoxParameterBinding, self)._update(result_future) try: value = self.unit.unit_value(int(result_future.result())) with util.block_signals(self.target): self.target.setValue(value) except Exception: pass
def __init__(self, **kwargs): super(SpinBoxParameterBinding, self).__init__(**kwargs) if self.profile.range is not None: with util.block_signals(self.target): self.target.setMinimum(self.profile.range[0]) self.target.setMaximum(self.profile.range[1]) if hasattr(self.target, 'delayed_valueChanged'): self.target.delayed_valueChanged.connect(self._write_value) else: self.target.valueChanged.connect(self._write_value) self.editing_observer = SpinBoxEditingObserver(self)
def _update(self, result_future): if self.editing_observer.editing: log.debug("SpinBoxParameterBinding: _update: early return as editing in progress") self.editing_observer.last_result_future = result_future return super(SpinBoxParameterBinding, self)._update(result_future) try: result = int(result_future.result()) with util.block_signals(self.target): self.target.setValue(result) log.debug("SpinBoxParameterBinding: _update: addr=%d, result=%d", self.address, result) except Exception: pass
def __init__(self, unit_name, **kwargs): super(DoubleSpinBoxParameterBinding, self).__init__(**kwargs) self.unit = self.profile.get_unit(unit_name) if self.profile.range is not None: with util.block_signals(self.target): self.target.setMinimum(self.unit.unit_value(self.profile.range[0])) self.target.setMaximum(self.unit.unit_value(self.profile.range[1])) if hasattr(self.target, 'delayed_valueChanged'): self.target.delayed_valueChanged.connect(self._value_changed) else: self.target.valueChanged.connect(self._value_changed) self.editing_observer = SpinBoxEditingObserver(self)