Qudi
|
Fysom is a Python package that allows the effortless creation of state machines with callbacks.
Each Qudi module contains, via the Base class, a state machine that governs some of its behaviour regarding activation and deactivation.
The states are:
Do not declare these transition function names in anything derived from Base, that will lead to unexpected behaviour!
In a module the default event handler called after the state has transitioned to activate or deactivate are the methods called on_activate
and on_deactivate
. Both methods don't take any parameters as default. For debugging purposes it is sometimes useful to access to the fysom event object. This is possible by defining new callback methods in the constructor:
and adding the fysom event object as parameter to the event handler:
InterruptableTask represents a task in a module that can be safely executed by checking preconditions and pausing other tasks that are being executed as well. The task can also be paused, given that the preconditions for pausing are met.
State diagram:
Each state has a transition state that allow for checks, synchronizatuion and for parts of the task to influence its own execution via signals. This also allows the TaskRunner to be informed about what the task is doing and ensuring that a task is executed in the correct thread.
Fill in later