Пример #1
0
    def _init_ui(self):
        # Widgets
        self._wdg_positions = SpecimenPositionListWidget()

        # Layouts
        layout = _AcquisitionWidget._init_ui(self)
        layout.addRow('Positions', self._wdg_positions)

        # Signals
        self._wdg_positions.edited.connect(self.edited)

        return layout
Пример #2
0
class AcquisitionMultipointWidget(_AcquisitionWidget):

    def __init__(self, parent=None):
        _AcquisitionWidget.__init__(self, AcquisitionMultipoint, parent)

    def _init_ui(self):
        # Widgets
        self._wdg_positions = SpecimenPositionListWidget()

        # Layouts
        layout = _AcquisitionWidget._init_ui(self)
        layout.addRow('Positions', self._wdg_positions)

        # Signals
        self._wdg_positions.edited.connect(self.edited)

        return layout

    def parameter(self, parameter=None):
        parameter = _AcquisitionWidget.parameter(self, parameter)
        parameter.positions.clear()
        parameter.positions.extend(self._wdg_positions.positions())
        return parameter

    def setParameter(self, condition):
        _AcquisitionWidget.setParameter(self, condition)
        self._wdg_positions.setPositions(condition.positions)

    def setReadOnly(self, state):
        _AcquisitionWidget.setReadOnly(self, state)
        self._wdg_positions.setReadOnly(state)

    def isReadOnly(self):
        return _AcquisitionWidget.isReadOnly(self) and \
            self._wdg_positions.isReadOnly()

    def hasAcceptableInput(self):
        return _AcquisitionWidget.hasAcceptableInput(self) and \
            self._wdg_positions.hasAcceptableInput()