bec_widgets.utils.bec_signal_proxy ================================== .. py:module:: bec_widgets.utils.bec_signal_proxy .. autoapi-nested-parse:: This custom class is a thin wrapper around the SignalProxy class to allow signal calls to be blocked. Unblocking the proxy needs to be done through the slot unblock_proxy. The most likely use case for this class is when the callback function is potentially initiating a slower progress, i.e. requesting a data analysis routine to analyse data. Requesting a new fit may lead to request piling up and an overall slow done of performance. This proxy will allow you to decide by yourself when to unblock and execute the callback again. Classes ------- .. autoapisummary:: bec_widgets.utils.bec_signal_proxy.BECSignalProxy Module Contents --------------- .. py:class:: BECSignalProxy(*args, rateLimit=25, timeout=10.0, **kwargs) Bases: :py:obj:`pyqtgraph.SignalProxy` Thin wrapper around the SignalProxy class to allow signal calls to be blocked, but arguments still being stored. :param \*args: Arguments to pass to the SignalProxy class. :param rateLimit: The rateLimit of the proxy. :type rateLimit: int :param timeout: The number of seconds after which the proxy automatically unblocks if still blocked. Default is 10.0 seconds. :type timeout: float :param \*\*kwargs: Keyword arguments to pass to the SignalProxy class. .. rubric:: Example >>> proxy = BECSignalProxy(signal, rate_limit=25, slot=callback) Initialization arguments: signal - a bound Signal or pyqtSignal instance delay - Time (in seconds) to wait for signals to stop before emitting (default 0.3s) slot - Optional function to connect sigDelayed to. rateLimit - (signals/sec) if greater than 0, this allows signals to stream out at a steady rate while they are being received. threadSafe - Specify if thread-safety is required. For backwards compatibility, it defaults to True. .. py:method:: _timeout_unblock() Internal method called by the QTimer upon timeout. Unblocks the proxy automatically if it is still blocked. .. py:method:: cleanup() Cleanup the proxy by stopping the timer and disconnecting the timeout signal. .. py:method:: signalReceived(*args) Receive signal, store the args and call signalReceived from the parent class if not blocked .. py:method:: unblock_proxy() Unblock the proxy, and call the signalReceived method in case there was an update of the args. .. py:property:: blocked Returns if the proxy is blocked .. py:attribute:: is_blocked .. py:attribute:: new_args :value: None .. py:attribute:: old_args :value: None