Switches in drive mode, after the Design canvas' GridSwitches: Menu → Switches (only when /api/outputs answers), 3×3 tiles per page with the output's name, On / Off / Flashing / level, the key and mode driving it and its LED colour line, a group per module, All off, More ▸, a tap toggles. The status pill above the car (pypilot's note in SidePanel): ● REC while the trip is recorded, estimated / no fix, hidden when all is well
This commit is contained in:
1 parent
82a728e024
commit
88fa2d27a3
5 files changed
+162
-5
No files matched your search
@@ -245,9 +245,27 @@ export class GnssControl {
|
||||
this._marker.setRotation(data.track);
|
||||
}
|
||||
this._marker.getElement().classList.toggle("gnss-marker--estimated", !!data.estimated);
|
||||
this._showTag(lngLat, data);
|
||||
}
|
||||
|
||||
// The status pill above the car (pypilot's note in the Design canvas' SidePanel): REC while
|
||||
// drive mode records the trip (it sets .trip-rec on <html>), estimated / no fix; none when all is well
|
||||
_showTag(lngLat, data) {
|
||||
const rec = document.documentElement.classList.contains("trip-rec");
|
||||
const fix = data.estimated ? "estimated" : data.mode >= 2 ? "" : "no fix";
|
||||
if (!rec && !fix) return this._tag?.getElement().replaceChildren();
|
||||
if (!this._tag) {
|
||||
const el = document.createElement("div");
|
||||
el.className = "gnss-tag";
|
||||
this._tag = new Marker({ element: el, anchor: "bottom", offset: [0, -16] }).setLngLat(lngLat).addTo(this._map);
|
||||
}
|
||||
glideMarker(this._tag, lngLat, POLL_INTERVAL_MS);
|
||||
this._tag.getElement().innerHTML = (rec ? `<span class="gnss-tag__rec">● REC</span>` : "") + (fix ? `<span>${fix}</span>` : "");
|
||||
}
|
||||
|
||||
_removeMarker() {
|
||||
this._tag?.remove();
|
||||
this._tag = null;
|
||||
if (this._marker) {
|
||||
this._marker.remove();
|
||||
this._marker = null;
|
||||
|
||||
Reference in new issue
Block a user