stoner_measurement.plugins.command.set_engine_state.SetEngineStateCommand¶
- class stoner_measurement.plugins.command.set_engine_state.SetEngineStateCommand(parent=None)[source]¶
Bases:
CommandPluginSet, 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.
- 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_suffix = ''¶
- 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 byfrom_json()to reconstruct the exact subclass."instance_name"— the currentinstance_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:
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