This commit is contained in:
2025-09-08 09:33:58 +02:00
parent 0130112354
commit 2b97279b9f

View File

@@ -178,9 +178,9 @@ class Pilatus(PSIDeviceBase, ADBase):
)
self._poll_thread_kill_event = threading.Event()
self._poll_rate = 1 # Poll rate in Hz
self._live_mode_thread = threading.Thread(
target=self._live_mode_loop, daemon=True, name=f"{self.name}_live_mode_thread"
)
# self._live_mode_thread = threading.Thread(
# target=self._live_mode_loop, daemon=True, name=f"{self.name}_live_mode_thread"
# )
# self._live_mode_kill_event = threading.Event()
# self._live_mode_run_event = threading.Event()
# self._live_mode_stopped_event = threading.Event()
@@ -194,6 +194,7 @@ class Pilatus(PSIDeviceBase, ADBase):
"""Poll the array data for preview updates."""
while not self._poll_thread_kill_event.wait(1 / self._poll_rate):
try:
logger.info(f"Running poll loop for {self.name}..")
value = self.image1.array_data.get()
if value is None:
continue
@@ -202,7 +203,7 @@ class Pilatus(PSIDeviceBase, ADBase):
# Geometry correction for the image
data = np.reshape(value, (height, width))
last_image: DevicePreviewMessage = self.preview.get()
logger.info(f"Preview image for {self.name} has shape {data.shape}")
if last_image is not None:
if np.array_equal(data, last_image.data):
# No update if image is the same, ~2.5ms on 2400x2400 image (6M)