Skip to content

FastSenseWidget: forward addBand/addMarker/addShaded/addFill annotations to the dashboard chart #216

Description

@HanSur94

Problem / motivation

A standalone FastSense plot supports rich static annotations — value bands, point markers, shaded regions between two curves, and area fills — via four public methods:

  • FastSense.addBand(yLow, yHigh, ...) (libs/FastSense/FastSense.m:685)
  • FastSense.addMarker(x, y, ...) (libs/FastSense/FastSense.m:742)
  • FastSense.addShaded(x, y1, y2, ...) (libs/FastSense/FastSense.m:831)
  • FastSense.addFill(x, y, ...) (libs/FastSense/FastSense.m:918)

The same plot embedded as a FastSenseWidget in a dashboard exposes none of them. FastSenseWidget's public config surface (libs/Dashboard/FastSenseWidget.m:10-24) is limited to Thresholds, ShowEventMarkers, ShowThresholdLabels, ShowPlantLog, and axis labels/limits — there is no addBand/addMarker/addShaded/addFill passthrough (verified: grep -niE "addBand|addMarker|addShaded|addFill|Annotation" libs/Dashboard/FastSenseWidget.m returns nothing).

So a sensor-analysis engineer cannot, on a dashboard chart:

  • shade an anomaly time-window (addShaded),
  • mark a calibration/maintenance event point (addMarker),
  • draw a reference value band (e.g. nominal operating envelope, via addBand),
  • fill the area under a curve.

Today the only way to get these on the chart is to drop out of the dashboard into a standalone plot — defeating the purpose of building the dashboard. This is a clean feature asymmetry: the capability exists one layer down but isn't surfaced through the widget.

Proposed feature

Add optional annotation passthrough properties to FastSenseWidget that forward to the inner FastSense instance at render time — exactly mirroring how Thresholds is already applied via applyThresholds_(fp, obj.Thresholds) just before fp.render().

Rough sketch

Lib/class: libs/Dashboard/FastSenseWidget.m only.

Public-API shape — new optional properties, each a (possibly empty) cell array of argument-lists forwarded verbatim to the matching FastSense method:

w = FastSenseWidget('Tag', tag, ...
    'Bands',  {{lo, hi, 'FaceColor', [.9 .9 .6]}}, ...   % -> fp.addBand(lo, hi, ...)
    'Markers',{{tCal, yCal, 'Label', 'calibration'}}, ... % -> fp.addMarker(...)
    'Shaded', {{xWin, y1, y2, 'FaceAlpha', 0.15}});       % -> fp.addShaded(...)

Render wiring (in render, right before fp.render() at FastSenseWidget.m:388, alongside applyThresholds_):

for k = 1:numel(obj.Bands),   fp.addBand(obj.Bands{k}{:});   end
for k = 1:numel(obj.Markers), fp.addMarker(obj.Markers{k}{:}); end
for k = 1:numel(obj.Shaded),  fp.addShaded(obj.Shaded{k}{:});  end
for k = 1:numel(obj.Fills),   fp.addFill(obj.Fills{k}{:});     end

(The detached-mirror render path at FastSenseWidget.m:1842 gets the same loop so pop-out windows match.)

Serialization: add the four fields to toStruct (:1497) / fromStruct (:1940), defaulting to {} when absent so older serialized dashboards load unchanged.

Value

High for the core sensor-analysis workflow. Annotating where the interesting thing happened — the anomaly window, the calibration point, the reference envelope — is a primary reason to build an informative dashboard rather than a bare line. The data and the drawing primitives already exist; only the passthrough is missing.

Constraints check

  • Toolbox-free: ✅ forwards to existing FastSense methods, which use base MATLAB/handle graphics only.
  • Backward-compatible: ✅ purely additive properties defaulting to empty {} (no-op); toStruct/fromStruct add optional fields, so existing scripts and serialized dashboards keep working byte-for-byte.
  • Pure MATLAB / Octave: ✅ no new dependencies.
  • Widget contract: ✅ works entirely through the existing DashboardWidget render/toStruct/fromStruct contract — no base-class change.

Effort estimate

S–M — four properties + a forwarding loop in the two render paths + the toStruct/fromStruct round-trip and a serialization test. Single file (FastSenseWidget.m).


AI-proposed via /feature-scout — needs a human product decision before implementation.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions