stoner_measurement.plugins.command.set_engine_state.SetEngineStateCommand

class stoner_measurement.plugins.command.set_engine_state.SetEngineStateCommand(parent=None)[source]

Bases: CommandPlugin

Set, optionally await, and snapshot a controller target.

Controller errors, disconnects and shutdown abort the command rather than consuming its settling timeout. Successful outputs from a previous run are cleared before a new action starts.

config_widget(parent: QWidget | None = None) → QWidget[source]

Build the common expression controls plus engine-specific settings.

declared_outputs() → PluginOutputs[source]

Declare configured outputs and their physical units together.

execute() → None[source]

Set the evaluated target, optionally wait for it, and capture final state.

abstract property output_names: tuple[str, ...]

Names of scalar values captured from the final engine snapshot.

output_value(name: str) → float[source]

Return one value from the state snapshot captured by execute().

poll_interval = 0.5
setpoint_expr: str
setpoint_suffix = ''
timed_out: bool
to_json() → dict[str, Any][source]

Serialise this plugin’s configuration to a JSON-compatible dict.

The returned dict contains at minimum:

  • "type" — the plugin sub-type tag (e.g. "trace", "state").

  • "class" — the fully qualified class path "module:ClassName" used by from_json() to reconstruct the exact subclass.

  • "instance_name" — the current instance_name.

Subclasses should call super().to_json() and then add their own configuration keys to the returned dict.

Returns:

A JSON-serialisable dictionary representing this plugin’s current configuration.

Return type:

(dict[str, Any])

Examples

>>> from qtpy.QtWidgets import QApplication
>>> _ = QApplication.instance() or QApplication([])
>>> from stoner_measurement.plugins.trace import DummyPlugin
>>> plugin = DummyPlugin()
>>> d = plugin.to_json()
>>> d["type"]
'trace'
>>> d["instance_name"]
'dummy'
>>> "class" in d
True
wait_expr: str
property wait_timeout_seconds: float | None

Maximum wait time in seconds, or None to wait indefinitely.