Skip to content

feat(toolbox_filter_editor): Filter Editor toolbox plugin#149

Open
pabloinigoblasco wants to merge 1 commit into
mainfrom
gh/filter-registry-service
Open

feat(toolbox_filter_editor): Filter Editor toolbox plugin#149
pabloinigoblasco wants to merge 1 commit into
mainfrom
gh/filter-registry-service

Conversation

@pabloinigoblasco

@pabloinigoblasco pabloinigoblasco commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Port of PlotJuggler 3's "Apply filter to data" tool to PJ4 as a toolbox panel. Pick a source curve in the dialog, choose a transform, configure its parameters, see the result live in the preview chart, give the output a custom alias, and Save to install it on the plot — or Generate to materialise the filtered series as a new persistent topic.

Available transforms

  • None / Absolute / Scale-and-Offset / Derivative / Integral
  • Moving Average, Moving RMS, Moving Variance/Stdev (configurable window; Moving Average has an optional time-centering toggle)
  • Outlier Removal (configurable factor; the 1-sample look-ahead delay matches PJ3 semantics)
  • Samples Counter (samples in the last N ms)
  • Binary Filter (=, <, , >, , range)
  • Time Since Previous Sample

Dialog features

  • Source list with per-curve colour swatches sourced from the active plot.
  • Multi-selection: apply the same transform to several source curves at once; each output curve gets the appropriate [name][TransformName] legend.
  • Parameter panel that switches with the chosen transform; defaults recreate the pre-transform identity.
  • Alias field — defaults to source[TransformName], user can override.
  • Preview chart of before/after (capped at 2k samples).
  • Autozoom toggle.
  • Process-global "filter clipboard": copy a recipe in one panel, paste it into another.
  • Save / Cancel / Reset / Generate buttons. Generate writes the filtered series as a persistent topic via the toolbox write host.

Wiring

The plugin registers its 12 builtin classes into the host's filter registry at loaderInit (via the SDK pj.filter_registry.v1 service), so the host's streaming read path resolves the same instances as the dialog's preview.

Stack

  • plotjuggler_sdk PR — Filter Editor SDK contract + registry service.

Test plan

  • Plugin shared library compiles.
  • builtin_transforms_test: 1/1 pass.
  • Open the dialog, configure each transform, verify preview matches a hand-computed sample.
  • Multi-select two curves, apply a Moving Average, verify both legends gain [Moving Average].
  • Save → close panel → reopen on the same curve → dialog reflects the saved state.
  • Generate → verify a new topic appears under the catalog and the curve can be dragged onto a plot.

@pabloinigoblasco pabloinigoblasco changed the title refactor(toolbox_filter_editor): consume the host-owned FilterTransformFactory refactor(toolbox_filter_editor): consume host-owned filter registry Jun 12, 2026
@pabloinigoblasco pabloinigoblasco force-pushed the gh/filter-registry-service branch from 93e1dac to 8c83120 Compare June 12, 2026 14:13
@pabloinigoblasco pabloinigoblasco changed the title refactor(toolbox_filter_editor): consume host-owned filter registry feat(toolbox_filter_editor): Filter Editor toolbox plugin Jun 12, 2026
@pabloinigoblasco pabloinigoblasco force-pushed the gh/filter-registry-service branch from 8c83120 to 3ff8888 Compare June 12, 2026 14:25
@pabloinigoblasco pabloinigoblasco force-pushed the gh/filter-registry-service branch 2 times, most recently from 8e1b223 to 3e06189 Compare June 13, 2026 18:41
Per-curve filter editor with live preview, Save (volatile read-path
transform), Generate (writes a persistent derived time series), and a
streaming-aware Generate continuation that keeps the derived series
appending sample-by-sample as the source advances under a sliding
retention window.

Highlights:
- Pulls the 12 built-in FilterTransform classes from the SDK via the
  pj.filter_registry.v1 service; the toolbox registers them through the
  ServiceRegistryBuilder so the host's read path uses the SAME factory
  instance (one source of truth for builtins).
- Generate streaming continuation: per-source stateful FilterTransform
  clone cached in GenerateState, fed only the NEW tail each tick via
  appendTail — keeps MovingAverage's internal buffer warm and avoids
  edge-effect artifacts when the source slides through retention.
- Save accepts the "none" transform too: lets the user explicitly commit
  a reset-to-original via Save (the host's on_data_changed sees inc_fn
  null for "none" and falls through to clearCurveTransform). Generate
  keeps the stricter isValid().
@pabloinigoblasco pabloinigoblasco force-pushed the gh/filter-registry-service branch from 3e06189 to ba6c922 Compare June 13, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant