Skip to content

Improve frame info window: timestamps, x-axis range, and per-byte-graph controls#1103

Open
dragz wants to merge 1 commit into
collin80:masterfrom
dragz:improve-frame-info-window
Open

Improve frame info window: timestamps, x-axis range, and per-byte-graph controls#1103
dragz wants to merge 1 commit into
collin80:masterfrom
dragz:improve-frame-info-window

Conversation

@dragz

@dragz dragz commented Jun 29, 2026

Copy link
Copy Markdown

SavvyCAN has been a tremendous help in my hobby of reverse engineering the canbus of my car. Please consider this improvement to the frame data analysis window. I'd be happy to adjust it if something is off or not up to par. My C++ is a bit rusty so Claude Code has done the heavy lifting.

Summary

  • Fix canframemodel.cpp timestamp arithmetic to combine seconds() + microSeconds() fields correctly everywhere, fixing display for captures longer than one second
  • Byte graphs now plot against real timestamps (respecting the app-wide time style setting) instead of frame index, and the x-axis spans the full capture window rather than only where the selected frame ID appears
  • Add per-graph reset button (lower-left overlay) restoring x-axis to full capture range and y-axis to [0, 265]
  • Add per-graph ─/● toggle button switching between line and scatter plots; state persists when switching frame IDs
  • Add reset-all and ─/● toggle-all buttons in the "Bytes Graph" section header

Changes

canframemodel.cpp

  • Add frameTimestampMicros() helper combining seconds() + microSeconds() so timestamps spanning more than one second are handled correctly throughout normalizeTiming, recalcOverwrite, addFrame, getIndexFromTimeID, and data()

re/frameinfowindow

  • Read time style and format from settings so byte graphs use the same representation (seconds, millis, clock) as the rest of the application
  • Plot byte graph x-axis using real frame timestamps instead of frame index; fix interval calculation to use full seconds+microseconds timestamp
  • Set byte graph x-axis range to span the entire capture window using captureXRange(), which scans all frames for the true min/max timestamp
  • Overlay buttons track the lower-left corner of each graph via eventFilter on QEvent::Resize

Test plan

  • Load a CAN log where a given ID appears only in a subset of the capture; verify byte graph x-axis spans the full capture
  • Switch between frame IDs; verify scatter/line toggle state is preserved per graph
  • Click ⌂ per-graph and ⌂ all-graphs; verify axes reset to defaults
  • Resize window/splitter; verify overlay buttons stay pinned to lower-left of each graph
  • Toggle ─/● all-graphs; verify all individual buttons update to match
  • Verify timestamp display matches the time style set in application preferences

Screenshot of dot scatter plots.
image

…ph controls

canframemodel.cpp:
- Add frameTimestampMicros() helper that combines seconds + microSeconds fields
  so timestamps spanning more than one second are handled correctly throughout
  normalizeTiming, recalcOverwrite, addFrame, getIndexFromTimeID, and data().

re/frameinfowindow:
- Read time style and format from settings so byte graphs use the same time
  representation (seconds, millis, clock) as the rest of the application.
- Set x-axis ticker and label per time style in setupByteGraph().
- Plot byte graph x-axis using real frame timestamps instead of frame index.
- Fix interval calculation to use full seconds+microseconds timestamp.
- Set byte graph x-axis range to span the entire capture window (all frames),
  not just the range where the selected frame ID appears.
- Add captureXRange() helper that scans modelFrames for the true min/max
  timestamp; shared by initial plot setup and reset logic.
- Add per-graph ⌂ reset button (lower-left corner overlay) that restores
  x-axis to full capture range and y-axis to default [0, 265].
- Add per-graph ─/● toggle button (next to reset) to switch between line
  and scatter dot plots; state persists when switching frame IDs.
- Add ⌂ reset-all and ─/● toggle-all buttons in the "Bytes Graph" header.
- Position overlay buttons via eventFilter on QEvent::Resize so they track
  the lower-left corner as the window or splitter is resized.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants