stoner_measurement.plugins.command.plot_markers.AddPlotMarkerCommand

class stoner_measurement.plugins.command.plot_markers.AddPlotMarkerCommand(parent=None)[source]

Bases: CommandPlugin

Add a labelled marker at runtime-evaluated plot coordinates.

The configuration page accepts Python expressions for x, y, and label. They are evaluated when the sequence reaches this command using the current sequence-engine namespace, so values calculated by earlier steps can be marked directly.

The label expression may produce any value; its string representation is displayed beside the marker. A configured label that is blank or contains only whitespace is passed to the plot as None, selecting the default coordinate label. Evaluated None and whitespace-only strings behave in the same way.

Markers have fixed data coordinates and follow zooming, panning, and axis scale changes. They remain until removed through the plot context menu, a Remove Plot Markers command, or a plot clear.

Variables:
  • x_expr (str) – Runtime expression producing the x coordinate.

  • y_expr (str) – Runtime expression producing the y coordinate.

  • label_expr (str) – Runtime expression producing the optional label.

  • add_plot_marker (pyqtSignal[float, float, object]) – Signal connected to add_data_marker().

  • instance_name (str) – Inherited Python identifier for this instance in the Script tab and QtConsole.

  • comment (str) – Inherited optional note displayed beside this step.

  • sequence_engine (SequenceEngine | None) – Inherited owning engine and its live namespace; None while detached.

Keyword Parameters:

parent (QObject | None) – Optional Qt parent object.

Examples

With an instance named add_plot_marker in the sequence, use the QtConsole to inspect or edit it before running. Substitute your instance name if different; result data reflects completed steps:

add_plot_marker.x_expr = "1.0"
add_plot_marker.y_expr = "2.0"
add_plot_marker.label_expr = "'Reference'"
add_plot_marker

Qt signal.

pyqtSignal(*types, name: str = ..., revision: 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.
config_widget(parent: QWidget | None = None) → QWidget[source]

Return editors for the runtime x, y, and label expressions.

execute() → None[source]

Evaluate the configured values and request a new plot marker.

property name: str

Return the user-visible plugin name.

property sequence_engine: SequenceEngine | None

Return the owning sequence engine, if attached.

to_json() → dict[str, Any][source]

Serialise the configured runtime expressions.