plesty.lib.ui.monitor_panel =========================== .. py:module:: plesty.lib.ui.monitor_panel .. autoapi-nested-parse:: The panel that shows a live view: the bridge from monitors to the shell. :class:`MonitorPanel` is the one place where the two halves meet — a :class:`~plesty.lib.monitor.Monitor` (what to draw) and a :class:`~plesty.lib.ui.Shell` sub-window (where to draw it). Building the panel attaches a renderer to the monitor, and the shell's clock drives :meth:`~plesty.lib.monitor.Monitor.pump`, so nothing else in the application has to poll. .. code-block:: python from plesty.lib.monitor import RunSource from plesty.lib.ui import MonitorPanel, run source = RunSource(run_dir, mapper=to_channels) run([MonitorPanel(SpectrumMonitor(source), area="top")], title="QD-FSS") Classes ------- .. autoapisummary:: plesty.lib.ui.monitor_panel.MonitorPanel Module Contents --------------- .. py:class:: MonitorPanel(monitor: plesty.lib.monitor.base_monitor.Monitor, *, theme: Optional[plesty.lib.ui.theme.Theme] = None, **kwargs: Any) Bases: :py:obj:`plesty.lib.ui.panel.Panel` Sub-window rendering one monitor. The panel is toolkit-free until it is built: constructing and describing it needs no GUI, which is what lets a headless test cover a shell's composition. Wrap *monitor* into a dockable panel. :param monitor: The live view to render; its name and title become the panel's unless overridden. :param theme: Palette for the plot; ``None`` loads the packaged theme. :param \*\*kwargs: Forwarded to :class:`~plesty.lib.ui.panel.Panel` (``name``, ``title``, ``area``, ``floating``, ``closable``, ``min_width``, ``min_height``). .. py:attribute:: kind :type: ClassVar[str] :value: 'monitor' Panel category, used for layout keys and styling hooks. .. py:attribute:: monitor .. py:attribute:: theme :value: None .. py:attribute:: renderer :type: Any :value: None .. py:method:: build(parent: Any = None) -> Any Create the plot widget and attach it to the monitor. :param parent: The parent widget provided by the shell. :returns: The plot widget. .. py:method:: tick() -> None Drain the monitor's source; every new frame redraws immediately. .. py:method:: status() -> str Return the monitor's status line. :returns: The text the monitor wants shown in the title bar. .. py:method:: close() -> None Detach the renderer and close the monitor's source. .. py:method:: describe() -> dict[str, Any] Return the panel description including the monitor it shows. :returns: The panel's placement plus :meth:`~plesty.lib.monitor.Monitor.describe`.