stoner_measurement.instruments.simulated.SimulatedMotorController

class stoner_measurement.instruments.simulated.SimulatedMotorController(transport=None, protocol=None)[source]

Bases: MotorController

Simple simulated motor controller.

get_position() → float[source]

Return current angular position in degrees.

get_target_position() → float | None[source]

Return the current target angle in degrees, if known.

has_reached_target_position(tolerance: float = 0.01) → bool[source]

Return True when current and target positions are within tolerance.

identify() → str[source]

Return the instrument identification string (*IDN?).

Sends the standard IEEE 488.2 *IDN? query and returns the response. Instruments that do not support *IDN? should override this method.

Returns:

Identification string returned by the instrument.

Return type:

(str)

Raises:

ConnectionError – If the transport is not open.

Examples

>>> from stoner_measurement.instruments.transport import NullTransport
>>> from stoner_measurement.instruments.protocol import ScpiProtocol
>>> from stoner_measurement.instruments.base_instrument import BaseInstrument
>>> t = NullTransport(responses=[b"ACME,Model1,SN001,v1.0\n"])
>>> instr = BaseInstrument(t, ScpiProtocol())
>>> instr.connect()
>>> instr.identify()
'ACME,Model1,SN001,v1.0'
>>> instr.disconnect()
is_moving() → bool[source]

Return True when the motor is moving.

move_home(direction: MotorMoveDirection = MotorMoveDirection.CLOCKWISE) → None[source]

Move to the configured home position.

move_relative(angle: float, direction: MotorMoveDirection = MotorMoveDirection.CLOCKWISE) → None[source]

Move by angle degrees in direction using the absolute move API.

move_to_angle(angle: float, direction: MotorMoveDirection = MotorMoveDirection.CLOCKWISE) → None[source]

Move to an absolute angle in degrees.

set_acceleration(acceleration: float) → None[source]

Set travel acceleration in degrees per second squared.

set_home(angle: float = 0.0) → None[source]

Set the current position reference to a home angle.

set_velocity(velocity: float) → None[source]

Set travel velocity in degrees per second.

property status: MotorStatus

Return a consolidated motor status snapshot.