You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -128,6 +140,28 @@ Optional C MEX functions with SIMD intrinsics (AVX2 on x86_64, NEON on arm64):
128
140
129
141
All share a common `simd_utils.h` abstraction layer. If MEX is unavailable, pure-MATLAB implementations are used with identical behavior.
130
142
143
+
## Data Flow Architecture
144
+
145
+
### Core Data Path
146
+
```
147
+
Raw Data (X, Y arrays)
148
+
↓
149
+
FastSenseDataStore (optional, for large datasets)
150
+
↓
151
+
Downsampling Engine (MinMax/LTTB)
152
+
↓
153
+
Pyramid Cache (lazy multi-resolution)
154
+
↓
155
+
Graphics Objects (line handles)
156
+
↓
157
+
Interactive Display
158
+
```
159
+
160
+
### Storage Modes
161
+
-**Memory mode**: X/Y arrays held in MATLAB workspace
162
+
-**Disk mode**: Data chunked into SQLite database via `FastSenseDataStore`
163
+
-**Auto mode**: Switches to disk when data exceeds `MemoryLimit` (default 500MB)
164
+
131
165
## Sensor Threshold Resolution
132
166
133
167
The `Sensor.resolve()` algorithm is segment-based:
@@ -139,7 +173,7 @@ The `Sensor.resolve()` algorithm is segment-based:
139
173
3. Assign threshold values per segment
140
174
4. Detect violations using SIMD-accelerated comparison
141
175
142
-
Complexity: O(S x R) where S = state segments and R = rules, instead of O(N x R) per-point evaluation.
176
+
Complexity: O(S × R) where S = state segments and R = rules, instead of O(N × R) per-point evaluation.
143
177
144
178
## Disk-Backed Data Storage
145
179
@@ -221,6 +255,44 @@ Clicking "Edit" in the toolbar creates a `DashboardBuilder` instance:
221
255
-**Load:** JSON is decoded, widgets array is normalized to cell, and `configToWidgets()` dispatches to each widget class's `fromStruct()` static method. An optional `SensorResolver` function handle re-binds Sensor objects by name.
222
256
-**Export script:** generates a `.m` file with `DashboardEngine` constructor calls and `addWidget` calls for each widget.
223
257
258
+
## Event Detection Architecture
259
+
260
+
The event detection system provides real-time threshold violation monitoring with configurable notifications and data persistence.
261
+
262
+
### Core Components
263
+
264
+
```
265
+
LiveEventPipeline
266
+
├── DataSourceMap — Maps sensor keys to data sources
267
+
├── IncrementalEventDetector — Tracks per-sensor state and open events
1.`LiveEventPipeline.runCycle()` polls all data sources
282
+
2. New data is passed to `IncrementalEventDetector.process()`
283
+
3. Sensor state is evaluated via `Sensor.resolve()`
284
+
4. Violations are grouped into events with debouncing (`MinDuration`)
285
+
5. Events are stored via `EventStore.append()` (atomic .mat writes)
286
+
6.`NotificationService` sends rule-based email alerts with plot snapshots
287
+
7. Active `EventViewer` instances auto-refresh to show new events
288
+
289
+
### Escalation Logic
290
+
291
+
When `EscalateSeverity` is enabled, events are promoted to the highest violated threshold:
292
+
- A violation starts at "Warning" level
293
+
- If "Alarm" threshold is also crossed, the event is escalated to "Alarm"
294
+
- The event retains the highest severity level encountered
295
+
224
296
## WebBridge Architecture
225
297
226
298
The `WebBridge` class provides a TCP server that bridges MATLAB dashboards to web-based visualization. It uses NDJSON (newline-delimited JSON) for message framing over TCP.
@@ -231,14 +303,14 @@ All messages are JSON objects terminated by a newline character. The protocol is
231
303
232
304
| Message Type | Direction | Description |
233
305
|-------------|-----------|-------------|
234
-
|`init`| MATLAB -> Bridge | Initial handshake with signal list, dashboard config, and registered actions |
235
-
|`data_changed`| MATLAB -> Bridge | Notify that signal data has been updated |
236
-
|`config_changed`| MATLAB -> Bridge | Dashboard layout/theme has changed |
237
-
|`actions_changed`| MATLAB -> Bridge | Available custom actions have changed |
- Single-line ASCII/Unicode bars with backspace-based updates
347
+
- Indentation support for nested operations (e.g., dock → tabs → tiles)
348
+
- Freeze/finish modes for permanent status lines
349
+
350
+
### Toolbars and Navigation
351
+
-**FastSenseToolbar**: Data cursor, crosshair, grid toggle, autoscale, export, live mode
352
+
-**DashboardToolbar**: Live toggle, edit mode, save/export, name editing
353
+
-**NavigatorOverlay**: Minimap with draggable zoom rectangle for `SensorDetailPlot`
354
+
355
+
### Link Groups
356
+
Multiple FastSense instances can share synchronized zoom/pan via `LinkGroup` strings. When one plot's XLim changes, all plots in the same group update automatically.
0 commit comments