def __init__(self, **kwargs): self._state_lock = threading.Lock() self._monitor_count = None self._repetitions = 1 self._acquisition_mode = AcqMode.Timer self._config = None self._config_dirty = True self._moveable = None self._moveable_obj = None self._synchronization = [] # dict with channel and its acquisition synchronization # key: PoolBaseChannel; value: AcqSynch self._channel_to_acq_synch = {} # dict with controller and its acquisition synchronization # key: PoolController; value: AcqSynch self._ctrl_to_acq_synch = {} kwargs['elem_type'] = ElementType.MeasurementGroup PoolGroupElement.__init__(self, **kwargs) configuration = kwargs.get("configuration") self.set_configuration(configuration) # if the configuration was never "really" written e.g. newly created MG # just sets it now so the _channe_to_acq_synch and _ctrl_to_acq_synch # are properly populated # TODO: make it more elegant if configuration is None: configuration = self.get_configuration() self.set_configuration(configuration, propagate=0, to_fqdn=False)
def __init__(self, **kwargs): self._physical_elements = [] self._in_start_move = False kwargs['elem_type'] = ElementType.MotorGroup PoolGroupElement.__init__(self, **kwargs) on_change = self.on_change self._position = Position(self, listeners=on_change)
def __init__(self, **kwargs): self._integration_time = None self._monitor_count = None self._acquisition_mode = AcqMode.Timer self._config = None self._config_dirty = True kwargs['elem_type'] = ElementType.MeasurementGroup PoolGroupElement.__init__(self, **kwargs) self.set_configuration(kwargs.get('configuration'))
def add_user_element(self, element, index=None): elem_type = element.get_type() if elem_type == ElementType.Motor: pass elif elem_type == ElementType.PseudoMotor: # TODO: make this happen pass else: raise Exception("element %s is not a motor" % element.name) PoolGroupElement.add_user_element(self, element, index=index)
def add_user_element(self, element, index=None): elem_type = element.get_type() if elem_type == ElementType.Motor: pass elif elem_type == ElementType.PseudoMotor: #TODO: make this happen pass else: raise Exception("element %s is not a motor" % element.name) PoolGroupElement.add_user_element(self, element, index=index)
def add_user_element(self, element, index=None): '''Override the base behavior, so the TriggerGate elements are silently skipped if used multiple times in the group''' user_elements = self._user_elements if element in user_elements: # skipping TriggerGate element if already present if element.get_type() is ElementType.TriggerGate: return return PoolGroupElement.add_user_element(self, element, index)
def __init__(self, **kwargs): self._state_lock = threading.Lock() self._monitor_count = None self._nb_starts = 1 self._pending_starts = 0 self._acquisition_mode = AcqMode.Timer self._config = MeasurementConfiguration(self) self._config_dirty = True self._moveable = None self._moveable_obj = None # by default software synchronizer initial domain is set to Position self._sw_synch_initial_domain = SynchDomain.Position self._synchronization = SynchronizationDescription() kwargs['elem_type'] = ElementType.MeasurementGroup PoolGroupElement.__init__(self, **kwargs) configuration = kwargs.get("configuration") if configuration is None: user_elements = self.get_user_elements() configuration = build_measurement_configuration(user_elements) self.set_configuration_from_user(configuration)
def _calculate_states(self, state_info=None): state, status = PoolGroupElement._calculate_states(self, state_info) # check if software synchronizer is occupied synch_soft = self.acquisition._synch._synch_soft acq_sw = self.acquisition._sw_acq acq_0d = self.acquisition._0d_acq if state in (State.On, State.Unknown) \ and (synch_soft.is_started() or acq_sw._is_started() or acq_0d._is_started()): state = State.Moving status += "/nSoftware synchronization is in progress" return state, status
def stop(self): self._pending_starts = 0 self.acquisition._synch._synch_soft.stop() PoolGroupElement.stop(self)
def abort(self): self._pending_starts = 0 PoolGroupElement.abort(self)
def stop(self): self.acquisition._synch._synch_soft.stop() PoolGroupElement.stop(self)