Commit f4e5c007 authored by Jerome Carnis's avatar Jerome Carnis 🦊
Browse files

deviceEigerP11.py: create constants for default frame numbers

parent 31c4e12e
Pipeline #28463 passed with stages
in 11 minutes and 4 seconds
......@@ -32,6 +32,11 @@ from kamzik3.macro.step import Step, StepDeviceMethod
from kamzik3.snippets.snippetsDecorators import expose_method
FRAMES_PER_FILE_SCAN = 1000
FRAMES_PER_FILE_LIVE = 1000000
# any large number is ok, images are not saved in the live-view mode
class InterfaceStatus(IntEnum):
"""Status of the Eiger interface (filewriter, eigerstream, monitor)."""
......@@ -184,7 +189,6 @@ class DeviceTangoEigerDetector(DeviceTango):
:param Exposure: desired exposure time per frame
"""
frames_per_file = 1000000
self.logger.info("Live view has started.")
self.set_attribute(["TriggerMode", VALUE], TriggerMode.INTS.value)
if self.file_writer is not None:
......@@ -192,7 +196,9 @@ class DeviceTangoEigerDetector(DeviceTango):
self.set_attribute(
["FileWriter", "Mode", VALUE], InterfaceStatus.DISABLED.value
)
self.set_attribute(["FileWriter", "NimagesPerFile", VALUE], frames_per_file)
self.set_attribute(
["FileWriter", "NimagesPerFile", VALUE], FRAMES_PER_FILE_LIVE
)
if self.eiger_stream is not None:
self.logger.info("EigerStream disabled")
self.set_attribute(
......@@ -205,11 +211,11 @@ class DeviceTangoEigerDetector(DeviceTango):
self.set_attribute(["FrameTime", VALUE], frame_time)
self.set_attribute(["CountTime", VALUE], exposure)
self.set_attribute(["Ntrigger", VALUE], 1)
self.set_attribute(["Nimages", VALUE], frames_per_file)
self.set_attribute(["Nimages", VALUE], FRAMES_PER_FILE_LIVE)
self.Arm()
self.Trigger()
self.set_value(
ATTR_FRAME_COUNT, self.get_value(ATTR_FRAME_COUNT) + frames_per_file
ATTR_FRAME_COUNT, self.get_value(ATTR_FRAME_COUNT) + FRAMES_PER_FILE_LIVE
)
@expose_method()
......@@ -409,6 +415,8 @@ class EigerScanner(DeviceScanner):
["FileWriter", "Mode", VALUE], InterfaceStatus.ENABLED.value
)
self.detector.set_attribute(["FileWriter", "NamePattern", VALUE], path)
self.detector.set_attribute(["FileWriter", "NimagesPerFile", VALUE], 1000)
self.detector.set_attribute(
["FileWriter", "NimagesPerFile", VALUE], FRAMES_PER_FILE_SCAN
)
self.detector.Arm()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment