def guide_line_length(self, value): _u.validate_attr_type(self, "guide_line_length", value, numbers.Number, none_allowed=True) if value is not None: _u.validate_attr_positive(self, "guide_line_length", value) self._guide_line_length = value self._guide = GlobalSpeedGuide(self)
def duration(self, value): is_multiple = False if isinstance(value, numbers.Number): _u.validate_attr_positive(self, "duration", value) elif value is not None: is_multiple = True _u.validate_attr_is_collection(self, "duration", value, min_length=1) for i in range(len(value)): _u.validate_attr_numeric(self, "duration[%d]" % i, value[i]) _u.validate_attr_positive(self, "duration[%d]" % i, value[i]) self._duration = value self._duration_multiple = is_multiple self._log_property_changed("duration")
def size(self, value): if self._preloaded: raise ttrk.InvalidStateError( "{:}.size cannot be set after the object was preloaded".format( _u.get_type_name(self))) if value is None: self._size = None else: _u.validate_attr_is_collection(self, "size", value, 2, 2) _u.validate_attr_numeric(self, "size[0]", value[0]) _u.validate_attr_positive(self, "size[0]", value[0]) _u.validate_attr_numeric(self, "size[1]", value[1]) _u.validate_attr_positive(self, "size[1]", value[1]) self._size = (int(value[0]), int(value[1])) self._log_property_changed("size")
def full_rotation_duration(self, value): _u.validate_attr_type(self, "degrees_per_sec", value, numbers.Number) _u.validate_attr_positive(self, "degrees_per_sec", value) self._degrees_per_sec = (360 / value) % 360
def degrees_per_sec(self, value): _u.validate_attr_type(self, "degrees_per_sec", value, numbers.Number) _u.validate_attr_positive(self, "degrees_per_sec", value) self._degrees_per_sec = value % 360
def radius(self, value): _u.validate_attr_type(self, "radius", value, numbers.Number) _u.validate_attr_positive(self, "radius", value) self._radius = value
def units_per_mm(self, value): _u.validate_attr_type(self, "units_per_mm", value, numbers.Number) _u.validate_attr_positive(self, "units_per_mm", value) self._units_per_mm = value self._log_setter("units_per_mm")
def max_movement_time(self, value): value = _u.validate_attr_numeric(self, "max_movement_time", value, _u.NoneValues.ChangeTo0) _u.validate_attr_positive(self, "max_movement_time", value) self._max_movement_time = value self._log_property_changed("max_movement_time")
def full_rotation_duration(self, value): _u.validate_attr_type(self, "full_rotation_duration", value, numbers.Number) _u.validate_attr_positive(self, "full_rotation_duration", value) self._degrees_per_sec = (360 / value) % 360 self._log_property_changed("full_rotation_duration")
def degrees_per_sec(self, value): _u.validate_attr_type(self, "degrees_per_sec", value, numbers.Number) _u.validate_attr_positive(self, "degrees_per_sec", value) self._degrees_per_sec = value % 360 self._log_property_changed("degrees_per_sec")
def radius(self, value): _u.validate_attr_type(self, "radius", value, numbers.Number) _u.validate_attr_positive(self, "radius", value) self._radius = value self._log_property_changed("radius")
def duration(self, value): _u.validate_attr_type(self, "duration", value, numbers.Number) _u.validate_attr_positive(self, "duration", value) self._duration = value self._log_property_changed("duration")
def zoom_duration(self, value): _u.validate_attr_numeric(self, "zoom_duration", value) _u.validate_attr_positive(self, "zoom_duration", value) self._zoom_duration = value self._log_property_changed(self, "zoom_duration")
def dot_radius(self, value): _u.validate_attr_type(self, "dot_radius", value, int) _u.validate_attr_positive(self, "dot_radius", value) self._dot_radius = value self._need_to_regenerate_dots = True self._log_property_changed(self, "dot_radius")
def max_trial_duration(self, value): value = _u.validate_attr_numeric(self, "max_trial_duration", value, _u.NoneValues.ChangeTo0) _u.validate_attr_positive(self, "max_trial_duration", value) self._max_trial_duration = value self._log_setter("max_trial_duration")
def size(self, value): _u.validate_attr_is_coord(self, "size", value) _u.validate_attr_positive(self, "size[0]", value[0]) _u.validate_attr_positive(self, "size[1]", value[1]) self._size = (value[0], value[1])