diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2026-09-19 17:38:07 -0600 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2026-09-19 17:38:07 -0600 |
| commit | f3327d56d48d63b21ffc03a55fa5e7db753d1707 (patch) | |
| tree | e19d4c7846dd4a434f8a18f82290597731b4a12c /ui/strip_chart.py | |
| parent | 00671a90bb51bfe485d98a928a456d55adbe1faf (diff) | |
Redesign Signal/Channel naming and fix pin-remap breaking references
Arduino analog Signal ids used to be the pin name itself, so fixing a
wrong pin silently changed the id and orphaned any plot trace, control,
or filter pipeline pointing at it. Analog Signal ids are now positional
(ai0, ai1, ...) and decoupled from the underlying pin, matching how
digital I/O already worked.
More broadly, formalizes a Device -> Signal -> Channel -> Plot naming
model (SignalConfig for physical device channels, Channel for derived/
computed ones) and adds core/reference_registry.py to propagate any
Signal or Channel id rename through plot traces, controls, and filter
pipelines instead of leaving them dangling. Signal ids are now editable
in the Signals tab with the same propagation.
.labui profile schema bumped to v2.0 with a transparent migration for
old files, including remapping old pin-name Signal ids to the new
positional ones. Removed six confirmed-dead files (two legacy device
classes, four superseded top-level ui/ duplicates).
Diffstat (limited to 'ui/strip_chart.py')
| -rw-r--r-- | ui/strip_chart.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/strip_chart.py b/ui/strip_chart.py index 6c644be..bdffb91 100644 --- a/ui/strip_chart.py +++ b/ui/strip_chart.py @@ -54,8 +54,8 @@ _STYLES = { def _windowed(times_dq, values_dq, seconds: float): """Last `seconds` of a (times, values) deque pair, walking in from the - newest sample only — same trick as ChannelBuffer.window(), needed here - for derived-channel buffers which aren't wrapped in ChannelBuffer.""" + newest sample only — same trick as SignalBuffer.window(), needed here + for derived-channel buffers which aren't wrapped in SignalBuffer.""" if not times_dq: return [], [] cutoff = times_dq[-1] - seconds @@ -210,7 +210,7 @@ class StripChartWidget(QWidget): return dc.unit return "" dev = self.registry.get_instance(device_id) - ch = dev.get_channel(channel_id) if dev else None + ch = dev.get_signal(channel_id) if dev else None return ch.unit if ch else "" @pyqtSlot(str, str, str) @@ -246,7 +246,7 @@ class StripChartWidget(QWidget): ts_l, vs_l = _windowed(bufs[0], bufs[1], window) if not ts_l: return else: - buf = self.engine.get_buffer(device_id, channel_id) + buf = self.engine.get_signal_buffer(device_id, channel_id) if buf is None or len(buf) < 2: return ts_l, vs_l = buf.window(window) if not ts_l: return @@ -273,7 +273,7 @@ class StripChartWidget(QWidget): mn = min(len(x_arr), len(y_arr)) e["curve"].setData(x_arr[-mn:], y_arr[-mn:]) else: - xbuf = self.engine.get_buffer(x_dev, x_ch) + xbuf = self.engine.get_signal_buffer(x_dev, x_ch) if xbuf and len(xbuf) >= 2: _, xvs = xbuf.all() x_arr = np.array(xvs, dtype=np.float64) |
