From aaa81c6efe40c4a807dc26c731f94168720ec55a Mon Sep 17 00:00:00 2001 From: Chadwick Boulay Date: Wed, 14 Oct 2026 02:49:41 -0400 Subject: [PATCH] Label the sweep's amplitude range with the stream's unit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit phosphor's controls bar now shows the amplitude range as an editable "± value" field, but cannot know the unit -- that is a property of the signal, which arrives on the shmem metadata. ShmemSweepWidget passes shape.unit through when it builds the controls and when the stream changes in place. Requires phosphor>=0.11.0 for set_amplitude_unit. Co-authored-by: Claude Opus 5.5 --- pyproject.toml | 4 ++-- src/ezmsg/tools/plot/shmem_sweep.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1060f2b..0956ff5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,14 +57,14 @@ sigmon = [ "pygraphviz>=1.14", "typer>=0.15.1", "ezmsg-qt>=0.2.1", - "phosphor>=0.9.1", + "phosphor>=0.11.0", "pandas", ] viewer = [ "PySide6>=6.7", "typer>=0.15.1", "ezmsg-qt>=0.2.1", - "phosphor>=0.9.1", + "phosphor>=0.11.0", ] [project.scripts] diff --git a/src/ezmsg/tools/plot/shmem_sweep.py b/src/ezmsg/tools/plot/shmem_sweep.py index c4b2645..943ecb7 100644 --- a/src/ezmsg/tools/plot/shmem_sweep.py +++ b/src/ezmsg/tools/plot/shmem_sweep.py @@ -249,6 +249,8 @@ def _apply_shape(self, shape: StreamShape) -> None: else: self._sweep.update_config(self._config_for(shape)) self._sweep.set_channel_labels(self._labels_for(shape)) + if self._controls is not None: + self._controls.set_amplitude_unit(shape.unit) def _labels_for(self, shape: StreamShape) -> list[str]: labels = shape.channel_labels @@ -306,5 +308,6 @@ def _build(self, shape: StreamShape) -> None: self._sweep.set_channel_labels_visible(True) if self._show_controls: self._controls = ChannelPlotControlsWidget(self._sweep, parent=self) + self._controls.set_amplitude_unit(shape.unit) self._layout.addWidget(self._controls) self.on_plot_built()