csaxs_bec.devices.epics.mcs_card.mcs_card_csaxs.suppress_mca_callbacks#
- suppress_mca_callbacks(mcs_card: MCSCard, restore_after_timeout: None | float = None)[source]#
Utility context manager to suppress MCA channel callbacks temporarily. It is required because erasing all channels via ‘erase_all’ PV triggers callbacks for each channel. Depending on timing, this can interfere with ongoing data acquisition so this context manager can be used to suppress those callbacks temporarily. If used with restore_after_timeout, the suppression will be automatically cleared after the specified timeout in seconds.
NOTE: Please be aware that it does not restore previous state, which means that _omit_mca_callbacks will remain set after exiting the context. It has to be cleared manually if needed. This can be improved in the future, but should be carefully coordinated with the logic implemented within ‘_on_counter_update’.
- Parameters:
mcs_card (MCSCard) – The MCSCard instance to suppress callbacks for.
restore_after_timeout (float | None) – Optional timeout in seconds to automatically clear the suppression after the specified time. If None, the original state is not restored.