Skip to content
Snippets Groups Projects
Commit a9bb5c0c authored by Perceval Guillou's avatar Perceval Guillou
Browse files

add ximea det in shutter presets

parent c8010d8d
No related branches found
No related tags found
1 merge request!303Draft: Id16a holo
Pipeline #193286 failed
......@@ -29,15 +29,25 @@ class DarkShutterPreset(ScanPreset):
Close shutter
"""
self.restore_params = {}
self.restore_shutter_mode = None
dets = [
node.device
for node in scan.acq_chain.nodes_list
if isinstance(node, LimaAcquisitionMaster)
]
for det in dets:
if det.camera_type == "Frelon":
if det.proxy.lima_type == "Frelon":
det.shutter.mode = "MANUAL"
det.shutter.close_time = 0.0
elif det.proxy.lima_type == "Ximea":
proxy = det._get_proxy('Ximea')
self.restore_params[proxy] = ("gpo_mode", proxy.gpo_mode)
proxy.gpo_mode = 'OFF'
self.restore_shutter_mode = self.shutter.mode
self.shutter.mode = self.shutter.MANUAL
print(f"\nPreparing shutter for {scan.name}\n")
print(f"Closing the dark shutter")
......@@ -54,3 +64,9 @@ class DarkShutterPreset(ScanPreset):
if self.open_shutter:
print(f"Opening the dark shutter")
self.shutter.open()
for obj, (attr, value) in self.restore_params.items():
setattr(obj, attr, value)
if self.restore_shutter_mode is not None:
self.shutter.mode = self.restore_shutter_mode
\ No newline at end of file
......@@ -29,6 +29,7 @@ class FastShutterPreset(ScanPreset):
Open shutter if shutter controlled by detector
"""
self.soft_shutter = False
self.restore_shutter_mode = None
dets = [
node.device
......@@ -37,7 +38,7 @@ class FastShutterPreset(ScanPreset):
]
det = dets[0] if len(dets) == 1 else None
if det is not None and det.camera_type == "Frelon":
if det is not None and det.proxy.lima_type == "Frelon":
if det.camera.image_mode == "FULL FRAME":
det.shutter.mode = "AUTO_FRAME"
det.shutter.close_time = self.shutter.closing_time
......@@ -45,6 +46,14 @@ class FastShutterPreset(ScanPreset):
self.soft_shutter = True
det.shutter.mode = "MANUAL"
det.shutter.close_time = 0.0
elif det is not None and det.proxy.lima_type == "Ximea":
proxy = det._get_proxy('Ximea')
if proxy.gpo_mode == 'OFF':
self.soft_shutter = True
self.restore_shutter_mode = self.shutter.mode
self.shutter.mode = self.shutter.MANUAL
elif self.shutter is not None:
self.soft_shutter = True
......@@ -62,3 +71,6 @@ class FastShutterPreset(ScanPreset):
"""
if self.soft_shutter and self.close_shutter:
self.shutter.close()
if self.restore_shutter_mode is not None:
self.shutter.mode = self.restore_shutter_mode
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment