GUI API

Main Window Entry Points

class shmpipeline.gui.app.MainWindow(*args, **kwargs)[source]

Bases: QMainWindow

Main GUI window for configuration editing and pipeline control.

The window combines document editing, validation, runtime controls, synthetic-input management, and viewer launch actions for one pipeline document.

Parameters:

theme_name (str | None)

property current_theme_name: str

Return the currently active GUI theme name.

shmpipeline.gui.app.main()[source]

Launch the shmpipeline desktop GUI.

Return type:

int

class shmpipeline.gui.control.ControlWindow(*args, **kwargs)[source]

Bases: QMainWindow

Minimal window for server handling and pipeline state-machine control.

Parameters:

theme_name (str | None)

property current_theme_name: str

Return the active theme name.

shmpipeline.gui.control.main()[source]

Launch the minimal control GUI.

Return type:

int

GUI Document Model

GUI document and validation helpers.

shmpipeline.gui.model.available_kernel_kinds()[source]

Return all registered kernel kinds for UI selection widgets.

Return type:

tuple[str, …]

shmpipeline.gui.model.clone_document(document)[source]

Return a deep editable copy of one document.

Parameters:

document (Mapping[str, Any])

Return type:

dict[str, Any]

shmpipeline.gui.model.create_manager(document)[source]

Instantiate a pipeline manager from the current GUI document.

Parameters:

document (Mapping[str, Any])

Return type:

PipelineManager

shmpipeline.gui.model.default_document()[source]

Return an empty editable pipeline document.

Return type:

dict[str, Any]

shmpipeline.gui.model.document_to_yaml(document)[source]

Serialize one document to readable YAML.

Parameters:

document (Mapping[str, Any])

Return type:

str

shmpipeline.gui.model.load_document(path)[source]

Load a YAML config file into the editable document shape.

Parameters:

path (str | Path)

Return type:

dict[str, Any]

shmpipeline.gui.model.parse_inline_yaml(text, *, fallback)[source]

Parse a small YAML fragment used by editors and dialogs.

Parameters:
  • text (str)

  • fallback (Any)

Return type:

Any

shmpipeline.gui.model.recommended_spawn_method(config)[source]

Return the preferred worker start method for GUI-launched pipelines.

Parameters:

config (PipelineConfig)

Return type:

str

shmpipeline.gui.model.save_document(path, document)[source]

Write one editable document to disk.

Parameters:
  • path (str | Path)

  • document (Mapping[str, Any])

Return type:

None

shmpipeline.gui.model.to_numpy(value)[source]

Convert one shared-memory payload to a NumPy array for display.

Parameters:

value (Any)

Return type:

ndarray

shmpipeline.gui.model.validate_document(document)[source]

Return config and kernel-validation errors for one document.

Parameters:

document (Mapping[str, Any])

Return type:

list[str]

GUI Themes

GUI theme definitions for the Qt desktop app.

class shmpipeline.gui.themes.ThemeDefinition(name, window, base, alternate_base, text, muted_text, button, button_text, highlight, highlight_text, accent, border, plot_background, plot_foreground, success, error, success_bg, error_bg)[source]

Bases: object

Color tokens shared by the GUI and viewer widgets.

Parameters:
  • name (str)

  • window (str)

  • base (str)

  • alternate_base (str)

  • text (str)

  • muted_text (str)

  • button (str)

  • button_text (str)

  • highlight (str)

  • highlight_text (str)

  • accent (str)

  • border (str)

  • plot_background (str)

  • plot_foreground (str)

  • success (str)

  • error (str)

  • success_bg (str)

  • error_bg (str)

shmpipeline.gui.themes.resolve_theme(theme_name)[source]

Return one of the supported GUI themes.

Parameters:

theme_name (str | None)

Return type:

ThemeDefinition

shmpipeline.gui.themes.build_palette(theme)[source]

Build the Qt palette for one theme.

Parameters:

theme (ThemeDefinition)

Return type:

PySide6.QtGui.QPalette

shmpipeline.gui.themes.build_stylesheet(theme)[source]

Build the application stylesheet for one theme.

Parameters:

theme (ThemeDefinition)

Return type:

str

shmpipeline.gui.themes.apply_application_theme(app, theme_name)[source]

Apply a theme to Qt and pyqtgraph surfaces.

Parameters:

theme_name (str | None)

Return type:

ThemeDefinition

Remote GUI Support

Remote GUI helpers for talking to the pipeline control plane.

shmpipeline.gui.remote.normalize_server_url(value)[source]

Return a normalized HTTP base URL for one control server.

Parameters:

value (str)

Return type:

str

shmpipeline.gui.remote.is_local_server_url(base_url)[source]

Return whether one control-server URL points at the local host.

Parameters:

base_url (str)

Return type:

bool

class shmpipeline.gui.remote.ServerConnection(base_url, token=None)[source]

Bases: object

Connection details for one remote control server.

Parameters:
  • base_url (str)

  • token (str | None)

class shmpipeline.gui.remote.RemotePipelineSession(connection, *, timeout=5.0, client=None)[source]

Bases: object

Manager-like remote session used by the GUI windows.

Parameters:

Viewer Support

Live shared-memory viewers used by the desktop GUI.

shmpipeline.gui.viewers.run_viewer_process(spec, theme_name)[source]

Launch one viewer window in its own Python process.

Parameters:
  • spec (dict[str, Any])

  • theme_name (str | None)

Return type:

int

shmpipeline.gui.viewers.launch_viewer_process(spec, theme_name)[source]

Start a detached viewer process for one shared-memory stream.

Parameters:
  • spec (dict[str, Any])

  • theme_name (str | None)

Return type:

Process

class shmpipeline.gui.viewers.SharedMemoryViewer(*args, **kwargs)[source]

Bases: QMainWindow

Live viewer for one shared-memory stream.

The implementation avoids pyqtgraph.ImageView because its default histogram/color-menu path pulls in optional matplotlib integration and can trip over unrelated import machinery in GPU-heavy environments.

GPU streams prefer their CPU mirror when available. Otherwise the viewer attaches to the GPU handle directly and takes safe cloned reads.

Parameters:

spec (dict[str, Any])

apply_theme(theme)[source]

Apply a GUI theme to plot and image surfaces.

Parameters:

theme (ThemeDefinition)

Return type:

None

refresh()[source]

Read the latest payload and refresh the active view.

Return type:

None