mirror of
https://github.com/ivan-usov-org/bec.git
synced 2025-04-22 02:20:02 +02:00
bug fix for device lists
This commit is contained in:
parent
ffbdf205d0
commit
c876e19eb7
@ -84,13 +84,18 @@ class ScanGuard:
|
||||
def _check_motors_movable(self, request) -> None:
|
||||
if request.content["scan_type"] == "device_rpc":
|
||||
device = request.content["parameter"]["device"]
|
||||
if not self.device_manager.devices[device].enabled:
|
||||
raise ScanRejection(f"Device {device} is not enabled.")
|
||||
if not isinstance(device, list):
|
||||
device = [device]
|
||||
for dev in device:
|
||||
if not self.device_manager.devices[dev].enabled:
|
||||
raise ScanRejection(f"Device {dev} is not enabled.")
|
||||
|
||||
motor_args = request.content["parameter"].get("args")
|
||||
if not motor_args:
|
||||
return
|
||||
for motor in motor_args:
|
||||
if not motor:
|
||||
continue
|
||||
if not self.device_manager.devices[motor].enabled:
|
||||
raise ScanRejection(f"Device {motor} is not enabled.")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user