drone-path 0.11.1 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/README.md +2 -2
- package/app/ipc.d.mts +1 -1
- package/app/ipc.mjs +10 -10
- package/app/main.mjs +3 -3
- package/app/preload.cjs +2 -2
- package/dist/appsession.js +9 -9
- package/dist/config.js +14 -0
- package/dist/manual/cliref.js +2 -1
- package/dist/manual/markdown.js +6 -1
- package/dist/plan.js +5 -1
- package/dist/renderer/dom.js +30 -1
- package/dist/renderer/scene.js +54 -11
- package/dist/renderer/tilesources.js +14 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# drone-path
|
|
2
2
|
|
|
3
|
+
## 0.12.1
|
|
4
|
+
|
|
5
|
+
- **Fixed:** The Export video dialog handles every outcome cleanly: a
|
|
6
|
+
failed or canceled run returns to the form with the outcome sentence
|
|
7
|
+
as a notice, so retry stays one click away, and a canceled run always
|
|
8
|
+
reads "Export canceled; its unfinished file was removed." The export
|
|
9
|
+
summary now reports the media duration (frames at the frame rate)
|
|
10
|
+
instead of the encode wall time, which read as a wrong duration
|
|
11
|
+
between the media specs.
|
|
12
|
+
- **Fixed:** Exported frames carry the heading pill: the HDG readout
|
|
13
|
+
joins ALT and SPD in the top-left HUD column, toggled by the heading
|
|
14
|
+
readout setting, exactly as the Map appearance preview shows it. The
|
|
15
|
+
preview pills use the export's placement and stacking, and on-video
|
|
16
|
+
pills read HDG/ALT/SPD.
|
|
17
|
+
- **Fixed:** Selected controls keep their accent selection marker while
|
|
18
|
+
hovered: HUD chips, map style tiles, trail swatches and structure bar
|
|
19
|
+
segments no longer read unselected under the cursor. Disabled HUD
|
|
20
|
+
chips dim to the disabled look instead of the "off" look, and select
|
|
21
|
+
and text fields lighten their border on hover like number fields.
|
|
22
|
+
- **Fixed:** A failed "Reveal in folder" in the Export telemetry dialog
|
|
23
|
+
no longer leaves its error notice behind after a successful retry;
|
|
24
|
+
every reveal attempt clears the previous error first.
|
|
25
|
+
- **Fixed:** The PiP overlay's map strip shows the zoom level and
|
|
26
|
+
announces refused zoom steps, so the `+` and `-` hotkeys give
|
|
27
|
+
feedback in every layout instead of silently re-pinning the zoom.
|
|
28
|
+
|
|
29
|
+
## 0.12.0
|
|
30
|
+
|
|
31
|
+
- **New:** The flight map zooms in and out with a small `−`/`+` pill
|
|
32
|
+
below the map (split view) and the `+` / `-` keys: every step pins the
|
|
33
|
+
level as the fixed "Zoom" setting, so the export renders exactly the
|
|
34
|
+
zoom the preview shows. Zooming clamps at the map's usable levels with
|
|
35
|
+
the matching button disabling at either end, and opening a recording
|
|
36
|
+
resets Zoom to auto-fit.
|
|
37
|
+
- **New:** The map card's Speed, Altitude and Zoom readouts now sit in
|
|
38
|
+
one compact strip below the map — labeled columns with a bare `−`
|
|
39
|
+
level `+` stepper instead of separate chip pills and a zoom row — and
|
|
40
|
+
the map reclaims the freed height. A turned-off HUD chip keeps its
|
|
41
|
+
column and shows a dimmed `--`.
|
|
42
|
+
- **New:** Map appearance is now a modal dialog with a live preview of
|
|
43
|
+
the export frame — the loaded recording or a bundled example flight —
|
|
44
|
+
and grouped settings: map style as thumbnail tiles, a trail color
|
|
45
|
+
swatch row with an explicit Style default, an Auto-fit zoom toggle
|
|
46
|
+
with a zoom level slider and Frame padding, clickable HUD chips, and
|
|
47
|
+
an opening & ending strip. The entry moved from File to View, and the
|
|
48
|
+
player shortcuts pause while the dialog is open.
|
|
49
|
+
|
|
3
50
|
## 0.11.1
|
|
4
51
|
|
|
5
52
|
- **Fixed:** Video export in the packaged desktop app ("Export video…")
|
package/README.md
CHANGED
|
@@ -70,8 +70,8 @@ telemetry JSON. The look settings carry over between launches.
|
|
|
70
70
|

|
|
71
71
|
|
|
72
72
|
*The desktop app playing a recording: the recording beside the synchronized
|
|
73
|
-
flight map, with the flight trail, drone position and
|
|
74
|
-
timeline.*
|
|
73
|
+
flight map, with the flight trail, drone position and the readout strip on one
|
|
74
|
+
shared timeline.*
|
|
75
75
|
|
|
76
76
|
## Feature requests
|
|
77
77
|
|
package/app/ipc.d.mts
CHANGED
package/app/ipc.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import path from 'node:path';
|
|
|
6
6
|
|
|
7
7
|
import { dialog, ipcMain, shell } from 'electron';
|
|
8
8
|
|
|
9
|
-
import { parsePickRequest,
|
|
9
|
+
import { parsePickRequest, parseTrackSaveRequest } from '../dist/appsession.js';
|
|
10
10
|
import { applyAppState, writeAppState } from '../dist/appstate.js';
|
|
11
11
|
import { APP_ORIGIN, appStateFile } from '../dist/apppaths.js';
|
|
12
12
|
import { parseExportRequest, parseSettingsPatch } from '../dist/config.js';
|
|
@@ -44,11 +44,11 @@ function requireVideo(state) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// The reveal/open guard: the renderer may only name a file this shell wrote
|
|
47
|
-
// (the last export or the last
|
|
47
|
+
// (the last export or the last track file, both set only by trusted
|
|
48
48
|
// handlers), never an arbitrary path.
|
|
49
49
|
function knownOutputOf(state, payload) {
|
|
50
50
|
const out = payload && typeof payload === 'object' ? payload.out : null;
|
|
51
|
-
if (typeof out !== 'string' || (out !== state.lastExportOut && out !== state.
|
|
51
|
+
if (typeof out !== 'string' || (out !== state.lastExportOut && out !== state.lastTrackOut)) {
|
|
52
52
|
throw new Error('unknown output');
|
|
53
53
|
}
|
|
54
54
|
return out;
|
|
@@ -156,8 +156,8 @@ function registerExportHandlers(state, devUrl) {
|
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
function
|
|
160
|
-
handle(devUrl, 'dronepath:
|
|
159
|
+
function registerTrackHandlers(state, devUrl, log) {
|
|
160
|
+
handle(devUrl, 'dronepath:track:pick-output', async () => {
|
|
161
161
|
const video = requireVideo(state);
|
|
162
162
|
// The export dialog's default folder, named after the recording
|
|
163
163
|
// (<basename>.telemetry.json); the typed name selects the format by its
|
|
@@ -177,11 +177,11 @@ function registerTelemetryHandlers(state, devUrl, log) {
|
|
|
177
177
|
defaultExtension: 'json',
|
|
178
178
|
});
|
|
179
179
|
});
|
|
180
|
-
handle(devUrl, 'dronepath:
|
|
180
|
+
handle(devUrl, 'dronepath:track:save', (raw) => {
|
|
181
181
|
requireVideo(state);
|
|
182
|
-
const request =
|
|
183
|
-
state.session.
|
|
184
|
-
state.
|
|
182
|
+
const request = parseTrackSaveRequest(raw);
|
|
183
|
+
state.session.saveTrack(request.outPath, request.range);
|
|
184
|
+
state.lastTrackOut = request.outPath;
|
|
185
185
|
log(`track: wrote ${request.outPath}`);
|
|
186
186
|
return { ok: true };
|
|
187
187
|
});
|
|
@@ -210,7 +210,7 @@ export function registerIpcHandlers(state, { devUrl, log, sendToWindow }) {
|
|
|
210
210
|
registerSessionHandlers(state, devUrl);
|
|
211
211
|
registerSettingsHandlers(state, devUrl, log);
|
|
212
212
|
registerExportHandlers(state, devUrl);
|
|
213
|
-
|
|
213
|
+
registerTrackHandlers(state, devUrl, log);
|
|
214
214
|
registerUpdateHandlers(state, devUrl, sendToWindow);
|
|
215
215
|
registerWindowHandlers(state, devUrl);
|
|
216
216
|
}
|
package/app/main.mjs
CHANGED
|
@@ -71,10 +71,10 @@ function createShellState() {
|
|
|
71
71
|
updates: null,
|
|
72
72
|
// A downloaded update waits even if its announcement raced the renderer.
|
|
73
73
|
updateReady: false,
|
|
74
|
-
// The destinations of the last successful export and the last
|
|
75
|
-
//
|
|
74
|
+
// The destinations of the last successful export and the last track
|
|
75
|
+
// save: the only paths the renderer may reveal or open.
|
|
76
76
|
lastExportOut: null,
|
|
77
|
-
|
|
77
|
+
lastTrackOut: null,
|
|
78
78
|
closePromptOpen: false,
|
|
79
79
|
pendingClose: false,
|
|
80
80
|
};
|
package/app/preload.cjs
CHANGED
|
@@ -14,8 +14,8 @@ contextBridge.exposeInMainWorld('dronepath', {
|
|
|
14
14
|
getSettings: () => ipcRenderer.invoke('dronepath:settings'),
|
|
15
15
|
saveSettings: (patch) => ipcRenderer.invoke('dronepath:settings:save', patch),
|
|
16
16
|
pickExportOutput: () => ipcRenderer.invoke('dronepath:export:pick-output'),
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
pickTrackOutput: () => ipcRenderer.invoke('dronepath:track:pick-output'),
|
|
18
|
+
saveTrack: (request) => ipcRenderer.invoke('dronepath:track:save', request),
|
|
19
19
|
startExport: (request) => ipcRenderer.invoke('dronepath:export:start', request),
|
|
20
20
|
cancelExport: () => ipcRenderer.invoke('dronepath:export:cancel'),
|
|
21
21
|
revealExportOutput: (payload) => ipcRenderer.invoke('dronepath:export:reveal', payload),
|
package/dist/appsession.js
CHANGED
|
@@ -17,23 +17,23 @@ export function parsePickRequest(raw) {
|
|
|
17
17
|
const input = typeof raw === 'object' && raw !== null ? raw : {};
|
|
18
18
|
return { settings: parseAppearanceSettings(input.settings) };
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const TRACK_SAVE_SHAPE = {
|
|
21
21
|
outPath: z.unknown().optional(),
|
|
22
22
|
range: z.unknown().optional(),
|
|
23
23
|
};
|
|
24
|
-
export function
|
|
25
|
-
const request = parseValue(strictShape(
|
|
26
|
-
invalid: 'invalid
|
|
27
|
-
unknownKey: (key) => `unknown
|
|
24
|
+
export function parseTrackSaveRequest(raw) {
|
|
25
|
+
const request = parseValue(strictShape(TRACK_SAVE_SHAPE, {
|
|
26
|
+
invalid: 'invalid track save request',
|
|
27
|
+
unknownKey: (key) => `unknown track save request key ${key}`,
|
|
28
28
|
}), raw);
|
|
29
29
|
const outPath = parseValue(z
|
|
30
|
-
.string({ error: () => 'invalid
|
|
31
|
-
.min(1, { error: () => 'invalid
|
|
30
|
+
.string({ error: () => 'invalid track save request: outPath' })
|
|
31
|
+
.min(1, { error: () => 'invalid track save request: outPath' }), request.outPath);
|
|
32
32
|
try {
|
|
33
33
|
trackFormatOf(outPath);
|
|
34
34
|
}
|
|
35
35
|
catch (e) {
|
|
36
|
-
throw new Error(`invalid
|
|
36
|
+
throw new Error(`invalid track save request: outPath must be a .gpx, .geojson, .kml, .kmz or .json file: ${outPath}`, { cause: e });
|
|
37
37
|
}
|
|
38
38
|
const range = request.range === undefined || request.range === null
|
|
39
39
|
? null
|
|
@@ -112,7 +112,7 @@ export function createAppSession(options) {
|
|
|
112
112
|
},
|
|
113
113
|
getSession: () => prepared?.session ?? null,
|
|
114
114
|
videoPath: () => videoPath,
|
|
115
|
-
|
|
115
|
+
saveTrack(file, range) {
|
|
116
116
|
if (!prepared)
|
|
117
117
|
throw new Error(ERR_NO_RECORDING);
|
|
118
118
|
writeTrackFile(file, { document: prepared.telemetry, track: prepared.track }, range);
|
package/dist/config.js
CHANGED
|
@@ -427,6 +427,20 @@ const LOOK_SETTINGS_KEYS = [
|
|
|
427
427
|
];
|
|
428
428
|
const ENCODE_SETTINGS_KEYS = ['codec', 'quality', 'preset'];
|
|
429
429
|
export const SETTINGS_KEYS = [...LOOK_SETTINGS_KEYS, ...ENCODE_SETTINGS_KEYS];
|
|
430
|
+
/** The look projection every consumer shares; hud is cloned so no caller can
|
|
431
|
+
leak chip state into another owner. */
|
|
432
|
+
export function appearanceOf(config) {
|
|
433
|
+
return {
|
|
434
|
+
style: config.style,
|
|
435
|
+
view: config.view,
|
|
436
|
+
zoom: config.zoom,
|
|
437
|
+
zoomOut: config.zoomOut,
|
|
438
|
+
hud: { ...config.hud },
|
|
439
|
+
introSec: config.introSec,
|
|
440
|
+
outroSec: config.outroSec,
|
|
441
|
+
trailColor: config.trailColor,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
430
444
|
export function settingsPatchOf(config) {
|
|
431
445
|
return {
|
|
432
446
|
style: config.style,
|
package/dist/manual/cliref.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CONFIG_FILE_OPTION, CONFIG_OPTIONS, TELEMETRY_JSON_ALIAS, cliDefaultOf, } from '../config.js';
|
|
2
|
+
import { escapeAngleBrackets } from './markdown.js';
|
|
2
3
|
function defaultCell(key) {
|
|
3
4
|
const value = cliDefaultOf(key);
|
|
4
5
|
if (typeof value === 'boolean')
|
|
@@ -6,7 +7,7 @@ function defaultCell(key) {
|
|
|
6
7
|
return value === '' ? '—' : `\`${value}\``;
|
|
7
8
|
}
|
|
8
9
|
function describe(row) {
|
|
9
|
-
const help = row.cli.help
|
|
10
|
+
const help = escapeAngleBrackets(row.cli.help);
|
|
10
11
|
return row.cli.choices ? `${help} (choices: ${row.cli.choices.join(', ')})` : help;
|
|
11
12
|
}
|
|
12
13
|
export function generateCliReference() {
|
package/dist/manual/markdown.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { Marked } from 'marked';
|
|
2
2
|
import { createSlugger } from './anchors.js';
|
|
3
3
|
import { isExternalTarget, parseImageRef, parsePageLink } from './links.js';
|
|
4
|
+
/** Angle brackets only — for help text that carries no entities (the CLI
|
|
5
|
+
reference renders these as literal angle brackets). */
|
|
6
|
+
export function escapeAngleBrackets(value) {
|
|
7
|
+
return value.replace(/</g, '<').replace(/>/g, '>');
|
|
8
|
+
}
|
|
4
9
|
function escapeHtml(value) {
|
|
5
|
-
return value.replace(/&/g, '&')
|
|
10
|
+
return escapeAngleBrackets(value.replace(/&/g, '&'));
|
|
6
11
|
}
|
|
7
12
|
function escapeAttr(value) {
|
|
8
13
|
return escapeHtml(value).replace(/"/g, '"');
|
package/dist/plan.js
CHANGED
|
@@ -4,6 +4,10 @@ const MIN_ZOOM = 2;
|
|
|
4
4
|
const HOVER_ZOOM_FLOOR = 16;
|
|
5
5
|
const MIN_TRACK_SPAN_PX = 80;
|
|
6
6
|
const TILE_SIZE_PX = 256;
|
|
7
|
+
/** The zoom levels the planner renders: the floor and the map style's tile maximum. */
|
|
8
|
+
export function zoomLimits(style) {
|
|
9
|
+
return { min: MIN_ZOOM, max: TILE_SOURCES[style].maxZoom || 19 };
|
|
10
|
+
}
|
|
7
11
|
function fitZoomToTrack(bbox, availW, availH, maxZoom) {
|
|
8
12
|
for (let zoom = maxZoom; zoom >= MIN_ZOOM; zoom--) {
|
|
9
13
|
const northWest = project(bbox.minLon, bbox.maxLat, zoom);
|
|
@@ -81,7 +85,7 @@ export function planView(bbox, width, height, config) {
|
|
|
81
85
|
bbox,
|
|
82
86
|
width,
|
|
83
87
|
height,
|
|
84
|
-
maxZoom:
|
|
88
|
+
maxZoom: zoomLimits(config.style).max,
|
|
85
89
|
maxNativeZoom: src.maxNativeZoom ?? null,
|
|
86
90
|
zoomOut: config.zoomOut,
|
|
87
91
|
zoomOverride: config.zoom,
|
package/dist/renderer/dom.js
CHANGED
|
@@ -64,7 +64,15 @@ function chipCss(at, theme, scale) {
|
|
|
64
64
|
font-size: 0.55em; font-weight: 700; letter-spacing: 1.2px;
|
|
65
65
|
color: ${theme.core}; opacity: 0.95;
|
|
66
66
|
}
|
|
67
|
-
${at} .chip .unit { font-weight: 500; opacity: 0.72; font-size: 0.68em; }
|
|
67
|
+
${at} .chip .unit { font-weight: 500; opacity: 0.72; font-size: 0.68em; }
|
|
68
|
+
${at} .chip .chip-arrow {
|
|
69
|
+
/* The heading arrow lives in a fixed square slot like the preview chip's,
|
|
70
|
+
so its ink never crowds the pill padding at any rotation angle. */
|
|
71
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
72
|
+
width: ${Math.round(24 * scale)}px; height: ${Math.round(24 * scale)}px;
|
|
73
|
+
font-size: ${Math.round(19 * scale)}px; line-height: 1;
|
|
74
|
+
color: ${theme.core};
|
|
75
|
+
}`;
|
|
68
76
|
}
|
|
69
77
|
function attrCss(at, scale) {
|
|
70
78
|
return `
|
|
@@ -106,6 +114,9 @@ export function sceneCss(src, theme, width, height, scale, scope) {
|
|
|
106
114
|
}
|
|
107
115
|
export function hudMarkup(hud) {
|
|
108
116
|
const chips = [];
|
|
117
|
+
if (hud.heading) {
|
|
118
|
+
chips.push('<div class="chip" id="chip-heading"><span class="label">HDG</span><span class="chip-arrow">▲</span><span class="num">--</span></div>');
|
|
119
|
+
}
|
|
109
120
|
if (hud.alt) {
|
|
110
121
|
chips.push('<div class="chip" id="chip-alt"><span class="label">ALT</span><span class="num">--</span><span class="unit">m</span></div>');
|
|
111
122
|
}
|
|
@@ -114,6 +125,24 @@ export function hudMarkup(hud) {
|
|
|
114
125
|
}
|
|
115
126
|
return chips.map((chip) => ` ${chip}`).join('\n');
|
|
116
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* The app strip's readout columns (#272): both always render so the strip's
|
|
130
|
+
* shape never depends on settings; a disabled chip keeps its column and shows
|
|
131
|
+
* the dimmed "--" placeholder instead of a value. The ids and .num/.unit spans
|
|
132
|
+
* match the export HUD contract, so the scene's value queries work for both.
|
|
133
|
+
*/
|
|
134
|
+
export function stripReadoutMarkup(hud) {
|
|
135
|
+
const column = (id, label, unit, live) => `<div class="map-readout${live ? '' : ' map-readout-off'}" id="chip-${id}">` +
|
|
136
|
+
`<span class="label">${label}</span>` +
|
|
137
|
+
`<span class="value"><span class="num">--</span><span class="unit">${unit}</span></span>` +
|
|
138
|
+
`</div>`;
|
|
139
|
+
return [
|
|
140
|
+
column('speed', 'Speed', 'm/s', hud.speed),
|
|
141
|
+
column('alt', 'Altitude', 'm', hud.alt),
|
|
142
|
+
]
|
|
143
|
+
.map((col) => ` ${col}`)
|
|
144
|
+
.join('\n');
|
|
145
|
+
}
|
|
117
146
|
/** A null hud keeps the chips out of the map frame: the caller mounts them in
|
|
118
147
|
a strip outside the map image instead. */
|
|
119
148
|
export function mapMarkup(hud, attribution) {
|
package/dist/renderer/scene.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TILE_SOURCES } from './tilesources.js';
|
|
2
|
-
import { droneMarkerMarkup, el, hudMarkup, mapMarkup, quietAttributionLinks, sceneCss } from './dom.js';
|
|
2
|
+
import { droneMarkerMarkup, el, hudMarkup, mapMarkup, quietAttributionLinks, sceneCss, stripReadoutMarkup } from './dom.js';
|
|
3
3
|
import { computeScale, introOutroScale, metersPerPixel, scaleBarMeters } from './framemath.js';
|
|
4
4
|
import { themeFor } from './theme.js';
|
|
5
5
|
import { createTrailController } from './trail.js';
|
|
@@ -11,6 +11,10 @@ function setChipText(chip, value, format) {
|
|
|
11
11
|
return;
|
|
12
12
|
chip.textContent = value === null || value === undefined ? '--' : format(value);
|
|
13
13
|
}
|
|
14
|
+
/** A missing value renders exactly like a disabled chip: the dimmed "--". */
|
|
15
|
+
function isPlaceholder(value) {
|
|
16
|
+
return value === null || value === undefined;
|
|
17
|
+
}
|
|
14
18
|
let scopeCount = 0;
|
|
15
19
|
class SceneState {
|
|
16
20
|
ready;
|
|
@@ -32,10 +36,13 @@ class SceneState {
|
|
|
32
36
|
bb;
|
|
33
37
|
layout;
|
|
34
38
|
decor;
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
headingChip = null;
|
|
40
|
+
altChip = null;
|
|
41
|
+
speedChip = null;
|
|
37
42
|
/** Chip container: inside the map frame for exports, or an external strip. */
|
|
38
43
|
hudRoot;
|
|
44
|
+
/** External strips get the column markup; the export frame keeps its pills. */
|
|
45
|
+
externalHud;
|
|
39
46
|
curIdx = 0;
|
|
40
47
|
constructor(host, firstData, L, hudHost) {
|
|
41
48
|
this.host = host;
|
|
@@ -44,8 +51,12 @@ class SceneState {
|
|
|
44
51
|
host.classList.add(this.scopeClass);
|
|
45
52
|
this.styleEl = document.createElement('style');
|
|
46
53
|
document.head.appendChild(this.styleEl);
|
|
47
|
-
|
|
54
|
+
// One definedness rule for both: a caller either supplies the external
|
|
55
|
+
// strip host or gets the in-frame export HUD, never a mix of the two.
|
|
56
|
+
const externalHud = hudHost !== undefined;
|
|
57
|
+
host.innerHTML = mapMarkup(externalHud ? null : firstData.hud, firstData.attribution);
|
|
48
58
|
this.hudRoot = hudHost ?? el(host, '#hud');
|
|
59
|
+
this.externalHud = externalHud;
|
|
49
60
|
this.attrEl = el(host, '#attr');
|
|
50
61
|
this.applyChrome();
|
|
51
62
|
this.mapEl = el(host, '#map');
|
|
@@ -243,10 +254,16 @@ class SceneState {
|
|
|
243
254
|
}
|
|
244
255
|
rebuildHud() {
|
|
245
256
|
// Scoped to the chip container so an external strip and a second scene
|
|
246
|
-
// (the export preview) can never cross-write.
|
|
247
|
-
|
|
248
|
-
this.
|
|
249
|
-
|
|
257
|
+
// (the export preview) can never cross-write. A scene whose caller
|
|
258
|
+
// overlays its own pills draws none of its own (#283).
|
|
259
|
+
this.hudRoot.innerHTML = this.externalHud
|
|
260
|
+
? stripReadoutMarkup(this.data.hud)
|
|
261
|
+
: this.data.hudPills === false
|
|
262
|
+
? ''
|
|
263
|
+
: hudMarkup(this.data.hud);
|
|
264
|
+
this.headingChip = this.hudRoot.querySelector('#chip-heading');
|
|
265
|
+
this.altChip = this.hudRoot.querySelector('#chip-alt');
|
|
266
|
+
this.speedChip = this.hudRoot.querySelector('#chip-speed');
|
|
250
267
|
if (this.decor.arrowEl) {
|
|
251
268
|
this.decor.arrowEl.style.display = this.data.hud.heading ? '' : 'none';
|
|
252
269
|
}
|
|
@@ -272,8 +289,34 @@ class SceneState {
|
|
|
272
289
|
}
|
|
273
290
|
}
|
|
274
291
|
updateHud(i) {
|
|
275
|
-
|
|
276
|
-
|
|
292
|
+
// A disabled chip and a missing sample share one presentation: the dimmed
|
|
293
|
+
// "--" placeholder instead of a value (#272 review).
|
|
294
|
+
this.setReadout(this.altChip, this.data.hud.alt ? this.data.alt[i] : null, (a) => String(Math.round(a)));
|
|
295
|
+
this.setReadout(this.speedChip, this.data.hud.speed ? this.data.speed[i] : null, (s) => s.toFixed(1));
|
|
296
|
+
this.setHeading(this.headingChip, this.data.headingDeg[i]);
|
|
297
|
+
}
|
|
298
|
+
/** The heading pill rotates its arrow like the marker does; a missing
|
|
299
|
+
sample falls back to the dimmed "--", matching the preview chip (#283). */
|
|
300
|
+
setHeading(chip, deg) {
|
|
301
|
+
if (!chip)
|
|
302
|
+
return;
|
|
303
|
+
const missing = deg === null || deg === undefined;
|
|
304
|
+
const arrow = chip.querySelector('.chip-arrow');
|
|
305
|
+
const num = chip.querySelector('.num');
|
|
306
|
+
if (arrow) {
|
|
307
|
+
arrow.style.display = missing ? 'none' : '';
|
|
308
|
+
if (!missing)
|
|
309
|
+
arrow.style.transform = 'rotate(' + deg + 'deg)';
|
|
310
|
+
}
|
|
311
|
+
if (num)
|
|
312
|
+
num.style.display = missing ? '' : 'none';
|
|
313
|
+
}
|
|
314
|
+
setReadout(chip, value, format) {
|
|
315
|
+
if (!chip)
|
|
316
|
+
return;
|
|
317
|
+
setChipText(chip.querySelector('.num'), value, format);
|
|
318
|
+
if (this.externalHud)
|
|
319
|
+
chip.classList.toggle('map-readout-off', isPlaceholder(value));
|
|
277
320
|
}
|
|
278
321
|
setFrame(i) {
|
|
279
322
|
this.curIdx = i;
|
|
@@ -324,7 +367,7 @@ class SceneState {
|
|
|
324
367
|
next.height !== prev.height;
|
|
325
368
|
if (decorInvalidated)
|
|
326
369
|
this.rebuildDecor();
|
|
327
|
-
if (!hudEq(prev.hud, next.hud))
|
|
370
|
+
if (!hudEq(prev.hud, next.hud) || next.hudPills !== prev.hudPills)
|
|
328
371
|
this.rebuildHud();
|
|
329
372
|
this.layoutMap();
|
|
330
373
|
return this.setFrame(this.curIdx);
|
|
@@ -22,3 +22,17 @@ export const TILE_SOURCES = {
|
|
|
22
22
|
maxNativeZoom: 17,
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
|
+
/** Leaflet wants HTML and the map style thumbnails plain text; the thumbnail
|
|
26
|
+
credits derive from these attributions so the wording can never drift. */
|
|
27
|
+
function plainCredit(html) {
|
|
28
|
+
return html
|
|
29
|
+
.replaceAll('©', '©')
|
|
30
|
+
.replace(/<a [^>]+>/g, '')
|
|
31
|
+
.replaceAll('</a>', '')
|
|
32
|
+
.split(' | ')
|
|
33
|
+
.map((part) => part.replace('Style: ', 'Style ')); // the thumbnail wording drops the colon
|
|
34
|
+
}
|
|
35
|
+
export const TILE_CREDITS = [
|
|
36
|
+
...plainCredit(TILE_SOURCES.satellite.attribution),
|
|
37
|
+
...plainCredit(TILE_SOURCES.topo.attribution),
|
|
38
|
+
].join(' · ');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drone-path",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Render flight-path map overlay videos (exactly the source frame rate and frame count) from DJI drone recordings - telemetry from the embedded CAM-meta (DVTM) stream or the .SRT sidecar.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "app/main.mjs",
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
"@types/react": "~19.3.0",
|
|
83
83
|
"@types/react-dom": "~19.3.0",
|
|
84
84
|
"concurrently": "~10.0.7",
|
|
85
|
-
"electron": "~45.
|
|
85
|
+
"electron": "~45.3.1",
|
|
86
86
|
"electron-builder": "~26.18.0",
|
|
87
|
-
"eslint": "~10.
|
|
87
|
+
"eslint": "~10.15.0",
|
|
88
88
|
"eslint-plugin-react-hooks": "~7.1.1",
|
|
89
89
|
"jsdom": "~31.0.1",
|
|
90
|
-
"lucide-react": "~1.
|
|
90
|
+
"lucide-react": "~1.73.0",
|
|
91
91
|
"marked": "~18.2.0",
|
|
92
92
|
"next": "~16.4.6",
|
|
93
93
|
"react": "~19.3.1",
|