diff --git a/src/fastcs_pandablocks/panda/fields.py b/src/fastcs_pandablocks/panda/fields.py index c46fe58..32c8006 100644 --- a/src/fastcs_pandablocks/panda/fields.py +++ b/src/fastcs_pandablocks/panda/fields.py @@ -341,14 +341,12 @@ def __init__( ) self._additional_attributes["delay"] = AttrRW( - Int(), + Int(max=bit_mux_field_info.max_delay, min=0), description="Clock delay on input.", handler=DefaultFieldHandler(panda_name), group=WidgetGroup.INPUTS.value, ) - # TODO: Add DRVL DRVH to `delay`. - class PosMuxFieldController(FieldController): def __init__( @@ -375,15 +373,18 @@ def __init__( initial_values: RawInitialValuesType, ): super().__init__(panda_name) - self.top_level_attribute = AttrR( - Float(prec=0), + self.top_level_attribute = AttrRW( + Float( + max_alarm=uint_param_field_info.max_val, + max=uint_param_field_info.max_val, + min_alarm=0, + min=0, + ), description=_strip_description(uint_param_field_info.description), group=WidgetGroup.PARAMETERS.value, initial_value=float(initial_values[panda_name]), ) - # TODO: set DRVL, DRVH, HOPR (new fastcs feature) - class UintReadFieldController(FieldController): def __init__( @@ -394,7 +395,7 @@ def __init__( ): super().__init__(panda_name) self.top_level_attribute = AttrR( - Float(prec=0), + Float(prec=0, min_alarm=0, max_alarm=uint_read_field_info.max_val), description=_strip_description(uint_read_field_info.description), group=WidgetGroup.READBACKS.value, initial_value=float(initial_values[panda_name]), @@ -410,7 +411,13 @@ def __init__( ): super().__init__(panda_name) self.top_level_attribute = AttrW( - Float(prec=0), + Float( + prec=0, + max_alarm=uint_write_field_info.max_val, + max=uint_write_field_info.max_val, + min_alarm=0, + min=0, + ), description=_strip_description(uint_write_field_info.description), group=WidgetGroup.OUTPUTS.value, )