Expand description
The engine: the Qt sensorviz’s MainWindow behaviour, with no UI.
spawn starts the engine and returns an Engine handle. The UI talks
to it only through Engine::command and Engine::query, and hears
from it only through the Event sink: the whole view state after every
change, and log lines.
§Threading
One thread, the engine thread, owns all state in one Viewer: the
open log’s Session, the per-tag Preferences, the status line and
the outstanding message. Commands and queries are applied on it in the
order they arrive. Session is Send and not Sync, which this keeps.
§Commands
| Command | Arguments | Does |
|---|---|---|
ready | Opens EngineConfig::initial_log and loads EngineConfig::initial_preferences, if set | |
open | path | File > Load: remembers the open log’s display choices, then opens the log and applies its tag’s preferences |
set_visible_streams | ids | View > Visible Streams |
set_stream_range | id, lower, upper | View > Ranges: the range and the ranges linked to it |
reset_zoom | View > Reset Zoom: clears the custom ranges | |
set_break_at_gaps | on | View > Break Lines at Gaps |
set_cursors_visible | on | View > Show Cursors |
set_utc_offset | hours | Configuration > UTC Offset |
set_parameter | id, value | A transform parameter (Sea-level Pressure, Declination, Battery Forward) |
set_title, set_title_visible | text, on | The graph title |
set_colors, set_axis_sides | colors / sides: id to #rrggbb / left/right | Stream Colors, Axis Sides |
load_preferences, store_preferences | path | File > Preferences > Load, Store |
load_default_preferences | File > Preferences > Load Defaults | |
save_file | path, base64 | Writes bytes the page made (File > Export PDF) |
§Queries
| Query | Arguments | Answer |
|---|---|---|
envelope | t0, t1, width | {traces: {id: {t, v}}, ms}: each drawn trace’s M4 envelope at width columns; a gap marker’s value is null |
hover | t | {time, rows: [{text}]}: the hover readout |
range | id | {lower, upper}: where the range dialog starts |
compass | t | The compass panel at t, from the sample at or after it: {time, heading, pitch, roll, dip, field, gravity, declination, batteryForward}, angles as the Qt panel shows them; null without a compass |
about | {title, version, userGuide, previewDialog} |
Structs§
- Engine
- The UI’s side of the engine: a cheap, cloneable sender of messages.
- Engine
Config - Where the engine starts, and what it tells Help.
- Message 🔒
- A message for the page to show once: a failed load, a refused file.
- UiLogger
- A
loglogger that forwards records to the sink asEvent::Log. Install it once, beforespawn. - Viewer
- Everything the engine thread owns.
Enums§
- Event
- What the engine tells the UI, through the sink given to
spawn. - Msg 🔒
- Messages to the engine thread, applied in the order they arrive.
Statics§
- LOGGER
- The logger to install with
log::set_logger. - LOG_
LEVEL 🔒 - The level passed on, as
log::Level as u8(1 ERROR .. 5 TRACE). - SINK 🔒
- The sink
UiLoggerforwards to, set byspawn.
Functions§
- arg_
bool 🔒 - A boolean argument, or false.
- arg_f64 🔒
- A number argument, if it is one.
- arg_str 🔒
- A string argument, or “”.
- file_
info 🔒 - The File Info pane, line for line as the Qt app’s
updateMetadata()writes it: the file, tag type, profile, record sets, the compass calibration, the compass source, then the info rows but for the largeconfigandinfoblobs. - parse_
color 🔒 #rrggbbas 0xRRGGBB.- run 🔒
- The engine loop: apply messages and publish the view state when it changed.
- spawn
- Starts the engine thread and returns its handle. Nothing is opened until
the page sends
ready. - status_
line 🔒 - The status line, as the Qt app’s
updateMetadata()writes it.
Type Aliases§
- Sink 🔒
- The event sink, shared between the engine thread and the logger.