w
This commit is contained in:
@@ -170,9 +170,10 @@ class DDG1(PSIDeviceBase, DelayGeneratorCSAXS):
|
||||
It's logic is coupled to the MCS card implementation and the DDG1 trigger logic.
|
||||
"""
|
||||
mcs.stop_all.put(1)
|
||||
mcs._omit_mca_callbacks.clear() # Ensure that callbacks are not suppressed
|
||||
status_acquiring = TransitionStatus(mcs.acquiring, [ACQUIRING.DONE, ACQUIRING.ACQUIRING])
|
||||
self.cancel_on_stop(status_acquiring)
|
||||
mcs.start_all.put(1) # Don't use erase_start as this may emit data through callbacks
|
||||
mcs.erase_start.put(1) # Don't use erase_start as this may emit data through callbacks
|
||||
status_acquiring.wait(timeout=10) # Allow 10 seconds in case communication is slow
|
||||
|
||||
def _poll_event_status(self) -> None:
|
||||
|
||||
@@ -43,12 +43,7 @@ def suppress_mca_callbacks(mcs_card: MCSCard):
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
mcs_card._channels_updated.wait(timeout=3.0)
|
||||
if not mcs_card._channels_updated.is_set():
|
||||
logger.warning(
|
||||
f"Timeout while waiting for MCA channels to be cleared for device {mcs_card.name}."
|
||||
)
|
||||
mcs_card._omit_mca_callbacks.clear()
|
||||
pass
|
||||
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
@@ -120,7 +115,6 @@ class MCSCardCSAXS(PSIDeviceBase, MCSCard):
|
||||
self._current_data: dict[str, dict[Literal["value", "timestamp"], list[int] | float]] = {}
|
||||
|
||||
self._omit_mca_callbacks: threading.Event = threading.Event()
|
||||
self._channels_updated: threading.Event = threading.Event()
|
||||
|
||||
def on_connected(self):
|
||||
"""
|
||||
@@ -177,14 +171,8 @@ class MCSCardCSAXS(PSIDeviceBase, MCSCard):
|
||||
|
||||
"""
|
||||
with self._rlock:
|
||||
if self._mca_counter_index == 0:
|
||||
self._channels_updated.clear()
|
||||
self._mca_counter_index += 1
|
||||
if self._omit_mca_callbacks.is_set():
|
||||
# Count supressing callbacks when erasing all channels
|
||||
if self._mca_counter_index == self.NUM_MCA_CHANNELS:
|
||||
self._mca_counter_index = 0
|
||||
self._channels_updated.set()
|
||||
return # Suppress callbacks when erasing all channels
|
||||
signal = kwargs.get("obj", None)
|
||||
if signal is None:
|
||||
|
||||
Reference in New Issue
Block a user