debug: add upcoming trains data probe

This commit is contained in:
2026-08-02 16:31:07 +08:00
parent c13a0c9dcc
commit b725c74e1d
2 changed files with 57 additions and 6 deletions
+19
View File
@@ -0,0 +1,19 @@
[OPEN] upcoming-data-missing
## Symptom
- Monitor shows `NONE / WAITING DATA` under `UPCOMING TRAINS`.
- Expected: list of upcoming trains parsed from CRN advanced display NBT (TrainStops).
## Hypotheses (falsifiable)
1. `Peripherals.blockReader` is not detected (wrong peripheral type string / not connected to this computer).
2. `blockReader.getBlockData()` succeeds but returns a table without `TrainStops` (block reader is pointing at the wrong block or advanced display data not present).
3. `TrainStops` exists but is not an array (non-numeric keys), so `ipairs()` iteration yields 0 rows.
4. `TrainStops` exists but the code path exits before assigning `State.upcomingTrains`.
## Evidence to collect (instrumentation)
- Whether blockReader/create_target are detected.
- Whether getBlockData succeeds.
- Whether TrainStops exists and how many rows it contains (ipairs count vs pairs count).
## Next action
- Add runtime instrumentation to display these values on the monitor and in logs.