From 6ece1c95c8ca93ae874d339104900cbe0fafb058 Mon Sep 17 00:00:00 2001 From: ygcxo Date: Sat, 7 Nov 2026 15:32:58 -0600 Subject: [PATCH 01/88] docs(adr): ADR-0056, the analysis log Picked signals logged between an explicit Start and Stop, the session's requests narrowed to them, exported as a wide CSV over the whole log and sized by its row interval. --- docs/adr/0056-analysis-log.md | 212 ++++++++++++++++++++++++++++++++++ docs/adr/README.md | 1 + 2 files changed, 213 insertions(+) create mode 100644 docs/adr/0056-analysis-log.md diff --git a/docs/adr/0056-analysis-log.md b/docs/adr/0056-analysis-log.md new file mode 100644 index 00000000..3c9014cc --- /dev/null +++ b/docs/adr/0056-analysis-log.md @@ -0,0 +1,212 @@ +# ADR-0056: The analysis log: picked signals logged at the bus's own pace between an explicit Start and Stop, exported as one wide row per sweep + +- **Status:** Accepted. Not built. +- **Date:** 2026-11-07. +- **Builds on:** [ADR-0015](0015-request-engine.md) (the request + engine) and [ADR-0039](0039-full-service01-coverage.md) (its two rate classes); + [ADR-0049](0049-recordings-in-core.md) (recordings in core, markers, + the viewer); [ADR-0054](0054-exports-and-imports.md) (exports + scrubbed by construction, the CSV export as built). + +## Context + +People who study a car's behavior over a drive (timing under load, +knock, fuel trims, boost) work from a log of a few dozen signals they +chose, taken over a planned run and read in a spreadsheet or a +dedicated analysis tool. The logs they pass around share one shape: +one header row, a time column first, one column per signal named with +its unit, one row per pass through the signals with every cell filled, +and a few hundred KB to about 1 MB for a 10-20 minute drive. + +Havne records already, but not in that shape or by that workflow: + +- **Record sessions is all or nothing.** The recorder (ADR-0049) + attaches after `ecuio_session_create` and before + `ecuio_session_start`, so a recording spans the whole session. There + is no "start logging now" on a running session. +- **The request set is the profile's.** A session polls every request + its profile and URI give (after the probe drops what the ECU + refuses), in two rate classes. Ticking a signal on Live picks what is + plotted, not what is asked, so a log of five signals is paced like a + log of fifty. +- **The CSV export is long form** (`time_s,signal,unit,value`, one row + per sample), in `havne-cli` only. The app has no export of a + recording; its Log page exports the frames in memory. + +## Decision + +### 1. The workflow + +Connect; pick signals (Live's checkboxes, the same list that picks the +plotted traces); **Start log**; drive; **Stop log**. Stop closes the +recording, which then opens in the viewer and exports. Record sessions +stays as it is, the always-on mode beside this deliberate one. + +- **Nothing waits for a save.** The recorder writes as it goes, so a + crash or a dropped link keeps everything up to that moment; Stop + only closes the folder. +- **No buttons while driving** beyond Start and Stop: nothing to mark, + nothing to press during a run. What happened is in the signals + (throttle, RPM, load), and the whole log is the record, steady state + as much as any pull. +- **A live readout beside Stop log:** the time logged and the size so + far at the current row rate (`12:30, 0.8 MB`). + +### 2. Requests narrowed to the picked signals + +A new call narrows a running session's rotation to the picked signals: + +```c +/* Asks only the requests that carry these signals, until called again; + * count 0 asks the whole set again. Append-only ABI. */ +ecuio_status_t ecuio_session_set_focus(ecuio_session_t* session, + const uint32_t* signal_ids, + uint32_t count); +``` + +- The engine parks every request whose defs are all outside the focus + (it stays in the table, it isn't refused) and runs the picked ones + in the fast class, so the rotation is as short as the picks allow. + Packing (several Service 01 PIDs to a request) keeps working over + what is left. +- Passive signals (broadcast frames a listener hears) aren't asked; + the focus only chooses which of them the log keeps. +- The probe and the DID scan are untouched: the focus applies to the + rotation after them. +- One call on the worker's own queue, so the rotation changes between + two requests, never inside an exchange. + +### 3. The recorder attaches to a running session + +`ecuio_session_record` also accepts a session that has started: the +recorder's ring is attached on the worker between two frames, and the +recording starts at that frame, its time 0 there. ADR-0049's rule +(attach before start) gets a dated amendment: before start is still how +Record sessions works; after start is the analysis log. A second +attach while one is live stays refused. + +### 4. Rows: one per sweep, derived at export + +A row is written once **every picked signal has a sample newer than the +previous row's**. For a polled set that is one row per sweep through +the rotation; for a mix of polled and broadcast signals it follows the +slowest picked signal, which is the rate at which every cell is new. + +- Derived from the values at export, so it needs no new record in the + recording, and it works on every recording already made, replays and + imports included. +- No ceiling while logging: the bus and the ECU set the pace, and fewer + signals run faster. An advanced setting, a minimum time between + sweeps (default off), exists for a slow adapter or a busy ECU, not + for file size. +- A row's time is the sample that completed it, in integer ms from the + log's start. Each cell is that signal's newest value at the row's + time: held, never interpolated or averaged, so a spike is shown as + read or not at all. + +### 5. The export: the wide CSV, sized at export + +The wide layout becomes the CSV export's default, in core +(`ecuio_export`), the app and `havne-cli`: + +``` +Time (ms),Engine speed (rpm),Vehicle speed (km/h),Ignition timing (deg) +0,812,0,10.5 +48,815,0,10.0 +``` + +- `Time (ms)` first, then each signal as `Name (unit)` in the picked + order; every row filled; fixed decimals per signal; comma, CRLF, no + quoting needed (a name or unit holding a comma or a quote is quoted + per RFC 4180, a formula-shaped one still fails the export as today). +- The long form stays, behind `--layout long` (`havne-cli`) and an + option in the app, for pandas and R. This is a change in the default: + a CHANGELOG "Changed" line, in a minor release (ADR-0048). +- **The whole log, sized by its time resolution.** The export always + covers the whole log (steady state is as much the analyst's as any + pull); its size is set by the row interval: every sweep (the + default), every 100 ms, every 250 ms, or a custom interval, with the + file's size estimated beside each choice before anything is written, + and the last choice remembered. Thinning keeps each row's newest + values, as above. The other two levers are the driver's: fewer + signals picked, and a shorter log between Start and Stop. +- Scrubbed as every export is (ADR-0054): identification and text + signals left out, the file checked for the car's identity. + +### 6. The viewer, for the analyst + +The log reads as well in Havne's viewer as in the analyst's own tool, +and the viewer aims to be the better of the two: moving around a long +log quickly, never cutting it. + +- Zoom and pan over the whole log, the cursor reading every picked + signal at once (built). +- Navigation aids, not trims: jump to the next or previous stretch of + high load or full throttle, and to steady cruise, found from the + signals. +- The roadmap's chart panes, two cursors and a span's statistics (the + time between the cursors, each signal's change, lowest, highest and + mean), which an analyst reaches for first; their own ADR. + +### 7. Front ends + +- **The app:** Start log, Stop log and the readout in the header while + connected; the viewer's Export (pcapng, CSV wide or long, a folder + copy) with the row interval and its size estimate. This also closes + the app's missing recording export. +- **`havne-cli`:** `havne-cli log --signals ` + (focus, record, stop on Ctrl+C or `--seconds`); + `havne-cli export ... --format csv [--layout wide|long] [--rows + sweep|]` (`--from`/`--to` stay for scripts). +- **Python:** `session.set_focus([...])` and recording a running + session; pandas reads the export or `signals.csv`, so no wrapper of + the export is needed. + +## Alternatives considered + +- **Reconnect behind the scenes with the picked set.** No new core + call, but Live goes blank for the reconnect, the probe runs again, + and an adapter that takes seconds to set up (ELM327 over Bluetooth) + makes Start feel broken. Kept as the fallback if the focus call + proves hard on a transport. +- **The recorder marks each sweep's end** (a record per pass). Exact, + but a new record kind, no help for recordings already made, and + undefined for broadcast signals. The derived rule gives the same + rows for a polled set. +- **A rate ceiling while logging, for file size.** Throws away data + that can't be had again; the size belongs at export, where the full + log is kept. +- **Trimming the export to marks or to detected pulls.** Marks need a + button pressed while driving, and both cut away the steady state an + analyst reads alongside the pulls. The size comes from the row + interval instead, and the viewer's navigation finds the pulls. +- **Averaging when thinning.** Smooths a knock spike or a misfire into + nothing; held values are what was read. +- **A spreadsheet workbook (`.xlsx`) instead.** Overlaps the wide CSV, + which spreadsheets and analysis tools read as is; left in the + potential roadmap. + +## Consequences + +- Two append-only ABI additions (the focus call, attach after start) + and a change of the CSV export's default. +- The engine gets a parked state beside refused; tests pin that a + parked request comes back on `count 0` and that the probe's results + survive a focus. +- The app gains its recording export, and with it the scrubbed copy to + share from the phone. +- What a log of N signals reaches on each adapter is measured, not + promised: a bench row per transport (J2534, ELM327 over USB, WiFi and + Bluetooth, SocketCAN) in the run sheets. + +## Open questions + +1. Units: the export in the units the app shows (its imperial choice) + or core's metric with `havne-cli --units`? +2. Decimals: from each signal's scale, or a signal file's own + `decimals` key (a schema change)? +3. The row rule when one picked signal stops answering: hold its last + value and keep writing rows (with a flag column?), or stall rows + until it returns? +4. The navigation aids' thresholds (what counts as high load, as + steady cruise), and whether they need throttle or fall back to load. diff --git a/docs/adr/README.md b/docs/adr/README.md index c664f2d7..fbcd06bb 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -61,6 +61,7 @@ old one, and the old record's status is updated to point at it. | [0053](0053-python-bindings.md) | Python bindings: pure Python on `ctypes` over the C ABI only, a shared core exporting the public names, a pull queue in core so no Python runs on the worker, a numeric version call, the exports checked against the headers, signal sets through signal files, the surrogates beside the library; one `py3-none` wheel per platform attached to each release with its checksums, provenance and SBOM entry, not on PyPI | Accepted | | [0054](0054-exports-and-imports.md) | Exports and imports in core: scrubbed by construction (each field classified, identification frames, text values, addresses, paths and labels left out and counted, unattributable diagnostic segments failing closed), then checked against the recording's own identity values; raw only by an explicit choice; a folder, CSV and pcapng (re-segmented frames marked) out, candump and mapped CSV in as recordings; the health report, a car's health in one scrubbed file | Accepted | | [0055](0055-elm327-emulator.md) | The ELM327 emulator: `havne-cli sim --elm327 tcp:` serves the simulated car as an ELM327 adapter on a TCP port on every platform, 127.0.0.1 unless the user names another address, one host at a time; core grows an unbound sim (`ecuio_sim_create_unbound`, `ecuio_sim_ask`) answering one request on the caller's clock, its faults as times and flags; the adapter's text stays in havne-cli | Accepted | +| [0056](0056-analysis-log.md) | The analysis log: the user picks signals, then Start log and Stop log; a running session's requests narrow to the picked signals (`ecuio_session_set_focus`) and the recorder attaches mid-session; the export is the wide CSV by default, one row once every picked signal is new, over the whole log, sized by its row interval; no marks or trimming; the viewer's Export and navigation aids | Accepted | ## Adding a record From 266fa74a1b56b8ef30bdf25e93092cc8046b97cc Mon Sep 17 00:00:00 2001 From: ygcxo Date: Sat, 7 Nov 2026 15:51:54 -0600 Subject: [PATCH 02/88] docs(adr): ADR-0056's units, decimals, silent signals and navigation The app's or --units' units, each signal's display decimals (the MAF to two), an empty cell for a silent signal that never holds up the rest, and the navigation aids' default thresholds. --- docs/adr/0056-analysis-log.md | 44 +++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/docs/adr/0056-analysis-log.md b/docs/adr/0056-analysis-log.md index 3c9014cc..fb3278ba 100644 --- a/docs/adr/0056-analysis-log.md +++ b/docs/adr/0056-analysis-log.md @@ -103,6 +103,13 @@ slowest picked signal, which is the rate at which every cell is new. log's start. Each cell is that signal's newest value at the row's time: held, never interpolated or averaged, so a spike is shown as read or not at all. +- **A signal that stops answering never holds up the rest.** One with + no new sample for 1 s, or 3x its own usual interval if that is + longer, leaves the rule, and rows go on without it; its cells are + left empty, never 0 and never its last value, since 0 is a reading + and a held value hides the loss. It rejoins the rule with its next + sample. Spreadsheets and analysis tools read an empty cell as + missing. ### 5. The export: the wide CSV, sized at export @@ -116,9 +123,20 @@ Time (ms),Engine speed (rpm),Vehicle speed (km/h),Ignition timing (deg) ``` - `Time (ms)` first, then each signal as `Name (unit)` in the picked - order; every row filled; fixed decimals per signal; comma, CRLF, no + order; every cell filled unless its signal is silent (section 4); comma, CRLF, no quoting needed (a name or unit holding a comma or a quote is quoted per RFC 4180, a formula-shaped one still fails the export as today). +- **Units:** the app's export in the units the app shows (its metric + or imperial choice), `havne-cli`'s by its `--units`, metric by + default; both through core's `ecuio_display_convert`. +- **Decimals:** each signal's own decimal places, as the app shows it + (`decimal_places`, 0 to 3, one more where a conversion needs it, kPa + to psi). Compared with logs other tools write for the same OBD + signals, these match (engine speed, coolant and intake temperature, + speed, timing, throttle) or give exactly the PID's resolution (load + and fuel trims at one decimal: their steps are 0.39 % and 0.78 %). + The one that rounds a step away is the MAF (0.01 g/s shown to one + decimal), which goes to two. - The long form stays, behind `--layout long` (`havne-cli`) and an option in the app, for pandas and R. This is a change in the default: a CHANGELOG "Changed" line, in a minor release (ADR-0048). @@ -142,8 +160,16 @@ log quickly, never cutting it. - Zoom and pan over the whole log, the cursor reading every picked signal at once (built). - Navigation aids, not trims: jump to the next or previous stretch of - high load or full throttle, and to steady cruise, found from the - signals. + high load and of steady cruise, found from the signals, with + thresholds the user can change: + - high load: throttle at 80 % or more while engine speed rises, for + at least 1 s; engine load at 80 % or more where there's no + throttle signal; + - steady cruise: speed within 2 km/h and throttle within 3 % for at + least 10 s. + + The defaults are a starting point, tuned against real logs before + the feature ships. - The roadmap's chart panes, two cursors and a span's statistics (the time between the cursors, each signal's change, lowest, highest and mean), which an analyst reaches for first; their own ADR. @@ -198,15 +224,3 @@ log quickly, never cutting it. - What a log of N signals reaches on each adapter is measured, not promised: a bench row per transport (J2534, ELM327 over USB, WiFi and Bluetooth, SocketCAN) in the run sheets. - -## Open questions - -1. Units: the export in the units the app shows (its imperial choice) - or core's metric with `havne-cli --units`? -2. Decimals: from each signal's scale, or a signal file's own - `decimals` key (a schema change)? -3. The row rule when one picked signal stops answering: hold its last - value and keep writing rows (with a flag column?), or stall rows - until it returns? -4. The navigation aids' thresholds (what counts as high load, as - steady cruise), and whether they need throttle or fall back to load. From 96ba20ea20c3299069f0be97590aec4acc7aa982 Mon Sep 17 00:00:00 2001 From: ygcxo Date: Sat, 7 Nov 2026 15:52:08 -0600 Subject: [PATCH 03/88] fix(ui): a phone's tab bar of touch-sized tabs, clear of the system's bars Each tab is at least 48 dp on the glass at any zoom, with an 8 dp gap below it before the window's edge, so a low tap no longer lands on Back or Home. The header and the tab bar paint the system's insets in their own color, and a test stand-in for the insets checks both. --- app/qml/Main.qml | 57 +++++++++++++++++++++++------- app/qml/Theme.qml | 14 ++++++++ tests/qml/tst_phone.qml | 77 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 12 deletions(-) diff --git a/app/qml/Main.qml b/app/qml/Main.qml index aca7d38c..45eb79ef 100644 --- a/app/qml/Main.qml +++ b/app/qml/Main.qml @@ -55,10 +55,22 @@ ApplicationWindow { // The layout width, after the zoom readonly property bool isCompact: zoomRoot.width < 720 - // A phone on its side, or a window as short - readonly property bool isShort: zoomRoot.height < 480 + // A phone on its side, or a window as short (the bars' insets apart) + readonly property bool isShort: zoomRoot.height - zoomRoot.insetTop - zoomRoot.insetBottom < 480 Binding { target: Theme; property: "dense"; value: root.isCompact || root.isShort } Binding { target: Theme; property: "shortLayout"; value: root.isShort } + Binding { target: Theme; property: "compact"; value: root.isCompact } + + // The system's bars over the window, per side: Qt's safe area, or a + // test's stand-in where larger (a test can't set SafeArea). The + // header and the tab bar paint theirs in their own color. + property var testInsets: ({ left: 0, top: 0, right: 0, bottom: 0 }) + readonly property var insets: { + const s = SafeArea.margins + const t = testInsets + return { left: Math.max(s.left, t.left), top: Math.max(s.top, t.top), + right: Math.max(s.right, t.right), bottom: Math.max(s.bottom, t.bottom) } + } readonly property int currentPage: stack.currentIndex // Page indices, in the order of the sidebar, stack and tab bar @@ -133,7 +145,7 @@ ApplicationWindow { : o === Qt.InvertedLandscapeOrientation ? "landscape, inverted" : "unknown" } readonly property string displayLine: { - const s = zoomRoot.safe + const s = root.insets return "Display: screen " + Screen.width + " × " + Screen.height + " (" + orientationName(Screen.orientation) + ", " + Screen.devicePixelRatio + "x)" + ", available " + Screen.desktopAvailableWidth + " × " + Screen.desktopAvailableHeight @@ -151,16 +163,20 @@ ApplicationWindow { // The whole UI, laid out at the window's size divided by the zoom and // scaled by it, so pages reflow as if the window were that size. // Shapes and text are vector-drawn, so they stay sharp at any zoom. - // It keeps out of the safe area's margins: Android draws the window - // under its status and navigation bars (edge to edge), where the - // window's color shows; elsewhere the margins are 0. + // It keeps out of the insets' sides; at the top and the bottom the + // header and the tab bar reach the window's edge and pad their insets + // in their own color (Android can draw the window under its status + // and navigation bars, edge to edge; elsewhere the insets are 0). Item { id: zoomRoot - readonly property var safe: parent.SafeArea.margins + readonly property var safe: root.insets + // The top and bottom insets in the layout's units + readonly property real insetTop: safe.top / Theme.zoom + readonly property real insetBottom: safe.bottom / Theme.zoom x: safe.left - y: safe.top + y: 0 width: (parent.width - safe.left - safe.right) / Theme.zoom - height: (parent.height - safe.top - safe.bottom) / Theme.zoom + height: parent.height / Theme.zoom scale: Theme.zoom transformOrigin: Item.TopLeft @@ -169,8 +185,9 @@ ApplicationWindow { spacing: 0 ToolBar { + objectName: "headerBar" Layout.fillWidth: true - Layout.preferredHeight: Theme.toolBarHeight + Layout.preferredHeight: Theme.toolBarHeight + zoomRoot.insetTop background: Rectangle { color: Theme.surface Rectangle { // 2px accent underline @@ -180,7 +197,9 @@ ApplicationWindow { } RowLayout { id: headerRow + objectName: "headerRow" anchors.fill: parent + anchors.topMargin: zoomRoot.insetTop anchors.leftMargin: 16 anchors.rightMargin: 16 spacing: 12 @@ -352,19 +371,26 @@ ApplicationWindow { } } + // A phone's tab bar: targets a touch's size at its top (each tab + // keeps its own height), then a gap and the system's bottom + // inset, all in the bar's color, so a tap low on a tab never + // reaches Back or Home beside it TabBar { id: tabBar objectName: "tabBar" visible: root.isCompact Layout.fillWidth: true + Layout.preferredHeight: Theme.touchTarget + Theme.barGap + zoomRoot.insetBottom + spacing: 0 currentIndex: stack.currentIndex onCurrentIndexChanged: stack.currentIndex = currentIndex - background: Rectangle { color: Theme.surface } + background: Rectangle { objectName: "tabBarBackground"; color: Theme.surface } // per-button styling since TabBar doesn't propagate backgrounds component ThemedTabButton: TabButton { id: btn + implicitHeight: Theme.touchTarget contentItem: Label { text: btn.text // 13px keeps "Settings" inside a fifth of a 375pt phone @@ -401,6 +427,13 @@ ApplicationWindow { ThemedTabButton { text: qsTr("Recs") } ThemedTabButton { text: qsTr("Settings") } } + // With no tab bar (the sidebar's width), the pages keep off + // the bottom inset + Item { + visible: !tabBar.visible + Layout.fillWidth: true + Layout.preferredHeight: zoomRoot.insetBottom + } } } @@ -461,7 +494,7 @@ ApplicationWindow { anchors.bottom: parent.bottom anchors.rightMargin: 8 + zoomRoot.safe.right // Above the tab bar on a phone, so it covers none of the tabs - anchors.bottomMargin: 8 + zoomRoot.safe.bottom + (tabBar.visible ? tabBar.height : 0) + anchors.bottomMargin: 8 + (tabBar.visible ? tabBar.height * Theme.zoom : zoomRoot.safe.bottom) width: frameRateLabel.implicitWidth + 12 height: frameRateLabel.implicitHeight + 6 radius: 4 diff --git a/app/qml/Theme.qml b/app/qml/Theme.qml index 0a523fda..627a3058 100644 --- a/app/qml/Theme.qml +++ b/app/qml/Theme.qml @@ -31,12 +31,26 @@ QtObject { // Shorter than 480 px: a phone on its side, where Live's and the // viewer's charts start maximized (Main.qml sets it with dense) property bool shortLayout: false + // Narrower than 720 px: a phone upright, where the tab bar shows + // (Main.qml sets it) + property bool compact: false readonly property int spacing: dense ? 6 : 8 readonly property int pageMargin: dense ? 10 : 16 readonly property int controlHeight: dense ? 32 : 36 readonly property int rowHeight: dense ? 36 : 44 readonly property int toolBarHeight: dense ? 40 : 48 readonly property int sidebarWidth: dense ? 150 : 220 + // The least a tap target measures each way on a phone (Material's + // 48 dp), on the glass: in the layout's units, which the zoom scales, + // a zoom under 1 asks for more, so a target never shrinks below it; + // elsewhere a control's own height. A control may draw smaller + // inside it. + readonly property real touchTarget: mobile || compact ? 48 * Math.max(1, 1 / zoom) + : controlHeight + // Between a bar's targets and the window's edge, on the glass too, so + // a tap low on the tab bar never lands on the system's Back or Home + // beside it + readonly property real barGap: 8 * Math.max(1, 1 / zoom) // A phone or tablet: touch only, no keyboard shortcuts, no file // manager for the app's own folders diff --git a/tests/qml/tst_phone.qml b/tests/qml/tst_phone.qml index 94384ef0..16043265 100644 --- a/tests/qml/tst_phone.qml +++ b/tests/qml/tst_phone.qml @@ -21,6 +21,7 @@ TestCase { function cleanup() { Relay.stop() Theme.developerMode = false + Theme.zoom = 1.0 Bridge.disconnectSession() tryVerify(() => !Bridge.disconnecting, 5000, "disconnect ends") Bridge.recording = false @@ -210,6 +211,82 @@ TestCase { compare(live.rowHeight, data.dense ? 36 : 44, "Live's rows follow it") } + // An item's rectangle in the window's own units (the glass's, the + // zoom applied) + function onGlass(item, main) { + return item.mapToItem(main.contentItem, 0, 0, item.width, item.height) + } + + // The phone's tab bar upright: every tab a touch's size on the glass + // at any zoom that shows the bar (67 % is the least at 384; at 50 % + // the layout passes 720 and the sidebar shows), the targets ending a + // gap above the window's bottom, and with the system's bars over the + // window (Android edge to edge) no tab inside the bottom inset, the + // bar's color reaching the window's edge and the header's row below + // the top inset + function test_theTabBarsTargetsAreATouchsSize_data() { + const none = { left: 0, top: 0, right: 0, bottom: 0 } + return [{ tag: "100 %", zoom: 1.0, insets: none }, + { tag: "67 %", zoom: 0.67, insets: none }, + { tag: "150 %", zoom: 1.5, insets: none }, + { tag: "the system's bars", zoom: 1.0, + insets: { left: 0, top: 24, right: 0, bottom: 48 } }, + { tag: "the system's bars at 67 %", zoom: 0.67, + insets: { left: 0, top: 24, right: 0, bottom: 48 } }] + } + + function test_theTabBarsTargetsAreATouchsSize(data) { + const main = createTemporaryObject(mainComponent, testCase) + verify(main, "Main loads") + main.width = 384 + main.height = 832 + Theme.zoom = data.zoom + main.testInsets = data.insets + verify(waitForPolish(main), "laid out") + const bar = find(main.contentItem, "tabBar") + tryVerify(() => bar.visible, 2000, "the tab bar shows upright") + const glass = main.contentItem.height + const floor = glass - data.insets.bottom - 8 + compare(bar.count, 7, "today's tabs") + for (let i = 0; i < bar.count; ++i) { + const tab = bar.itemAt(i) + const r = onGlass(tab, main) + verify(r.height >= 48 - 0.5, tab.text + " is " + r.height + " tall on the glass") + verify(r.width >= 48 - 0.5, tab.text + " is " + r.width + " wide on the glass") + verify(r.y + r.height <= floor + 0.5, + tab.text + " ends at " + (r.y + r.height) + ", past " + floor) + } + const back = onGlass(find(bar, "tabBarBackground"), main) + verify(back.y + back.height >= glass - 0.5, + "the bar's color ends at " + (back.y + back.height) + " of " + glass) + const head = onGlass(find(main.contentItem, "headerRow"), main) + verify(head.y >= data.insets.top - 0.5, + "the header's row starts at " + head.y + ", inside the top inset") + const rowHeight = Theme.toolBarHeight * Theme.zoom + verify(head.height >= rowHeight - 0.5, + "the header's row is " + head.height + " tall, under " + rowHeight) + const headBar = onGlass(find(main.contentItem, "headerBar"), main) + verify(headBar.y <= 0.5, "the header's color starts at the window's top") + } + + // At the sidebar's width (a phone on its side) there's no tab bar, and + // the pages still keep off the bottom inset + function test_thePagesKeepOffTheBottomInsetBesideTheSidebar() { + const main = createTemporaryObject(mainComponent, testCase) + verify(main, "Main loads") + main.width = 832 + main.height = 384 + main.testInsets = { left: 0, top: 24, right: 0, bottom: 30 } + verify(waitForPolish(main), "laid out") + verify(!find(main.contentItem, "tabBar").visible, "the sidebar instead") + const home = find(main.contentItem, "homePage") + main.gotoPage(Array.from(home.parent.children).indexOf(home)) + verify(waitForPolish(main), "laid out") + const r = onGlass(home.parent, main) + verify(r.y + r.height <= main.contentItem.height - 30 + 0.5, + "the pages end at " + (r.y + r.height) + " of " + main.contentItem.height) + } + // The chart maximized: on its side by default, upright on request, // each shape keeping its own choice; Live keeps its window row and // its link banner, and its list gives way From de2e28a0b31690f13b21cba0778d19a7b406ff0f Mon Sep 17 00:00:00 2001 From: ygcxo Date: Sat, 7 Nov 2026 16:26:02 -0600 Subject: [PATCH 04/88] feat(ui): the Log page filters by an ID mask, a length and a time, and By ID marks changed bytes The ID field takes candump's ID:mask beside IDs and ranges, and refuses a slash with words naming the colon. Length takes byte counts and ranges, Time a range of the table's seconds with either end open. By ID draws the bytes that changed from an ID's frame before in the warning color. --- app/framefilter.cpp | 160 ++++++++++++++++++++- app/framefilter.h | 56 +++++++- app/qml/LogPage.qml | 82 ++++++++++- app/sessionbridge.cpp | 57 ++++++-- app/sessionbridge.h | 22 ++- docs/testing.md | 2 +- tests/qml/tst_log.qml | 80 +++++++++++ tests/test_bridge.cpp | 322 ++++++++++++++++++++++++++++++++++++++++-- 8 files changed, 733 insertions(+), 48 deletions(-) diff --git a/app/framefilter.cpp b/app/framefilter.cpp index 7d9e537b..b46c3826 100644 --- a/app/framefilter.cpp +++ b/app/framefilter.cpp @@ -3,8 +3,11 @@ #include "framefilter.h" +#include #include +#include + #include "ecuio/core.h" namespace { @@ -33,6 +36,45 @@ bool hexId(QString text, uint32_t* out) return true; } +// One length in bytes, decimal; false past what a frame holds +bool decimalLength(QString text, int* out) +{ + text = text.trimmed(); + if (text.isEmpty() || text.size() > 4) { + return false; + } + for (const QChar c : text) { + if (c < QLatin1Char('0') || c > QLatin1Char('9')) { + return false; + } + } + const int value = text.toInt(); + if (value > static_cast(ECUIO_FRAME_DATA_MAX)) { + return false; + } + *out = value; + return true; +} + +// Seconds as the table shows them ("12.5", "30", ".25"), into +// microseconds; false for a sign, an exponent or past a million hours +bool seconds(QString text, uint64_t* out) +{ + static const QRegularExpression form( + QStringLiteral("^([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$")); + text = text.trimmed(); + if (!form.match(text).hasMatch()) { + return false; + } + bool ok = false; + const double value = text.toDouble(&ok); + if (!ok || value > 3.6e9) { + return false; + } + *out = static_cast(std::llround(value * 1e6)); + return true; +} + } // namespace QString FrameFilter::parseIds(const QString& text, std::vector* out) @@ -47,7 +89,25 @@ QString FrameFilter::parseIds(const QString& text, std::vector* out) if (item.isEmpty()) { return QStringLiteral("an empty item between commas"); } + if (item.contains(QLatin1Char('/'))) { + return QStringLiteral( + "\"%1\": an ID and its mask take \":\", as in 7E0:7F8") + .arg(item); + } IdRange r; + const qsizetype colon = item.indexOf(QLatin1Char(':')); + if (colon >= 0) { + if (!hexId(item.left(colon), &r.first) || + !hexId(item.mid(colon + 1), &r.mask)) { + return QStringLiteral( + "\"%1\" isn't a hex ID and mask like 7E0:7F8") + .arg(item); + } + r.last = r.first; + r.masked = true; + ranges.push_back(r); + continue; + } const qsizetype dash = item.indexOf(QLatin1Char('-')); const bool ok = dash < 0 ? hexId(item, &r.first) @@ -113,21 +173,96 @@ QString FrameFilter::parseData(const QString& text, std::vector* out, return {}; } +QString FrameFilter::parseLengths(const QString& text, + std::vector* out) +{ + out->clear(); + if (text.trimmed().isEmpty()) { + return {}; + } + std::vector ranges; + for (const QString& raw : text.split(QLatin1Char(','))) { + const QString item = raw.trimmed(); + if (item.isEmpty()) { + return QStringLiteral("an empty item between commas"); + } + LengthRange r; + const qsizetype dash = item.indexOf(QLatin1Char('-')); + const bool ok = dash < 0 + ? decimalLength(item, &r.first) + : decimalLength(item.left(dash), &r.first) && + decimalLength(item.mid(dash + 1), &r.last); + if (!ok) { + return QStringLiteral( + "\"%1\" isn't a length in bytes (up to %2) or a range " + "like 1-7") + .arg(item) + .arg(ECUIO_FRAME_DATA_MAX); + } + if (dash < 0) { + r.last = r.first; + } else if (r.last < r.first) { + return QStringLiteral("\"%1\" runs backward").arg(item); + } + ranges.push_back(r); + } + *out = std::move(ranges); + return {}; +} + +QString FrameFilter::parseTimes(const QString& text, TimeRange* out) +{ + *out = TimeRange(); + const QString t = text.trimmed(); + if (t.isEmpty()) { + return {}; + } + // Not const: each return moves it + QString shape = + QStringLiteral("\"%1\" isn't a range of seconds like 12.5-30, " + "12.5- (from then on) or -30 (up to then)") + .arg(t); + const qsizetype dash = t.indexOf(QLatin1Char('-')); + if (dash < 0 || t.indexOf(QLatin1Char('-'), dash + 1) >= 0) { + return shape; + } + const QString from = t.left(dash).trimmed(); + const QString to = t.mid(dash + 1).trimmed(); + TimeRange r; + r.set = true; + if ((from.isEmpty() && to.isEmpty()) || + (!from.isEmpty() && !seconds(from, &r.first)) || + (!to.isEmpty() && !seconds(to, &r.last))) { + return shape; + } + if (r.last < r.first) { + return QStringLiteral("\"%1\" runs backward").arg(t); + } + *out = r; + return {}; +} + int FrameFilter::terms() const { return (ids.empty() ? 0 : 1) + (data.empty() ? 0 : 1) + - (direction == AnyDirection ? 0 : 1) + (flag == AnyFlag ? 0 : 1); + (direction == AnyDirection ? 0 : 1) + (flag == AnyFlag ? 0 : 1) + + (lengths.empty() ? 0 : 1) + (time.set ? 1 : 0); } -bool FrameFilter::matches(uint32_t id, uint32_t flags, const uint8_t* payload, - int length) const +bool FrameFilter::matches(uint32_t id, uint32_t flags, uint64_t timestampUs, + const uint8_t* payload, int length) const { const bool extended = (flags & ECUIO_FRAME_FLAG_EXTENDED) != 0; if (!ids.empty()) { bool any = false; for (const IdRange& r : ids) { - if (id >= r.first && id <= r.last && - (extended || id <= kMaxStandardId)) { + const bool in = r.masked + ? (id & r.mask) == (r.first & r.mask) && + (extended || (r.first <= kMaxStandardId && + r.mask <= kMaxStandardId)) + : id >= r.first && id <= r.last && + (extended || id <= kMaxStandardId); + if (in) { any = true; break; } @@ -165,6 +300,21 @@ bool FrameFilter::matches(uint32_t id, uint32_t flags, const uint8_t* payload, default: break; } + if (time.set && (timestampUs < time.first || timestampUs > time.last)) { + return false; + } + if (!lengths.empty()) { + bool any = false; + for (const LengthRange& r : lengths) { + if (length >= r.first && length <= r.last) { + any = true; + break; + } + } + if (!any) { + return false; + } + } if (data.empty()) { return true; } diff --git a/app/framefilter.h b/app/framefilter.h index 68a882c6..135b89e3 100644 --- a/app/framefilter.h +++ b/app/framefilter.h @@ -6,11 +6,17 @@ // flags, the direction). It chooses rows to show, as a search does; it // reads no field of a payload, so decoding stays in core (rule 2). // -// ID hex IDs and ranges, commas between, "0x" optional: -// "7E8, 7E0-7EF, 0x18DAF110". An ID past 0x7FF matches only an -// extended (29-bit) frame. +// ID hex IDs, ranges and IDs under a mask, commas between, "0x" +// optional: "7E8, 7E0-7EF, 0x18DAF110, 7E0:7F8". A mask is +// candump's can_id:can_mask, the ID's bits where the mask has +// ones. An ID (or a mask) past 0x7FF matches only an extended +// (29-bit) frame. // Data hex bytes, "??" for any byte, found anywhere in the payload; // "^" first anchors them at byte 0: "^62 F1 ??". +// Length data lengths in bytes and ranges, decimal, commas between: +// "8", "1-7, 12, 64". +// Time the table's seconds, one range, both ends in it: "12.5-30", +// "12.5-" (from then on) or "-30" (up to then). // Direction every frame, the received ones, or the sent ones (an // echo of the session's own transmit, ECUIO_FRAME_FLAG_TX_ECHO). // Flags any, or one: extended, standard, CAN FD, reassembled, @@ -38,9 +44,36 @@ class FrameFilter Error = 7 }; + // first to last; or, masked, the IDs whose bits under mask are + // first's (last is first) struct IdRange { uint32_t first = 0; uint32_t last = 0; + bool masked = false; + uint32_t mask = 0; + bool operator==(const IdRange& o) const + { + return first == o.first && last == o.last && masked == o.masked && + mask == o.mask; + } + }; + struct LengthRange { + int first = 0; + int last = 0; + bool operator==(const LengthRange& o) const + { + return first == o.first && last == o.last; + } + }; + // Session time in microseconds, both ends in the range + struct TimeRange { + bool set = false; + uint64_t first = 0; + uint64_t last = UINT64_MAX; + bool operator==(const TimeRange& o) const + { + return set == o.set && first == o.first && last == o.last; + } }; // The ID field's text into ranges; "" when it parses (empty is any @@ -50,18 +83,27 @@ class FrameFilter // (empty is any payload), else why not static QString parseData(const QString& text, std::vector* out, bool* anchored); + // The length field's text into ranges; "" when it parses (empty is + // any length), else why not, naming the item + static QString parseLengths(const QString& text, + std::vector* out); + // The time field's text into a range; "" when it parses (empty is + // any time, not set), else why not + static QString parseTimes(const QString& text, TimeRange* out); std::vector ids; std::vector data; bool anchored = false; int direction = AnyDirection; int flag = AnyFlag; + std::vector lengths; + TimeRange time; // How many fields are in force: 0 is no filter, every frame shown int terms() const; bool active() const { return terms() > 0; } - // A frame as the ring holds it: its ID, its ECUIO_FRAME_FLAG_* and - // its payload - bool matches(uint32_t id, uint32_t flags, const uint8_t* payload, - int length) const; + // A frame as the ring holds it: its ID, its ECUIO_FRAME_FLAG_*, its + // session time and its payload + bool matches(uint32_t id, uint32_t flags, uint64_t timestampUs, + const uint8_t* payload, int length) const; }; diff --git a/app/qml/LogPage.qml b/app/qml/LogPage.qml index e9d75eeb..044771bc 100644 --- a/app/qml/LogPage.qml +++ b/app/qml/LogPage.qml @@ -41,14 +41,19 @@ Pane { // a field that doesn't parse and says why function applyFilter() { const r = Bridge.model.setFilter(filterIds.text, filterData.text, - page.filterDirection, filterFlag.currentIndex) + page.filterDirection, filterFlag.currentIndex, + filterLengths.text, filterTimes.text) filterIdsProblem.text = r.ids filterDataProblem.text = r.data + filterLengthsProblem.text = r.lengths + filterTimesProblem.text = r.times } function clearFilter() { filterIds.text = "" filterData.text = "" + filterLengths.text = "" + filterTimes.text = "" filterFlag.currentIndex = 0 page.filterDirection = 0 applyFilter() @@ -71,6 +76,20 @@ Pane { page.byId = false } + // A By ID row's payload with the bytes that changed from the frame + // before marked, as styled text: the payload's spaced hex and the + // changed positions, both from the bridge + function markedPayload(hex, changed) { + if (!changed || changed.length === 0) + return hex + const bytes = hex.split(" ") + for (const at of changed) { + if (at < bytes.length) + bytes[at] = "" + bytes[at] + "" + } + return bytes.join(" ") + } + // Frames a second, as the By ID view shows them function rateText(rate) { return rate <= 0 ? "-" : rate < 10 ? rate.toFixed(1) + "/s" : Math.round(rate) + "/s" @@ -431,6 +450,57 @@ Pane { Layout.preferredWidth: 0 // the panel's width, not its text's } + // The data length in bytes, and a span of the table's seconds + Label { text: qsTr("Length"); color: Theme.textDim; font.pixelSize: 13 } + RowLayout { + Layout.fillWidth: true + Layout.preferredWidth: 0 // the panel's width, not its text's + spacing: Theme.spacing + TextField { + id: filterLengths + objectName: "filterLengths" + Layout.fillWidth: true + Layout.preferredWidth: 0 // half the row, not its text's + placeholderText: qsTr("8, 1-7") + font.family: Theme.monoFamily + inputMethodHints: Qt.ImhPreferNumbers | Qt.ImhNoPredictiveText + onTextEdited: page.applyFilter() + } + Label { text: qsTr("Time"); color: Theme.textDim; font.pixelSize: 13 } + TextField { + id: filterTimes + objectName: "filterTimes" + Layout.fillWidth: true + Layout.preferredWidth: 0 // half the row, not its text's + placeholderText: qsTr("12.5-30") + font.family: Theme.monoFamily + inputMethodHints: Qt.ImhFormattedNumbersOnly | Qt.ImhNoPredictiveText + onTextEdited: page.applyFilter() + } + } + Item { visible: filterLengthsProblem.visible } // the label column, empty + Label { + id: filterLengthsProblem + objectName: "filterLengthsProblem" + visible: text !== "" + color: Theme.warning + font.pixelSize: 12 + wrapMode: Text.Wrap + Layout.fillWidth: true + Layout.preferredWidth: 0 // the panel's width, not its text's + } + Item { visible: filterTimesProblem.visible } // the label column, empty + Label { + id: filterTimesProblem + objectName: "filterTimesProblem" + visible: text !== "" + color: Theme.warning + font.pixelSize: 12 + wrapMode: Text.Wrap + Layout.fillWidth: true + Layout.preferredWidth: 0 // the panel's width, not its text's + } + Flow { Layout.columnSpan: 2 Layout.fillWidth: true @@ -478,7 +548,8 @@ Pane { objectName: "filterClear" text: qsTr("Clear the filter") enabled: Bridge.model.filterTerms > 0 || filterIds.text !== "" - || filterData.text !== "" + || filterData.text !== "" || filterLengths.text !== "" + || filterTimes.text !== "" onClicked: page.clearFilter() } } @@ -920,9 +991,14 @@ Pane { font.family: Theme.monoFamily; font.pixelSize: 12 Layout.preferredWidth: 52 } + // The bytes that changed from the ID's frame + // before, in the warning color and bold Label { id: idPayload - text: idRow.model.payloadHex + objectName: "idPayload" + text: page.markedPayload(idRow.model.payloadHex, + idRow.model.changedBytes) + textFormat: Text.StyledText color: Theme.text font.family: Theme.monoFamily; font.pixelSize: 12 Layout.fillWidth: true diff --git a/app/sessionbridge.cpp b/app/sessionbridge.cpp index 49b3f315..9aa8f3ae 100644 --- a/app/sessionbridge.cpp +++ b/app/sessionbridge.cpp @@ -285,11 +285,16 @@ void FrameListModel::clear() } QVariantMap FrameListModel::setFilter(const QString& ids, const QString& data, - int direction, int flag) + int direction, int flag, + const QString& lengths, + const QString& times) { FrameFilter next; const QString idWords = FrameFilter::parseIds(ids, &next.ids); const QString dataWords = FrameFilter::parseData(data, &next.data, &next.anchored); + const QString lengthWords = + FrameFilter::parseLengths(lengths, &next.lengths); + const QString timeWords = FrameFilter::parseTimes(times, &next.time); next.direction = direction >= FrameFilter::AnyDirection && direction <= FrameFilter::Sent ? direction @@ -305,14 +310,17 @@ QVariantMap FrameListModel::setFilter(const QString& ids, const QString& data, next.data = m_filter.data; next.anchored = m_filter.anchored; } - const bool same = next.ids.size() == m_filter.ids.size() && - std::equal(next.ids.begin(), next.ids.end(), m_filter.ids.begin(), - [](const FrameFilter::IdRange& a, - const FrameFilter::IdRange& b) { - return a.first == b.first && a.last == b.last; - }) && - next.data == m_filter.data && next.anchored == m_filter.anchored && - next.direction == m_filter.direction && next.flag == m_filter.flag; + if (!lengthWords.isEmpty()) { + next.lengths = m_filter.lengths; + } + if (!timeWords.isEmpty()) { + next.time = m_filter.time; + } + const bool same = + next.ids == m_filter.ids && next.data == m_filter.data && + next.anchored == m_filter.anchored && + next.direction == m_filter.direction && next.flag == m_filter.flag && + next.lengths == m_filter.lengths && next.time == m_filter.time; if (!same) { beginResetModel(); m_filter = std::move(next); @@ -335,7 +343,10 @@ QVariantMap FrameListModel::setFilter(const QString& ids, const QString& data, emit selectionChanged(); } } - return {{QStringLiteral("ids"), idWords}, {QStringLiteral("data"), dataWords}}; + return {{QStringLiteral("ids"), idWords}, + {QStringLiteral("data"), dataWords}, + {QStringLiteral("lengths"), lengthWords}, + {QStringLiteral("times"), timeWords}}; } quint64 FrameListModel::newestTimestampUs() const @@ -581,6 +592,7 @@ QVariant FrameIdModel::data(const QModelIndex& index, int role) const case CountRole: return r.count; case RateRole: return r.rate; case PayloadRole: return QString::fromLatin1(r.payload.toHex(' ').toUpper()); + case ChangedRole: return r.changed; default: return QVariant(); } } @@ -592,7 +604,8 @@ QHash FrameIdModel::roleNames() const {ExtendedRole, "extended"}, {CountRole, "frames"}, {RateRole, "rate"}, - {PayloadRole, "payloadHex"} + {PayloadRole, "payloadHex"}, + {ChangedRole, "changedBytes"} }; } @@ -609,6 +622,7 @@ void FrameIdModel::refresh() quint64 first = std::numeric_limits::max(); quint64 last = 0; int recent = 0; + QByteArray before; // the payload of the frame before the newest }; std::map byKey; std::map seen; @@ -617,10 +631,11 @@ void FrameIdModel::refresh() ((f.flags & ECUIO_FRAME_FLAG_EXTENDED) != 0 ? (quint64{1} << 32) : 0) | f.id; IdRow& row = byKey[key]; row.key = key; + Seen& s = seen[key]; + s.before = std::move(row.payload); ++row.count; row.payload = QByteArray(reinterpret_cast(f.data), f.length); oldest = std::min(oldest, f.timestampUs); - Seen& s = seen[key]; s.first = std::min(s.first, f.timestampUs); s.last = std::max(s.last, f.timestampUs); if (f.timestampUs > from) { @@ -632,6 +647,15 @@ void FrameIdModel::refresh() next.reserve(byKey.size()); for (auto& [key, row] : byKey) { const Seen& s = seen[key]; + if (row.count > 1) { + const qsizetype common = + std::min(s.before.size(), row.payload.size()); + for (qsizetype b = 0; b < row.payload.size(); ++b) { + if (b >= common || s.before[b] != row.payload[b]) { + row.changed.append(static_cast(b)); + } + } + } if (!shortLog) { row.rate = static_cast(s.recent) * 1e6 / static_cast(RateWindowUs); @@ -662,10 +686,13 @@ void FrameIdModel::refresh() } else { IdRow& old = m_rows[i]; if (old.count != next[j].count || old.rate != next[j].rate || - old.payload != next[j].payload) { + old.payload != next[j].payload || + old.changed != next[j].changed) { old = next[j]; - emit dataChanged(index(static_cast(i), 0), index(static_cast(i), 0), - {CountRole, RateRole, PayloadRole}); + emit dataChanged( + index(static_cast(i), 0), + index(static_cast(i), 0), + {CountRole, RateRole, PayloadRole, ChangedRole}); } ++i; ++j; diff --git a/app/sessionbridge.h b/app/sessionbridge.h index 0e02f517..c9ff9318 100644 --- a/app/sessionbridge.h +++ b/app/sessionbridge.h @@ -100,12 +100,15 @@ class FrameListModel : public QAbstractListModel void setNewestFirst(bool newestFirst); // The filter (framefilter.h's syntax): the ID and data fields' text, - // FrameFilter::Direction and FrameFilter::Flag. A field that doesn't - // parse keeps the filter in force as it was; the answer is { ids, - // data }, each "" or the words for its field. A change shows the + // FrameFilter::Direction, FrameFilter::Flag, and the length and time + // fields' text. A field that doesn't parse keeps its part of the + // filter in force as it was; the answer is { ids, data, lengths, + // times }, each "" or the words for its field. A change shows the // rows anew and lets the selection go Q_INVOKABLE QVariantMap setFilter(const QString& ids, const QString& data, - int direction, int flag); + int direction, int flag, + const QString& lengths = QString(), + const QString& times = QString()); int filterTerms() const { return m_filter.terms(); } // The flags a row shows, in words, the ID's width left to its column: // "FD BRS", "reassembled", "truncated", "after a loss", "error", @@ -204,7 +207,8 @@ class FrameListModel : public QAbstractListModel void notifySelected(int first, int last); bool shows(const Row& r) const { - return m_filter.matches(r.arbId, r.flags, r.data(), r.length); + return m_filter.matches(r.arbId, r.flags, r.timestampUs, r.data(), + r.length); } // The ring's row for an arrival number it holds const Row& rowOfArrival(quint64 seq) const @@ -253,8 +257,11 @@ class FrameIdModel : public QAbstractListModel ArbIdRole = Qt::UserRole + 1, ExtendedRole, CountRole, - RateRole, // frames a second, a double - PayloadRole // the newest payload, spaced hex + RateRole, // frames a second, a double + PayloadRole, // the newest payload, spaced hex + ChangedRole // the newest payload's byte positions that differ from + // the frame before it (a list of ints; past the + // shorter payload, every byte); none with one frame }; int rowCount(const QModelIndex& parent = {}) const override; @@ -272,6 +279,7 @@ class FrameIdModel : public QAbstractListModel int count = 0; double rate = 0.0; QByteArray payload; // the newest + QVariantList changed; }; const FrameListModel* m_frames; std::vector m_rows; diff --git a/docs/testing.md b/docs/testing.md index 981a6d8d..52f3ad22 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -491,7 +491,7 @@ round trip each, negligible at the transport's read cap | The CSV export ([ADR-0054](adr/0054-exports-and-imports.md)'s appendix "the CSV export as built"): a recording's values written byte for byte, one row per sample after the comment line; a text signal and an identification-keyed number DID left out and counted; a value echoing the fake VIN failing the export; a name, a unit or a raw text value that starts as a formula failing it, a negative number written; a range; a recording with no `frames.csv`, and one with no `signals.csv` refused; `havne-cli export --format csv` over `tests/golden/recording/replay-obd2` read back by Python's `csv` module row for row, twice to the same bytes, and a range | `CsvExportTest` (`test_core`), `CliTransferTest` (`test_cli`), `CliTransferRunTest.csv`. Mutation-checked 2026-11-06 (15) | | The folder export ([ADR-0054](adr/0054-exports-and-imports.md)'s appendix "the folder export as built"): every file of the copy byte for byte; a range; raw; a mock's label as `