Keypad bindings in the UI (/keypad.html, after the Design canvas' GridBinding): the keypads drawn as can.json has them, a key or knob picked by a tap or by pressing it, what it drives (a screen action or an output), the output's mode, what it does in an open menu, its LEDs; saved per car in data/drive/bindings.json over the profile's (GET/PUT/DELETE /api/keypad/bindings, checked on the way in), drive mode takes them when it loads
This commit is contained in:
1 parent
d6af65f4ef
commit
e82b2236b5
7 files changed
+325
-8
No files matched your search
@@ -604,7 +604,10 @@ export function setupDriving(map, nightButton, routePanel, gpxPanel) {
|
||||
map.on("pitchend", render);
|
||||
setInterval(render, RENDER_MS);
|
||||
|
||||
fetch(PROFILE_URL, { cache: "no-cache" }).then((r) => r.json()).then((p) => {
|
||||
// the keypads' bindings: this car's own (saved in /keypad.html) over the profile's
|
||||
const savedBindings = fetch("/api/keypad/bindings", { cache: "no-store" }).then((r) => (r.ok ? r.json() : null)).catch(() => null);
|
||||
fetch(PROFILE_URL, { cache: "no-cache" }).then((r) => r.json()).then(async (p) => {
|
||||
p.bindings = (await savedBindings)?.bindings || p.bindings;
|
||||
profile = p;
|
||||
// Cells of p.cell px at most; on a bigger screen only the map's columns
|
||||
// and rows (beside an open menu) stretch, the rest stays cell-sized.
|
||||
|
||||
Reference in new issue
Block a user