NA's page keys name the other locations with a problem in a blue band; PROP OUT reads Chronicles
- campuses.remote_summary -> custom variable sp_remote; band flashes until acknowledged there, steady after, "SC?" when silent
- nav_locations_band (NA only); red stays for NA's own problems
- PROP OUT: /Volumes/Location Assets/{date} on NA ProP (Chronicles share)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -265,6 +265,28 @@ def nav_templates(cfg):
|
||||
raise FileNotFoundError("no nav key templates for Companion %s" % version)
|
||||
|
||||
|
||||
REMOTE_VAR = "sp_remote" # North Attleboro's summary of the other locations (settings/campuses.py writes it)
|
||||
BAND_BLUE, BAND_DARK = 0x1E6FFF, 0x0B2A66
|
||||
|
||||
|
||||
def locations_band(flash_var):
|
||||
"""A blue band across the bottom of NA's page-number key naming the other locations with a problem
|
||||
("SC", "SC WS"): it flashes until that location acknowledges, then stays. Red stays NA's own
|
||||
(2026-10-21, the user: "i dont want the NA page buttons to flash red, that should he reserved for on site
|
||||
problems")."""
|
||||
r = "$(custom:%s)" % REMOTE_VAR
|
||||
on = "$(internal:time_unix) - jsonpath(%s, '$.t') < 30 && jsonpath(%s, '$.n') > 0" % (r, r)
|
||||
color = "jsonpath(%s, '$.f') == 1 && $(custom:%s) == 1 ? %d : %d" % (r, flash_var, BAND_DARK, BAND_BLUE)
|
||||
box = {"id": stable_id("nav", "band_box"), "name": "Locations", "usage": "auto", "type": "box", "enabled": prop(on, True),
|
||||
"opacity": prop(100), "x": prop(0), "y": prop(60), "width": prop(100), "height": prop(40), "rotation": prop(0),
|
||||
"color": prop(color, True), "borderWidth": prop(0), "borderColor": prop(0), "borderPosition": prop("inside")}
|
||||
text = {"id": stable_id("nav", "band_text"), "name": "Locations text", "usage": "auto", "type": "text", "enabled": prop(on, True),
|
||||
"opacity": prop(100), "x": prop(0), "y": prop(60), "width": prop(100), "height": prop(40), "rotation": prop(0),
|
||||
"text": prop("jsonpath(%s, '$.x')" % r, True), "color": prop(0xFFFFFF), "halign": prop("center"), "valign": prop("center"),
|
||||
"fontsize": prop("auto"), "fontsizeAllowShrink": prop(True), "font": prop("companion-sans"), "outlineColor": prop(4278190080)}
|
||||
return [box, text]
|
||||
|
||||
|
||||
def nav_key(kind, names, status_page=None, hold_ms=1000, tap_page=1, cfg=None):
|
||||
"""Companion's own UP / page number / DOWN key, coloured like the ALL button.
|
||||
|
||||
@@ -291,6 +313,8 @@ def nav_key(kind, names, status_page=None, hold_ms=1000, tap_page=1, cfg=None):
|
||||
layer["borderColor"] = prop(fg, True)
|
||||
paint(layer.get("children", []))
|
||||
paint(key["style"]["layers"])
|
||||
if kind == "pagenum" and (cfg.get("nav_locations_band") or False):
|
||||
key["style"]["layers"] += locations_band(opts["flash"])
|
||||
if kind == "pagenum" and status_page:
|
||||
step = key["steps"]["0"]
|
||||
tap = step["action_sets"]["down"]
|
||||
|
||||
Reference in New Issue
Block a user