Motor
- class lys_instr.MultiController.MultiControllerInterface(*axisNamesAll, **kwargs)[source]
Bases:
HardwareInterface
Abstract interface for multi-axis motor controllers.
This class provides background polling, state management, and Qt signals for axis value and state updates. Subclasses must implement device-specific methods:
_get()
,_set()
,_isBusy()
, and_isAlive()
._get()
,_set()
, and_isBusy()
should raise RuntimeError if the device is not responding or if there is a communication error._isAlive()
should always return the current alive state and should not raiseRuntimeError
that causes interruption.- Parameters:
*axisNamesAll – Names of all axes to manage.
**kwargs – Additional keyword arguments passed to QThread.
- aliveStateChanged
Signal (dict) emitted when alive state changes.
- busyStateChanged
Signal (dict) emitted when busy state changes.
- get(type=<class 'dict'>)[source]
Gets the current values of all axes in the specified data type.
- Parameters:
type (type, optional) – Output type (dict, list, or np.ndarray). Defaults to dict.
- Returns:
Axis values in the requested format.
- Return type:
dict or list or np.ndarray
- Raises:
TypeError – If an unsupported output type is requested.
- property isAlive
Returns the current alive state of all axes.
- Returns:
Mapping of axis names to their alive state.
- Return type:
dict[str, bool]
- property isBusy
Returns the current busy state of all axes.
- Returns:
Mapping of axis names to their busy state.
- Return type:
dict[str, bool]
- Raises:
RuntimeError – If the device is not responding or a communication error occurs.
- property nameList
Returns the list of axis names.
- Returns:
List of axis names.
- Return type:
list of str
- set(wait=False, lock=True, **kwargs)[source]
Sets target values for one or more axes.
For each axis specified in
kwargs
, sets its target value. For example, to set x to 1.0 and y to 2.0, call:set(x=1.0, y=2.0)
. Optionally waits until all axes become idle after setting.- Parameters:
wait (bool, optional) – If True, block until all axes become idle after setting. Defaults to False.
**kwargs – Axis-value pairs to set, e.g., x=1.0, y=2.0.
- Raises:
ValueError – If any provided axis name is invalid.
- settingsWidget()[source]
Returns a generic settings dialog.
This method is intended to be overridden in subclasses to provide a device-specific settings UI.
- Returns:
The settings dialog.
- Return type:
QDialog
- Raises:
NotImplementedError – If the subclass does not implement this method.
- stop()[source]
Stops all axes.
Calls the instance-specific
_stop()
method to perform the actual stopping logic.
- property target
Returns the current target values of all axes.
- Returns:
Mapping of axis names to their target positions.
- Return type:
dict[str, float]
- valueChanged
Signal (dict) emitted when axis values change.
- class lys_instr.MultiController.MultiSwitchInterface(labelNames, *axisNamesAll, **kwargs)[source]
Bases:
MultiControllerInterface
- property labelNames
- class lys_instr.MultiController.OffsettableMultiMotorInterface(*axesNames, autoSave=True, **kwargs)[source]
Bases:
MultiControllerInterface
Add offset functionality for MultiMotor.
- get(type=<class 'dict'>)[source]
Gets the current values of all axes in the specified data type.
- Parameters:
type (type, optional) – Output type (dict, list, or np.ndarray). Defaults to dict.
- Returns:
Axis values in the requested format.
- Return type:
dict or list or np.ndarray
- Raises:
TypeError – If an unsupported output type is requested.
- property offset
Dictionary of offset for respective axes.
- offsetChanged
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class offsetDict(axesNames, parent)[source]
Bases:
dict
- valueChanged
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- set(**kwargs)[source]
Sets target values for one or more axes.
For each axis specified in
kwargs
, sets its target value. For example, to set x to 1.0 and y to 2.0, call:set(x=1.0, y=2.0)
. Optionally waits until all axes become idle after setting.- Parameters:
wait (bool, optional) – If True, block until all axes become idle after setting. Defaults to False.
**kwargs – Axis-value pairs to set, e.g., x=1.0, y=2.0.
- Raises:
ValueError – If any provided axis name is invalid.
- class lys_instr.gui.MultiMotor.MultiMotorGUI(obj, axisNamesSettable=None, axisNamesJoggable=None, axisNamesOffsettable=None, memory=None, memoryPath=None)[source]
Bases:
QWidget
GUI widget for controlling and monitoring a multi-axis motor.
Provides controls for moving, jogging, offsetting, and saving/loading positions for multiple axes.
- property controllers