mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
Merge origin/main into german/navara
Conflict resolutions:
- src/main.js: upstream's PHOTON_URL place-search setting is read once at
module level and passed as geospatial: { endpoints: { photon } } by
createApplication(), so every engine start of the switch flow gets it; the
old single top-level createStandaloneApplication() call stays removed.
- src/layers/bikeshare/render/cesium/rendering.js: upstream's
publishedCapacity fix applied with this branch's
resolveCapacity(model, capacity, status) signature. The same fix is ported
to src/layers/bikeshare/render/navara.js (record.publishedCapacity, status
polls resolve from it), with a Navara regression test; upstream's
proxyRoute test imports the moved render/cesium/rendering.js.
- src/layers/traffic/flow.js: upstream's nextTask() yield and current()
check kept before the scene is taken from this branch's
_trafficScene?.() ?? _viewer?.scene with its missing-scene return.
- scripts/package-boundaries.json, scripts/format-scope.json: union of both
sides' file lists.
- src/voice/actionSchemas.test.mjs: both history comments kept, payload hash
recomputed for the merged schemas (Sentinel-2 map stack enum plus the
shorter layer alias hint).
- src/hudAltitudeDatum.test.mjs: this branch's engine-based IntelHUD
construction with upstream's placeLabels summary context.
This commit is contained in:
commit
1a1eef0e5c
494 files changed
+28358
-1361
No files matched your search
@@ -118,6 +118,7 @@ export function createRendering({
|
||||
stationName: station.name,
|
||||
point,
|
||||
capacity: parts.model.toNonNegativeInteger(station.capacity),
|
||||
publishedCapacity: parts.model.toNonNegativeInteger(station.capacity),
|
||||
bikesAvailable: null,
|
||||
docksAvailable: null,
|
||||
isInstalled: station.isInstalled,
|
||||
@@ -178,7 +179,12 @@ export function createRendering({
|
||||
if (!record) continue;
|
||||
|
||||
const status = statusMap.get(record.stationId) || null;
|
||||
const capacity = resolveCapacity(parts.model, record.capacity, status);
|
||||
// Resolve from the published capacity, not last poll's derived value.
|
||||
const capacity = resolveCapacity(
|
||||
parts.model,
|
||||
record.publishedCapacity,
|
||||
status,
|
||||
);
|
||||
record.capacity = capacity;
|
||||
|
||||
record.bikesAvailable = parts.model.toNonNegativeInteger(
|
||||
|
||||
@@ -146,6 +146,7 @@ export function createBikeshareNavaraRenderer(engine, context) {
|
||||
show: true,
|
||||
},
|
||||
capacity: parts.model.toNonNegativeInteger(station.capacity),
|
||||
publishedCapacity: parts.model.toNonNegativeInteger(station.capacity),
|
||||
bikesAvailable: null,
|
||||
docksAvailable: null,
|
||||
isInstalled: station.isInstalled,
|
||||
@@ -178,7 +179,12 @@ export function createBikeshareNavaraRenderer(engine, context) {
|
||||
const record = state._stationRenderMap.get(key);
|
||||
if (!record) continue;
|
||||
const status = statusMap.get(record.stationId) || null;
|
||||
record.capacity = resolveCapacity(parts.model, record.capacity, status);
|
||||
// Resolve from the published capacity, not last poll's derived value.
|
||||
record.capacity = resolveCapacity(
|
||||
parts.model,
|
||||
record.publishedCapacity,
|
||||
status,
|
||||
);
|
||||
record.bikesAvailable = parts.model.toNonNegativeInteger(
|
||||
status?.bikesAvailable,
|
||||
);
|
||||
|
||||
@@ -194,3 +194,42 @@ test('station positions sample the visible surface with own point sets excluded'
|
||||
f.layer.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
test('a Navara station without a published capacity re-derives it from every status poll', async () => {
|
||||
const f = fixture();
|
||||
try {
|
||||
f.layer.enable();
|
||||
await settle();
|
||||
const { rendering } = f.renderer;
|
||||
const { model } = f.context.parts;
|
||||
const info = model.parseStationInformation({
|
||||
data: {
|
||||
stations: [
|
||||
{ station_id: 'open', name: 'Open', lat: 30.26, lon: -97.74 },
|
||||
],
|
||||
},
|
||||
});
|
||||
rendering.ensureCityPoints(city, info);
|
||||
const poll = (stations) =>
|
||||
rendering.applyStatusToPoints(
|
||||
city,
|
||||
model.parseStationStatus({ data: { stations } }),
|
||||
);
|
||||
const open = f.context.state._stationRenderMap.get(`${city}:open`);
|
||||
poll([
|
||||
{ station_id: 'open', num_bikes_available: 10, num_docks_available: 20 },
|
||||
]);
|
||||
assert.equal(open.capacity, 30);
|
||||
poll([
|
||||
{ station_id: 'open', num_bikes_available: 4, num_docks_available: 2 },
|
||||
]);
|
||||
assert.equal(open.capacity, 6, 'the second poll is not pinned to 30');
|
||||
assert.equal(
|
||||
f.context.state._stationRenderMap.get(key).capacity,
|
||||
10,
|
||||
'a published capacity is kept',
|
||||
);
|
||||
} finally {
|
||||
f.layer.destroy();
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user