qudi.core.StatusVar
- class qudi.core.StatusVar(name: str | None = None, default: Any | None = None, *, constructor: Callable | None = None, representer: Callable | None = None)[source]
Bases:
builtins.objectThis class defines a status variable that is loaded before activation and saved after deactivation.
- __init__(name: str | None = None, default: Any | None = None, *, constructor: Callable | None = None, representer: Callable | None = None)[source]
- Parameters:
- namestr
Identifier of the status variable when stored.
- defaultAny
Default value for the status variable when a saved version is not present.
- constructorcallable
Constructor function for the variable; use for type checks or conversion.
- representercallable
Representer function for the status variable; use for saving conversion.
Methods
__init__([name, default, constructor, ...])- Parameters:
constructor(func)This is the decorator for declaring constructor function for this StatusVar.
copy(**kwargs)Create a new instance of StatusVar with copied and updated values.
representer(func)This is the decorator for declaring a representer function for this StatusVar.
- __init__(name: str | None = None, default: Any | None = None, *, constructor: Callable | None = None, representer: Callable | None = None)[source]
- Parameters:
- namestr
Identifier of the status variable when stored.
- defaultAny
Default value for the status variable when a saved version is not present.
- constructorcallable
Constructor function for the variable; use for type checks or conversion.
- representercallable
Representer function for the status variable; use for saving conversion.
- constructor(func: Callable) Callable[source]
This is the decorator for declaring constructor function for this StatusVar.
- Parameters:
- funccallable
Constructor function for this StatusVar.
- Returns:
- callable
The original function so this can be used as a decorator.