fix: truncate requested detector position if request is impossible
This commit is contained in:
+6
-4
@@ -1996,13 +1996,15 @@ class AareDAQ:
|
||||
|
||||
if request.dtz is not None:
|
||||
if request.dtz < self.__cfg.cached_dtz_low:
|
||||
raise ValueError(
|
||||
f"Requested DTZ {request.dtz} is less than low detector limit {self.__cfg.cached_dtz_low}"
|
||||
logger.error(
|
||||
f"Requested DTZ {request.dtz} is less than low detector limit {self.__cfg.cached_dtz_low}. Truncating to the nearest allowable value."
|
||||
)
|
||||
request.dtz = self.__cfg.cached_dtz_low
|
||||
elif request.dtz > self.__cfg.cached_dtz_high:
|
||||
raise ValueError(
|
||||
f"Requested DTZ {request.dtz} exceeds high detector limit {self.__cfg.cached_dtz_high}"
|
||||
logger.error(
|
||||
f"Requested DTZ {request.dtz} exceeds high detector limit {self.__cfg.cached_dtz_high}. Truncating to the nearest allowable value."
|
||||
)
|
||||
request.dtz = self.__cfg.cached_dtz_high
|
||||
logger.info(f"requesting dtz to move to {request.dtz}")
|
||||
self.__cfg.dtz = request.dtz
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user