This repository was archived by the owner on Aug 6, 2026. It is now read-only.
Simple CAN based HIL - #83
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new CAN-based HIL (hardware-in-the-loop) test runner to DAQApp2, with an egui UI widget and a JSON-based configuration format (individual tests + presets) for validating received CAN messages within time windows.
Changes:
- Introduces a new
hilmodule for config discovery/loading and runtime evaluation of expectations. - Adds a new
HilUI widget and wires it into the widget system, sidebar, and action spawning. - Adds
hil_config/schema + sample presets/tests to define expectations and presets.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/widgets.rs | Registers the new Hil widget and forwards show/CAN handling. |
| src/ui/sidebar.rs | Adds “Add HIL” button to spawn the HIL widget. |
| src/ui/mod.rs | Exposes the new ui::hil module. |
| src/ui/hil.rs | Implements the egui HIL widget UI/state machine and test execution loop. |
| src/main.rs | Adds mod hil; to compile the new module. |
| src/hil/mod.rs | Declares hil::config and hil::run submodules. |
| src/hil/config.rs | Implements listing/loading HIL presets/tests from JSON on disk. |
| src/hil/run.rs | Implements expectation tracking, matching, and pass/fail evaluation. |
| src/app.rs | Adds per-widget instance counter and spawn logic for Hil. |
| src/action.rs | Adds WidgetType::Hil and command palette entry. |
| hil_config/schema.json | Defines the JSON schema for HIL test files. |
| hil_config/presets.json | Adds a sample preset referencing included tests. |
| hil_config/tests/idk.json | Adds a sample test including tx and expect sections. |
| hil_config/tests/heartbeats_non_crit.json | Adds a sample heartbeat expectation test (non-critical). |
| hil_config/tests/heartbeats_crit.json | Adds a sample heartbeat expectation test (critical). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LelsersLasers
force-pushed
the
millan/simple_hil
branch
from
June 13, 2026 23:48
08aaf3a to
947e46a
Compare
LelsersLasers
marked this pull request as ready for review
June 13, 2026 23:48
LelsersLasers
force-pushed
the
millan/simple_hil
branch
from
July 29, 2026 03:04
947e46a to
9cd1584
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HIL_Loopback_Demo.mp4
Simple HIL only supporting expecting to receive CAN messages at certain windows and validating the values received. Supports both individual tests and presets which are a collection of individual tests.
Synatx
hil_config/presets.json:{ "Preset name": [ "individual_test_basename", "another_test_basename" ], "All Heartbeats": [ "heartbeats_crit", "heartbeats_non_crit" ] }hil_config/tests/individual_test_basename.json:{ "$schema": "../schema.json", "name": "Test name", "description": "test description", "expect": [ { "window": [0, 10000], "msg_name": "abox_version" }, { "window": [15, 20], "msg_name": "thermistor_telemetry", "signals": { "temperature": [30.0, 40.0] } } ] }Signals is optional. If not provided, will only check that the message is received within the window. You do no have to specify all signals. If a signal is not listed, then it's value will be ignored, only listed signals will be checked.
windowis in milliseconds after the test has started.As currently implemented, the UI thread is in charge of running the tests and checking the received CAN messages, so time precision is only ~16-20ms when running at 60 FPS
Not (yet) supported