Appearance
Build and test
Build
js
import { build } from '@emdzej/navx-sdk';
import { checkNoMulDiv, uiBuild } from '@emdzej/navx-sdk/ui';
const ui = uiBuild('dist/gen/myapp');
const sources = ['myapp.c', ...ui.sources];
checkNoMulDiv(sources, ui.includes, 'dist/gen/myapp', 'myapp');
const { module } = build(sources, { name: 'myapp', cflags: ['-Os', '-Werror', ...ui.includes.map((i) => `-I${i}`)] });Check module.bytes before you write it anywhere: parity, CRC, and a size that's a multiple of 4.
The emulated unit
The NAVX emulator (@emdzej/navx-emu) runs the unit's own software from a flash copy of your own, with the NavX firmware on top. A test or a screenshot tool:
- Boot with
NAVX_FLASH=/path/flash. Put the launcher inpstartup. - Put your module on a disc:
APPS/MYAPPandAPPS/APPS.TXT(My app|/dvd/APPS/MYAPP||uiruns it inside the shell). - Drive the knob with BMBT frames:js
m.ibus.receive(ibusFrame(0xf0, 0x3b, [0x49, 0x80 | 1])); // one step right m.ibus.receive(ibusFrame(0xf0, 0xff, [0x48, 0x05])); // press … m.ibus.receive(ibusFrame(0xf0, 0xff, [0x48, 0x85])); // … release - Put made-up car traffic into the I-Bus ring, give the GPS a fix (
new Machine({ gps: { lat, lon, speedKmh, heading } })), and take shots withm.video.snapshot().
Every screenshot on this site was made this way, with made-up data.
Check
- Look at the shots against the UI guidelines.
- After any colour change, run
node ui/tools/contrast.mjs: every text colour must be at 4.5:1 or more on the car's LCD. - Keep vitest to 2 workers. Emulator runs are heavy.