pyaml.common.abstract#
Abstract read/write interfaces for scalar and array values.
The interfaces define the small protocol used by PyAML runtime elements to read values, write setpoints, report units, and map scalar channels onto array-backed data.
Classes
|
Expose one array element through a scalar read/write interface. |
Define read-only access to an array of floating-point values. |
|
Define read-only access to one floating-point value. |
|
Define read/write access to an array of floating-point values. |
|
Define read/write access to one floating-point value. |
- class pyaml.common.abstract.RWMapper(bind, idx)#
Bases:
ReadWriteFloatScalarExpose one array element through a scalar read/write interface.
- Parameters:
bind (ReadWriteFloatArray) – Array interface containing the mapped value.
idx (int) – Zero-based index of the mapped element.
Methods
Get the value at the mapped index.
Set the value at the mapped index.
Set the value and wait for it to reach the setpoint.
Get the unit for the value.
Get the mapped array index.
- get()#
Get the value at the mapped index.
- Returns:
float – Value at the mapped array index
- Return type:
float
- index()#
Get the mapped array index.
- Returns:
int – The index in the array that this scalar maps to
- Return type:
int
- set(value)#
Set the value at the mapped index.
- Parameters:
value (float) – Value to set
- set_and_wait(value)#
Set the value and wait for it to reach the setpoint.
- Parameters:
value (float) – Target value to set and wait for
- Raises:
NotImplementedError – This method is not yet implemented
- unit()#
Get the unit for the value.
- Returns:
str – Unit string for the value at the mapped index
- Return type:
str
- class pyaml.common.abstract.ReadFloatArray#
Bases:
objectDefine read-only access to an array of floating-point values.
Methods
Return the current values as an array.
Return the units associated with the array values.
- abstractmethod get()#
Return the current values as an array.
- abstractmethod unit()#
Return the units associated with the array values.
- class pyaml.common.abstract.ReadFloatScalar#
Bases:
objectDefine read-only access to one floating-point value.
Methods
- abstractmethod get()#
Return the current scalar value.
- Returns:
float – Current value.
- Return type:
float64
- abstractmethod unit()#
Return the physical unit of the scalar value.
- Returns:
str – Unit label.
- Return type:
str
- class pyaml.common.abstract.ReadWriteFloatArray#
Bases:
ReadFloatScalarDefine read/write access to an array of floating-point values.
Methods
Write array values in the interface’s defined order.
Write array values and wait for readback confirmation.
- abstractmethod set(value)#
Write array values in the interface’s defined order.
- Parameters:
value (numpy.ndarray) – Values to write.
- abstractmethod set_and_wait(value)#
Write array values and wait for readback confirmation.
- Parameters:
value (numpy.ndarray) – Target values.
- class pyaml.common.abstract.ReadWriteFloatScalar#
Bases:
ReadFloatScalarDefine read/write access to one floating-point value.
Methods
Write a scalar setpoint.
Write a setpoint and wait for readback confirmation.
- abstractmethod set(value)#
Write a scalar setpoint.
- Parameters:
value (float) – Value to write.
- abstractmethod set_and_wait(value)#
Write a setpoint and wait for readback confirmation.
- Parameters:
value (float) – Target value.