This commit is contained in:
2025-09-05 09:12:02 +02:00
parent 7d9f5cff40
commit 83506df2c7

View File

@@ -193,14 +193,14 @@ class Pilatus(PSIDeviceBase, ADBase):
data = np.reshape(value, (height, width))
last_image: DevicePreviewMessage = self.preview.get()
if last_image is None:
return
elif np.array_equal(data, last_image.data):
# No update if image is the same, ~2.5ms on 2400x2400 image (6M)
logger.info(
f"Pilatus preview image for {self.name} is the same as last one, not updating."
)
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)
logger.info(
f"Pilatus preview image for {self.name} is the same as last one, not updating."
)
return
logger.info(f"Setting data for {self.name}")
self.preview.put(data)
except Exception: # pylint: disable=broad-except