wip fix mcs card from csaxs
This commit is contained in:
@@ -255,9 +255,9 @@ class MCSCardCSAXS(PSIDeviceBase, MCSCard):
|
||||
**kwargs: Additional keyword arguments from the subscription, including 'obj' (the EpicsSignalRO instance).
|
||||
"""
|
||||
with self._rlock:
|
||||
self._mca_counter_index += 1
|
||||
if self._omit_mca_callbacks.is_set():
|
||||
return # Suppress callbacks when erasing all channels
|
||||
self._mca_counter_index += 1
|
||||
signal: EpicsSignalRO | None = kwargs.get("obj", None)
|
||||
if signal is None:
|
||||
logger.error(f"Called without 'obj' in kwargs: {kwargs}")
|
||||
@@ -367,6 +367,7 @@ class MCSCardCSAXS(PSIDeviceBase, MCSCard):
|
||||
# Clear any previous data, just to be sure
|
||||
with self._rlock:
|
||||
self._current_data.clear()
|
||||
self._mca_counter_index = 0
|
||||
|
||||
# NOTE Reset events for monitoring async_data_emission thread which is
|
||||
# running during complete to wait for all data from the card
|
||||
@@ -396,6 +397,7 @@ class MCSCardCSAXS(PSIDeviceBase, MCSCard):
|
||||
with suppress_mca_callbacks(self):
|
||||
with self._rlock:
|
||||
self._current_data.clear()
|
||||
self._current_data_index = 0
|
||||
self.erase_all.put(1)
|
||||
|
||||
def _monitor_async_data_emission(self) -> None:
|
||||
@@ -413,7 +415,7 @@ class MCSCardCSAXS(PSIDeviceBase, MCSCard):
|
||||
while self._start_monitor_async_data_emission.wait():
|
||||
try:
|
||||
logger.info(f"Monitoring async data emission for {self.name}...")
|
||||
if self.scan_info is not None:
|
||||
if hasattr(self.scan_info.msg, "num_points") and self.scan_info.msg.num_points is not None:
|
||||
if self._current_data_index == self.scan_info.msg.num_points:
|
||||
for callback in self._scan_done_callbacks:
|
||||
callback(exception=None)
|
||||
|
||||
Reference in New Issue
Block a user