feat(sim): decoder simulator for testing without a decoder (1.64.0)

This commit is contained in:
larssand committed 2026-11-05 18:37:36 +01:00
1 parent d0a5df6992
commit 0ce7280cbf
6 files changed
+133 -4

No files matched your search

+4
View File
@@ -429,6 +429,10 @@ AMMC sends PASSING messages like this ([AMMC docs](https://www.ammconverter.eu/d
{ "msg": "PASSING", "passing_number": 1, "transponder": 232323, "rtc_time": "2022-10-11T22:57:36.099+02:00", "strength": 0.0, "resend": false, "loop_id": "55" }
```
### Testing without a decoder
`npm run sim` starts a decoder simulator on `ws://127.0.0.1:9000` (the app's default decoder address) that replaces AMMC and the decoder, so it also runs on a laptop without either. It sends passings with realistic lap times (about 18 s, a crash now and then) for the transponders in the active heat (sponsor heats: the cars), and follows when you switch heat. Start the heat on Race Day and the laps come in. Options: `npm run sim -- --lap 15 --spread 2 --tp 1001,1002 --port 9000`. If port 9000 is busy (AMMC running), stop AMMC or use `--port 9100` and set the decoder address to `ws://127.0.0.1:9100`.
## Development and tests
- **Unit, logic and API tests:** `npm test`. The SQLite integration tests start their own server against a temporary database and never touch `data/`.