magscope.hardware#
Classes#
Abstract base class for processes in the MagScope |
|
Base class for absolute-Z focus motors used by MagScope. |
Module Contents#
- class magscope.hardware.HardwareManagerBase[source]#
Bases:
magscope.processes.ManagerProcessBase,abc.ABCAbstract base class for processes in the MagScope
Subclass requirements: * Each subclass should have a unique name. * There should only be one instance of each subclass (singleton). * The class name is used for consistent inter-process identification.
- _buffer: magscope.datatypes.MatrixBuffer | None = None[source]#
- class magscope.hardware.FocusMotorBase[source]#
Bases:
HardwareManagerBase,abc.ABCBase class for absolute-Z focus motors used by MagScope.
Subclasses provide the device-specific motion primitives while this base class standardizes polling, telemetry buffering, and the optional bridge to the simulated camera. The hardware matrix buffer stores rows as
[timestamp, current_z, target_z, is_at_target]whereis_at_targetis encoded as0.0or1.0.- fetch()[source]#
Checks if the hardware has new data.
If the hardware has new data, then it stores the data and timestamp in the matrix buffer (self._buffer).
The timestamp should be the seconds since the unix epoch: (January 1, 1970, 00:00:00 UTC)
- _poll_hardware(now: float) None[source]#
Allow subclasses to advance device state before telemetry is sampled.