Report model load failures to model sets, and bound the tracked model's retries again

The renderer contract gains an optional event on model draw sets,
`on('loadFailed', (id, message) => ...)`, beside `ready`: a model's url
failed to load, once per failed load. The item stays in the set drawing
what it drew before; removing it and adding it again tries at once. A
renderer that cannot tell a failure may never fire it.

The Cesium draw port fires it once Cesium is done with the frame it
raised the error in, and not for a load that was superseded or whose item
went. The stub fails urls under `stub-fail:`, telling each load once. A
conformance check (`draw.models.loadFailed`) runs on both, with a model
url the dev server does not serve for Cesium.

The flights and military layers use it in place of rewriting every
unloaded model every 5 s. A fleet model whose load failed is removed and
added again 5 s later. The tracked model gets back its per-selection
budget: a failed load is let go and tried again 1.5 s later, and after
three failures the contact stays 2D until another is selected, as
before the models moved onto the draw port. A good load retires the
budget, and a model that loads after all is kept.
This commit is contained in:
Sameh Khamis committed 2026-11-07 19:44:15 -08:00
1 parent 396e7f0deb
commit 5370feb825
23 files changed
+536 -58

No files matched your search

+5 -1
View File
@@ -5,7 +5,8 @@
* layer reads what it pushed (and what the set told it) back from itself.
*
* Write `show` and the placement with {@link showModel} and
* {@link placeModel}; the set's `ready` event sets `ready`. The placement is
* {@link placeModel}; the set's `ready` event sets `ready`, and its
* `loadFailed` event `failedAt`. The placement is
* kept as the column-major frame the model is posed in, the same frame a
* renderer builds from the item's position and heading, so anchors on the
* model can be read from it.
@@ -19,6 +20,8 @@ import { eastNorthUp } from '../geo/frames.js';
* @property {string|null} url The model asset the layer sends.
* @property {boolean} ready Whether the set reported the model loaded and
* posed (`ready`).
* @property {number} failedAt When (epoch ms) the set last reported the
* model's load failed (`loadFailed`); 0 when it has not.
* @property {boolean} show Whether the layer last showed the model.
* @property {boolean} placed Whether the layer has placed it yet.
* @property {Float64Array} matrix Where the layer last placed it: the
@@ -55,6 +58,7 @@ export function createModelRecord({
id,
url,
ready: false,
failedAt: 0,
show: false,
placed: false,
matrix,