fix: remove metadata updates on ScanStatusMessage

This commit is contained in:
appel_c 2025-02-26 18:25:16 +01:00
parent 0fcc2b610f
commit 0659ec01d1
2 changed files with 3 additions and 8 deletions

View File

@ -176,13 +176,10 @@ class SimMonitorAsync(PSIDeviceBase, SimMonitorAsyncControl):
def _send_data_to_bec(self) -> None: def _send_data_to_bec(self) -> None:
"""Sends bundled data to BEC""" """Sends bundled data to BEC"""
if self.scan_info.msg is None: metadata = {"async_update": self.async_update.get()}
return
metadata = self.scan_info.msg.metadata
metadata.update({"async_update": self.async_update.get()})
msg = messages.DeviceMessage( msg = messages.DeviceMessage(
signals={self.readback.name: self.data_buffer}, metadata=self.scan_info.msg.metadata signals={self.readback.name: self.data_buffer}, metadata=metadata
) )
self.connector.xadd( self.connector.xadd(
MessageEndpoints.device_async_readback( MessageEndpoints.device_async_readback(

View File

@ -130,12 +130,10 @@ class SimWaveform(Device):
def _send_async_update(self): def _send_async_update(self):
"""Send the async update to BEC.""" """Send the async update to BEC."""
metadata = self.scan_info.msg.metadata
async_update_type = self.async_update.get() async_update_type = self.async_update.get()
if async_update_type not in ["extend", "append"]: if async_update_type not in ["extend", "append"]:
raise ValueError(f"Invalid async_update type: {async_update_type}") raise ValueError(f"Invalid async_update type: {async_update_type}")
metadata.update({"async_update": async_update_type}) metadata = {"async_update": async_update_type}
msg = messages.DeviceMessage( msg = messages.DeviceMessage(
signals={self.waveform.name: {"value": self.waveform.get(), "timestamp": time.time()}}, signals={self.waveform.name: {"value": self.waveform.get(), "timestamp": time.time()}},
metadata=metadata, metadata=metadata,