Skip to content

Commit 7664828

Browse files
docs: auto-update API reference from source code
1 parent 87015be commit 7664828

2 files changed

Lines changed: 100 additions & 0 deletions

File tree

wiki/API-Reference:-Dashboard.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,47 @@ ALLPAGEWIDGETS Return concatenation of all pages' Widgets.
458458
Used for ReflowCallback injection and Follow toggle sweep.
459459
When Pages is empty, returns obj.Widgets.
460460

461+
#### `linked = collectLinkedCrosshairs_(obj, widgets)`
462+
463+
COLLECTLINKEDCROSSHAIRS_ Enumerate linked+rendered crosshairs on active page (260602-mri).
464+
linked = collectLinkedCrosshairs_(obj, widgets) flattens widgets via
465+
flattenWidgetsForPreview_ and returns a cell array of structs:
466+
{struct('widget', w, 'hc', hc), ...}
467+
for every flattened FastSenseWidget with CrosshairLinked=true AND a
468+
valid rendered HoverCrosshair_. Widgets failing any guard are silently
469+
skipped. PURE (no side effects) so it is unit-testable with a
470+
hand-built widget list.
471+
Made public (Access=public) so tests and DashboardLayout can call it.
472+
473+
#### `rewireCrosshairLinks_(obj)`
474+
475+
REWIRECEOSSHAIRLINKS_ Re-prime BroadcastFcn_ on active-page linked crosshairs (260602-mri).
476+
1. Clear BroadcastFcn_/BroadcastLeaveFcn_ on ALL active-page FastSense
477+
crosshairs (handles toggled-OFF widgets + previous-page crosshairs).
478+
2. For each currently-linked+rendered crosshair, install the engine
479+
broadcast callbacks. Must be called after rerenderWidgets (fresh
480+
HoverCrosshair_ handles), after switchPage, and after detachWidget.
481+
Wrapped in try/catch at call sites; inner per-handle errors are silently
482+
skipped so a single bad crosshair never breaks the whole sweep.
483+
484+
#### `broadcastCrosshairX_(obj, sourceHc, xQuery)`
485+
486+
BROADCASTCROSSHAIRX_ Mirror xQuery onto all OTHER linked crosshairs on active page (260602-mri).
487+
Fired at end of source crosshair's onMove (via BroadcastFcn_).
488+
Re-collects the linked set each call (cheap; active page only;
489+
upstream throttle limits call rate to ~40 Hz; N widgets small).
490+
491+
#### `broadcastCrosshairLeave_(obj, sourceHc)`
492+
493+
BROADCASTCROSSHAIRLEAVE_ Tell all OTHER linked crosshairs to hide (260602-mri).
494+
Fired at end of source crosshair's onLeave (via BroadcastLeaveFcn_).
495+
496+
#### `onCrosshairLinkToggle(obj, widget)`
497+
498+
ONCROSSHAIRLINKTOGGLE Called by DashboardLayout after widget.setCrosshairLink(tf) (260602-mri).
499+
Re-derives the whole active-page link set from current flags — idempotent.
500+
Wrapped in try/catch so a single toggle failure never crashes the bar.
501+
461502
#### `notifyEventsChanged(obj)`
462503

463504
NOTIFYEVENTSCHANGED Refresh all event-aware widgets after store mutation (260513-snt).
@@ -851,6 +892,24 @@ ONPLANTLOGTOGGLEPRESSED_ Toggle button callback — wraps setShowPlantLog with t
851892
software-level guard for Enable='off' because uicontrols only
852893
honor Enable natively for user-driven mouse clicks.
853894

895+
#### `addCrosshairLinkToggle(obj, widget)`
896+
897+
ADDCROSSHAIRLINKTOGGLE Inject crosshair-link 'X' button into WidgetButtonBar (260602-mri).
898+
Duck-typed: only called for widgets where ismethod(widget,'setCrosshairLink').
899+
Idempotent: removes any prior CrosshairLinkButton before creating the new one.
900+
Glyph: 'X' (ASCII, Octave-safe — matches existing V/A/L/i/^ glyphs).
901+
Position: leftmost chrome button, placed to the LEFT of the V/A cluster;
902+
final position settled by reflowChrome_ (reflowChrome_ is called from
903+
both realizeWidget and from this method for callback-driven rebuilds).
904+
Active (linked) state highlighted via chooseYLimitActiveBg_ (same as V/A).
905+
906+
#### `onCrosshairLinkTogglePressed_(obj, src, widget)`
907+
908+
ONCROSSHAIRLINKTOGLEPRESSED_ CrosshairLink toggle callback (260602-mri).
909+
Flips widget.CrosshairLinked, notifies the engine, and rebuilds the
910+
button visual. All errors are caught and surfaced as namespaced
911+
warnings so no toggle failure can crash the dashboard refresh loop.
912+
854913
### Static Methods
855914

856915
#### `DashboardLayout.reflowChrome_(hCell, barH, inset)`
@@ -1571,6 +1630,7 @@ obj = FastSenseWidget(varargin)
15711630
| ShowPlantLog | `false` | Phase 1032 PLOG-VIZ-03 — opt-in per-widget plant-log vertical-line overlay |
15721631
| LiveViewMode | `'preserve'` | |
15731632
| YLimitMode | `'auto-visible'` | |
1633+
| CrosshairLinked | `false` | |
15741634
| CurrentXLimOverrideForTest_ | `[]` | |
15751635

15761636
### Methods
@@ -1632,6 +1692,14 @@ SETYLIMITMODE Set the Y-axis rescale strategy and re-fit if rendered.
16321692
'auto-all' - rescale to all data the bound Tag exposes
16331693
'locked' - freeze YLim; no further rescale on tick/refresh
16341694

1695+
#### `setCrosshairLink(obj, tf)`
1696+
1697+
SETCROSSHAIRLINK Set the crosshair-link flag (260602-mri).
1698+
setCrosshairLink(obj, tf) sets CrosshairLinked to logical(tf).
1699+
tf must be a logical scalar or a numeric 0/1 scalar.
1700+
Does NOT touch graphics — the engine owns broadcast wiring.
1701+
Throws FastSenseWidget:invalidCrosshairLink for invalid input.
1702+
16351703
#### `autoScaleY_(obj, y)`
16361704

16371705
AUTOSCALEY_ Rescale the Y axis to cover current data + thresholds.

wiki/API-Reference:-FastPlot.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,33 @@ HOVERCROSSHAIR Construct hover crosshair attached to a FastSense.
11921192

11931193
### Methods
11941194

1195+
#### `setBroadcastFcn(obj, moveFn, leaveFn)`
1196+
1197+
SETBROADCASTFCN Set (or clear) crosshair-link broadcast callbacks (260602-mri).
1198+
setBroadcastFcn(obj, moveFn, leaveFn)
1199+
moveFn — @(x) callback, or [] to clear. Called at end of onMove.
1200+
leaveFn — @() callback, or []. Called at end of onLeave on source.
1201+
nargin < 3: leaveFn defaults to [].
1202+
1203+
#### `onMoveExternal(obj, xQuery)`
1204+
1205+
ONMOVEEXTERNAL Mirror an external crosshair data-x without re-broadcasting.
1206+
Called by DashboardEngine.broadcastCrosshairX_ to drive a peer
1207+
crosshair at xQuery. Sets IsMirrored_ so the peer's own
1208+
onFigureMove_->onLeave (fired in the same motion dispatch when
1209+
the cursor is not over this widget) is swallowed and the
1210+
mirrored crosshair stays visible. IsMirrored_ is cleared either
1211+
when this widget becomes the hover source (its own real onMove)
1212+
or by onLeaveExternal (the source's leave-broadcast).
1213+
1214+
#### `onLeaveExternal(obj)`
1215+
1216+
ONLEAVEEXTERNAL Clear mirror state and hide crosshair on command.
1217+
Called by DashboardEngine.broadcastCrosshairLeave_ when the
1218+
source crosshair's own onLeave fires (cursor left all linked axes).
1219+
Hides DIRECTLY (does NOT call onLeave) so it never re-broadcasts
1220+
leave — that would ping-pong between linked peers indefinitely.
1221+
11951222
#### `onMove(obj, xQuery)`
11961223

11971224
ONMOVE Update + show the crosshair at data x-coordinate xQuery.
@@ -1202,6 +1229,11 @@ ONMOVE Update + show the crosshair at data x-coordinate xQuery.
12021229

12031230
ONLEAVE Hide the crosshair line + datatip.
12041231

1232+
#### `hideGraphics_(obj)`
1233+
1234+
HIDEGRAPHICS_ Hide the crosshair line + datatip (no broadcast).
1235+
Shared by onLeave (source path) and onLeaveExternal (peer path).
1236+
12051237
---
12061238

12071239
## `NavigatorOverlay` --- Zoom rectangle, dimming, and drag interaction on navigator axes.

0 commit comments

Comments
 (0)