Skip to content

Commit

Permalink
set operational limits
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Nov 12, 2024
1 parent 304dd1b commit ee8bb95
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/fastcs_pandablocks/panda/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand All @@ -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__(
Expand All @@ -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]),
Expand All @@ -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,
)
Expand Down

0 comments on commit ee8bb95

Please sign in to comment.