fix(timepix): move to pushing raw data from backend through redis
This commit is contained in:
@@ -190,6 +190,9 @@ class TimePixControl(ADBase):
|
||||
DETECTOR_SHAPE = (512, 1024) # Shape of the TimePix detector
|
||||
|
||||
|
||||
TIMEPIX_FLY_BACKEND_DEFAULT_REDIS_TOPIC = "user/timepix_fly_backend/raw_data"
|
||||
|
||||
|
||||
class Timepix(PSIDeviceBase, TimePixControl):
|
||||
"""
|
||||
Integration of the Timepix detector for the SuperXAS beamline. The control interface is
|
||||
@@ -253,15 +256,22 @@ class Timepix(PSIDeviceBase, TimePixControl):
|
||||
**kwargs: Additional keyword arguments for the base class.
|
||||
"""
|
||||
|
||||
super().__init__(
|
||||
name=name, prefix=prefix, scan_info=scan_info, device_manager=device_manager, **kwargs
|
||||
)
|
||||
self._redis_raw_data_topic = TIMEPIX_FLY_BACKEND_DEFAULT_REDIS_TOPIC
|
||||
|
||||
self.backend = TimepixFlyBackend(
|
||||
backend_rest_url=backend_rest_url, hostname=hostname, socket_port=socket_port
|
||||
backend_rest_url=backend_rest_url,
|
||||
hostname=hostname,
|
||||
socket_port=socket_port,
|
||||
redis_topic=self._redis_raw_data_topic,
|
||||
redis_connector=self.device_manager.connector,
|
||||
)
|
||||
self._pixel_map = None
|
||||
self._troistep = 1
|
||||
self._troin = 5000
|
||||
super().__init__(
|
||||
name=name, prefix=prefix, scan_info=scan_info, device_manager=device_manager, **kwargs
|
||||
)
|
||||
|
||||
self._poll_thread = threading.Thread(
|
||||
target=self._poll_array_data, daemon=True, name=f"{self.name}_poll_thread"
|
||||
)
|
||||
@@ -660,10 +670,12 @@ class Timepix(PSIDeviceBase, TimePixControl):
|
||||
# XES specific staging
|
||||
if self.enable_xes:
|
||||
# Prepare TimePixFly
|
||||
con = self.device_manager.connector
|
||||
other_config = OtherConfigModel(
|
||||
TRoiStep=self.troistep,
|
||||
TRoiN=self.troin,
|
||||
output_uri=f"tcp:{self.backend.hostname}:{self.backend.socket_port}",
|
||||
# output_uri=f"tcp:{self.backend.hostname}:{self.backend.socket_port}",
|
||||
output_uri=f"redis://{con.host}:{con.port}/{self._redis_raw_data_topic}?scan-id={scan_msg.scan_id}",
|
||||
save_interval=int(131000 / 5) - 5,
|
||||
) # Save interval in 131kHz units,
|
||||
logger.debug(f"Current TimePixFly configuration: {other_config}")
|
||||
|
||||
Reference in New Issue
Block a user