Skip to content

Commit e4c528d

Browse files
authored
Change oav parameters direction attribute to enum from int (#2092)
1 parent a979c80 commit e4c528d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/dodal/devices/oav/oav_parameters.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from daq_config_server import ConfigClient
88
from daq_config_server.models import DisplayConfig
99

10+
from dodal.devices.oav.pin_image_recognition import ScanDirections
11+
1012
# GDA currently assumes this aspect ratio for the OAV window size.
1113
# For some beamline this doesn't affect anything as the actual OAV aspect ratio
1214
# matches. Others need to take it into account to rescale the values stored in
@@ -99,7 +101,9 @@ def update(name, param_type, default=None):
99101
self.open_ksize: int = update("open_ksize", int, default=0)
100102
self.close_ksize: int = update("close_ksize", int, default=5)
101103
self.min_callback_time: float = update("min_callback_time", float, default=0.08)
102-
self.direction: int = update("direction", int)
104+
self.direction: ScanDirections = [*ScanDirections][
105+
self.active_params["direction"]
106+
]
103107
self.max_tip_distance: float = update("max_tip_distance", float, default=300)
104108

105109
def get_max_tip_distance_in_pixels(self, microns_per_pixel: float) -> float:

0 commit comments

Comments
 (0)