Merge remote-tracking branch 'origin/main' into models/three-km-true-size

# Conflicts:
#	docs/CURRENT-STATE.md
This commit is contained in:
Sameh Khamis committed 2026-11-17 15:29:39 -08:00
commit b9cbc42f20
137 files changed
+8267 -688

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
- Generate the Traditional Chinese catalog instead of translating it:
`npm run i18n -- --zh-hant` writes `zh-Hant` from `zh-CN` with OpenCC `s2tw`
and its character corrections, and `npm test` fails, naming the key, when
`zh-Hant` is edited by hand (German, @gekh, #1699).
+7
View File
@@ -0,0 +1,7 @@
- Give counts real plural forms in every language: the wildlife count, the
Data Library list, the News time window, the GhostMaps event age and the
bridge radar range now read "1 Tag" and "7 Tage", «0,75 МОР. МИЛИ» and
«12 МОР. МИЛЬ». Street level words "the view centre" in each language's
grammar, the News heading Latest agrees with the news it heads, and FOCUS,
CONFIRMED and the course readout each have their own translation where one
word served two places (German, @gekh, #1700).
+7
View File
@@ -0,0 +1,7 @@
- Draw contacts by kind: aircraft icons share one size, helicopters turn a
three-frame rotor while airborne or moving, ADS-B ground vehicles get one
amber sprite and ground stations one mast, and vessels get hull sprites by
type plus one buoy. Going back to live keeps contacts on screen and replaces
them by id instead of emptying the map, and 1 min/s playback no longer
stalls waiting for positions. Cesium models move their parts (rotors,
propellers, gear, doors) from the optional model part state (samehkhamis, #1788).
+31 -8
View File
@@ -2291,8 +2291,20 @@ clears nothing. A snapshot that fails clears the time and is asked again after
5 seconds; one the source drops for a newer request (an `AbortError`) is no
failure, and nothing is cleared. A layer has one snapshot loading at a time:
the older is aborted before a newer starts. Moving the view while vessels follow the clock asks for the new
area at the same time. Back at live the contacts are cleared and the layer
polls at once.
area at the same time. Back at live the layer polls at once and keeps the
contacts it shows until that live snapshot answers; it then stands in for every
contact. A contact it has keeps its icon and model: an aircraft eases from
where it is drawn onto its live path (unless that is farther than a jump would
be, 5 km; a placed aircraft over a recovery's time, nose along the way, and a
new answer while that ease runs eases on from where it is then), and a vessel
moves to its live fix. A contact it lacks is judged as a live poll judges any
absence, as last seen at its newest fix rather than when it was loaded: a
partial snapshot keeps only those fixed within five minutes, the tracked
aircraft stays only while its newest fix is under ten minutes old and it has
not landed, the selected vessel is held as a live refresh holds it, and the
rest go at once (no missed-poll grace); the tracked aircraft's trail goes on. A live poll already out when
the clock comes back to live is the one that takes over. A live snapshot that fails, or that brings no
vessels, clears the layer; one dropped for a newer poll clears nothing.
A timeline may also declare `spanMs`: each record of a snapshot at a time then
carries `fixes`, `{ atMs, lat, lon, altitudeM? }` in time order, its own track
@@ -2307,6 +2319,13 @@ those it has keep their place, as their fixes put them. Paused, a time nearing
the end of the fixes after the newest asks for the snapshot there. A contact is not drawn more than a minute before its first
fix, as it was not there yet. Each contact keeps at most 240 fixes, at least
20 seconds apart, and the loaded snapshot times span at most 20 minutes.
Playing on with fixes, the layer asks for the next step 4 seconds of play
ahead at the clock's rate (at least a step; at 60x, 4 minutes ahead), and play
holds only a minute short of where the newest snapshot's fixes end (as far as
nine in ten of its records' fixes reach, at most the declared span; the minute
at most half of it), not at the step still loading. An aircraft keeps the fixes it holds
when the next snapshot's run reaches back over them: only the last of them,
made again from the new run, and the fixes past it are made and added.
A snapshot at `atMs` describes the world as it stood then: `observedAtMs` is
at or before `atMs`, no record is observed later than `atMs`, freshness and
@@ -5782,7 +5801,9 @@ Shipped locales: **en** (source and fallback), **ar**, **de**, **es**, **fr**, *
- **Gate.** `npm run i18n` (and `src/i18n/catalog.test.mjs` under `npm test`)
extracts every message and fails on missing, empty, unused,
placeholder-mismatched, still-English (plural forms included) or
wrongly-shaped plural entries.
wrongly-shaped plural entries. `zh-Hant` is generated from `zh-CN`
(`npm run i18n -- --zh-hant`: OpenCC `s2tw` through `opencc-js`, then a
fixed list of character corrections), and the gate fails when it differs.
- **Not translated by design:** layer ids, share-link and hash parameters, API
fields, voice tool schemas, provider names, feed data (callsigns, vessel and
station names) and attribution.
@@ -7416,7 +7437,7 @@ silently demoting every later lookup for the session.
Mission world text has no native `LabelGraphics`: overview launch markers publish at most 48 ambient candidates for a 24-winner budget, while selecting a mission clears that overview source and publishes its launch-site callout, stage re-entry annotations, live/estimated payload-position readout, and orbit annotation as protected selected-lane entries. The source retains the exact former strings and colors. Static anchors reuse the Cartesian values used to build their mission geometry; the moving payload entry reads the layer's per-frame live-position cache; catalog-backed orbit annotation positions are cached in the same one-second matrix update that realigns the orbit primitive. Keyhole edge fade, horizon culling, final collision placement, and UI exclusion are owned by the shared host. Deselect restores the bounded overview, and refresh, disable, and destroy replace or clear both mission sources.
A selected mission renders its orbit as four repeating tactical sectors, each containing one prominent cyan dot followed by one hundred thin translucent dashes. The bright dots act as orbit anchors while the subdued dash field remains depth-tested against the globe and is shown only for the selected mission.
Close selected-pad views add one static 500 m-radius cyan launch-zone ring with a low-opacity translucent fill over the sampled photoreal launch-site surface. The single scene primitive is created only for the visible selected site and is otherwise dormant. It appears during Focus, sufficiently close manual zoom, and the replay countdown, but is suppressed above 120 km camera altitude, beyond 180 km direct camera-to-pad range, for unselected missions, and whenever Space Missions is inactive. Focus establishes a launch-site-centered camera transform once; subsequent manual heading and pitch changes remain centered on that site without an automated per-frame correction. Surface mission markers and labels use an additional conservative globe-limb margin before the exact ellipsoid occluder boundary, preventing near-horizon visibility from alternating between frames.
- **AIS vessels**: chevron symbology (naval cyan base, type tints), world-space headings, MMSI-keyed reconciliation (selection survives refreshes; pinned 3 refreshes with STALE marker when absent), detection-overlay integration (`type: 'SEA'`; a vessel's callout fades by the painted opacity of its own ambient card, so a card dropped by budget, collisions or UI chrome, or faded at the keyhole rim, leaves the callout readable), contextStore registration for voice Q&A. Empty-space clicks, id-less photorealistic-tile picks, and Escape dismiss the vessel card/HUD/context and clear its trail; picks owned by another layer (including `gev-trail:*`) and raw vessel-record picks without a live MMSI key are no-ops for vessel selection. Click and key handlers detach while the layer is disabled and reinstall on enable. Selecting another vessel replaces the selection and trail, and reconciliation clears a trail if its owning vessel is evicted.
- **AIS vessels**: hull sprites by vessel kind, tinted by type (see the map sprites entry below), world-space headings, MMSI-keyed reconciliation (selection survives refreshes; pinned 3 refreshes with STALE marker when absent), detection-overlay integration (`type: 'SEA'`; a vessel's callout fades by the painted opacity of its own ambient card, so a card dropped by budget, collisions or UI chrome, or faded at the keyhole rim, leaves the callout readable), contextStore registration for voice Q&A. Empty-space clicks, id-less photorealistic-tile picks, and Escape dismiss the vessel card/HUD/context and clear its trail; picks owned by another layer (including `gev-trail:*`) and raw vessel-record picks without a live MMSI key are no-ops for vessel selection. Click and key handlers detach while the layer is disabled and reinstall on enable. Selecting another vessel replaces the selection and trail, and reconciliation clears a trail if its owning vessel is evicted.
- **Track trails**: server accumulates per-MMSI ring buffers (`/api/vessels/track?mmsi=`, Float32+Uint32, 64 samples, 30s/25m thinning); aircraft backfill proxies `/api/flights/track` (OAuth, own credit bucket). Military aircraft keep only their locally accumulated trails: `/api/military/track` validates the hex, then answers `503 history_unavailable` without an upstream request.
- Shared `src/data/pickRegistry.js` stops the two flight layers' click handlers from fighting over the camera.
@@ -8021,8 +8042,10 @@ pins and share links already supply complete boxes.
normal four-samples-per-250-ms budget. Retry timestamps more than the maximum
30-second backoff ahead of the current clock are ignored. A smaller rollback
can retain a bounded retry delay of up to 30 seconds.
- Commercial and military aircraft use the same high-level FLEET model regime: an aircraft draws as its glTF model only within 3 km of the camera (eye to aircraft: `MODEL_ADD_M` = 3,000 m, kept to `MODEL_KEEP_M` = 3,600 m so a contact on the edge does not flicker) and as its icon farther away, controlled by the DISPLAY rail `3D` toggle and `Proximity` / `All` modes. Both modes use the same radius and differ by their caps (`MODEL_MAX` 150, `MODEL_MAX_ALL` 350). Models are drawn at their true size, with no minimum pixel size. The fleet ceiling (`MODEL_ALT_CEIL_M`, 33,600 m) is the highest contact the layers draw (`MODEL_HIGHEST_CONTACT_M`, 30 km) plus the keep radius: above it no contact can be within range, so the eligibility pass is skipped; below it only the distance decides. Every model is one of the project's procedural fleet models (`public/models/fleet/`, MIT, 122 GLBs, about 2 MB in all; `public/models/README.md`), chosen per aircraft by `aircraftModelSpec` (`src/data/fleetModels.js`): the first of its ICAO type's callsign rules in `types.json` (`aircraft_callsign`) its callsign matches, else its type's entry, else the model of its `classifyAircraft` class for a type the map lacks, else its ADS-B emitter category's, else the default airliner. It is drawn LIFE SIZE: the type's published length over the model's built length (`src/layers/flights/modelSpec.js`, shared by Flights, Military Flights and Local ADS-B), and a grounded aircraft stands the model's scaled clearance above the ground. An airport ground vehicle (feed type `ZVEH`) is a fire truck (`FIRE…`), pushback tug (`PUSH…`, `TUG…`), van (`DEICER…`, `SQUID…`, `SQB…`) or else a car by its callsign, and a ground station (`GRND`) is an 11.8 m radio mast; these models (catalog category `other`) are drawn at their built size, and such a contact with no altitude stands on the ground instead of at the airborne default (`src/layers/flights/records.js`). `classifyAircraft` still picks the 2D icons. The whole set loads once, up front, when a layer that draws it starts (`loadFleetModelSet`, which logs `[Fleet] N/122 models (X MB) loaded in N ms`); models are built from those bytes, never fetched mid-session, and an aircraft stays its billboard until the set has loaded. Every aircraft model draws its mesh's own colours (`aircraftModelBlend`, `src/data/aircraftModelLighting.js`): Cesium's `ColorBlendMode.HIGHLIGHT` with white, in Flights, Military Flights and Local ADS-B alike; the tracked colour (cyan, or amber in Military Flights) and the emergency red multiply into the mesh, so its paint still shows. IR boost draws them flat white (`MIX` at `1.0`). Under NVG/FLIR (map preset or Cockpit vision) models render unlit flat-white at full alpha and scene fog is disabled (fog otherwise blacks out distant models with the globe hidden); state restores on exit.
- Vessels, Transit and Rail draw fleet models under the same DISPLAY rail `3D` toggle, at the same altitude ceiling, caps and 3 km add/keep radii as the aircraft, at true size (`FLEET_MODEL_POLICY`, `src/layers/flights/policy.js`; `createFleetModelLayer`, `src/data/fleetModelInstances.js`). A vessel's model follows its AIS ship type and is drawn at its reported length and beam (AIS static dimensions A+B and C+D, now carried on vessel rows as `length` and `beam`), standing at the sea surface, heading by true heading then course. An aid to navigation is not a hull: a vessel record whose type names a buoy, beacon, mark, RACON or light, or whose MMSI is an aid-to-navigation station's (`99MIDxxxx`), is `isAidToNavigation` (`src/data/vesselTypes.js`) and is drawn as the set's `buoys` model of the IALA mark its type names (`aidToNavigationModel`, `src/data/fleetModels.js`: cardinal N/E/S/W, port or starboard hand, preferred channel by its side, safe water, isolated danger, special mark; a beacon, light, light vessel, RACON or reference point with no mark of its own is the special mark), else a red can (`DEFAULT_AID_MODEL`), at its built size and facing north whatever heading it reports. A type is an aid's when it is one of the 32 kinds an aid report names or uses a word for one (buoy, beacon, cardinal, safe water, RACON, lighthouse and so on); a vessel that works on aids (`Buoy Tender`, `Buoy Layer`) is not one. Its icon is a bone-white ringed disc (`AID_TO_NAVIGATION_STYLE`, `src/data/vesselLabels.js`) instead of a chevron, never rotated, and its card, selected card and HUD readout (`src/layers/vessels/cards.js`) show its kind alone, whole, in that colour: no speed or heading, since a fixed mark has neither. AISStream subscribes to `AidsToNavigationReport` (message 21) by default, and the server names each report's aid type code (0 to 31) as its kind (`aidToNavigationTypeName`: `20` is `Cardinal Mark N`) rather than reading it as a ship type, and its name runs on into the report's `NameExtension`. A virtual aid (the report's `VirtualAtoN` flag: a mark broadcast where nothing physical stands) carries `virtual: true` on its row, and on its vessel source record (the live-source contract's `virtual`, `src/sources/live/contract.js`, false unless a source says true; any source may set it). It keeps its disc but never gets a model (`vesselModelSpec` returns null for it, and the vessel layer gathers no model item for it), and its card and readout add `VIRTUAL` after its kind. `aisStreamRows` (`server/providers/vessels/ais-store.js`) puts every vessel ahead of every aid, so a capped request (the layer asks for 12,000 rows) never gives up a ship for a buoy. The `vessels_in_area` tool (and the brief built on it) counts ships only: it leaves aids out of its rows, counts, breakdowns and speed stats. A transit vehicle's model follows its route's GTFS `route_type` when its record carries one and that type is a kind of the vehicle's mode (`types.json` `transit.route_types`: 200 a coach, 101 a high-speed set, 106 a regional DMU, 710 a double-decker), else its layer mode (`transit.modes`: bus, trolleybus, tram, cable car, subway, monorail, rail, funicular, gondola or ferry; a vehicle of `unknown` mode keeps its icon); a fleet hint that overrules the route (a bus on a tram route) leaves the type unused. A monorail and a gondola are raised by their `transit.elevation` lifts. A train's model follows its rail category and mode (rail, metro or tram). The bundled GTFS-Realtime proxy carries no route type, so its vehicles draw their mode's model; a source that adds `routeType` reaches the finer ones. Both stand on the road or rail top they are drawn on, without the 1.5 m `GROUND_FLOOR_LIFT_M` their icons carry, and are painted in their mode or category colour where the model's `_TINT` attribute marks it. A vessel model is clipped at its waterline (one clipping plane per model, at the model origin's horizontal plane), so its hull below the water never shows through a plain globe, which Cesium does not depth-test models against. Under the NVG/FLIR styles (the Flights `irBoost` parameter) these models render unlit flat white, as aircraft models do. Each vehicle's icon stays the visual until its model is loaded, ready and placed; a model is picked as its icon is, and a vehicle drawn as its model keeps its selection card and its place in the detection overlay.
- Commercial and military aircraft use the same high-level FLEET model regime: an aircraft draws as its glTF model only within 3 km of the camera (eye to aircraft: `MODEL_ADD_M` = 3,000 m, kept to `MODEL_KEEP_M` = 3,600 m so a contact on the edge does not flicker) and as its icon farther away, controlled by the DISPLAY rail `3D` toggle and `Proximity` / `All` modes. Both modes use the same radius and differ by their caps (`MODEL_MAX` 150, `MODEL_MAX_ALL` 350). Models are drawn at their true size, with no minimum pixel size. The fleet ceiling (`MODEL_ALT_CEIL_M`, 33,600 m) is the highest contact the layers draw (`MODEL_HIGHEST_CONTACT_M`, 30 km) plus the keep radius: above it no contact can be within range, so the eligibility pass is skipped; below it only the distance decides. Every model is one of the project's procedural fleet models (`public/models/fleet/`, MIT, 122 GLBs, about 2 MB in all; `public/models/README.md`), chosen per aircraft by `aircraftModelSpec` (`src/data/fleetModels.js`): the first of its ICAO type's callsign rules in `types.json` (`aircraft_callsign`) its callsign matches, else its type's entry, else the model of its `classifyAircraft` class for a type the map lacks, else its ADS-B emitter category's, else the default airliner. It is drawn LIFE SIZE: the type's published length over the model's built length (`src/layers/flights/modelSpec.js`, shared by Flights, Military Flights and Local ADS-B), and a grounded aircraft stands the model's scaled clearance above the ground. An airport ground vehicle (feed type `ZVEH`) is a fire truck (`FIRE…`), pushback tug (`PUSH…`, `TUG…`), van (`DEICER…`, `SQUID…`, `SQB…`) or else a car by its callsign, and a ground station (`GRND`) is an 11.8 m radio mast; these models (catalog category `other`) are drawn at their built size, and such a contact with no altitude stands on the ground instead of at the airborne default (`src/layers/flights/records.js`). `classifyAircraft` still picks the 2D icons (see the map sprites entry below). The whole set loads once, up front, when a layer that draws it starts (`loadFleetModelSet`, which logs `[Fleet] N/122 models (X MB) loaded in N ms`); models are built from those bytes, never fetched mid-session, and an aircraft stays its billboard until the set has loaded. Every aircraft model draws its mesh's own colours (`aircraftModelBlend`, `src/data/aircraftModelLighting.js`): Cesium's `ColorBlendMode.HIGHLIGHT` with white, in Flights, Military Flights and Local ADS-B alike; the tracked colour (cyan, or amber in Military Flights) and the emergency red multiply into the mesh, so its paint still shows. IR boost draws them flat white (`MIX` at `1.0`). Under NVG/FLIR (map preset or Cockpit vision) models render unlit flat-white at full alpha and scene fog is disabled (fog otherwise blacks out distant models with the globe hidden); state restores on exit.
- **Map sprites.** Every far-away contact is a white sprite on the 96-unit, nose-up frame of `src/data/aircraftIcons.js`, tinted when it is drawn, so one icon-atlas slot serves every colour and selection state. Sprites are the far level of detail: the handoff to 3D models is unchanged, and no sprite is sized by the contact's length (each layer keeps its own size rules: aircraft ×0.8 on the ground and larger when tracked, vessels by speed). **Aircraft** keep their class glyphs, and every class draws at one size: there is no per-class scale in Flights, Military Flights or Local ADS-B, and each glyph is fitted so its farthest edge sits 44 units from the centre of the 96-unit frame (`BODY_HALF_EXTENT`, re-measured from the rasters by `src/data/aircraftIcons.test.mjs`), so a light aircraft is as big as a quadjet and is told apart by shape. `classifyAircraft` (`src/data/aircraftClass.js`) has two classes that are not aircraft, each with a label: `vehicle` (Airport vehicle: feed type `ZVEH`, ADS-B emitter category `C1` or `C2`, OpenSky category 16 or 17), one van-shaped sprite for every kind, tinted orange amber (`VEHICLE_TINT_CSS`, `#FF8F1F`, apart from the military `#FFB800`), and `station` (Ground station / obstacle: type `GRND`, or the point, cluster and line obstacles of emitter `C3` to `C5` and OpenSky 18 to 20), a radio mast drawn upright, also when tracked. Both are known from a contact's first fix: Flights classes it by the feed's own ground type before any airframe lookup (the early ground-type rule in `src/layers/flights/records.js`) and keeps a feed's emitter category string (`"C1"`) as well as OpenSky's integer one; Local ADS-B classes it by its emitter category. The **helicopter** is a top-down body under a four-blade rotor drawn in three frames 30° apart (`aircraftIcon('helicopter', px, frame)`); four blades repeat every 90°, so the loop is seamless. `rotorFrame` (`src/data/rotorFrames.js`) steps the frames at 10 a second from a phase hashed from the contact's id, so helicopters flying together do not change in step, and holds the middle frame (blades as an X) on the ground. The Flights and Military Flights layers keep the airborne helicopters drawn as their glyph in a map and, on each fleet pass (about 12 a second), write new images only for those in the camera's view, above the horizon and shown, whose frame changed (`_turnRotors`, `src/data/aircraftIconLayer.js`); one judged out of view is not judged again until its frame steps on. The tracked one's billboard is given its new images, and the still frame as soon as it lands. With no airborne helicopter on the map the pass does nothing. Local ADS-B redraws its markers each frame and picks the frame as it does. **Vessels** are drawn as the white hull of their kind (`vesselKind`, `src/data/vesselTypes.js`, by AIS type code or text family: cargo 70–79, tanker 80–89, passenger and ferry 60–69, high-speed 40–49, fishing 30, tug, pilot and service 31, 32, 50, 52–54, sailing 36, pleasure 37, military, law enforcement and rescue 35, 55, 51, and other), bow up and turned with course (`src/data/vesselSprites.js`), tinted by the kind's colour (`VESSEL_KIND_STYLES`, shared with the vessel card's accent; sailing `#b49cff`, pleasure `#ff6f61`, military and law `#a9bccb` and high-speed `#c6ff3d` are their own), white while selected. **Aids to navigation** are one buoy sprite, upright, never turned and with no halo.
- Fleet models with moving parts are posed live (`ModelItem.parts`, capability `modelParts`), by the rules in `src/data/modelPartDrivers.js`, read from each model's part table (`fleetPartTable`, `src/data/fleetModels.js`). Aircraft and helicopters (Flights, Military Flights, Local ADS-B): fans, propellers and rotors turn while airborne or taxiing faster than 1 m/s; the landing gear is down on the ground, comes down between 750 and 600 m above the ground when descending faster than 1 m/s, and otherwise is down below 100 m and up above 300 m; gear doors open over the first quarter of the gear's travel; flaps follow the gear in the air and are up on the ground. Height above the ground is the render altitude over the cached ground floor; where no ground height is known (always for Local ADS-B), the gear is down while the aircraft descends faster than 1 m/s, slower than 85 m/s, below 5,000 m, and up otherwise. Vessels: the radar sweeps while under way (over 0.5 m/s). Transit and rail: wheels roll at the speed drawn, and doors open while stopped at a stop. A model without parts, or a renderer without `modelParts`, draws the model whole, at rest. The bundled fleet set (`public/models/fleet/`) has no part tables yet, so it draws as before.
- Vessels, Transit and Rail draw fleet models under the same DISPLAY rail `3D` toggle, at the same altitude ceiling, caps and 3 km add/keep radii as the aircraft, at true size (`FLEET_MODEL_POLICY`, `src/layers/flights/policy.js`; `createFleetModelLayer`, `src/data/fleetModelInstances.js`). A vessel's model follows its AIS ship type and is drawn at its reported length and beam (AIS static dimensions A+B and C+D, now carried on vessel rows as `length` and `beam`), standing at the sea surface, heading by true heading then course. An aid to navigation is not a hull: a vessel record whose type names a buoy, beacon, mark, RACON or light, or whose MMSI is an aid-to-navigation station's (`99MIDxxxx`), is `isAidToNavigation` (`src/data/vesselTypes.js`) and is drawn as the set's `buoys` model of the IALA mark its type names (`aidToNavigationModel`, `src/data/fleetModels.js`: cardinal N/E/S/W, port or starboard hand, preferred channel by its side, safe water, isolated danger, special mark; a beacon, light, light vessel, RACON or reference point with no mark of its own is the special mark), else a red can (`DEFAULT_AID_MODEL`), at its built size and facing north whatever heading it reports. A type is an aid's when it is one of the 32 kinds an aid report names or uses a word for one (buoy, beacon, cardinal, safe water, RACON, lighthouse and so on); a vessel that works on aids (`Buoy Tender`, `Buoy Layer`) is not one. Its icon is the buoy sprite, tinted bone white (`AID_TO_NAVIGATION_STYLE`, `src/data/vesselLabels.js`), upright and never turned, and its card, selected card and HUD readout (`src/layers/vessels/cards.js`) show its kind alone, whole, in that colour: no speed or heading, since a fixed mark has neither. AISStream subscribes to `AidsToNavigationReport` (message 21) by default, and the server names each report's aid type code (0 to 31) as its kind (`aidToNavigationTypeName`: `20` is `Cardinal Mark N`) rather than reading it as a ship type, and its name runs on into the report's `NameExtension`. A virtual aid (the report's `VirtualAtoN` flag: a mark broadcast where nothing physical stands) carries `virtual: true` on its row, and on its vessel source record (the live-source contract's `virtual`, `src/sources/live/contract.js`, false unless a source says true; any source may set it). It keeps its buoy sprite but never gets a model (`vesselModelSpec` returns null for it, and the vessel layer gathers no model item for it), and its card and readout add `VIRTUAL` after its kind. `aisStreamRows` (`server/providers/vessels/ais-store.js`) puts every vessel ahead of every aid, so a capped request (the layer asks for 12,000 rows) never gives up a ship for a buoy. The `vessels_in_area` tool (and the brief built on it) counts ships only: it leaves aids out of its rows, counts, breakdowns and speed stats. A transit vehicle's model follows its route's GTFS `route_type` when its record carries one and that type is a kind of the vehicle's mode (`types.json` `transit.route_types`: 200 a coach, 101 a high-speed set, 106 a regional DMU, 710 a double-decker), else its layer mode (`transit.modes`: bus, trolleybus, tram, cable car, subway, monorail, rail, funicular, gondola or ferry; a vehicle of `unknown` mode keeps its icon); a fleet hint that overrules the route (a bus on a tram route) leaves the type unused. A monorail and a gondola are raised by their `transit.elevation` lifts. A train's model follows its rail category and mode (rail, metro or tram). The bundled GTFS-Realtime proxy carries no route type, so its vehicles draw their mode's model; a source that adds `routeType` reaches the finer ones. Both stand on the road or rail top they are drawn on, without the 1.5 m `GROUND_FLOOR_LIFT_M` their icons carry, and are painted in their mode or category colour where the model's `_TINT` attribute marks it. A vessel model is clipped at its waterline (one clipping plane per model, at the model origin's horizontal plane), so its hull below the water never shows through a plain globe, which Cesium does not depth-test models against. Under the NVG/FLIR styles (the Flights `irBoost` parameter) these models render unlit flat white, as aircraft models do. Each vehicle's icon stays the visual until its model is loaded, ready and placed; a model is picked as its icon is, and a vehicle drawn as its model keeps its selection card and its place in the detection overlay.
- **Aircraft models skip Cesium's dynamic environment map (2026-10-24).** Flights, Military Flights and Local ADS-B pass `environmentMapOptions: AIRCRAFT_ENVIRONMENT_MAP_OPTIONS` (`{ enabled: false }`, `src/data/aircraftModelLighting.js`) to every drawn model. Otherwise each `Model` renders the sky around it and reads it back from the GPU (`readPixels`) when it is first placed, and again whenever it moves more than 1 km, the scene's atmosphere settings change, or (under sunlight dynamic lighting) an hour of scene time passes (`DynamicEnvironmentMapManager`, Cesium 1.138). The models are lit from Cesium's default spherical harmonics instead, with no specular environment map, so the sky's model-lighting cube map no longer reaches aircraft. `src/data/aircraftModelLighting.test.mjs` pins the option at every drawn model call; every model is built from the fleet set loaded up front, so there is no separate preload.
- The DISPLAY-rail `3D` toggle is the user-facing activation path for both aircraft layers. Their small approved GLBs build their render resources without Cesium's frame-spread job queue, preventing continuous Photorealistic 3D Tiles streaming from starving model readiness; model caps, tracking, camera, and fallback billboards are unchanged.
- **The `3D` toggle DEFAULTS ON in `proximity` on a first run.** Proximity is itself the budget — models appear only within 3 km of the camera and only for the nearest `MODEL_MAX` — so the default costs nothing at globe scale, and `all` remains a deliberate opt-in. A fresh boot runs NO layer-state restoration (`LayerStateCoordinator.start()` returns early with neither a share payload nor stored state), so four independent initializers decide what a first-run operator sees and must agree: `booleanOption('models3d', 'e', true)` in `src/data/layerState.js`, `_models3dEnabled = true` in BOTH flight layers, `this._models3dEnabled = true` in `src/ui/aircraftDisplay.js`, and the `active` / `visible` classes on `#models3d-toggle` / `#models3d-mode-row` in `index.html`. All four are pinned together in `src/data/layerState.test.mjs`. Explicit state still wins: because the codec omits default-valued options, `models3d: false` is now what travels in a link (`lo=…f.e.0`) and restores OFF at both aircraft layers. **Consequence for returning users:** a stored `gev:layer-state:v2` blob is a FULL options snapshot, so a session that wrote one before this change carries `models3d:false` and keeps 3D off until the operator flips it (or clears the key) — the durable snapshot is treated as the recipient's own state, by design.
@@ -8850,8 +8873,8 @@ on purpose:
- **Class.** Each aircraft is classified with `aircraftClass.js` from its
ADS-B emitter category (dump1090 strings: `A1` light, `A3` large, `A7`
rotorcraft; set A/B/C/D = type code 4/3/2/1) and, once known, its adsbdb
ICAO type. Silhouette and per-class scale come from `aircraftIcons.js`
(×0.8 on the ground), tinted magenta.
ICAO type. The silhouette comes from `aircraftIcons.js`, at the one
size every class draws at (×0.8 on the ground), tinted magenta.
- **3D.** The DISPLAY rail's 3D toggle and its proximity/all mode apply: the
layer reads the Flights layer's `models3d` params and uses the same ceiling,
caps, add/keep radii, visible-first eligibility
+4 -1
View File
@@ -102,7 +102,8 @@ Call it before views render. `onLocaleChange` listeners word their text again at
- **Pass literals.** `t('Close')`, not `t(label)` (unless `label` holds a `msg()` value) and never a template literal with `${…}`.
- **Use placeholders, not concatenation.** `t('Flying to {place}…', { place })`, not `t('Flying to') + ' ' + place`. Word order differs between languages.
- **Use `tn()` for counts**, not `count === 1 ? … : …`. Russian has three forms.
- **Give a fallback phrase its own message.** When code has no name to pass and falls back to a phrase ("the view centre", "this spot"), write `t('{source} at the view centre', { source })`, not `t('{source} at {place}', { place: t('the view centre') })`: after a preposition, other languages put the phrase in a case a separately translated phrase does not have.
- **Use `tn()` for counts**, not `count === 1 ? … : …`. Russian has three forms for whole numbers and a fourth for fractions. That includes a number the English writes with a symbol or abbreviation, so both English forms read the same (`tn(hours, 'Last {hours} h', 'Last {hours} h', { hours: formatNumber(hours) })`): other languages inflect the words around it («Última 1 h», «Últimas 24 h»). Fractions take their own form (ru «0,75 МОР. МИЛИ»).
- **Translate the label, not the value.** Layer ids, enums, share-link parameters, API fields, voice tool schemas and feed data (callsigns, vessel and place names) stay as they are; translate only the text shown for them.
- **No `t()` at module top level.** Keep the English in `msg()` and call `t()` when rendering.
- **Numbers and dates** go through `formatNumber`, `formatDate`, `formatRelativeTime` and `formatUtcDayMonth` from `src/i18n/index.js`, which follow the active language.
@@ -119,6 +120,8 @@ npm run i18n -- --prune # drop entries whose English no longer exists
Changing the English changes the key: the old translation goes unused and the new text shows as missing. Add the translation to every `src/i18n/locales/<code>.json` (or ask a translator), prune, and run `npm test`; it fails until every language is complete.
Do not translate `zh-Hant`: it is generated. After `zh-CN`, run `npm run i18n -- --zh-hant` (see [zh-Hant.md](./translations/zh-Hant.md)).
To see a language, open the app with `?lang=ru`, or use the language picker (the globe button in the bottom-right corner).
An empty translation is reported, and so is one left as the English, plural forms included. When English is right on purpose (a code such as CRT, a product name), list it under the language in `src/i18n/same-as-english.json`.
+36
View File
@@ -163,6 +163,42 @@ optional:
- `frame.renderNow()` throws when the frame fails to draw. With
`{ifDue: true}` it runs one tick of the loop now, as the loop's own would
(camera flight, input, clock), and draws only a frame that is due.
- `ModelItem.parts` (capability `modelParts`, `ModelPartState`) poses a
model's moving parts. It applies to a model whose mesh carries a `_PART`
vertex attribute (each vertex's part index) and whose root node's glTF
`extras.parts` is its part table: each part's name, kind (`body`, `spin`,
`hinge`, `slide`, `deploy`, `separable`, `marker`), pivot, axis, limits,
rest and parent. `spin` turns parts at degrees a second, advanced by the
renderer on its own clock (a change of rate goes on from the angle
reached); `deploy` sets parts between stowed (0) and deployed (1);
`poses` moves, turns, hides or highlights a part by name, in the model's
glTF frame (forward −X, up +Y, right −Z). It changes live without loading
the model again. A model without a part table ignores it, and a renderer
without the capability, or that cannot pose parts, draws the model
whole, at rest, as its file draws it: the application runs fully without
it. The maths is `gods-eye-view/render/modelParts` (`partMatrices`:
deploy, then spin, then the pose, then the parent's), so a renderer that
poses parts draws exactly those; with `axisScale` the parts turn rigidly
in the stretched model. The Cesium port lists it and poses parts where
its context is WebGL 2 with floating-point textures, drawing models whole
elsewhere. A posed model gets a custom shader that moves each vertex by
its part's matrix, read from a small texture written in place when the
parts change and each frame a part of a model in view spins (a model out
of view or under 4 pixels across is not turned and asks for no frame),
composed with `maskColor`, `unlit` and `thermal`. A moved part's material
normal (its normal map and back-face flip kept) turns by the inverse
transpose of its matrix, exact under `axisScale`; a hidden part draws
nothing and a highlighted one is mixed toward its colour. A model at rest
keeps the shader it had, and part shaders go with the draw port. Cesium
culls and picks a model by its bounds as its file draws it, so a part
moved outside them (a large `offsetM`) draws only while those bounds are
in view, and is not picked there. The check `draw.models.parts` poses,
hides, moves, clamps and spins the parts of a model built in code
(`render/conformance/partsModel.js`): a move right lands a quarter turn
clockwise of a move forward, a mesh node turned, scaled and moved changes
nothing, a move stretches with `axisScale`, and a slide and a hinge stop
at their limits. The live layers drive it from each vehicle's record
(`src/data/modelPartDrivers.js`).
The Cesium port lists `gpuTiming` where its context has
`EXT_disjoint_timer_query_webgl2`: while anyone listens to frame signals,
+2
View File
@@ -36,6 +36,8 @@ npm run i18n -- --prune # drop entries the code no longer uses
Changing English text changes its key: the old translation becomes unused and the new text shows as missing. Translate it and prune.
Do not translate `zh-Hant`: it is generated. Translate `zh-CN`, then run `npm run i18n -- --zh-hant` (see [zh-Hant.md](./translations/zh-Hant.md)).
## Fixing a translation
Edit `src/i18n/locales/<code>.json` and run `npm run i18n`. To see your change, open the app with `?lang=<code>`.
+1
View File
@@ -66,6 +66,7 @@ Every form must keep `{count}`. For one and two, Arabic names the quantity with
| call sign | رمز النداء |
| vessel, ship | سفينة |
| satellite | قمر صناعي |
| CONFIRMED (sightings chip; a landing) | مؤكَّدة / مؤكَّد |
| launch (rocket) / space mission | إطلاق / مهمة فضائية |
| contact (tracked object) | هدف |
| installation, site / mapped | منشأة، موقع / مرسوم |
+1
View File
@@ -53,6 +53,7 @@ Keep the verb in agreement: «{count} Station meldet» / «{count} Stationen mel
| aircraft / flight / military flights | Luftfahrzeug (HUD and short labels: Flugzeug) / Flug / Militärflüge |
| vessel, ship | Schiff |
| satellite / shell (Starlink) / DENSE | Satellit / Schale / DICHT |
| CURRENTLY OVER (orbit, before a place name) | ÜBERFLUG |
| launch (rocket) / launch site / space mission | Start / Startplatz / Raummission |
| ascent / replay / payload / stage / downrange | Aufstieg / Replay, Wiedergabe / Nutzlast / Stufe / Downrange |
| contact / tracking | Kontakt / Verfolgung |
+2
View File
@@ -45,6 +45,8 @@ The `many` form is the `other` text with «de» after the number: «{count} de c
| aircraft, plane / flight / military flights | aeronave / vuelo / vuelos militares |
| vessel, ship | buque |
| satellite / shell (Starlink) / DENSE | satélite / capa / DENSO |
| FOCUS (the held object; the button) | ENFOQUE / ENFOCAR |
| CONFIRMED (sightings chip; a landing) | CONFIRMADOS / CONFIRMADA |
| launch (rocket) / launch site / space mission | lanzamiento / lugar de lanzamiento / misión espacial |
| ascent / replay / payload / stage | ascenso / repetición / carga útil / etapa |
| contact / tracking | contacto / rastreo |
+2
View File
@@ -49,6 +49,8 @@ The `many` form is the `other` text with « de » (« d' » before a vowel) afte
| aircraft / flight / military flights | aéronef (avion in short copy) / vol / vols militaires |
| vessel, ship / tanker (AIS type) | navire / navire-citerne |
| satellite / shell (Starlink) / DENSE | satellite / couche de la constellation / DENSE |
| FOCUS (the held object; the button) | CENTRÉ / CENTRER |
| CONFIRMED (sightings chip; a landing) | CONFIRMÉES / CONFIRMÉE |
| launch / launch site / space mission | lancement / site de lancement / mission spatiale |
| ascent / replay / payload / stage / downrange | ascension / rejeu / charge utile / étage / distance au sol (DIST. SOL) |
| contact / tracking / track (HUD) | contact / suivi / piste |
+2
View File
@@ -41,6 +41,8 @@ With {count} shown as a digit, `two` and `other` share the plural noun (2 מצל
| aircraft / flight / military flight | מטוס (כלי טיס in class lists) / טיסה / טיסה צבאית |
| vessel / ship / ships | אונייה / אוניות |
| satellite | לוויין |
| FOCUS (the held object; the button) | מוקד / התמקד |
| CONFIRMED (sightings chip; a landing) | מאושרות / מאושר |
| launch (rocket) / space mission | שיגור / משימת חלל |
| contact / tracking | מגע / עקיבה |
| installation / site | מתקן / אתר |
+3
View File
@@ -52,6 +52,9 @@ The `many` form is the `other` text with «di» after the number when a noun fol
| aircraft, plane / flight / military flights | aereo / volo / voli militari |
| vessel, ship | nave |
| satellite / shell (Starlink) / DENSE | satellite / shell / DENSO |
| FOCUS (the held object; the button) | PUNTAMENTO / FOCUS |
| CONFIRMED (sightings chip; a landing) | CONFERMATI / CONFERMATA |
| CURRENTLY OVER (orbit, before a place name) | SORVOLO |
| SPARSE / BALANCED / DENSE (detection modes) | RADO / BILANCIATO / DENSO (agree with «overlay») |
| broadband (Starlink shell) | a banda larga |
| VISUAL (CelesTrak group) | VISIBILI |
+4 -1
View File
@@ -57,6 +57,9 @@ The `many` form is the `other` text with «de» after the number: «{count} de c
| aircraft, plane / flight / military flights | aeronave, avião / voo / voos militares |
| vessel, ship / TANKER (AIS class) | embarcação / NAVIO-TANQUE |
| satellite / shell (Starlink) / DENSE | satélite / camada orbital / DENSO |
| FOCUS (the held object; the button) | FOCO / FOCAR |
| CONFIRMED (sightings chip; a landing) | CONFIRMADOS / CONFIRMADA |
| CURRENTLY OVER (orbit, before a place name) | SOBREVOO |
| SPARSE / BALANCED / DENSE (detection modes) | ESPARSO / EQUILIBRADO / DENSO (o modo) |
| launch (rocket) / launch site / space mission | lançamento / local de lançamento / missão espacial |
| KM DOWNRANGE / EST. DOWNRANGE | KM DO LOCAL DE LANÇAMENTO / EST. PELA DIST. DO LANÇAMENTO |
@@ -89,7 +92,7 @@ The `many` form is the `other` text with «de» after the number: «{count} de c
| detection overlay | sobreposição de detecção |
| pin (Draw tool) / box (Recent Imagery) | marcador / área |
| Cyber (HUD layout, effect) | Ciber |
| heading / course / altitude / ground speed | rumo / curso / altitude / velocidade solo (VELOC. SOLO) |
| heading / course / altitude / ground speed | rumo / curso (a ship's course: rumo) / altitude / velocidade solo (VELOC. SOLO) |
| map heading / bearing (compass, north up) | orientação (do mapa) |
| HDG / BRG / CRS / FOV / DEST / SPD / RANGE | HDG / BRG / CRS / FOV / DEST / SPD / RANGE (unchanged) |
| V/S (vertical speed code) | V/S (unchanged) |
+1 -1
View File
@@ -8,7 +8,7 @@ Catalog: `src/i18n/locales/ru.json`. General rules: [TRANSLATORS.md](../TRANSLAT
- Sentence case, not Title Case: "Live Flights" → «Рейсы в реальном времени».
- Quotes inside Russian text are «ёлочки». Write ё where it belongs: её, ещё, всё.
- In short labels, a standard abbreviation with a period beats a wrapped line: НЕОПРЕД., СЛЕД.
- Units: км, м, км/ч, м/с, уз (knots), фт (feet), ч, мин, с; in UPPERCASE text КМ, М, КМ/С, УЗ, ФТ. MW is МВт in any case. `°` and `%` stay.
- Units: км, м, км/ч, м/с, уз (knots), фт (feet), ч, мин, с; in UPPERCASE text КМ, М, КМ/С, УЗ, ФТ. MW is МВт in any case. `°` and `%` stay. Nautical miles on the bridge radar are «мор. миля», a noun that follows the count: «3 МОР. МИЛИ», «12 МОР. МИЛЬ», «0,75 МОР. МИЛИ».
## Plurals
+1
View File
@@ -53,6 +53,7 @@ Abbreviated units and codes do not change: «{count} MEDD.».
| aircraft / flight / military flights | luftfartyg (short labels: flygplan) / flygning / militärflyg |
| vessel, ship | fartyg |
| satellite / shell (Starlink) | satellit / skal |
| CONFIRMED (sightings chip; a landing) | BEKRÄFTADE / BEKRÄFTAD |
| launch (rocket) / launch site / space mission | uppskjutning / uppskjutningsplats / rymduppdrag |
| contact / tracking | kontakt / följning |
| installation / site | anläggning / plats |
+2 -1
View File
@@ -12,7 +12,7 @@ Translation source: meirm (#312).
- The apostrophe is always ʼ (U+02BC): обʼєкт, звʼязок, памʼять. Not ' or ’.
- Quotes inside Ukrainian text are «ялинки»; a button or layer name inside a sentence goes in them: Увімкніть «Вуличні знімки».
- In short labels, a standard abbreviation with a period beats a wrapped line: ПОПЕР., ДАЛЬН., КАЛІБР.
- Units: км, м, км/год, м/с, вуз (knots), фт (feet), год, хв, с, МГц, дБ, гПа; in UPPERCASE text КМ, М, КМ/С, ВУЗ, ФТ. MW is МВт in any case. `°` and `%` stay. Decimal comma in coordinates written as text: 28,2710° пн. ш.
- Units: км, м, км/год, м/с, вуз (knots), фт (feet), год, хв, с, МГц, дБ, гПа; in UPPERCASE text КМ, М, КМ/С, ВУЗ, ФТ. Nautical miles on the bridge radar are «мор. миля», a noun that follows the count: «3 МОР. МИЛІ», «12 МОР. МИЛЬ», «0,75 МОР. МИЛІ». MW is МВт in any case. `°` and `%` stay. Decimal comma in coordinates written as text: 28,2710° пн. ш.
- Coordinates: пн. ш. / пд. ш. / сх. д. / зх. д.; the HUD hemisphere letters are Пн, Пд, Сх, Зх.
## Plurals
@@ -45,6 +45,7 @@ A `tn()` entry needs four forms. `Intl.PluralRules('uk')` picks:
| aircraft / flight / military flights | літак (short HUD: борт) / рейс / військові рейси |
| vessel, ship / vessels | судно / судна (gen. pl. суден) |
| satellite | супутник |
| CURRENTLY OVER (orbit, before a place name) | ПРОЛІТ |
| launch (rocket) / space mission | запуск / космічна місія |
| ascent (rocket) / booster FLIGHT {n} | виведення / ПОЛІТ {n} (not рейс) |
| contact / tracking | контакт / стеження |
+12 -4
View File
@@ -2,16 +2,24 @@
Catalog: `src/i18n/locales/zh-Hant.json`. General rules: [TRANSLATORS.md](../TRANSLATORS.md).
`zh-Hant` is the Simplified Chinese catalog (`zh-CN`, credited to abiyeenzo, #914, and EDIT-Aeterna, #979) written in Traditional characters with OpenCC character conversion. Wording and terminology are the same as in `zh-CN`: change a term in [zh-CN.md](./zh-CN.md) and the `zh-CN` catalog first, then convert. Only the script differs.
**Do not translate or edit this catalog: it is generated.** `zh-Hant` is the Simplified Chinese catalog (`zh-CN`, credited to abiyeenzo, #914, and EDIT-Aeterna, #979) written in Traditional characters. Wording and terminology are the same as in `zh-CN`; only the script differs. To add or change an entry, edit [zh-CN.md](./zh-CN.md) and the `zh-CN` catalog, then run:
After `s2tw` conversion, fix the characters OpenCC picks wrongly: 年曆史 → 年歷史, 下遊 → 下游, 並道 → 併道, 發佈 → 發布, 公佈 → 公布, 控制檯 → 控制台, and 周 → 週 where it means a week (1 週/秒).
```sh
npm run i18n -- --zh-hant # rewrite zh-Hant.json from zh-CN.json
```
`npm test` fails when `zh-Hant.json` differs from the conversion of `zh-CN.json`, naming the entry, and `npm run i18n -- --missing zh-Hant` points to this command instead of printing a template.
The command converts with OpenCC `s2tw` ([opencc-js](https://github.com/nk2028/opencc-js), `cn` → `tw`), which changes characters only. Never `s2twp`: it also swaps in Taiwan vocabulary (影片, 伺服器, 載入, 圖示), which this catalog does not use. After the conversion it fixes the characters OpenCC picks wrongly here: 年曆史 → 年歷史, 下遊 → 下游, 並道 → 併道 (only in entries whose English key says merge), 發佈 → 發布, 公佈 → 公布, 宣佈 → 宣布, 控制檯 → 控制台, 箇中 → 個中 (全部 {n} 個中), and 周 → 週 in ` 周/秒` (1 週/秒, weeks per second). OpenCC writes 週 itself in 每週, 本週, 上週, 一週 and 兩週, but not after a number (過去 2 周, {count} 周前): a new string like that needs its own pair. The list is `ZH_HANT_CORRECTIONS` in `scripts/i18n.mjs`; when the conversion picks another wrong character, add the pair there (with a key pattern if it is right only in some entries) and run the command.
An entry `zh-CN` keeps in English on purpose needs the same line under `zh-Hant` in `src/i18n/same-as-english.json`.
## Style
- Follow [zh-CN.md](./zh-CN.md) for wording, punctuation, spacing, units and the glossary, written in Traditional characters.
- Wording, punctuation, spacing, units and the glossary are those of [zh-CN.md](./zh-CN.md), written in Traditional characters.
- Relative-time placeholders may already include 前. In `LIVE · updated {age}`, the caller supplies the complete relative age; do not append another 前.
- The picker displays 中文(繁體) / Chinese (Traditional); explicit Hans tags select Simplified Chinese.
## Plurals
`Intl.PluralRules('zh-Hant')` uses only `other`. Keep the measure words of the `zh-CN` entry: 「{count} 架飛機」、「{count} 艘船」.
`Intl.PluralRules('zh-Hant')` uses only `other`. The measure words come from the `zh-CN` entry: 「{count} 架飛機」、「{count} 艘船」.
+8
View File
@@ -34,6 +34,7 @@
"@vue/test-utils": "^2.5.1",
"flag-icons": "7.5.0",
"happy-dom": "^20.14.6",
"opencc-js": "1.4.2",
"prettier": "3.9.6",
"puppeteer": "^25.16.0",
"sharp": "^0.35.4",
@@ -2990,6 +2991,13 @@
"node": ">= 0.8"
}
},
"node_modules/opencc-js": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/opencc-js/-/opencc-js-1.4.2.tgz",
"integrity": "sha512-EdcspgdROiCCZDM+jZR6Pa670xW+EW2QhctPBQ8gRjg6lrx4IHEl+2s+kt5izk/TkxVRgdWuFgaGkaEdIUfdaw==",
"dev": true,
"license": "MIT AND Apache-2.0"
},
"node_modules/pako": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
+2
View File
@@ -90,6 +90,7 @@
"@vue/test-utils": "^2.5.1",
"flag-icons": "7.5.0",
"happy-dom": "^20.14.6",
"opencc-js": "1.4.2",
"prettier": "3.9.6",
"puppeteer": "^25.16.0",
"sharp": "^0.35.4",
@@ -343,6 +344,7 @@
"./render/vectorBase": "./src/render/vectorBase/index.js",
"./render/iconSegment": "./src/data/iconSegment.js",
"./render/recession": "./src/render/recession.js",
"./render/modelParts": "./src/render/modelParts.js",
"./render/windStreamlines": "./src/layers/wind/streamlines.js",
"./render/weather": "./src/render/weather.js",
"./weather/effects": "./src/weatherEffectsMath.js",
+151 -12
View File
@@ -3,17 +3,21 @@
// npm run i18n check every catalog and find unmarked UI text
// npm run i18n -- --prune also drop entries the code no longer uses
// npm run i18n -- --missing ru print what ru lacks, as JSON to translate
// npm run i18n -- --zh-hant rewrite zh-Hant from zh-CN (see toZhHant)
//
// A translation left as the English fails unless src/i18n/same-as-english.json
// lists it.
// lists it. zh-Hant is not translated: it is generated from zh-CN, and the
// check fails when it differs.
//
// Messages are the English literals passed to t(), tn() and msg() in src/,
// plus the markup opted in with data-i18n* in index.html and the Vue views.
// It also lists UI text that is not marked at all (see findUnmarked).
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { execFileSync } from 'node:child_process';
import { createRequire } from 'node:module';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { isDeepStrictEqual } from 'node:util';
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const LOCALES_DIR = path.join(ROOT, 'src/i18n/locales');
@@ -510,10 +514,11 @@ export function readCatalog(locale) {
return JSON.parse(readFileSync(catalogPath(locale), 'utf8'));
}
/** Sorted: git lists untracked files first, and main needs zh-CN before zh-Hant. */
export function shippedLocales() {
return trackedFiles('src/i18n/locales/*.json').map((file) =>
path.basename(file, '.json'),
);
return trackedFiles('src/i18n/locales/*.json')
.map((file) => path.basename(file, '.json'))
.sort();
}
/** Messages a locale keeps exactly as in English, on purpose. */
@@ -532,7 +537,9 @@ const blank = (value) => value.trim() === '';
const hasLetters = (value) => /\p{L}{2}/u.test(value.replace(/\{[^}]*\}/g, ''));
const STILL_ENGLISH = (text, locale) =>
`"${text}" is still English: translate it, or list it under "${locale}" in src/i18n/same-as-english.json`;
locale === ZH_HANT
? `"${text}" is still English: translate it in ${ZH_HANT_SOURCE} and run ${ZH_HANT_COMMAND}, or list it under "${ZH_HANT}" in src/i18n/same-as-english.json as under "${ZH_HANT_SOURCE}"`
: `"${text}" is still English: translate it, or list it under "${locale}" in src/i18n/same-as-english.json`;
/**
* Compare one catalog with the extracted messages.
@@ -619,16 +626,138 @@ export function missingTemplate(locale, catalog, messages) {
return out;
}
// zh-Hant is zh-CN in Traditional characters (docs/translations/zh-Hant.md):
// the same wording, only the script differs. OpenCC s2tw (opencc-js, cn → tw)
// converts characters only; s2twp would also swap in Taiwan vocabulary
// (影片, 伺服器, 載入), which the catalog does not use.
const ZH_HANT = 'zh-Hant';
const ZH_HANT_SOURCE = 'zh-CN';
const ZH_HANT_COMMAND = 'npm run i18n -- --zh-hant';
// Characters s2tw picks wrongly in this text, replaced after the conversion.
// A pair with a third item applies only to entries whose English key matches it.
const ZH_HANT_CORRECTIONS = [
['年曆史', '年歷史'],
['下遊', '下游'],
// 併道 is merging lanes; elsewhere 並 (and) stays before 道路, 道謝 and the like.
['並道', '併道', /\bmerge\b/i],
['發佈', '發布'],
['公佈', '公布'],
['宣佈', '宣布'],
['控制檯', '控制台'],
// 個 after a count ({n} 个中, of {n}), not the literary 箇中.
['箇中', '個中'],
// 周 as a week: the time-lapse speed in weeks per second.
[' 周/秒', ' 週/秒'],
];
let s2tw;
// Loaded on first use, so extracting messages needs no node_modules
// (stale-index.test.mjs); main reports a missing package as a zh-Hant error.
function converter() {
try {
s2tw ??= createRequire(import.meta.url)('opencc-js/cn2t').Converter({
from: 'cn',
to: 'tw',
});
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') throw error;
throw new Error('opencc-js is not installed: run npm ci', { cause: error });
}
return s2tw;
}
export function toZhHant(text, key = '') {
return ZH_HANT_CORRECTIONS.reduce(
(out, [wrong, right, keys]) =>
!keys || keys.test(key) ? out.replaceAll(wrong, right) : out,
converter()(text),
);
}
/** The zh-Hant catalog for a zh-CN catalog: the same keys in the same order. */
export function zhHantCatalog(zhCN) {
const convert = (entry, text) => {
if (typeof entry === 'string') return toZhHant(entry, text);
if (entry && typeof entry === 'object')
return Object.fromEntries(
Object.entries(entry).map(([category, form]) => [
category,
convert(form, text),
]),
);
return entry;
};
return Object.fromEntries(
Object.entries(zhCN).map(([text, entry]) => [text, convert(entry, text)]),
);
}
/**
* Where a zh-Hant catalog is not the conversion of the zh-CN one.
* @param {Set<string>} [reported] Keys already reported missing from zh-Hant.
* @returns {string[]} One error per entry, naming its key.
*/
export function checkZhHant(zhCN, zhHant, reported = new Set()) {
const expected = zhHantCatalog(zhCN);
const fix = `zh-Hant is generated: edit ${ZH_HANT_SOURCE}, then run ${ZH_HANT_COMMAND}`;
const errors = [];
for (const [text, entry] of Object.entries(expected)) {
if (!Object.hasOwn(zhHant, text)) {
if (!reported.has(text))
errors.push(`"${text}" is in ${ZH_HANT_SOURCE} but not here. ${fix}`);
} else if (!isDeepStrictEqual(zhHant[text], entry))
errors.push(
`"${text}" is ${JSON.stringify(zhHant[text])}, not ${ZH_HANT_SOURCE} converted (${JSON.stringify(entry)}). ${fix}`,
);
}
for (const text of Object.keys(zhHant)) {
if (!Object.hasOwn(expected, text))
errors.push(`"${text}" is not in ${ZH_HANT_SOURCE}. ${fix}`);
}
const order = Object.keys(expected);
const keys = Object.keys(zhHant);
if (!errors.length && keys.length === order.length) {
const at = order.findIndex((text, i) => keys[i] !== text);
if (at >= 0)
errors.push(
`entries leave the ${ZH_HANT_SOURCE} order at "${order[at]}": run ${ZH_HANT_COMMAND}`,
);
}
return errors;
}
const serialize = (catalog) => `${JSON.stringify(catalog, null, 2)}\n`;
export function writeZhHant() {
const catalog = zhHantCatalog(readCatalog(ZH_HANT_SOURCE));
writeFileSync(catalogPath(ZH_HANT), serialize(catalog));
return Object.keys(catalog).length;
}
function main(args) {
const messages = extractMessages();
const missingFor = args.includes('--missing')
? args[args.indexOf('--missing') + 1]
: null;
if (missingFor?.toLowerCase() === ZH_HANT.toLowerCase()) {
console.error(
`${ZH_HANT} is generated, not translated: add the entries to ${ZH_HANT_SOURCE} (npm run i18n -- --missing ${ZH_HANT_SOURCE}), then run ${ZH_HANT_COMMAND}`,
);
return 1;
}
if (missingFor) {
const out = missingTemplate(missingFor, readCatalog(missingFor), messages);
console.log(JSON.stringify(out, null, 2));
return 0;
}
if (args.includes('--zh-hant')) {
const count = writeZhHant();
console.log(
`${ZH_HANT}: wrote ${count} entries converted from ${ZH_HANT_SOURCE}`,
);
}
let failed = false;
for (const locale of shippedLocales()) {
let catalog = readCatalog(locale);
@@ -637,10 +766,7 @@ function main(args) {
catalog = Object.fromEntries(
Object.entries(catalog).filter(([text]) => messages.has(text)),
);
writeFileSync(
catalogPath(locale),
`${JSON.stringify(catalog, null, 2)}\n`,
);
writeFileSync(catalogPath(locale), serialize(catalog));
console.log(`${locale}: pruned ${stale.length} unused entries`);
} else if (stale.length) {
failed = true;
@@ -649,11 +775,24 @@ function main(args) {
);
for (const text of stale) console.log(` ${JSON.stringify(text)}`);
}
// shippedLocales() is sorted, so --prune has already pruned zh-CN.
const zhCN = locale === ZH_HANT ? readCatalog(ZH_HANT_SOURCE) : null;
if (zhCN) {
try {
errors.push(...checkZhHant(zhCN, catalog, new Set(missing)));
} catch (error) {
if (error.cause?.code !== 'MODULE_NOT_FOUND') throw error;
errors.push(error.message);
}
}
if (missing.length) {
failed = true;
console.log(
`${locale}: ${missing.length} missing (npm run i18n -- --missing ${locale}):`,
);
const fill = !zhCN
? `npm run i18n -- --missing ${locale}`
: missing.every((text) => Object.hasOwn(zhCN, text))
? `run ${ZH_HANT_COMMAND}`
: `add them to ${ZH_HANT_SOURCE}, then ${ZH_HANT_COMMAND}`;
console.log(`${locale}: ${missing.length} missing (${fill}):`);
for (const text of missing)
console.log(` ${JSON.stringify(text)} ${messages.get(text).where}`);
}
+49 -1
View File
@@ -13,6 +13,7 @@
"src/render/cesium/camera.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/iconAtlas.js",
"src/data/iconSet.js",
@@ -285,6 +286,7 @@
"src/ui/views/panels/SatelliteGroundView.vue",
"src/data/vesselTypes.js",
"src/data/fleetModels.js",
"src/render/modelParts.js",
"src/ui/views/panels/AircraftModelHero.vue"
],
"external": ["vue", "pinia", "vue-i18n"]
@@ -1150,6 +1152,7 @@
"src/render/cesium/camera.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/motionModel.js",
"src/data/iconAtlas.js",
@@ -1344,6 +1347,7 @@
"src/data/bundledJson.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/motionModel.js",
"src/geo/julian.js",
@@ -1733,6 +1737,7 @@
"src/render/cesium/camera.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/motionModel.js",
"src/data/iconSet.js",
@@ -1872,10 +1877,13 @@
"civil-flights": {
"exports": ["./layers/flights"],
"modules": [
"src/data/rotorFrames.js",
"src/data/fleetModels.js",
"src/render/modelParts.js",
"src/data/vesselTypes.js",
"src/data/fleetTrailAnchors.js",
"src/data/fleetModelInstances.js",
"src/data/modelPartDrivers.js",
"src/data/headingDegrees.js",
"src/i18n/marker.js",
"src/cyberSonar.js",
@@ -2018,12 +2026,15 @@
"military-flights": {
"exports": ["./layers/military"],
"modules": [
"src/data/rotorFrames.js",
"src/layers/flights/modelSpec.js",
"src/layers/flights/policy.js",
"src/data/fleetModels.js",
"src/render/modelParts.js",
"src/data/vesselTypes.js",
"src/data/fleetTrailAnchors.js",
"src/data/fleetModelInstances.js",
"src/data/modelPartDrivers.js",
"src/data/headingDegrees.js",
"src/i18n/marker.js",
"src/cyberSonar.js",
@@ -2198,10 +2209,15 @@
"vessel-layer": {
"exports": ["./layers/vessels"],
"modules": [
"src/data/units.js",
"src/render/color.js",
"src/data/vesselSprites.js",
"src/data/fleetModels.js",
"src/render/modelParts.js",
"src/data/aircraftClass.js",
"src/i18n/marker.js",
"src/data/fleetModelInstances.js",
"src/data/modelPartDrivers.js",
"src/data/aircraftModelLighting.js",
"src/data/modelEligibility.js",
"src/data/fleetTrailAnchors.js",
@@ -2393,6 +2409,7 @@
"src/data/iconAtlas.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/render/motion/iconMotion.js",
"src/render/cesium/heights.js",
"src/render/baseTilesets.js",
@@ -2451,6 +2468,7 @@
"src/render/cesium/tileRequests.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/motionModel.js",
"src/geo/julian.js",
@@ -2616,6 +2634,7 @@
"src/render/cesium/drawQuads.js",
"src/render/cesium/drawMeshes.js",
"src/render/cesium/drawModels.js",
"src/render/modelParts.js",
"src/render/recession.js",
"src/geo/polyline.js",
"src/render/cesium/gpuIcons.js",
@@ -2714,6 +2733,7 @@
"src/render/cesium/camera.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/iconSet.js",
"src/geo/horizon.js",
@@ -2805,6 +2825,7 @@
"src/render/cesium/camera.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/motionModel.js",
"src/geo/julian.js",
@@ -2905,6 +2926,7 @@
"src/render/cesium/camera.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/iconAtlas.js",
"src/data/motionModel.js",
@@ -3133,6 +3155,7 @@
"src/render/rendererOf.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/iconSet.js",
"src/geo/horizon.js",
"src/data/aircraftRecession.js",
@@ -3322,6 +3345,7 @@
"src/render/cesium/drawQuads.js",
"src/render/cesium/drawMeshes.js",
"src/render/cesium/drawModels.js",
"src/render/modelParts.js",
"src/render/recession.js",
"src/geo/polyline.js",
"src/render/cesium/gpuIcons.js",
@@ -3415,6 +3439,7 @@
"src/render/cesium/credits.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/iconSet.js",
"src/geo/horizon.js",
@@ -3647,6 +3672,7 @@
"src/render/cesium/camera.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/iconSet.js",
"src/geo/horizon.js",
@@ -3850,6 +3876,7 @@
"src/render/baseTilesets.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/iconSet.js",
"src/geo/horizon.js",
@@ -4061,6 +4088,9 @@
"./standalone/catalog"
],
"modules": [
"src/data/units.js",
"src/data/vesselSprites.js",
"src/data/rotorFrames.js",
"src/render/stub/viewRectangle.js",
"src/render/stub/math.js",
"src/render/cesium/controlledCamera.js",
@@ -4076,8 +4106,10 @@
"src/data/aircraftIconLayer.js",
"src/data/fixCurve.js",
"src/data/aircraftModelLayer.js",
"src/data/modelPartDrivers.js",
"src/data/aircraftMotionRegime.js",
"src/data/fleetModels.js",
"src/render/modelParts.js",
"src/data/fleetTrailAnchors.js",
"src/data/fleetModelInstances.js",
"src/app/layers/fleetModels.js",
@@ -5462,14 +5494,19 @@
"application-layer-construction": {
"exports": ["./application/layers"],
"modules": [
"src/data/units.js",
"src/data/vesselSprites.js",
"src/data/rotorFrames.js",
"src/layers/flights/icons.js",
"src/data/aircraftIconLayer.js",
"src/data/fixCurve.js",
"src/data/aircraftModelLayer.js",
"src/data/modelPartDrivers.js",
"src/data/aircraftMotionRegime.js",
"src/geo/julian.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/iconSet.js",
"src/data/iconSegment.js",
"src/data/iconAtlas.js",
@@ -6309,6 +6346,7 @@
"src/render/cesium/camera.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/iconSet.js",
"src/geo/horizon.js",
@@ -6468,6 +6506,7 @@
"src/render/cesium/camera.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/iconSet.js",
"src/geo/horizon.js",
@@ -6678,6 +6717,7 @@
"src/data/aircraftClass.js",
"src/data/aircraftEmergency.js",
"src/data/fleetModels.js",
"src/render/modelParts.js",
"src/data/vesselTypes.js",
"src/data/fleetTrailAnchors.js",
"src/data/courseFromFixes.js"
@@ -7095,10 +7135,12 @@
"exports": ["./layers/transit/standalone"],
"modules": [
"src/data/fleetModels.js",
"src/render/modelParts.js",
"src/data/vesselTypes.js",
"src/data/aircraftClass.js",
"src/i18n/marker.js",
"src/data/fleetModelInstances.js",
"src/data/modelPartDrivers.js",
"src/data/modelEligibility.js",
"src/data/fleetTrailAnchors.js",
"src/data/aircraftModelLighting.js",
@@ -7248,8 +7290,10 @@
"modules": [
"src/i18n/marker.js",
"src/data/fleetModels.js",
"src/render/modelParts.js",
"src/data/vesselTypes.js",
"src/data/fleetModelInstances.js",
"src/data/modelPartDrivers.js",
"src/data/aircraftClass.js",
"src/data/aircraftModelLighting.js",
"src/data/fleetTrailAnchors.js",
@@ -7637,6 +7681,7 @@
"src/render/cesium/drawHit.js",
"src/render/cesium/iconSetPrimitive.js",
"src/render/recession.js",
"src/render/modelParts.js",
"src/data/aircraftRecession.js",
"src/data/motionModel.js",
"src/data/iconSet.js",
@@ -8051,6 +8096,7 @@
"./render/vectorBase",
"./render/iconSegment",
"./render/recession",
"./render/modelParts",
"./render/windStreamlines",
"./geo/screenCluster"
],
@@ -8073,6 +8119,7 @@
"src/render/input/wheel.js",
"src/render/conformance/expect.js",
"src/render/conformance/checks/ports.js",
"src/render/conformance/partsModel.js",
"src/render/stub/math.js",
"src/geo/index.js",
"src/geo/julian.js",
@@ -8101,7 +8148,8 @@
"src/data/motionModel.js",
"src/layers/wind/streamlines.js",
"src/layers/wind/model.js",
"src/render/recession.js"
"src/render/recession.js",
"src/render/modelParts.js"
],
"external": ["pbf", "@mapbox/vector-tile", "kdbush"]
},
+6 -6
View File
@@ -29,7 +29,7 @@
* E4 diversity : ≥5 distinct glyph data-URIs displayed ambiently after
* enrichment (expected: 8)
* E5 glyphs : every billboard's image === aircraftIcon(classify(typeCode))
* E6 scales : every billboard's scale === CLASS_SCALE_2D[klass]
* E6 scales : every billboard's scale === 1, whatever its class
* E7 bounds : ≤4 concurrent requests, ≥185 ms between dispatches (≤5/s
* drip), total ≤300 (budget ceiling)
* E8 next poll : another poll neither reverts glyphs nor re-requests hexes
@@ -53,7 +53,7 @@
import fs from 'node:fs';
import path from 'node:path';
import puppeteer from 'puppeteer';
import { classifyAircraft, CLASS_SCALE_2D } from '../src/data/aircraftClass.js';
import { classifyAircraft } from '../src/data/aircraftClass.js';
import { aircraftIcon } from '../src/data/aircraftIcons.js';
// ---------------------------------------------------------------------------
@@ -362,7 +362,7 @@ async function main() {
const bb = beforeById.get(hex);
if (!bb) baselineBad.push(`${hex}:missing`);
else if (bb.image !== AIRLINER_ICON) baselineBad.push(`${hex}:not-default-glyph`);
else if (Math.abs(bb.scale - (CLASS_SCALE_2D.airliner || 1)) > 1e-9) baselineBad.push(`${hex}:scale=${bb.scale}`);
else if (Math.abs(bb.scale - 1) > 1e-9) baselineBad.push(`${hex}:scale=${bb.scale}`);
}
record('E2 baseline: all 12 category-0 planes default to the airliner glyph',
baselineBad.length === 0,
@@ -415,13 +415,13 @@ async function main() {
for (const [hex, klass] of expected) {
const bb = afterById.get(hex);
const wantImg = aircraftIcon(klass);
const wantScale = CLASS_SCALE_2D[klass] || 1;
const wantScale = 1;
if (!bb || bb.image !== wantImg) glyphBad.push(`${hex}(${klass})${bb ? ':wrong-image' : ':missing'}`);
if (bb && Math.abs(bb.scale - wantScale) > 1e-9) scaleBad.push(`${hex}: ${bb.scale} != ${wantScale}`);
}
record('E5 glyphs: every billboard matches aircraftIcon(classify(typeCode))',
glyphBad.length === 0, glyphBad.length ? glyphBad.join(' ') : `${expected.size} matched (incl. the found:false miss staying airliner)`);
record('E6 scales: every billboard has its per-class CLASS_SCALE_2D',
record('E6 scales: every billboard has the one fleet scale',
scaleBad.length === 0, scaleBad.length ? scaleBad.join(' ') : 'all scales exact (composes with scaleByDistance)');
await page.screenshot({ path: path.join(SHOT_DIR, 'enrich-after-diverse.png') });
@@ -469,7 +469,7 @@ async function main() {
for (const [hex, klass] of expected) {
const bb = afterPollById.get(hex);
if (!bb || bb.image !== aircraftIcon(klass)) pollBad.push(`${hex}(${klass})${bb ? ':reverted' : ':missing'}`);
else if (Math.abs(bb.scale - (CLASS_SCALE_2D[klass] || 1)) > 1e-9) pollBad.push(`${hex}:scale-reverted`);
else if (Math.abs(bb.scale - 1) > 1e-9) pollBad.push(`${hex}:scale-reverted`);
}
const noReRequests = afterPoll.starts === Object.keys(TYPES).length;
record('E8 next poll: enriched glyphs persist and no hex is re-requested',
+5 -5
View File
@@ -13,8 +13,8 @@
* B1 ingest : both layers ingest the synthetic planes
* B2 billboards : every fleet billboard carries EXACTLY the expected
* per-class glyph (image data-URI === aircraftIcon(klass),
* imported from src) and per-class scale (flights:
* CLASS_SCALE_2D; military: 0.7 × CLASS_SCALE_2D)
* imported from src) and one scale for every class
* (flights: 1; military: 0.7)
* B3 models : with 3D on, fleet Cesium.Model.scale === the life-size
* scale of the fleet model the aircraft's type or category
* selects (aircraftModelSpec) per icao; tracked too
@@ -33,7 +33,7 @@ import fs from 'node:fs';
import path from 'node:path';
import puppeteer from 'puppeteer';
import { stubPlanespotters } from './qa-photo-stub.mjs';
import { classifyAircraft, CLASS_SCALE_2D } from '../src/data/aircraftClass.js';
import { classifyAircraft } from '../src/data/aircraftClass.js';
import { aircraftModelSpec } from '../src/data/fleetModels.js';
// Every aircraft draws its fleet model life size: its type's length over the
// model's built length, chosen by type code (military) or category (flights).
@@ -381,14 +381,14 @@ async function main() {
for (const [id, klass] of expectedFlights) {
const bb = bbById.get(id);
const wantImg = aircraftIcon(klass);
const wantScale = CLASS_SCALE_2D[klass] || 1;
const wantScale = 1;
if (!bb || bb.image !== wantImg) glyphBad.push(`${id}(${klass})${bb ? ':wrong-image' : ':missing'}`);
if (bb && Math.abs(bb.scale - wantScale) > 1e-9) scaleBad.push(`${id}: ${bb.scale} != ${wantScale}`);
}
for (const [id, klass] of expectedMilitary) {
const bb = bbById.get(id);
const wantImg = aircraftIcon(klass);
const wantScale = MIL_BILLBOARD_SCALE * (CLASS_SCALE_2D[klass] || 1);
const wantScale = MIL_BILLBOARD_SCALE;
if (!bb || bb.image !== wantImg) glyphBad.push(`${id}(${klass})${bb ? ':wrong-image' : ':missing'}`);
if (bb && Math.abs(bb.scale - wantScale) > 1e-9) scaleBad.push(`${id}: ${bb.scale} != ${wantScale}`);
}
+35 -13
View File
@@ -401,6 +401,11 @@ const OPENSKY_CATEGORY = {
7: 'fastjet', // High performance (>5g, >400 kt)
8: 'helicopter', // Rotorcraft
9: 'glider',
16: 'vehicle', // Surface vehicle, emergency
17: 'vehicle', // Surface vehicle, service
18: 'station', // Point obstacle
19: 'station', // Cluster obstacle
20: 'station', // Line obstacle
};
/** ADS-B emitter-category string → class. */
@@ -413,13 +418,35 @@ const EMITTER_CATEGORY = {
A6: 'fastjet',
A7: 'helicopter',
B1: 'glider',
C1: 'vehicle', // Surface vehicle, emergency
C2: 'vehicle', // Surface vehicle, service
C3: 'station', // Point obstacle
C4: 'station', // Cluster obstacle
C5: 'station', // Line obstacle
};
/**
* The type codes feeds give what is not an aircraft: an airport vehicle
* (ZVEH) and a ground station (GRND).
*/
const GROUND_TYPE_CLASS = { ZVEH: 'vehicle', GRND: 'station' };
/**
* The class an aircraft draws and reads as, from its ICAO type code (which
* outranks the category), else its OpenSky integer or ADS-B emitter category.
* Besides the aircraft classes, `vehicle` is an airport vehicle (type ZVEH,
* emitter C1 or C2) and `station` a ground station or obstacle (type GRND,
* emitter C3 to C5). A known type code outside every set is an airliner, and
* so is a contact with nothing to go on.
* @param {{typeCode?: string|null, category?: string|number|null}} [record]
* @returns {string}
*/
export function classifyAircraft({ typeCode, category } = {}) {
const code = String(typeCode || '')
.trim()
.toUpperCase();
if (code) {
if (GROUND_TYPE_CLASS[code]) return GROUND_TYPE_CLASS[code];
if (FASTJET.has(code)) return 'fastjet';
if (UAV.has(code)) return 'uav';
if (HELI.has(code)) return 'helicopter';
@@ -452,18 +479,13 @@ export const AIRCRAFT_CLASS_LABELS = Object.freeze({
fastjet: msg('Fast jet'),
bizjet: msg('Business jet'),
uav: msg('Drone'),
vehicle: msg('Airport vehicle'),
station: msg('Ground station / obstacle'),
});
/** Billboard scale multipliers (skylight GLYPH_SCALE, + fastjet). */
export const CLASS_SCALE_2D = {
light: 0.62,
glider: 0.58,
turboprop: 0.86,
airliner: 1.0,
widebody: 1.3,
quadjet: 1.45,
helicopter: 0.82,
fastjet: 0.8,
bizjet: 0.72,
uav: 0.75,
};
/**
* The tint an airport vehicle's sprite draws with in Flights and Local
* ADS-B: an orange amber, apart from aircraft white and the military layer's
* yellow amber (#FFB800).
*/
export const VEHICLE_TINT_CSS = '#FF8F1F';
+49 -4
View File
@@ -1,7 +1,7 @@
// src/data/aircraftClass.test.mjs
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { classifyAircraft, CLASS_SCALE_2D } from './aircraftClass.js';
import { AIRCRAFT_CLASS_LABELS, classifyAircraft } from './aircraftClass.js';
test('type-code classification (military layer path)', () => {
assert.equal(classifyAircraft({ typeCode: 'F16' }), 'fastjet');
@@ -48,8 +48,53 @@ test('typeCode outranks category; unknown → airliner', () => {
assert.equal(classifyAircraft({ typeCode: null, category: 0 }), 'airliner');
});
test('the icon scale table covers every class', () => {
for (const kind of ['light','glider','turboprop','airliner','widebody','quadjet','helicopter','fastjet','bizjet','uav']) {
assert.ok(Number.isFinite(CLASS_SCALE_2D[kind]), kind);
test('every class has a label', () => {
for (const kind of [
'light',
'glider',
'turboprop',
'airliner',
'widebody',
'quadjet',
'helicopter',
'fastjet',
'bizjet',
'uav',
'vehicle',
'station',
]) {
assert.ok(AIRCRAFT_CLASS_LABELS[kind], kind);
}
});
test('airport vehicles and ground stations class apart from aircraft', () => {
// A feed's own types, in any case.
assert.equal(classifyAircraft({ typeCode: 'ZVEH' }), 'vehicle');
assert.equal(classifyAircraft({ typeCode: ' zveh ' }), 'vehicle');
assert.equal(classifyAircraft({ typeCode: 'GRND' }), 'station');
// Emitter categories: surface vehicles, then obstacles.
assert.equal(classifyAircraft({ category: 'C1' }), 'vehicle');
assert.equal(classifyAircraft({ category: 'C2' }), 'vehicle');
for (const category of ['C3', 'C4', 'C5'])
assert.equal(classifyAircraft({ category }), 'station', category);
// OpenSky's integer categories for the same.
assert.equal(classifyAircraft({ category: 16 }), 'vehicle');
assert.equal(classifyAircraft({ category: 17 }), 'vehicle');
assert.equal(classifyAircraft({ category: 18 }), 'station');
// A type code still outranks the category.
assert.equal(
classifyAircraft({ typeCode: 'ZVEH', category: 'A3' }),
'vehicle',
);
assert.equal(
classifyAircraft({ typeCode: 'A320', category: 'C1' }),
'airliner',
);
});
test('helicopter types and categories', () => {
for (const typeCode of ['EC35', 'R44', 'S76', 'H60', 'AS50', 'B407'])
assert.equal(classifyAircraft({ typeCode }), 'helicopter', typeCode);
assert.equal(classifyAircraft({ category: 'A7' }), 'helicopter');
assert.equal(classifyAircraft({ category: 8 }), 'helicopter');
});
+161 -8
View File
@@ -32,6 +32,7 @@ import {
TRACKED_ICON_PX,
} from './aircraftIcons.js';
import { cockpitContactDotImage } from './cockpitContactDot.js';
import { rotorFrame, rotorTurns } from './rotorFrames.js';
import { aircraftRecedeSpec } from './aircraftRecession.js';
import { TIMELINE_UNSEEN_MS } from '../time/timelineFixes.js';
@@ -456,6 +457,14 @@ export function createAircraftIcons({
const { focusPassIsNeeded } = services.focus;
// The near-image switch the rows were last written with (CSS px).
let switchPx = nearImageSwitchPx(1);
/**
* Airborne helicopters drawn as their glyph, whose rotor turns: the rotor
* frame each was last drawn at, and the frame it was last judged at
* (`_turnRotors`), so one out of view is judged again only once its frame
* has stepped on.
* @type {Map<string, {drawn: number, checked: number}>}
*/
const rotors = new Map();
/** The delayed instant (epoch ms) every untracked contact is drawn at. */
const _displayMs = () =>
@@ -473,6 +482,9 @@ export function createAircraftIcons({
* back before it (`_replanExpired`).
*/
const planFrom = new Map();
/** When each placed contact's running ease ends (epoch ms): a new answer
* while it runs eases on from where it is drawn instead of cutting it. */
const easeEnds = new Map();
/** The display time the rows were last checked against. */
let replannedAt = -Infinity;
@@ -543,7 +555,9 @@ export function createAircraftIcons({
state._icons?.dispose();
state._icons = null;
liveSet = null;
rotors.clear();
planFrom.clear();
easeEnds.clear();
replannedAt = -Infinity;
}
@@ -607,13 +621,19 @@ export function createAircraftIcons({
* Following the clock, a contact not there yet at the time drawn
* (`regime.unseen`) is not drawn until its warm-up begins.
* @param {string} icao24
* @param {{fromCourseDeg?: number|null, rewound?: boolean}} [options]
* @param {{fromCourseDeg?: number|null, rewound?: boolean,
* handover?: boolean}} [options]
* `fromCourseDeg`: nose to glide from when the row's own motion is not
* what was on screen (tracking handoff). `rewound`: the time drawn moved
* back before the row's motion; it is drawn where it was then, with no
* easing from where it is drawn now.
* easing from where it is drawn now. `handover`: the clock came back to
* live and this is the contact's first live fix: it eases from where it
* is drawn onto its live path, however its last plan ran out.
*/
function _planIcon(icao24, { fromCourseDeg, rewound = false } = {}) {
function _planIcon(
icao24,
{ fromCourseDeg, rewound = false, handover = false } = {},
) {
const icons = state._icons;
if (!icons?.has(icao24) || holdsPlan(icao24)) return;
const history = state._positionHistory.get(icao24);
@@ -628,7 +648,7 @@ export function createAircraftIcons({
// A host-supplied placement decides where a live contact is drawn; with
// none, or no answer for this contact, the layer's own motion below does.
if (_planPlaced(icao24, info, history, t)) return;
if (_planPlaced(icao24, info, history, t, handover)) return;
const regime = parts.motion._motionRegime(history, info, renderTime);
if (regime.unseen) {
@@ -745,7 +765,7 @@ export function createAircraftIcons({
fromCourseDeg == null &&
!rewound &&
icons.shown(icao24) &&
icons.expires(icao24) > t - RECOVER_STALE_PLAN_MS
(handover || icons.expires(icao24) > t - RECOVER_STALE_PLAN_MS)
) {
const prev = icons.item(icao24);
const drawn = motionPosition(prev.motion, prev.pos, t);
@@ -804,13 +824,21 @@ export function createAircraftIcons({
* @returns {boolean} False when there is no placement, the layer follows
* the world clock, or it has no answer for this contact.
*/
function _planPlaced(icao24, info, history, t) {
function _planPlaced(icao24, info, history, t, handover = false) {
if (!placeAt || followsClock()) return false;
const leadMs = displayDelay.currentMs;
const from = vec();
const start = placeAt(icao24, t + leadMs, info, history, from);
if (!start) return false;
const { courseDeg: course } = start;
// Back at live, or while an ease runs, it eases on from where it is drawn.
const easing = easeEnds.get(icao24) > t;
if (
(handover || easing) &&
_easePlaced(icao24, info, history, t, from, start)
)
return true;
easeEnds.delete(icao24);
const t1 = t + PLACED_PLAN_MS;
const to = vec();
const end = placeAt(icao24, t1 + leadMs, info, history, to);
@@ -835,6 +863,40 @@ export function createAircraftIcons({
return true;
}
/**
* Back at live, a placed contact still on screen eases from where it is
* drawn onto where it is placed, as the layer's own motion recovers (and a
* new answer while that ease runs eases on from where it is then): along
* the straight line to where the placement has it when the ease ends, nose
* along that line, unless it is nearer than a recovery or farther than a
* jump would be.
* @returns {boolean} Whether the contact was planned to ease.
*/
function _easePlaced(icao24, info, history, t, placed, start) {
const icons = state._icons;
if (!icons.shown(icao24)) return false;
const prev = icons.item(icao24);
const drawn = motionPosition(prev.motion, prev.pos, t);
const errorM = distance(drawn, placed);
if (!(errorM > RECOVER_MIN_M && errorM < RECOVER_SNAP_M)) return false;
const speed = start.speedMps ?? info?.velocity ?? 0;
const end = t + recoveryMs(errorM, speed);
const target = vec();
if (!placeAt(icao24, end + displayDelay.currentMs, info, history, target))
return false;
const motion = straightSegment(drawn, t, end, target);
const course = motionCourse(motion, undefined, t);
icons.setUnseen(icao24, false);
icons.update(
icao24,
{ pos: clone(drawn), course, motion, courseGlide: undefined },
{ expiresAt: end },
);
planFrom.set(icao24, t);
easeEnds.set(icao24, end);
return true;
}
/**
* Re-plan every row whose regime ended by `t` (epoch ms), and, following
* the clock, every row whose motion starts after `t` once the time drawn
@@ -906,26 +968,94 @@ export function createAircraftIcons({
* @returns {{image: string, imageLod: {near: string, switchPx: number},
* size: [number, number], scale: number, scaleByDistance: object}}
*/
function _fleetLook(icao24, info = state.records.data.get(icao24)) {
function _fleetLook(
icao24,
info = state.records.data.get(icao24),
frame = _rotorFrameOf(icao24, info, Date.now()),
) {
const rendering = parts.rendering;
return {
image: aircraftIcon(
rendering._iconKind(icao24, info?.klass),
FLEET_ICON_PX,
frame,
),
imageLod: {
near: aircraftIcon(
rendering._iconKind(icao24, info?.klass),
TRACKED_ICON_PX,
frame,
),
switchPx,
},
size: [FLEET_ICON_SIZE_PX, FLEET_ICON_SIZE_PX],
scale: rendering._fleetBillboardScale(icao24, info?.klass),
scale: rendering._fleetBillboardScale(icao24),
scaleByDistance: NORMAL_SCALE_BY_DISTANCE,
};
}
/**
* The rotor frame a contact draws at `nowMs` (`rotorFrames.js`): a
* helicopter's, which holds still on the ground unless it taxis; undefined
* for every other kind.
*/
function _rotorFrameOf(icao24, info, nowMs) {
if (parts.rendering._iconKind(icao24, info?.klass) !== 'helicopter')
return undefined;
return rotorFrame(icao24, nowMs, _rotorState(info));
}
/** What turns a contact's rotor: whether it is grounded, and its speed (m/s). */
function _rotorState(info) {
const speed = info?.velocity ?? info?.speedMps;
return {
onGround: info?.onGround === true,
speedMps: Number.isFinite(speed) ? speed : null,
};
}
/**
* Turn the rotors of the airborne helicopters in view: each one's images
* are written again only when its rotor frame changed (`ROTOR_FPS`, run
* from the fleet pass). One out of view, below the horizon, or hidden for
* its 3D model keeps its frame. The tracked one is drawn by the tracked
* icon, which is given its new images. With no airborne helicopter drawn
* this does nothing.
* @param {number} nowMs Epoch ms the frame is chosen at.
* @param {number} t The display instant, epoch ms (where icons are drawn).
* @param {((position: {x: number, y: number, z: number}) => boolean)|null}
* [inView] Whether a position is in the camera's view; none: all are.
*/
function _turnRotors(nowMs, t, inView = null) {
const icons = state._icons;
if (!rotors.size || !icons) return;
let occluder;
for (const [id, rotor] of rotors) {
const frame = rotorFrame(id, nowMs);
// Drawn at this frame, or already judged at it: nothing to do.
if (frame === rotor.drawn || frame === rotor.checked) continue;
rotor.checked = frame;
const tracked = id === state._trackedIcao;
if (!icons.has(id) || (!tracked && !icons.shown(id))) continue;
const position = icons.position(id, t);
if (!position) continue;
if (occluder === undefined) occluder = _occluder();
if (!_aboveHorizon(position, occluder)) continue;
if (inView && !inView(position)) continue;
rotor.drawn = frame;
if (tracked) {
parts.tracking?._syncTrackedBillboardImage?.();
continue;
}
const { image, imageLod } = _fleetLook(
id,
state.records.data.get(id),
frame,
);
icons.update(id, { image, imageLod });
}
}
/** Image, size, scale, tint and freshness for one row under the current
* normal/cockpit contract. Motion and course stay with `_planIcon`. */
function _applyIconPresentation(icao24) {
@@ -953,8 +1083,27 @@ export function createAircraftIcons({
color: rgba(rendering._fleetBillboardColor(icao24, info)),
rotationMode: 'course',
};
// A ground station's mast stands upright.
if (!cockpitDot && info?.klass === 'station') {
look.rotationMode = 'screen';
look.rotation = 0;
}
look.alpha = state.records.missingPolls.get(icao24) ? staleAlpha : 1;
icons.update(icao24, look);
// An airborne helicopter drawn as its glyph turns its rotor.
const frame = cockpitDot
? undefined
: _rotorFrameOf(icao24, info, Date.now());
if (frame === undefined || !rotorTurns(_rotorState(info))) {
// A tracked helicopter that lands shows the still frame at once.
if (rotors.delete(icao24) && tracked)
parts.tracking?._syncTrackedBillboardImage?.();
} else rotors.set(icao24, { drawn: frame, checked: frame });
}
/** Whether any airborne helicopter's rotor turns (`_turnRotors` has work). */
function _rotorsTurning() {
return rotors.size > 0;
}
/** Add a row for a new contact, hidden while it is the tracked one. */
@@ -990,7 +1139,9 @@ export function createAircraftIcons({
/** Drop a contact and everything the layer keeps for it. */
function _forgetContact(icao24) {
state._icons?.remove(icao24);
rotors.delete(icao24);
planFrom.delete(icao24);
easeEnds.delete(icao24);
parts.rendering._releaseModel(icao24);
state.records.forget(icao24);
// The host-supplied placement, if any, forgets it as well.
@@ -1025,6 +1176,8 @@ export function createAircraftIcons({
_focusIcons,
_applyIconPresentation,
_fleetLook,
_turnRotors,
_rotorsTurning,
_addIcon,
_forgetContact,
_iconIds,
+283 -1
View File
@@ -6,10 +6,12 @@ import {
createContactIcons,
floorCoastArc,
} from './aircraftIconLayer.js';
import { COAST_FLOOR_LIFT_M } from './motionModel.js';
import { COAST_FLOOR_LIFT_M, recoveryMs } from './motionModel.js';
import { fromDegrees, toCartographicRadians } from '../geo/ellipsoid.js';
import { bindFakeDraw } from '../testSupport/fakeDrawPort.mjs';
import { createDisplayDelay } from './displayDelay.js';
import { aircraftIcon, FLEET_ICON_PX } from './aircraftIcons.js';
import { ROTOR_STILL_FRAME } from './rotorFrames.js';
const WORLD_MS = Date.UTC(2026, 10, 1, 12, 0);
@@ -199,3 +201,283 @@ test('a coast over known ground that never rises is planned once', () => {
'held on the ground where the coast stopped',
);
});
test('only airborne helicopters in view turn their rotor, written when the frame steps', (t) => {
t.mock.timers.enable({ apis: ['Date'], now: WORLD_MS });
const here = fromDegrees(0, 30, 300);
const away = fromDegrees(90, 30, 300);
const records = new Map([
['h1', { klass: 'helicopter', onGround: false }],
['h2', { klass: 'helicopter', onGround: true }],
['p1', { klass: 'airliner', onGround: false }],
['h3', { klass: 'helicopter', onGround: false }],
]);
const state = {
now: () => Date.now(),
_icons: createContactIcons(),
_positionHistory: new Map(),
_cockpitNearContacts: new Set(),
records: { data: records, missingPolls: new Map() },
};
const icons = createAircraftIcons({
state,
services: { focus: { focusPassIsNeeded: () => false } },
parts: {
rendering: {
_iconKind: (_id, klass) => klass,
_fleetBillboardColor: () => [1, 1, 1, 1],
_fleetBillboardScale: () => 1,
},
},
layerId: 'flights',
courseMaxDps: 3,
cockpitContactSizePx: 8,
});
for (const id of records.keys()) {
state._icons.put(
{
id,
pos: id === 'h3' ? away : here,
motion: { kind: 'hold', courseDeg: 0 },
size: [20, 20],
},
{ expiresAt: Infinity },
);
icons._applyIconPresentation(id);
}
const image = (id) => state._icons.item(id).image;
// The grounded helicopter holds the still frame.
assert.equal(
image('h2'),
aircraftIcon('helicopter', FLEET_ICON_PX, ROTOR_STILL_FRAME),
);
const h3Before = image('h3');
const writes = new Map();
const update = state._icons.update;
state._icons.update = (id, patch, options) => {
writes.set(id, (writes.get(id) ?? 0) + 1);
return update(id, patch, options);
};
// The fleet pass, every 80 ms for a second; h3 is out of view.
const inView = (p) => Math.abs(p.x - here.x) < 1;
const seen = new Set();
for (let step = 0; step <= 12; step++) {
if (step) t.mock.timers.tick(80);
icons._turnRotors(Date.now(), Date.now(), inView);
seen.add(image('h1'));
}
// Through every frame, written only on the steps its frame changed.
assert.equal(seen.size, 3);
for (const frame of [0, 1, 2])
assert.ok(seen.has(aircraftIcon('helicopter', FLEET_ICON_PX, frame)));
assert.ok(
writes.get('h1') >= 8 && writes.get('h1') <= 11,
`${writes.get('h1')} writes`,
);
assert.equal(writes.get('h2') ?? 0, 0, 'grounded: frozen');
assert.equal(writes.get('p1') ?? 0, 0, 'not a helicopter');
assert.equal(writes.get('h3') ?? 0, 0, 'out of view');
assert.equal(image('h3'), h3Before);
// Landing freezes it on the still frame.
records.get('h1').onGround = true;
icons._applyIconPresentation('h1');
const landed = writes.get('h1');
t.mock.timers.tick(400);
icons._turnRotors(Date.now(), Date.now(), inView);
assert.equal(writes.get('h1'), landed);
assert.equal(
image('h1'),
aircraftIcon('helicopter', FLEET_ICON_PX, ROTOR_STILL_FRAME),
);
});
/** An icon layer over helicopters `ids`, all at `here`, for the rotor tests. */
function rotorFixture(records, positions, tracking = {}) {
const state = {
now: () => Date.now(),
_icons: createContactIcons(),
_positionHistory: new Map(),
_cockpitNearContacts: new Set(),
records: { data: records, missingPolls: new Map() },
};
const icons = createAircraftIcons({
state,
services: { focus: { focusPassIsNeeded: () => false } },
parts: {
rendering: {
_iconKind: (_id, klass) => klass,
_fleetBillboardColor: () => [1, 1, 1, 1],
_fleetBillboardScale: () => 1,
},
tracking,
},
layerId: 'flights',
courseMaxDps: 3,
cockpitContactSizePx: 8,
});
for (const id of records.keys()) {
state._icons.put(
{
id,
pos: positions[id],
motion: { kind: 'hold', courseDeg: 0 },
size: [20, 20],
},
{ expiresAt: Infinity },
);
icons._applyIconPresentation(id);
}
return { state, icons };
}
test('a tracked helicopter that lands shows the still frame at once', (t) => {
t.mock.timers.enable({ apis: ['Date'], now: WORLD_MS });
const records = new Map([['h1', { klass: 'helicopter', onGround: false }]]);
let synced = 0;
const { state, icons } = rotorFixture(
records,
{ h1: fromDegrees(0, 30, 300) },
{ _syncTrackedBillboardImage: () => synced++ },
);
state._trackedIcao = 'h1';
assert.equal(icons._rotorsTurning(), true);
records.get('h1').onGround = true;
icons._applyIconPresentation('h1');
assert.equal(synced, 1, 'the tracked billboard is given its images again');
assert.equal(icons._rotorsTurning(), false);
assert.equal(
icons._fleetLook('h1').image,
aircraftIcon('helicopter', FLEET_ICON_PX, ROTOR_STILL_FRAME),
);
// Taxiing faster than 1 m/s, its rotor turns again, as the model's does.
records.get('h1').velocity = 5;
icons._applyIconPresentation('h1');
assert.equal(icons._rotorsTurning(), true);
records.get('h1').velocity = 0;
icons._applyIconPresentation('h1');
assert.equal(synced, 2);
assert.equal(icons._rotorsTurning(), false);
// An untracked one landing does not touch the tracked billboard.
records.get('h1').onGround = false;
icons._applyIconPresentation('h1');
state._trackedIcao = null;
records.get('h1').onGround = true;
icons._applyIconPresentation('h1');
assert.equal(synced, 2);
});
test('a helicopter out of view is judged once per rotor frame, not every pass', (t) => {
t.mock.timers.enable({ apis: ['Date'], now: WORLD_MS });
const records = new Map();
const positions = {};
for (let i = 0; i < 300; i++) {
const id = `h${i}`;
records.set(id, { klass: 'helicopter', onGround: false });
positions[id] = fromDegrees(90, 30, 300);
}
const { state, icons } = rotorFixture(records, positions);
let judged = 0;
const inView = () => {
judged++;
return false;
};
const writes = [];
const update = state._icons.update;
state._icons.update = (id, ...rest) => {
writes.push(id);
return update(id, ...rest);
};
// Passes 10 ms apart for 2 s: 200 passes over 300 helicopters, all out of
// view. Each is judged at most once per frame step (20 steps), and not on
// a step back onto the frame it is drawn at.
for (let pass = 0; pass < 200; pass++) {
t.mock.timers.tick(10);
icons._turnRotors(Date.now(), Date.now(), inView);
}
assert.ok(judged <= 300 * 21, `${judged} judgements`);
assert.ok(judged >= 300 * 10, `${judged} judgements`);
assert.equal(writes.length, 0, 'none in view: no image written');
});
test('back at live, a placed contact eases from where it is drawn over a recovery, nose along the way', (t) => {
t.mock.timers.enable({ apis: ['Date'], now: WORLD_MS });
const drawnAt = fromDegrees(0, 30, 3_000);
const SPEED = 200;
// The placement has it 2 km east of where it is drawn, flying east.
const placedAt = (wallMs) => {
const east = 2_000 + (SPEED * (wallMs - WORLD_MS)) / 1000;
return fromDegrees(east / (111_320 * Math.cos(Math.PI / 6)), 30, 3_000);
};
const plan = (handover, keep = {}) => {
const state = {
now: () => Date.now(),
_icons: createContactIcons(),
_positionHistory: new Map([['c', [{ epochMs: WORLD_MS }]]]),
records: { data: new Map([['c', {}]]) },
};
const icons = createAircraftIcons({
state,
services: { focus: { focusPassIsNeeded: () => false } },
parts: {
motion: { _displayTimeAt: (ms) => ms, _fixEpochMs: (f) => f.epochMs },
},
layerId: 'flights',
courseMaxDps: 3,
cockpitContactSizePx: 8,
placeAt: (_id, wallMs, _info, _history, out) => {
Object.assign(out, placedAt(wallMs));
return { courseDeg: 90, speedMps: SPEED };
},
});
state._icons.put(
{
id: 'c',
pos: drawnAt,
motion: { kind: 'hold', courseDeg: 0 },
course: 0,
size: [20, 20],
},
{ expiresAt: -Infinity },
);
icons._planIcon('c', handover ? { handover: true } : undefined);
keep.icons = icons;
return state._icons;
};
const metres = (a, b) => Math.hypot(a.x - b.x, a.y - b.y, a.z - b.z);
const eased = plan(true);
const end = eased.expires('c');
assert.equal(end, WORLD_MS + recoveryMs(2_000, SPEED));
assert.ok(end - WORLD_MS > 1_000, 'longer than a placed plan');
assert.ok(metres(eased.position('c', WORLD_MS, {}), drawnAt) < 1);
assert.ok(metres(eased.position('c', end, {}), placedAt(end)) < 1);
// The nose points along the way from where it is drawn to where it goes.
assert.ok(Math.abs(eased.course('c', WORLD_MS) - 90) < 1);
const plain = plan(false);
assert.ok(
metres(plain.position('c', WORLD_MS, {}), placedAt(WORLD_MS)) < 1,
'without the handover it is drawn where it is placed',
);
// The next answer comes 15 s in, the ease still running: it eases on from
// where it is drawn then, not cut to where it is placed.
const keep = {};
const easing = plan(true, keep);
const firstEnd = easing.expires('c');
assert.ok(firstEnd - WORLD_MS > 15_000, 'an ease longer than a poll');
t.mock.timers.tick(15_000);
const at = Date.now();
const drawnThen = easing.position('c', at, {});
keep.icons._planIcon('c');
assert.ok(metres(easing.position('c', at, {}), drawnThen) < 1);
const reEnd = easing.expires('c');
assert.ok(reEnd > at + 1_000, 'eases on');
assert.ok(metres(easing.position('c', reEnd, {}), placedAt(reEnd)) < 1);
// Once it has caught up, the next answer draws it where it is placed.
t.mock.timers.tick(reEnd - at + 1);
keep.icons._planIcon('c');
assert.ok(
metres(easing.position('c', Date.now(), {}), placedAt(Date.now())) < 1,
);
});
+115 -28
View File
@@ -8,9 +8,9 @@
* width/height 20 (24 tracked) in flights.js / militaryFlights.js, so Cesium
* DOWN-samples this larger, higher-precision source to the same on-screen
* footprint — crisp anti-aliased edges instead of an upscaled 32px bitmap. The
* on-screen size is unchanged and CLASS_SCALE_2D is untouched (no scale
* compensation needed: the billboard's explicit width/height, not the SVG's,
* sets the pixel size — the intrinsic SVG size only controls raster fidelity).
* on-screen size is unchanged (the billboard's explicit width/height, not the
* SVG's, sets the pixel size — the intrinsic SVG size only controls raster
* fidelity).
*
* All glyphs are nose-up (nose toward -Y at rotation 0; the screen-projected
* rotation pipeline in iconOrientation.js spins the whole glyph). Fill is white
@@ -23,12 +23,19 @@
* quadjet/glider use the "bold" chart-symbol redraw; light/fastjet keep the
* original drawings. Raster fidelity doubled (192px source, same 96 coords).
*
* The helicopter is a top-down body under a four-blade rotor drawn in three
* frames (`aircraftIcon('helicopter', px, frame)`, turned by
* `rotorFrames.js`). Two kinds are not aircraft: `vehicle`, one sprite for
* every airport vehicle, and `station`, a mast for ground stations, drawn
* upright.
*
* Silhouette language follows skylight's type-aware glyphs (MIT,
* https://github.com/cpaczek/skylight): slender fuselages, swept wings for
* jets, long high-aspect wings for the glider, straight wings + prop discs for
* props, a rotor disc + tail boom + tail-rotor for the helicopter, and a delta
* for the fast jet. Each class has a DISTINCT planform so it reads at ~20px by
* shape, not just by footprint size.
* shape alone: every glyph is fitted to the same extent, so none is bigger
* than another.
*/
const VIEW = 96;
@@ -130,23 +137,6 @@ const BODIES = {
L -3,-25 C -3,-29 -2.4,-33 0,-35 Z" fill="white" ${STROKE_BOLD}/>
<rect x="-10.5" y="32.5" width="21" height="5" rx="1.5" fill="white" ${STROKE_BOLD}/>`,
// ── Helicopter: a SOLID translucent main-rotor disc (survives downscale as an
// obvious circle, unlike a thin ring) with a bold two-blade cross, a
// teardrop cabin, a tail boom, and a tail rotor. Unmistakable "disc on top"
// silhouette that never reads as a fixed-wing.
helicopter: `
<circle cx="0" cy="-6" r="31" fill="white" fill-opacity="0.22"/>
<g transform="rotate(45 0 -6)">
<rect x="-30.5" y="-8.2" width="61" height="4.4" rx="2.2" fill="white" fill-opacity="0.9"/>
<rect x="-30.5" y="-8.2" width="61" height="4.4" rx="2.2" fill="white" fill-opacity="0.9" transform="rotate(90 0 -6)"/>
</g>
<path d="M0,-22 C 8,-20 10.5,-13 10.5,-6 C 10.5,2 7.5,7 0,8.5
C -7.5,7 -10.5,2 -10.5,-6 C -10.5,-13 -8,-20 0,-22 Z" fill="white" ${STROKE}/>
<path d="M-2.6,8 L 2.6,8 L 1.8,32 L -1.8,32 Z" fill="white" ${STROKE}/>
<path d="M-8,27 L 8,27 L 8,30.6 L -8,30.6 Z" fill="white"/>
<circle cx="5.6" cy="35" r="6" fill="white" fill-opacity="0.6"/>
<circle cx="5.6" cy="35" r="2.1" fill="white"/>`,
// ── Fast jet: sharp delta/cropped-delta with a pointed nose, LERX root
// blend, and twin tail fins. Aggressive, all-wing.
fastjet: `
@@ -236,6 +226,87 @@ const BODIES = {
L -1.6,30 L -13,36 L -13,32 L -2.1,24
L -2.3,0 L -43,-2.5 L -43,-7 L -2.4,-12
L -4.4,-30 C -4.6,-35 -3.6,-40 0,-40 Z" fill="white" ${STROKE}/>`,
// ── Airport vehicle (type ZVEH, emitter C1/C2): one service van seen from
// above, front up, for every kind (fire truck, tug, car, de-icer). A
// boxy body, a dark windscreen band and a roof light bar; the layer
// tints it amber so it reads apart from aircraft.
vehicle: `
<path d="M-12,-39 L 12,-39 L 15,-36 L 15,38 L 13,40 L -13,40 L -15,38
L -15,-36 Z" fill="white" ${STROKE}/>
<path d="M-18.5,-25 h4 v3 h-4 Z M14.5,-25 h4 v3 h-4 Z" fill="white" ${STROKE}/>
<path d="M-13,-32 L 13,-32 L 12,-21 L -12,-21 Z" fill="rgba(0,0,0,0.62)"/>
<rect x="-10" y="-13" width="20" height="5" rx="1.5" fill="rgba(0,0,0,0.45)"/>`,
// ── Ground station or obstacle (type GRND, emitter C3–C5): a radio mast
// with two pairs of signal arcs, drawn upright on screen, never turned.
station: `
<path d="M7.1,-38.4 A 11 11 0 0 1 7.1,-21.6 M-7.1,-38.4 A 11 11 0 0 0 -7.1,-21.6
M12.2,-44.6 A 19 19 0 0 1 12.2,-15.4 M-12.2,-44.6 A 19 19 0 0 0 -12.2,-15.4"
fill="none" stroke="rgba(0,0,0,0.32)" stroke-width="5" stroke-linecap="round"/>
<path d="M7.1,-38.4 A 11 11 0 0 1 7.1,-21.6 M-7.1,-38.4 A 11 11 0 0 0 -7.1,-21.6
M12.2,-44.6 A 19 19 0 0 1 12.2,-15.4 M-12.2,-44.6 A 19 19 0 0 0 -12.2,-15.4"
fill="none" stroke="white" stroke-width="3.4" stroke-linecap="round"/>
<circle cx="0" cy="-30" r="4.5" fill="white" ${STROKE}/>
<path d="M-2.5,-25 L 2.5,-25 L 7,34 L 13,34 L 13,38 L -13,38 L -13,34
L -7,34 Z" fill="white" ${STROKE}/>`,
};
/**
* The helicopter, seen from above: a cabin, tail boom and tail plane under a
* four-blade main rotor. The rotor turns in {@link ROTOR_FRAMES} frames 30°
* apart; four blades repeat every 90°, so the third frame steps back onto
* the first and the loop is seamless. The middle frame (blades as an X) is
* the still one.
*/
const HELI_ROTOR_CENTRE_Y = -11.2;
const HELI_DISC = `<circle cx="0" cy="${HELI_ROTOR_CENTRE_Y}" r="32.8" fill="white" fill-opacity="0.22"/>`;
const HELI_BODY = `
<path d="M0,-33.4 L -2.3,-32.1 L -4.2,-28 L -4.3,-30.6 L -6.2,-30.6
L -6.2,0.2 L -4.3,0.2 L -4.2,-3.1 L -1.9,7.9 L -1.7,18.9
L -7.4,19.2 L -7.8,24 L -2.9,24.4 L -3.2,35.6 L -1.2,36
L 0,34.3 L 1.2,36 L 3.2,35.6 L 2.9,24.4 L 7.8,24 L 7.4,19.2
L 1.7,18.9 L 1.9,7.9 L 4.2,-3.1 L 4.3,0.2 L 6.2,0.2 L 6.2,-30.6
L 4.3,-30.6 L 4.2,-28 L 2.3,-32.1 Z" fill="white" ${STROKE}/>
<circle cx="0" cy="${HELI_ROTOR_CENTRE_Y}" r="3.2" fill="white" ${STROKE}/>`;
/** Main-rotor blade angle of each frame, degrees clockwise. */
const ROTOR_ANGLES_DEG = [15, 45, 75];
/** How many rotor frames the helicopter turns through. */
export const ROTOR_FRAMES = ROTOR_ANGLES_DEG.length;
/** The frame a helicopter holds when its rotor does not turn. */
export const ROTOR_STILL_FRAME = 1;
/** One rotor frame: the disc, two crossed blades at `angle`, the body over them. */
function helicopterBody(frame) {
const angle = ROTOR_ANGLES_DEG[frame] ?? ROTOR_ANGLES_DEG[ROTOR_STILL_FRAME];
const blade = (deg) =>
`<rect x="-32.2" y="${HELI_ROTOR_CENTRE_Y - 2.2}" width="64.4" height="4.4" rx="2.2" fill="white" fill-opacity="0.92" stroke="rgba(0,0,0,0.25)" stroke-width="0.8" transform="rotate(${deg} 0 ${HELI_ROTOR_CENTRE_Y})"/>`;
return `${HELI_DISC}${blade(angle)}${blade(angle + 90)}${HELI_BODY}`;
}
/**
* Every sprite draws at one size. The bodies were drawn at different spans
* (a light aircraft's half-extent is 32.8 units, a quadjet's 47), so each is
* scaled until its farthest painted edge, stroke included, sits
* {@link GLYPH_HALF_EXTENT} units from the centre. Values are each body's
* measured half-extent; aircraftIcons.test.mjs re-measures the rasters.
*/
const GLYPH_HALF_EXTENT = 44;
const BODY_HALF_EXTENT = {
airliner: 42.7,
widebody: 45.7,
quadjet: 47.0,
turboprop: 40.7,
light: 32.8,
glider: 46.0,
fastjet: 44.7,
bizjet: 42.7,
uav: 43.7,
helicopter: 44.0,
vehicle: 40.7,
station: 47.1,
tr3b: 40.8,
tr3bHot: 42.3,
};
const _iconCache = new Map();
@@ -259,16 +330,32 @@ export const FLEET_ICON_PX = FLEET_RASTER_PX;
* it stays crisp at its biggest on-screen sizes. */
const TRACKED_RASTER_PX = 192;
/** Data URI for a class silhouette (lazily built, cached per kind+size).
* Default size serves the fleet; pass `aircraftIcon(kind, TRACKED_ICON_PX)`
* (re-exported below) for the tracked billboard. */
/** Raster size of the tracked glyph and every glyph's near image. */
export const TRACKED_ICON_PX = TRACKED_RASTER_PX;
export function aircraftIcon(kind, px = FLEET_RASTER_PX) {
const k = BODIES[kind] ? kind : 'airliner';
const key = `${k}@${px}`;
/**
* Data URI for a class silhouette (lazily built, cached per kind, size and
* frame). The default size serves the fleet; pass
* `aircraftIcon(kind, TRACKED_ICON_PX)` for the near image.
* @param {string} kind A `classifyAircraft()` class, or a TR-3B kind.
* @param {number} [px] Raster size.
* @param {number} [frame] A helicopter's rotor frame, 0 to `ROTOR_FRAMES - 1`
* (the still frame by default); other kinds have one image.
* @returns {string}
*/
export function aircraftIcon(kind, px = FLEET_RASTER_PX, frame) {
const heli = kind === 'helicopter';
const k = heli || BODIES[kind] ? kind : 'airliner';
const f = heli
? Number.isInteger(frame) && frame >= 0 && frame < ROTOR_FRAMES
? frame
: ROTOR_STILL_FRAME
: 0;
const key = `${k}@${px}#${f}`;
let uri = _iconCache.get(key);
if (!uri) {
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${px}" height="${px}" viewBox="0 0 ${VIEW} ${VIEW}"><g transform="translate(${C},${C})">${BODIES[k]}</g></svg>`;
const body = heli ? helicopterBody(f) : BODIES[k];
const fit = +(GLYPH_HALF_EXTENT / BODY_HALF_EXTENT[k]).toFixed(4);
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${px}" height="${px}" viewBox="0 0 ${VIEW} ${VIEW}"><g transform="translate(${C},${C}) scale(${fit})">${body}</g></svg>`;
uri = 'data:image/svg+xml;base64,' + _b64(svg);
_iconCache.set(key, uri);
}
+57
View File
@@ -0,0 +1,57 @@
// src/data/aircraftIcons.test.mjs
import { test } from 'node:test';
import assert from 'node:assert/strict';
import sharp from 'sharp';
import { aircraftIcon, ROTOR_FRAMES } from './aircraftIcons.js';
const KINDS = [
'airliner',
'widebody',
'quadjet',
'turboprop',
'light',
'glider',
'fastjet',
'bizjet',
'uav',
'helicopter',
'vehicle',
'station',
'tr3b',
'tr3bHot',
];
const PX = 480;
/** Farthest painted pixel from the centre, in the 96-unit glyph space. */
async function halfExtent(uri) {
const svg = Buffer.from(uri.split(',')[1], 'base64');
const { data, info } = await sharp(svg)
.ensureAlpha()
.raw()
.toBuffer({ resolveWithObject: true });
let half = 0;
const c = info.width / 2;
for (let y = 0; y < info.height; y++) {
for (let x = 0; x < info.width; x++) {
if (data[(y * info.width + x) * 4 + 3] <= 8) continue;
half = Math.max(half, c - x, x + 1 - c, c - y, y + 1 - c);
}
}
return (half * 96) / info.width;
}
test('every sprite fills the same extent, whatever its class', async () => {
const extents = {};
for (const kind of KINDS) {
extents[kind] = await halfExtent(aircraftIcon(kind, PX));
}
for (let frame = 0; frame < ROTOR_FRAMES; frame++) {
extents[`helicopter#${frame}`] = await halfExtent(
aircraftIcon('helicopter', PX, frame),
);
}
for (const [kind, half] of Object.entries(extents)) {
assert.ok(Math.abs(half - 44) <= 0.6, `${kind}: ${half.toFixed(2)}`);
}
});
+61 -2
View File
@@ -14,7 +14,8 @@ import {
showModel,
} from './modelRecord.js';
import { modelDrawnScale } from './modelVisualAnchor.js';
import { fleetModelSet } from './fleetModels.js';
import { fleetModelSet, fleetPartTable } from './fleetModels.js';
import { aircraftLayerPartState } from './modelPartDrivers.js';
import { findCamera, findDraw, rendererOf } from '../render/rendererOf.js';
import { fromDegrees, toLonLatH } from '../geo/ellipsoid.js';
import {
@@ -338,6 +339,54 @@ export function createAircraftModels({
record.tint = [base[0], base[1], base[2], alpha];
}
/** A finite number of the first of `values` that is one, else null. */
const _finite = (...values) =>
values.find((v) => typeof v === 'number' && Number.isFinite(v)) ?? null;
/**
* How high an aircraft flies above the ground under it: its render
* altitude over the cached ground floor there; null where that floor is
* not known (the gear then follows the approach rule instead).
*/
function _heightAboveGround(meta) {
const altitude = _finite(meta.renderAltitudeM);
const floor =
Number.isFinite(meta.rawLat) && Number.isFinite(meta.rawLon)
? services.groundFloor?.cachedGroundFloor?.(meta.rawLat, meta.rawLon)
: null;
return altitude !== null && Number.isFinite(floor)
? altitude - floor
: null;
}
/**
* The moving parts a contact's model is posed with, from its record
* (`aircraftLayerPartState`): gear, doors and flaps by its height and climb,
* fans, propellers and rotors while it flies or taxis. An airport vehicle
* is a road vehicle (`groundVehiclePartState`): its wheels roll with its
* speed. Undefined for a model without parts.
*/
function _partsOf(meta, spec) {
if (!meta) return undefined;
const table = fleetPartTable(fleetModelSet(), spec?.model);
if (!table) return undefined;
return aircraftLayerPartState(table, {
klass: meta.klass,
onGround: meta.onGround === true,
heightAboveGroundM: _heightAboveGround(meta),
altitudeM: _finite(meta.altitude, meta.altitudeM),
verticalRateMps: _finite(meta.verticalRate, meta.verticalRateMps),
speedMps: _finite(meta.velocity, meta.speedMps),
});
}
/** Pose a record's parts as its contact's record says, and key them for `_send`. */
function _poseParts(record, meta, spec) {
const pose = _partsOf(meta, spec);
record.parts = pose;
record.partsKey = pose ? JSON.stringify(pose) : '';
}
/** The record's item, as its set draws it. */
function _itemOf(id, record) {
return {
@@ -355,6 +404,7 @@ export function createAircraftModels({
// the IR boost draws it flat white.
colorBlend: aircraftModelBlend(state._irBoost === true),
environmentMap: AIRCRAFT_ENVIRONMENT_MAP_OPTIONS.enabled,
...(record.parts ? { parts: record.parts } : {}),
show: record.show,
};
}
@@ -364,7 +414,7 @@ export function createAircraftModels({
if (!set) return;
const p = record.position;
const t = record.tint ?? WHITE;
const key = `${record.url}|${p.x},${p.y},${p.z}|${record.heading}|${record.scale}|${record.minPixelSize}|${t[0]},${t[1]},${t[2]},${t[3]}|${state._irBoost === true}|${record.show}`;
const key = `${record.url}|${p.x},${p.y},${p.z}|${record.heading}|${record.scale}|${record.minPixelSize}|${t[0]},${t[1]},${t[2]},${t[3]}|${state._irBoost === true}|${record.show}|${record.partsKey ?? ''}`;
if (key === record.sent) return;
record.sent = key;
const item = _itemOf(id, record);
@@ -423,6 +473,7 @@ export function createAircraftModels({
// Placed BEFORE the readiness test on purpose: a model can turn ready
// between ticks, and its first drawn frame must be at this placement.
placeModel(record, displayPos, _modelHeading(course, meta));
_poseParts(record, meta, spec);
if (!record.ready) {
showModel(record, false); // not loaded yet → keep the 2D icon, no half-model flash
_send(set, icao24, record, spec, out);
@@ -852,6 +903,7 @@ export function createAircraftModels({
displayPos,
_modelHeading(parts.motion._trackedDisplayCourse(), meta),
);
_poseParts(record, meta, spec);
showModel(record, record.ready);
_send(state._modelSets.tracked, icao24, record, spec);
if (record.ready) _hideTrackedFleetModel();
@@ -927,6 +979,13 @@ export function createAircraftModels({
afterReplan(renderTime, t, nowMs, pose?.position ?? null);
const focusTarget = getFocusTarget();
parts.icons._focusIcons(t, nowMs, focusTarget);
// Airborne helicopters in view step their rotor frame (none: no work).
if (parts.icons._rotorsTurning?.())
parts.icons._turnRotors(
Date.now(),
t,
pose ? (position) => inView(pose, position) : null,
);
// 3D model regime: only when enabled AND the camera is zoomed in past the altitude ceiling.
// Drop all models the moment we leave it (toggled off / zoomed out) so icons resume.
+1 -1
View File
@@ -102,7 +102,7 @@ for (const layer of LAYERS) {
// `_iconKind` is identity for every unconverted contact (see
// tr3bRegistry.test.mjs) — it only swaps the glyph for a contact the
// operator explicitly converted into a TR-3B.
assert.match(source, /aircraftIcon\(\s*(?:parts\.)?rendering\._iconKind\(icao24, info\?\.klass\),?\s*(?:FLEET_ICON_PX,?\s*)?\)/,
assert.match(source, /aircraftIcon\(\s*(?:parts\.)?rendering\._iconKind\(icao24, info\?\.klass\),?\s*(?:FLEET_ICON_PX,?\s*)?(?:frame,?\s*)?\)/,
'near contacts and model fallbacks retain the class-derived aircraft silhouette');
assert.match(source, /color: rgba\(rendering\._cockpitContactColor\(icao24, info\)\),\s*rotationMode: 'screen',/,
'far dots are reset to a rotation-free presentation');
+2
View File
@@ -1285,6 +1285,8 @@ const AIRCRAFT_CLASS_NAMES = {
turboprop: msg('Turboprops'),
fastjet: msg('Fast jets'),
quadjet: msg('Four-engine jets'),
vehicle: msg('Airport vehicles'),
station: msg('Ground stations / obstacles'),
};
/**
+21 -4
View File
@@ -1,6 +1,6 @@
import { selectModelEligible } from './modelEligibility.js';
import { AIRCRAFT_ENVIRONMENT_MAP_OPTIONS } from './aircraftModelLighting.js';
import { fleetModelSet } from './fleetModels.js';
import { fleetModelSet, fleetPartTable } from './fleetModels.js';
import { findCamera, findDraw } from '../render/rendererOf.js';
import { fromDegrees, toLonLatH } from '../geo/ellipsoid.js';
import { horizonFrom } from '../geo/horizon.js';
@@ -116,6 +116,10 @@ let instances = 0;
* by their caps. Models are drawn at their true size.
* @param {(url: string) => string} [options.resolveAsset]
* @param {boolean} [options.waterline] Clip each model at its waterline.
* @param {(item: object, table: object) => object|undefined} [options.partState]
* The moving parts a vehicle's model is posed with (`ModelItem.parts`),
* from its item and its model's part table (`modelPartDrivers.js`); asked
* only for a model that has a part table.
* @param {object} [options.draw] Stands in for the viewer's draw port (tests).
* @returns {object}
*/
@@ -125,6 +129,7 @@ export function createFleetModelLayer({
policy,
waterline = false,
resolveAsset = (url) => url,
partState = null,
draw,
}) {
const port = draw ?? findDraw(viewer);
@@ -230,8 +235,15 @@ export function createFleetModelLayer({
return fromDegrees(at.lon, at.lat, at.height + lift);
}
/** The part state an item's model is posed with, or undefined. */
function partsOf(item) {
if (!partState) return undefined;
const table = fleetPartTable(fleetModelSet(), item.spec?.model);
return table ? partState(item, table) : undefined;
}
/** The draw item for an admitted model, as the set draws it, at `at`. */
function itemOf(id, record, item, show, boost, at = placement(item)) {
function itemOf(id, record, item, show, boost, at, parts) {
const mask = item.spec.tinted && !boost ? fleetColor(item.tint) : null;
return {
id,
@@ -259,6 +271,7 @@ export function createFleetModelLayer({
: { shading: 'pbr' }),
...(mask ? { maskColor: mask } : {}),
...(waterline ? { clip: 'belowOrigin' } : {}),
...(parts ? { parts } : {}),
meta: item.pickId ?? id,
show,
};
@@ -275,6 +288,8 @@ export function createFleetModelLayer({
const heading = item.headingDeg || 0;
const mask = item.spec.tinted && !boost ? fleetColor(item.tint) : null;
const meta = item.pickId ?? id;
const parts = partsOf(item);
const partsKey = parts ? JSON.stringify(parts) : '';
const sent = record.sent;
if (
sent !== null &&
@@ -286,7 +301,8 @@ export function createFleetModelLayer({
sameColor(sent.mask, mask) &&
sent.boost === boost &&
sent.show === show &&
sent.meta === meta
sent.meta === meta &&
sent.partsKey === partsKey
)
return null;
const next = (record.sent ??= {});
@@ -300,7 +316,8 @@ export function createFleetModelLayer({
next.boost = boost;
next.show = show;
next.meta = meta;
return itemOf(id, record, item, show, boost, at);
next.partsKey = partsKey;
return itemOf(id, record, item, show, boost, at, parts);
}
return {
+29
View File
@@ -20,6 +20,7 @@
*/
import { classifyAircraft } from './aircraftClass.js';
import { readPartTable } from '../render/modelParts.js';
import { FLEET_TRAIL_ANCHORS } from './fleetTrailAnchors.js';
import { isAidToNavigation } from './vesselTypes.js';
@@ -527,6 +528,34 @@ export function namedFleetModels(types) {
]);
}
/** Each loaded set's part tables by model name (null for a model without one). */
const partTables = new WeakMap();
/**
* The part table of model `name` in a loaded set, read once from its GLB:
* which moving parts it has (`render/modelParts.js`); null for a model
* without one, or whose GLB did not load.
* @param {{bytes?: Map<string, Uint8Array>}|null|undefined} set
* @param {string|null|undefined} name
* @returns {import('../render/modelParts').PartTable|null}
*/
export function fleetPartTable(set, name) {
const bytes = name ? set?.bytes?.get(name) : undefined;
if (!bytes) return null;
let tables = partTables.get(set);
if (!tables) partTables.set(set, (tables = new Map()));
if (!tables.has(name)) {
let table = null;
try {
table = readPartTable(bytes);
} catch {
// A malformed table: the model draws whole.
}
tables.set(name, table);
}
return tables.get(name);
}
let loading = null;
let loaded = null;
+243
View File
@@ -0,0 +1,243 @@
/**
* @module modelPartDrivers
* @description What the live layers ask of a fleet model's moving parts
* (`ModelItem.parts`), from a vehicle's own record: each a pure function of
* the model's part table and what the record says, so the same record poses
* the same parts at any time. A model without a part table gets none, and a
* renderer that does not pose parts draws the model whole, at rest.
*
* Which parts each rule drives is read from the table by kind and name:
*
* - **Aircraft and helicopters** ({@link aircraftPartState}). Spin parts
* named `fan…`, `prop…` and `rotor…` turn while the aircraft is airborne,
* or on the ground moving faster than {@link MOVING_MPS}. Hinge parts named
* `gear…` are down on the ground; in the air they come down between
* {@link GEAR_APPROACH_M} metres above the ground when descending faster
* than {@link DESCENDING_MPS} (an approach), and otherwise are down below
* {@link GEAR_TAKEOFF_M}`[0]` and up above `[1]` (after take-off), in
* between in proportion. Without a height above the ground (no ground
* height known under it), the gear is down while it descends faster than
* {@link DESCENDING_MPS} slower than {@link APPROACH_MPS} below
* {@link APPROACH_CEILING_M} (an approach: the highest runways are about
* 4,400 m up), and up otherwise. Their doors (`door…`) open over the first
* quarter of the gear's travel and stay open while it is out; flaps
* (`flap…`) follow the gear in the air and are up on the ground.
* - **Vessels** ({@link vesselPartState}): spin parts named `radar…` sweep
* while the vessel is under way, faster than {@link UNDER_WAY_MPS}.
* - **Road and rail vehicles** ({@link groundVehiclePartState}): spin parts
* named `axle…` roll with the vehicle's speed (their pivot's height is the
* wheel's radius), and slide parts named `doors…` are open while the
* vehicle is stopped at a stop.
*
* Fractions and speeds are rounded ({@link DEPLOY_STEP}, {@link SPEED_STEP_MPS})
* so a record that barely changes asks for the same state.
*/
/** Ground speed (m/s) above which a grounded aircraft's engines turn. */
export const MOVING_MPS = 1;
/** Vertical rate (m/s, negative down) below which an aircraft is descending. */
export const DESCENDING_MPS = -1;
/** Heights above the ground (m) over which the gear comes down on approach: up at the first, down at the second. */
export const GEAR_APPROACH_M = Object.freeze([750, 600]);
/** Heights above the ground (m) over which the gear goes up otherwise: down at the first, up at the second. */
export const GEAR_TAKEOFF_M = Object.freeze([100, 300]);
/** Ground speed (m/s) under which a descending aircraft is on approach, where no ground height is known (about 165 kt). */
export const APPROACH_MPS = 85;
/** Altitude (m) under which a descending aircraft may be on approach, where no ground height is known. */
export const APPROACH_CEILING_M = 5000;
/** Speed (m/s) above which a vessel is under way. */
export const UNDER_WAY_MPS = 0.5;
/** Speed (m/s) under which a vehicle at a stop is stopped there. */
export const STOPPED_MPS = 0.5;
/** Deploy fractions are rounded to this step. */
export const DEPLOY_STEP = 1 / 32;
/** Speeds are rounded to this step (m/s) before they turn wheels. */
export const SPEED_STEP_MPS = 0.5;
/** Degrees a second each spinning part turns at, by name. */
export const SPIN_RATES_DPS = Object.freeze({
rotor_tail: 3000,
rotor: 1080,
prop: 1500,
fan: 900,
radar: 144,
});
/** A wheel's radius (m) where its axle's pivot does not say. */
const DEFAULT_WHEEL_RADIUS_M = 0.4;
const RADIANS_TO_DEGREES = 180 / Math.PI;
/** `value` rounded to `step`. */
const rounded = (value, step) => Math.round(value / step) * step;
/** 0..1 between `from` (0) and `to` (1), linear, clamped. */
function ramp(value, from, to) {
const t = (value - from) / (to - from);
return Math.min(1, Math.max(0, t));
}
/**
* Whether an aircraft's engines and rotors turn: airborne, or on the ground
* moving faster than {@link MOVING_MPS}. The rotor sprite (`rotorFrames.js`)
* follows the same rule as the model's spinning parts.
* @param {{onGround?: boolean, speedMps?: number|null}} aircraft
* @returns {boolean}
*/
export function enginesTurn({ onGround, speedMps }) {
return (
!onGround ||
(typeof speedMps === 'number' &&
Number.isFinite(speedMps) &&
speedMps > MOVING_MPS)
);
}
/** A spin part's rate by its name, or 0 for a name not listed. */
function spinRate(name) {
if (name === 'rotor_tail') return SPIN_RATES_DPS.rotor_tail;
for (const prefix of ['rotor', 'prop', 'fan', 'radar'])
if (name.startsWith(prefix)) return SPIN_RATES_DPS[prefix];
return 0;
}
/** Each part of `kind` whose name starts with one of `prefixes`. */
function* partsOf(table, kind, prefixes) {
for (const part of table?.parts ?? [])
if (part.kind === kind && prefixes.some((p) => part.name.startsWith(p)))
yield part;
}
/** A state with only the members that name a part; undefined for none. */
function stateOf(spin, deploy) {
const out = {};
if (Object.keys(spin).length) out.spin = spin;
if (Object.keys(deploy).length) out.deploy = deploy;
return out.spin || out.deploy ? out : undefined;
}
/**
* How far an aircraft's gear is down, 0 (up) to 1 (down), by the rule in the
* module comment.
* @param {{onGround?: boolean, heightAboveGroundM?: number|null,
* altitudeM?: number|null, verticalRateMps?: number|null,
* speedMps?: number|null}} aircraft
* @returns {number}
*/
export function gearDown({
onGround,
heightAboveGroundM,
altitudeM,
verticalRateMps,
speedMps,
}) {
if (onGround) return 1;
const known = (v) => typeof v === 'number' && Number.isFinite(v);
const descending = known(verticalRateMps) && verticalRateMps < DESCENDING_MPS;
const h = heightAboveGroundM;
if (!known(h))
return descending &&
known(speedMps) &&
speedMps < APPROACH_MPS &&
(!known(altitudeM) || altitudeM < APPROACH_CEILING_M)
? 1
: 0;
const down = descending
? Math.max(
ramp(h, GEAR_APPROACH_M[0], GEAR_APPROACH_M[1]),
ramp(h, GEAR_TAKEOFF_M[1], GEAR_TAKEOFF_M[0]),
)
: ramp(h, GEAR_TAKEOFF_M[1], GEAR_TAKEOFF_M[0]);
return rounded(down, DEPLOY_STEP);
}
/**
* An aircraft's or helicopter's part state, by the rule in the module
* comment; undefined when its model has no part the rule drives.
* @param {import('../render/modelParts').PartTable|null|undefined} table
* @param {{onGround?: boolean, heightAboveGroundM?: number|null,
* altitudeM?: number|null, verticalRateMps?: number|null,
* speedMps?: number|null}} aircraft
* @returns {import('../render/contract/draw').ModelPartState|undefined}
*/
export function aircraftPartState(table, aircraft) {
if (!table) return undefined;
const spin = {};
const deploy = {};
if (enginesTurn(aircraft))
for (const part of partsOf(table, 'spin', ['fan', 'prop', 'rotor']))
spin[part.name] = spinRate(part.name);
const gear = gearDown(aircraft);
const doors = Math.min(1, rounded(gear * 4, DEPLOY_STEP));
for (const part of partsOf(table, 'hinge', ['gear']))
deploy[part.name] = gear;
for (const part of partsOf(table, 'hinge', ['door']))
deploy[part.name] = doors;
for (const part of partsOf(table, 'hinge', ['flap']))
deploy[part.name] = aircraft.onGround ? 0 : gear;
return stateOf(spin, deploy);
}
/**
* The part state of a contact in an aircraft layer: an airport vehicle
* (class `vehicle`) is a road vehicle ({@link groundVehiclePartState}, its
* wheels rolling with its speed, never at a stop), every other contact an
* aircraft ({@link aircraftPartState}).
* @param {import('../render/modelParts').PartTable|null|undefined} table
* @param {{klass?: string|null, onGround?: boolean,
* heightAboveGroundM?: number|null, altitudeM?: number|null,
* verticalRateMps?: number|null, speedMps?: number|null}} contact
* @returns {import('../render/contract/draw').ModelPartState|undefined}
*/
export function aircraftLayerPartState(table, contact) {
return contact.klass === 'vehicle'
? groundVehiclePartState(table, { speedMps: contact.speedMps })
: aircraftPartState(table, contact);
}
/**
* A vessel's part state, by the rule in the module comment; undefined when
* it is not under way or its model has no radar.
* @param {import('../render/modelParts').PartTable|null|undefined} table
* @param {{speedMps?: number|null}} vessel
* @returns {import('../render/contract/draw').ModelPartState|undefined}
*/
export function vesselPartState(table, { speedMps }) {
if (!table || !(typeof speedMps === 'number' && speedMps > UNDER_WAY_MPS))
return undefined;
const spin = {};
for (const part of partsOf(table, 'spin', ['radar']))
spin[part.name] = SPIN_RATES_DPS.radar;
return stateOf(spin, {});
}
/**
* A road or rail vehicle's part state, by the rule in the module comment;
* undefined when it neither moves nor stands at a stop, or its model has no
* part the rule drives.
* @param {import('../render/modelParts').PartTable|null|undefined} table
* @param {{speedMps?: number|null, atStop?: boolean}} vehicle
* @returns {import('../render/contract/draw').ModelPartState|undefined}
*/
export function groundVehiclePartState(table, { speedMps, atStop }) {
if (!table) return undefined;
const speed =
typeof speedMps === 'number' && Number.isFinite(speedMps)
? rounded(Math.max(0, speedMps), SPEED_STEP_MPS)
: 0;
const spin = {};
const deploy = {};
if (speed > 0)
for (const part of partsOf(table, 'spin', ['axle'])) {
const radius =
part.pivot[1] > 0.05 ? part.pivot[1] : DEFAULT_WHEEL_RADIUS_M;
// Rolling forward (−X) on the ground turns a wheel about +Z (its left).
const sign = Math.sign(part.axis?.[2] ?? 0);
if (sign !== 0)
spin[part.name] = (sign * speed * RADIANS_TO_DEGREES) / radius;
}
if (atStop && speed < STOPPED_MPS)
for (const part of partsOf(table, 'slide', ['doors']))
deploy[part.name] = 1;
return stateOf(spin, deploy);
}
+257
View File
@@ -0,0 +1,257 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';
import {
aircraftLayerPartState,
aircraftPartState,
enginesTurn,
gearDown,
groundVehiclePartState,
SPIN_RATES_DPS,
vesselPartState,
} from './modelPartDrivers.js';
import { fleetPartTable } from './fleetModels.js';
import { partTableOf } from '../render/modelParts.js';
import { partsModelGlb } from '../render/conformance/partsModel.js';
const AIRLINER = partTableOf({
parts: [
{ name: 'body', kind: 'body' },
{ name: 'flap_right', kind: 'hinge', axis: [0, 0, -1], limits: [0, 40] },
{ name: 'engine_right', kind: 'marker' },
{
name: 'fan_right',
kind: 'spin',
parent: 'engine_right',
axis: [1, 0, 0],
},
{ name: 'gear_nose', kind: 'hinge', axis: [0, 0, 1], limits: [90, 0] },
{
name: 'door_nose_right',
kind: 'hinge',
axis: [1, 0, 0],
limits: [0, 90],
},
{ name: 'gear_right', kind: 'hinge', axis: [-1, 0, 0], limits: [90, 0] },
],
});
const HELICOPTER = partTableOf({
parts: [
{ name: 'body', kind: 'body' },
{ name: 'rotor_main', kind: 'spin', axis: [0, 1, 0] },
{ name: 'rotor_tail', kind: 'spin', axis: [0, 0, -1] },
{ name: 'skids', kind: 'marker' },
],
});
const TRAWLER = partTableOf({
parts: [
{ name: 'body', kind: 'body' },
{ name: 'radar', kind: 'spin', pivot: [-4, 10, 0], axis: [0, 1, 0] },
{ name: 'bridge', kind: 'marker' },
],
});
const BUS = partTableOf({
parts: [
{ name: 'body', kind: 'body' },
{
name: 'doors_right',
kind: 'slide',
pivot: [-4.75, 0.35, -1.3],
axis: [1, 0, 0],
limits: [0, 1.08],
},
{ name: 'axle_1', kind: 'spin', pivot: [-3.3, 0.5, 0], axis: [0, 0, -1] },
{ name: 'axle_2', kind: 'spin', pivot: [2.6, 0.5, 0], axis: [0, 0, -1] },
],
});
test('the gear is down on the ground and up in cruise', () => {
assert.equal(gearDown({ onGround: true }), 1);
assert.equal(gearDown({ heightAboveGroundM: 10000, verticalRateMps: 0 }), 0);
assert.equal(
gearDown({ heightAboveGroundM: 10000, verticalRateMps: -10 }),
0,
);
// No height known: up.
assert.equal(gearDown({ heightAboveGroundM: null }), 0);
});
test('without a ground height, the gear is down on approach: descending, slow and low', () => {
// Denver: 1,650 m up, the ground under it unknown.
const at = (fields) => gearDown({ heightAboveGroundM: null, ...fields });
assert.equal(at({ altitudeM: 2000, verticalRateMps: -4, speedMps: 70 }), 1);
// Climbing out, cruising, or descending fast: up.
assert.equal(at({ altitudeM: 2000, verticalRateMps: 8, speedMps: 70 }), 0);
assert.equal(at({ altitudeM: 11000, verticalRateMps: -4, speedMps: 70 }), 0);
assert.equal(at({ altitudeM: 3000, verticalRateMps: -8, speedMps: 140 }), 0);
// Without a speed it cannot tell: up.
assert.equal(at({ altitudeM: 2000, verticalRateMps: -4 }), 0);
});
test('on approach the gear comes down between 750 and 600 m above the ground', () => {
const at = (h) => gearDown({ heightAboveGroundM: h, verticalRateMps: -4 });
assert.equal(at(800), 0);
assert.equal(at(675), 0.5);
assert.equal(at(600), 1);
assert.equal(at(50), 1);
});
test('climbing or level, the gear goes up between 100 and 300 m', () => {
const at = (h) => gearDown({ heightAboveGroundM: h, verticalRateMps: 8 });
assert.equal(at(50), 1);
assert.equal(at(200), 0.5);
assert.equal(at(300), 0);
assert.equal(at(700), 0);
// Level at 700 m: up; descending through it: up until the approach band.
assert.equal(gearDown({ heightAboveGroundM: 700, verticalRateMps: 0 }), 0);
});
test('an airliner in cruise spins its fans, gear, doors and flaps up', () => {
const state = aircraftPartState(AIRLINER, {
onGround: false,
heightAboveGroundM: 11000,
verticalRateMps: 0,
speedMps: 230,
});
assert.deepEqual(state, {
spin: { fan_right: SPIN_RATES_DPS.fan },
deploy: {
flap_right: 0,
gear_nose: 0,
door_nose_right: 0,
gear_right: 0,
},
});
});
test('an airliner on final has gear, doors and flaps down', () => {
const state = aircraftPartState(AIRLINER, {
onGround: false,
heightAboveGroundM: 300,
verticalRateMps: -4,
speedMps: 70,
});
assert.deepEqual(state.deploy, {
flap_right: 1,
gear_nose: 1,
door_nose_right: 1,
gear_right: 1,
});
// The doors open over the first quarter of the gear's travel.
const coming = aircraftPartState(AIRLINER, {
heightAboveGroundM: 745,
verticalRateMps: -4,
});
assert.ok(coming.deploy.gear_nose > 0 && coming.deploy.gear_nose < 0.25);
assert.ok(coming.deploy.door_nose_right > coming.deploy.gear_nose);
});
test('parked, its engines stop; taxiing, they turn; its flaps are up on the ground', () => {
const parked = aircraftPartState(AIRLINER, { onGround: true, speedMps: 0 });
assert.equal(parked.spin, undefined);
assert.equal(parked.deploy.gear_nose, 1);
assert.equal(parked.deploy.flap_right, 0);
const taxiing = aircraftPartState(AIRLINER, { onGround: true, speedMps: 8 });
assert.equal(taxiing.spin.fan_right, SPIN_RATES_DPS.fan);
});
test('a helicopter’s rotors turn in the air and stop on the ground', () => {
const flying = aircraftPartState(HELICOPTER, {
onGround: false,
heightAboveGroundM: 300,
});
assert.deepEqual(flying, {
spin: {
rotor_main: SPIN_RATES_DPS.rotor,
rotor_tail: SPIN_RATES_DPS.rotor_tail,
},
});
assert.equal(
aircraftPartState(HELICOPTER, { onGround: true, speedMps: 0 }),
undefined,
);
});
test('a vessel’s radar sweeps while it is under way', () => {
assert.deepEqual(vesselPartState(TRAWLER, { speedMps: 4 }), {
spin: { radar: SPIN_RATES_DPS.radar },
});
assert.equal(vesselPartState(TRAWLER, { speedMps: 0.2 }), undefined);
assert.equal(vesselPartState(TRAWLER, { speedMps: null }), undefined);
// A model without a radar, or without a table, gets nothing.
assert.equal(vesselPartState(HELICOPTER, { speedMps: 4 }), undefined);
assert.equal(vesselPartState(null, { speedMps: 4 }), undefined);
});
test('a bus’s wheels roll with its speed, top forward; its doors open at a stop', () => {
const moving = groundVehiclePartState(BUS, { speedMps: 10 });
// 10 m/s on 0.5 m wheels: 20 rad/s, about +Z (its left), the top rolling forward.
const rate = -(10 / 0.5) * (180 / Math.PI);
assert.ok(Math.abs(moving.spin.axle_1 - rate) < 1e-9);
assert.equal(moving.deploy, undefined);
const stopped = groundVehiclePartState(BUS, { speedMps: 0, atStop: true });
assert.deepEqual(stopped, { deploy: { doors_right: 1 } });
assert.equal(
groundVehiclePartState(BUS, { speedMps: 0, atStop: false }),
undefined,
);
// Speeds are rounded: 10.1 m/s turns the wheels as 10 does.
assert.deepEqual(groundVehiclePartState(BUS, { speedMps: 10.1 }), moving);
});
test('an airport vehicle rolls its wheels and never holds its doors open; an aircraft is posed as one', () => {
// A van: wheels roll with its speed.
const rolling = aircraftLayerPartState(BUS, {
klass: 'vehicle',
onGround: true,
speedMps: 10,
});
assert.deepEqual(rolling, groundVehiclePartState(BUS, { speedMps: 10 }));
assert.ok(rolling.spin.axle_1 !== 0);
// Stopped on the apron it is not at a stop: its doors stay shut.
assert.equal(
aircraftLayerPartState(BUS, {
klass: 'vehicle',
onGround: true,
speedMps: 0,
}),
undefined,
);
// Every other class is an aircraft.
const flying = {
klass: 'helicopter',
onGround: false,
heightAboveGroundM: 300,
};
assert.deepEqual(
aircraftLayerPartState(HELICOPTER, flying),
aircraftPartState(HELICOPTER, flying),
);
});
test('engines and rotors turn in the air, or on the ground faster than 1 m/s', () => {
assert.equal(enginesTurn({ onGround: false }), true);
assert.equal(enginesTurn({ onGround: true, speedMps: 0 }), false);
assert.equal(enginesTurn({ onGround: true, speedMps: 1 }), false);
assert.equal(enginesTurn({ onGround: true, speedMps: 1.5 }), true);
assert.equal(enginesTurn({ onGround: true, speedMps: null }), false);
assert.equal(enginesTurn({ onGround: true, speedMps: Number.NaN }), false);
});
test('a model of a loaded set has its part table, read once', () => {
const set = { bytes: new Map([['pod', partsModelGlb()]]) };
const table = fleetPartTable(set, 'pod');
assert.deepEqual(
table.parts.map((p) => p.name),
['body', 'pod', 'ram', 'arm'],
);
assert.equal(fleetPartTable(set, 'pod'), table);
assert.equal(fleetPartTable(set, 'missing'), null);
assert.equal(fleetPartTable(null, 'pod'), null);
// A model without a table has none.
const plain = { bytes: new Map([['x', new Uint8Array(4)]]) };
assert.equal(fleetPartTable(plain, 'x'), null);
});
+75
View File
@@ -0,0 +1,75 @@
/**
* @module rotorFrames
* @description Which rotor frame a helicopter icon shows at a time
* (`aircraftIcon('helicopter', px, frame)`). The frames step at
* {@link ROTOR_FPS}; each contact starts at its own phase, taken from its
* id, so helicopters flying together do not change frame in step. The
* rotor turns as the 3D model's does (`enginesTurn`): airborne, or on the
* ground moving faster than 1 m/s; otherwise it holds the still frame.
*/
import { ROTOR_FRAMES, ROTOR_STILL_FRAME } from './aircraftIcons.js';
import { enginesTurn } from './modelPartDrivers.js';
export { ROTOR_FRAMES, ROTOR_STILL_FRAME };
/** Rotor frames shown per second. */
export const ROTOR_FPS = 10;
/** Phase by id: hashing each id once, as many as the helicopters seen. */
const phases = new Map();
const PHASES_MAX = 4096;
/**
* A contact's phase, 0 (inclusive) to 1, the same for the same id every
* time (FNV-1a over its characters, mixed).
* @param {string} id
* @returns {number}
*/
export function rotorPhase(id) {
const key = String(id ?? '');
let phase = phases.get(key);
if (phase !== undefined) return phase;
let hash = 0x811c9dc5;
for (let i = 0; i < key.length; i++) {
hash ^= key.charCodeAt(i);
hash = Math.imul(hash, 0x01000193);
}
// Mixed (MurmurHash3's finaliser), so ids differing in their last
// characters, as ICAO addresses do, spread over the whole range.
hash ^= hash >>> 16;
hash = Math.imul(hash, 0x85ebca6b);
hash ^= hash >>> 13;
hash = Math.imul(hash, 0xc2b2ae35);
hash ^= hash >>> 16;
phase = (hash >>> 0) / 0x100000000;
if (phases.size >= PHASES_MAX) phases.clear();
phases.set(key, phase);
return phase;
}
/**
* Whether a helicopter's rotor turns: airborne, or taxiing (`enginesTurn`).
* @param {{onGround?: boolean, speedMps?: number|null}} [state]
* @returns {boolean}
*/
export function rotorTurns({ onGround = false, speedMps = null } = {}) {
return enginesTurn({ onGround, speedMps });
}
/**
* The rotor frame a helicopter shows at `nowMs`: the still frame while its
* rotor does not turn ({@link rotorTurns}), else stepping through the frames
* at `ROTOR_FPS` from its phase.
* @param {string} id
* @param {number} nowMs Epoch ms (any steady clock).
* @param {{onGround?: boolean, speedMps?: number|null}} [state] Ground speed in m/s.
* @returns {number} 0 to `ROTOR_FRAMES - 1`.
*/
export function rotorFrame(id, nowMs, state = {}) {
if (!rotorTurns(state) || !Number.isFinite(nowMs)) return ROTOR_STILL_FRAME;
const step = Math.floor(
(nowMs / 1000) * ROTOR_FPS + rotorPhase(id) * ROTOR_FRAMES,
);
return ((step % ROTOR_FRAMES) + ROTOR_FRAMES) % ROTOR_FRAMES;
}
+102
View File
@@ -0,0 +1,102 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { aircraftPartState } from './modelPartDrivers.js';
import { partTableOf } from '../render/modelParts.js';
import {
ROTOR_FPS,
ROTOR_FRAMES,
ROTOR_STILL_FRAME,
rotorFrame,
rotorPhase,
rotorTurns,
} from './rotorFrames.js';
import { aircraftIcon } from './aircraftIcons.js';
const svg = (uri) =>
Buffer.from(uri.slice(uri.indexOf(',') + 1), 'base64').toString('utf8');
test('the helicopter has three rotor frames, each its own image', () => {
assert.equal(ROTOR_FRAMES, 3);
const frames = [0, 1, 2].map((frame) =>
aircraftIcon('helicopter', 64, frame),
);
assert.equal(new Set(frames).size, 3);
// Frames 30° apart on a four-blade rotor: the third steps back onto the
// first, a seamless loop.
assert.match(svg(frames[0]), /rotate\(15 0 -11\.2\)/);
assert.match(svg(frames[1]), /rotate\(45 0 -11\.2\)/);
assert.match(svg(frames[2]), /rotate\(75 0 -11\.2\)/);
// No frame, or one out of range, is the still frame.
assert.equal(aircraftIcon('helicopter', 64), frames[ROTOR_STILL_FRAME]);
assert.equal(aircraftIcon('helicopter', 64, 7), frames[ROTOR_STILL_FRAME]);
// Other kinds have one image whatever the frame.
assert.equal(aircraftIcon('airliner', 64, 2), aircraftIcon('airliner', 64));
});
test('frames step at the rotor rate through every frame in order', () => {
const id = 'abc123';
const stepMs = 1000 / ROTOR_FPS;
const start = 1_700_000_000_000;
const seen = [];
for (let i = 0; i < 9; i++) seen.push(rotorFrame(id, start + i * stepMs + 1));
for (let i = 1; i < seen.length; i++)
assert.equal(seen[i], (seen[i - 1] + 1) % ROTOR_FRAMES, seen.join(','));
// Within one step it holds.
const at = start + 5 * stepMs + 1;
const held = rotorFrame(id, at);
for (let ms = 0; ms < stepMs; ms += 10) {
const frame = rotorFrame(id, at + ms);
assert.ok(frame === held || frame === (held + 1) % ROTOR_FRAMES);
}
});
test('each contact has its own phase, so a group does not change in step', () => {
assert.equal(rotorPhase('abc123'), rotorPhase('abc123'));
const ids = Array.from(
{ length: 24 },
(_, i) => `a${i.toString(16).padStart(5, '0')}`,
);
const phases = ids.map(rotorPhase);
for (const phase of phases) assert.ok(phase >= 0 && phase < 1);
assert.ok(new Set(phases).size > 20, 'phases differ by contact');
// At one instant the group shows every frame, not one.
const at = 1_700_000_000_000;
const frames = new Set(ids.map((id) => rotorFrame(id, at)));
assert.equal(frames.size, ROTOR_FRAMES);
});
test('the rotor sprite turns exactly when the model’s rotor does: in the air, or taxiing', () => {
const table = partTableOf({
parts: [
{ name: 'body', kind: 'body' },
{ name: 'rotor_main', kind: 'spin', axis: [0, 1, 0] },
],
});
const stepMs = 1000 / ROTOR_FPS;
for (const state of [
{ onGround: false },
{ onGround: true, speedMps: 0 },
{ onGround: true, speedMps: 1 },
{ onGround: true, speedMps: 3 },
{ onGround: true, speedMps: null },
]) {
const modelSpins = aircraftPartState(table, state)?.spin?.rotor_main > 0;
assert.equal(rotorTurns(state), modelSpins, JSON.stringify(state));
const frames = new Set(
[0, 1, 2, 3].map((i) =>
rotorFrame('abc123', 1_700_000_000_000 + i * stepMs + 1, state),
),
);
assert.equal(frames.size, modelSpins ? ROTOR_FRAMES : 1);
}
});
test('a helicopter on the ground holds the still frame', () => {
const stepMs = 1000 / ROTOR_FPS;
for (let i = 0; i < 6; i++)
assert.equal(
rotorFrame('abc123', 1_700_000_000_000 + i * stepMs, { onGround: true }),
ROTOR_STILL_FRAME,
);
assert.equal(rotorFrame('abc123', Number.NaN), ROTOR_STILL_FRAME);
});
+29 -1
View File
@@ -38,6 +38,29 @@ function courseBetween(from, to) {
return (toDegrees(Math.atan2(y, x)) + 360) % 360;
}
/**
* Where in `fixes` (in time order) the fixes to make begin: the last at or
* before the newest a contact holds, so the held run goes on into the new
* one and its seam is made again from the new run (its course heads where
* the new run goes, at the new record's height), and those after it. 0
* unless `history` is its own fixes around a time (`timeline` entries) and
* `fixes` starts at or before the newest of them and reaches it.
* @param {object[]|undefined} history
* @param {Array<{atMs: number}>} fixes
* @returns {number}
*/
function heldThrough(history, fixes) {
const newest = history?.[history.length - 1];
if (!newest || history[0].timeline !== true || newest.timeline !== true)
return 0;
const heldMs = newest.epochMs;
if (!(fixes[0].atMs <= heldMs && fixes[fixes.length - 1].atMs >= heldMs))
return 0;
let index = 0;
while (index < fixes.length && fixes[index].atMs <= heldMs) index++;
return index - 1;
}
/**
* An aircraft's motion history with the fixes its record carries at a time
* (`observation.fixes`, see src/time/timelineFixes.js) merged in, so the
@@ -65,7 +88,12 @@ export function mergeAircraftTimelineFixes(
const baroM = Number.isFinite(observation.baroAltitudeM)
? observation.baroAltitudeM
: null;
const entries = fixes.map((fix, index) => {
// Playing on, the next snapshot's fixes mostly repeat those held: when its
// run reaches back into the held fixes, those stay as they are and only
// the seam and the fixes past it are made and added.
const from = heldThrough(history, fixes);
const entries = fixes.slice(from).map((fix, offset) => {
const index = from + offset;
const course =
index + 1 < fixes.length
? courseBetween(fix, fixes[index + 1])
+82
View File
@@ -145,3 +145,85 @@ test("a tracked trail takes the fixes after its newest point, up to the snapshot
);
assert.equal(historyAfterTrail(history, [], 120_000).length, 3);
});
test('playing on, the fixes a contact holds stay as they are and only the seam and newer ones are made', () => {
const held = mergeAircraftTimelineFixes(
[],
{ fixes: [fix(0, 0), fix(60_000, 1), fix(120_000, 2)] },
META,
100,
60_000,
);
const kept = held.map((entry) => entry);
// The next snapshot's run reaches back into the held fixes, a little
// differently picked: those held stay, the newer are added after them.
const next = mergeAircraftTimelineFixes(
held,
{
fixes: [
fix(30_000, 0.6),
fix(90_000, 1.6),
fix(120_000, 2.1),
fix(180_000, 3),
fix(240_000, 4),
],
},
META,
100,
120_000,
);
assert.deepEqual(
next.map((entry) => entry.epochMs),
[0, 60_000, 120_000, 180_000, 240_000],
);
for (const [k, entry] of kept.slice(0, -1).entries())
assert.equal(next[k], entry, 'a held entry is kept, not made again');
// The seam is made again from the new run: its course heads where the
// new run goes, so the course and height do not step there.
assert.notEqual(next[2], kept[2]);
const lat = (entry) =>
Cesium.Math.toDegrees(
Cesium.Cartographic.fromCartesian(entry.position).latitude,
);
assert.ok(Math.abs(lat(next[2]) - 2.1) < 1e-9);
assert.ok(Math.abs(lat(next[3]) - 3) < 1e-9);
// Each new fix heads where the track goes next, read from the new run.
assert.ok(
Math.abs(next[3].track) < 1e-6 || Math.abs(next[3].track - 360) < 1e-6,
);
});
test('a run that starts after the held fixes, or a history not of its own fixes, is merged whole', () => {
const held = mergeAircraftTimelineFixes(
[],
{ fixes: [fix(0, 0), fix(60_000, 1)] },
META,
100,
0,
);
const later = mergeAircraftTimelineFixes(
held,
{ fixes: [fix(120_000, 2), fix(180_000, 3)] },
META,
100,
120_000,
);
assert.deepEqual(
later.map((entry) => entry.epochMs),
[0, 60_000, 120_000, 180_000],
);
// A run reaching back over the held fixes replaces them, as before, when
// the history holds a live report.
const report = { ...held[1], timeline: undefined };
const mixed = mergeAircraftTimelineFixes(
[held[0], report],
{ fixes: [fix(30_000, 0.5), fix(90_000, 1.5)] },
META,
100,
60_000,
);
assert.deepEqual(
mixed.map((entry) => entry.epochMs),
[0, 30_000, 90_000],
);
});
+7
View File
@@ -0,0 +1,7 @@
/**
* @module units
* @description Unit conversions the layers share.
*/
/** Metres a second in one knot (one nautical mile, 1852 m, an hour). */
export const KNOT_MPS = 1852 / 3600;
+15 -37
View File
@@ -5,7 +5,11 @@
*/
import { t, msg } from '../i18n/index.js';
import { normalizeVesselType } from './vesselTypes.js';
import {
normalizeVesselType,
vesselKind,
VESSEL_KIND_STYLES,
} from './vesselTypes.js';
export { normalizeVesselType };
@@ -22,32 +26,7 @@ export const VESSEL_CARD_FADE_DISTANCE_M = 5_000_000;
export const VESSEL_CARD_FADE_START_RATIO = 0.7;
/**
* AIS type family → chevron hue + card accent. Single source of truth for
* vessel type colors so billboard chevrons and host cards cannot drift apart.
*/
const TYPE_STYLES = [
{ pattern: /tanker/i, css: '#ffb347', accent: '255, 179, 71' },
{
pattern: /cargo|container|bulk|carrier/i,
css: '#39d5ff',
accent: '57, 213, 255',
},
{
pattern: /passenger|ferry|cruise/i,
css: '#ff7adf',
accent: '255, 122, 223',
},
{ pattern: /fishing/i, css: '#7cff9b', accent: '124, 255, 155' },
{
pattern: /tug|tow|pilot|supply|service/i,
css: '#f7f0a3',
accent: '247, 240, 163',
},
];
const DEFAULT_STYLE = { css: '#39d5ff', accent: '57, 213, 255' };
/**
* An aid to navigation's disc and card accent: a bone white apart from every
* An aid to navigation's buoy and card accent: a bone white apart from every
* ship type's colour.
*/
export const AID_TO_NAVIGATION_STYLE = Object.freeze({
@@ -55,8 +34,8 @@ export const AID_TO_NAVIGATION_STYLE = Object.freeze({
accent: '217, 210, 192',
});
// Card text for the type tokens above. The tokens stay English: TYPE_STYLES
// and tests match on them.
// Card text for the type tokens above. The tokens stay English: the vessel
// kinds (`vesselKind`) and tests match on them.
const TYPE_DISPLAY_KEYS = Object.freeze({
FISHING: msg('FISHING'),
TOWING: msg('TOWING'),
@@ -91,19 +70,18 @@ export function displayVesselType(type) {
return key ? t(key) : normalized;
}
/** AIS ship type → CSS hex hue for the billboard chevron. */
/**
* AIS ship type → CSS hex colour its sprite is tinted with. The sprite and
* the card take it from the vessel's kind (`vesselKind`), so they cannot
* drift apart.
*/
export function vesselTypeCss(type) {
return styleForType(type).css;
return VESSEL_KIND_STYLES[vesselKind(type)].css;
}
/** AIS ship type → "r, g, b" accent string for the host card. */
export function accentForVesselType(type) {
return styleForType(type).accent;
}
function styleForType(type) {
const text = normalizeVesselType(type);
return TYPE_STYLES.find((entry) => entry.pattern.test(text)) || DEFAULT_STYLE;
return VESSEL_KIND_STYLES[vesselKind(type)].accent;
}
/**
+167
View File
@@ -0,0 +1,167 @@
/**
* @module vesselSprites
* @description The map sprites of the vessel layer, as SVG data URIs: one hull
* per vessel kind (`vesselKind` in vesselTypes.js), seen from above with its
* bow up (north), and one buoy for every aid to navigation, standing upright.
*
* Every sprite is white with dark detail, drawn on the 96-unit frame of
* aircraftIcons.js (centre 48,48). The layer tints it at draw time (the
* kind's colour, white while selected), so one image serves every colour and
* state, as the aircraft glyphs do: one icon-atlas slot per shape. Hulls
* share one length and differ in shape only; widths are exaggerated so they
* read at small sizes.
*/
const VIEW = 96;
const C = VIEW / 2;
/** Raster size of every vessel sprite (px): sharp at its largest drawn size. */
export const VESSEL_SPRITE_PX = 64;
/** The hull edge: dark so a light tint still reads on light ground. */
const EDGE =
'stroke="rgba(4,18,24,0.9)" stroke-width="2.1" stroke-linejoin="round"';
/** Superstructure and deck detail: dark, so tinting leaves it dark. */
const DETAIL = 'fill="rgba(4,18,24,0.42)"';
/** Each kind's hull and detail, centred, bow toward −Y. */
const HULLS = {
// Container ship: fine bow, long parallel sides, square stern; container
// rows forward and the bridge aft.
cargo: `
<path d="M0,-43 C -7,-41 -13,-36 -16.8,-28 L -16.8,37 L -14.7,43 L 14.7,43
L 16.8,37 L 16.8,-28 C 13,-36 7,-41 0,-43 Z" fill="white" ${EDGE}/>
<path d="M-13,-26 h26 v5 h-26 Z M-13,-19 h26 v5 h-26 Z M-13,-12 h26 v5 h-26 Z
M-13,-5 h26 v5 h-26 Z M-13,2 h26 v5 h-26 Z M-13,9 h26 v5 h-26 Z
M-13,16 h26 v5 h-26 Z M-16,26 h32 v4 h-32 Z" ${DETAIL}/>`,
// Tanker: full bow, a pipe run down the centre line with its manifold
// across, the bridge aft.
tanker: `
<path d="M0,-43 C -8,-42 -15,-37 -17.9,-30 L -17.9,36 L -15.3,43 L 15.3,43
L 17.9,36 L 17.9,-30 C 15,-37 8,-42 0,-43 Z" fill="white" ${EDGE}/>
<path d="M-1.3,-34 h2.6 v62 h-2.6 Z M-14,-5.6 h28 v3.2 h-28 Z
M-17.4,28.6 h34.8 v5.3 h-34.8 Z" ${DETAIL}/>`,
// Passenger ship or ferry: a superstructure covering nearly the whole deck.
passenger: `
<path d="M0,-43 C -6,-41.5 -12,-36 -15.3,-29.6 L -17.1,-28 L -17.1,30.5
L -15.6,39 L -14.2,43 L 14.2,43 L 15.6,39 L 17.1,30.5 L 17.1,-28
L 15.3,-29.6 C 12,-36 6,-41.5 0,-43 Z" fill="white" ${EDGE}/>
<path d="M-14.6,-27 h29.2 v55 h-29.2 Z" ${DETAIL}/>
<path d="M-2.5,6 h5 v8 h-5 Z" fill="white"/>`,
// High-speed craft: a catamaran, two slim bows and a square stern.
highspeed: `
<path d="M-17.9,-32.3 L -16.1,-33.1 L -14.7,-39.9 L -13.4,-43 L -12.1,-40.7
L -9.9,-32.4 L 9.9,-32.4 L 12.1,-40.7 L 13.4,-43 L 14.7,-39.9
L 16.1,-33.1 L 17.9,-32.3 L 17.9,43 L 9.3,43 L 8.3,42.2 L -8.3,42.2
L -9.3,43 L -17.9,43 Z" fill="white" ${EDGE}/>
<path d="M-9.7,-14.6 h19.4 v12.8 h-19.4 Z" ${DETAIL}/>`,
// Fishing vessel: a narrow hull, the wheelhouse forward and outrigger
// booms across amidships.
fishing: `
<path d="M-24,2.3 h48 v3.2 h-48 Z" fill="white" ${EDGE}/>
<path d="M0,-43 C -5,-40 -9.5,-31 -11.7,-24.8 L -13.1,-17.7 L -13.1,30.4
L -11.1,41.1 L -9.9,43 L 9.9,43 L 11.1,41.1 L 13.1,30.4 L 13.1,-17.7
L 11.7,-24.8 C 9.5,-31 5,-40 0,-43 Z" fill="white" ${EDGE}/>
<path d="M-8.8,-20.4 h17.6 v12.1 h-17.6 Z" ${DETAIL}/>`,
// Tug, pilot or service boat: short, wide and blunt, the wheelhouse
// amidships and two towing bitts aft.
tug: `
<path d="M-7,-43 L 7,-43 C 14,-40 20,-33 22.5,-22 L 24,-13 L 24,19
C 24,28 21,36 17,42 L 16,43 L -16,43 L -17,42 C -21,36 -24,28
-24,19 L -24,-13 L -22.5,-22 C -20,-33 -14,-40 -7,-43 Z"
fill="white" ${EDGE}/>
<path d="M-13.9,-12.9 h27.8 v12.3 h-27.8 Z M-12.4,4.8 h5 v4.3 h-5 Z
M7.4,4.8 h5 v4.3 h-5 Z" ${DETAIL}/>`,
// Sailing boat: a rounded hull with its sail filled to one side.
sailing: `
<path d="M0,-43 C -6,-40 -12,-31 -15.5,-21 C -18,-13 -19.4,-5 -19.4,3
L -19.3,34.2 L -17.1,39.8 L -14.3,43 L 14.3,43 L 17.1,39.8
L 19.3,34.2 L 19.4,3 C 19.4,-5 18,-13 15.5,-21 C 12,-31 6,-40 0,-43 Z"
fill="white" ${EDGE}/>
<path d="M0,-30 Q 21.6,-6 2,26 L -1,26 Q 7.8,-4 0,-30 Z" fill="white"
stroke="rgba(4,18,24,0.9)" stroke-width="1.4" stroke-linejoin="round"/>
<circle cx="0" cy="-12" r="2.6" fill="rgba(4,18,24,0.85)"/>`,
// Pleasure craft: a motor yacht, fine bow and a long cabin.
pleasure: `
<path d="M0,-43 C -5,-40 -11,-31 -15.9,-19.8 L -17.9,-12.6 L -17.9,32.7
L -17.2,37.6 L -16.2,38.2 L -16.2,43 L 16.2,43 L 16.2,38.2
L 17.2,37.6 L 17.9,32.7 L 17.9,-12.6 L 15.9,-19.8 C 11,-31 5,-40 0,-43 Z"
fill="white" ${EDGE}/>
<path d="M-15.2,-12.8 h30.4 v34.5 h-30.4 Z" ${DETAIL}/>`,
// Military, law enforcement or rescue: a patrol boat, sharp bow, a gun
// forward of the bridge.
military: `
<path d="M0,-43 C -4,-41 -9.6,-32 -12.6,-25.2 L -14.8,-17.1 L -15.3,-11.7
L -15.1,36.8 L -13.8,41.3 L -12.6,43 L 12.6,43 L 13.8,41.3
L 15.3,36.8 L 15.3,-11.7 L 14.8,-17.1 L 12.6,-25.2 C 9.6,-32 4,-41 0,-43 Z"
fill="white" ${EDGE}/>
<path d="M-10.2,-13.4 h20.4 v10 h-20.4 Z M-4.2,9.6 h8.4 v6.5 h-8.4 Z" ${DETAIL}/>
<circle cx="0" cy="-22" r="3.2" ${DETAIL}/>`,
// Any other vessel: a plain hull with a deckhouse aft.
other: `
<path d="M0,-43 C -6,-42 -12,-37 -14.8,-29.9 L -17.4,-23.3 L -17.9,-19.4
L -17.9,35.6 L -16.9,39.3 L -14.9,43 L 14.9,43 L 16.9,39.3
L 17.9,35.6 L 17.9,-19.4 L 17.4,-23.3 L 14.8,-29.9 C 12,-37 6,-42 0,-43 Z"
fill="white" ${EDGE}/>
<path d="M-10.8,8.3 h21.6 v13.1 h-21.6 Z" ${DETAIL}/>`,
};
/**
* The buoy every aid to navigation is drawn as, seen from the side: a
* flared float with a dark waterline band, a tapering body, a lantern and a
* round top-mark, centred on the frame. No halo; it is never turned.
*/
const BUOY = `
<path d="M27.6,36.5 L 26.4,31.5 L 25.2,27.5 L 14.4,23.5 L 11.4,-7.5
L 12.6,-7.5 L 12.6,-10.5 L 3.8,-10.5 L 2.9,-17.5 L -2.9,-17.5
L -3.8,-10.5 L -12.6,-10.5 L -12.6,-7.5 L -11.4,-7.5 L -14.4,23.5
L -25.2,27.5 L -26.4,31.5 L -27.6,36.5 Z" fill="white" ${EDGE}/>
<path d="M26.4,31.5 L 27.6,36.5 L -27.6,36.5 L -26.4,31.5 Z
M-12.6,-10.5 h25.2 v3 h-25.2 Z" fill="rgba(4,18,24,0.7)"/>
<path d="M-1.9,-22 h3.8 v4.5 h-3.8 Z" fill="white" ${EDGE}/>
<circle cx="0" cy="-30" r="7" fill="white" ${EDGE}/>`;
const cache = new Map();
const b64 = (s) =>
typeof btoa === 'function'
? btoa(s)
: Buffer.from(s, 'utf8').toString('base64');
function sprite(key, body) {
let uri = cache.get(key);
if (!uri) {
const px = VESSEL_SPRITE_PX;
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${px}" height="${px}" viewBox="0 0 ${VIEW} ${VIEW}"><g transform="translate(${C},${C})">${body}</g></svg>`;
uri = 'data:image/svg+xml;base64,' + b64(svg);
cache.set(key, uri);
}
return uri;
}
/**
* The hull sprite of a vessel kind (`other` for one it does not know).
* @param {string} kind One of `VESSEL_KINDS`.
* @returns {string} SVG data URI.
*/
export function vesselSprite(kind) {
const k = HULLS[kind] ? kind : 'other';
return sprite(k, HULLS[k]);
}
/**
* The buoy sprite of every aid to navigation.
* @returns {string} SVG data URI.
*/
export function aidSprite() {
return sprite('aid', BUOY);
}
+71
View File
@@ -0,0 +1,71 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { aidSprite, vesselSprite, VESSEL_SPRITE_PX } from './vesselSprites.js';
import { VESSEL_KINDS, VESSEL_KIND_STYLES, vesselKind } from './vesselTypes.js';
import { AID_TO_NAVIGATION_STYLE, accentForVesselType, vesselTypeCss } from './vesselLabels.js';
const svg = (uri) =>
Buffer.from(uri.slice(uri.indexOf(',') + 1), 'base64').toString('utf8');
test('vessel types pick their kind by AIS code or text family', () => {
const cases = {
cargo: ['70', '79', 'Container Ship', 'Bulk Carrier', 'Ro-Ro Cargo'],
tanker: ['80', '89', 'Crude Oil Tanker', 'LNG Carrier', 'LPG'],
passenger: ['60', '69', 'Passenger/Ferry', 'Cruise Ship'],
highspeed: ['40', '49', 'High-Speed Craft', 'HSC'],
fishing: ['30', 'Fishing Vessel', 'Trawler'],
tug: ['31', '32', '50', '52', '53', '54', 'Tug', 'Pilot Vessel', 'Supply'],
sailing: ['36', 'Sailing Vessel'],
pleasure: ['37', 'Pleasure Craft', 'Yacht'],
military: ['35', '55', '51', 'Military', 'Law Enforcement', 'Coast Guard', 'SAR'],
other: ['0', '20', '33', '34', '58', '90', 'Dredger', '', null, undefined, '255'],
};
for (const [kind, types] of Object.entries(cases))
for (const type of types) assert.equal(vesselKind(type), kind, String(type));
assert.deepEqual(new Set(Object.keys(cases)), new Set(VESSEL_KINDS));
});
test('each vessel kind has its own white hull sprite, bow up', () => {
const sprites = VESSEL_KINDS.map(vesselSprite);
assert.equal(new Set(sprites).size, VESSEL_KINDS.length);
for (const uri of sprites) {
const text = svg(uri);
assert.match(text, new RegExp(`width="${VESSEL_SPRITE_PX}"`));
assert.match(text, /viewBox="0 0 96 96"/);
// Drawn white for the tint; nothing baked in colour.
assert.match(text, /fill="white"/);
assert.doesNotMatch(text, /#[0-9a-f]{6}/i);
}
assert.equal(vesselSprite('unknown'), vesselSprite('other'));
});
test('vessel colours: one per kind, the new kinds apart from the rest', () => {
const css = VESSEL_KINDS.map((kind) => VESSEL_KIND_STYLES[kind].css);
// Only cargo and other share the default cyan.
assert.equal(new Set(css).size, VESSEL_KINDS.length - 1);
assert.equal(VESSEL_KIND_STYLES.cargo.css, VESSEL_KIND_STYLES.other.css);
for (const kind of ['sailing', 'pleasure', 'military', 'highspeed']) {
const own = VESSEL_KIND_STYLES[kind].css;
for (const other of VESSEL_KINDS)
if (other !== kind) assert.notEqual(own, VESSEL_KIND_STYLES[other].css, `${kind} vs ${other}`);
assert.notEqual(own, AID_TO_NAVIGATION_STYLE.css);
}
// The sprite tint and the card accent are the same colour.
for (const [type, kind] of [['36', 'sailing'], ['37', 'pleasure'], ['55', 'military'], ['41', 'highspeed'], ['71', 'cargo']]) {
const { css: hex, accent } = VESSEL_KIND_STYLES[kind];
assert.equal(vesselTypeCss(type), hex);
assert.equal(accentForVesselType(type), accent);
const rgb = [1, 3, 5].map((i) => Number.parseInt(hex.slice(i, i + 2), 16)).join(', ');
assert.equal(accent, rgb, kind);
}
});
test('an aid to navigation is the one buoy sprite, white with no halo', () => {
const text = svg(aidSprite());
assert.equal(aidSprite(), aidSprite());
assert.ok(!VESSEL_KINDS.map(vesselSprite).includes(aidSprite()));
assert.match(text, /fill="white"/);
// No light halo stroke around it.
assert.doesNotMatch(text, /rgba\(235,240,245/);
assert.doesNotMatch(text, /#[0-9a-f]{6}/i);
});
+70
View File
@@ -46,6 +46,76 @@ export function normalizeVesselType(type) {
return NUMERIC_TYPE_FAMILIES[Math.floor(code / 10)] || 'OTHER';
}
/**
* The vessel kinds a ship is drawn as, each with its own hull sprite and
* colour (`vesselSprites.js`), by the type family its AIS type resolves to
* ({@link normalizeVesselType}), in order: the first that matches.
*/
const VESSEL_KIND_RULES = [
['tanker', /tanker|\blng\b|\blpg\b|gas carrier/i],
['highspeed', /high[- ]?speed|\bhsc\b/i],
['passenger', /passenger|ferry|cruise/i],
['cargo', /cargo|container|bulk|carrier|freighter|ro-?ro/i],
['fishing', /fishing|trawler/i],
[
'military',
/military|naval|navy|warship|law enforce|police|patrol|coast ?guard|\bsar\b|search and rescue/i,
],
['tug', /tug|tow|pilot|tender|supply|service|anti-pollution/i],
['sailing', /sail/i],
['pleasure', /pleasure|yacht/i],
];
/** Every vessel kind {@link vesselKind} names, `other` last. */
export const VESSEL_KINDS = Object.freeze([
...VESSEL_KIND_RULES.map(([kind]) => kind),
'other',
]);
/**
* Each vessel kind's colour on the map and on its card, as CSS and as the
* card's "r, g, b" accent. Every one reads on dark water and differs from
* the rest; cargo and other share the default cyan.
*/
export const VESSEL_KIND_STYLES = Object.freeze({
cargo: Object.freeze({ css: '#39d5ff', accent: '57, 213, 255' }),
tanker: Object.freeze({ css: '#ffb347', accent: '255, 179, 71' }),
passenger: Object.freeze({ css: '#ff7adf', accent: '255, 122, 223' }),
highspeed: Object.freeze({ css: '#c6ff3d', accent: '198, 255, 61' }),
fishing: Object.freeze({ css: '#7cff9b', accent: '124, 255, 155' }),
tug: Object.freeze({ css: '#f7f0a3', accent: '247, 240, 163' }),
sailing: Object.freeze({ css: '#b49cff', accent: '180, 156, 255' }),
pleasure: Object.freeze({ css: '#ff6f61', accent: '255, 111, 97' }),
military: Object.freeze({ css: '#a9bccb', accent: '169, 188, 203' }),
other: Object.freeze({ css: '#39d5ff', accent: '57, 213, 255' }),
});
/** Kind by type text: a feed uses few distinct type texts. */
const KIND_MEMO = new Map();
const KIND_MEMO_MAX = 1024;
/**
* The kind of vessel an AIS type names, a numeric ship-type code (ITU-R
* M.1371) or a text type: `cargo` (70 to 79), `tanker` (80 to 89),
* `passenger` (60 to 69), `highspeed` (40 to 49), `fishing` (30), `tug`
* (tugs, towing, pilots, tenders, anti-pollution: 31, 32, 50, 52 to 54),
* `sailing` (36), `pleasure` (37), `military` (military, law enforcement,
* search and rescue: 35, 55, 51) or `other` (anything else, unknown types
* included).
* @param {string|number|null|undefined} type
* @returns {string} One of {@link VESSEL_KINDS}.
*/
export function vesselKind(type) {
const text = normalizeVesselType(type);
let kind = KIND_MEMO.get(text);
if (kind !== undefined) return kind;
kind = VESSEL_KIND_RULES.find(([, pattern]) => pattern.test(text))?.[0];
kind ??= 'other';
if (KIND_MEMO.size >= KIND_MEMO_MAX) KIND_MEMO.clear();
KIND_MEMO.set(text, kind);
return kind;
}
/**
* The kind of aid to navigation an AIS aid-to-navigation report (message 21)
* names by its type code, 0 to 31 (ITU-R M.1371, IALA marks): beacons and
+92
View File
@@ -3,13 +3,16 @@ import assert from 'node:assert/strict';
import {
checkCatalog,
checkZhHant,
extractMessages,
findUnmarked,
markedTemplate,
readCatalog,
shippedLocales,
toZhHant,
unmarkedMarkup,
unmarkedScript,
zhHantCatalog,
} from '../../scripts/i18n.mjs';
import { LOCALES } from './locale.js';
@@ -36,6 +39,95 @@ for (const locale of shippedLocales()) {
});
}
test('zh-Hant is zh-CN converted to Traditional characters (npm run i18n -- --zh-hant)', () => {
assert.deepEqual(
checkZhHant(readCatalog('zh-CN'), readCatalog('zh-Hant')),
[],
);
});
test('toZhHant converts characters, not vocabulary, and fixes what s2tw picks wrongly', () => {
// s2twp would write 影片, 伺服器 and 載入; zh-Hant keeps the zh-CN words.
assert.equal(toZhHant('视频'), '視頻');
assert.equal(toZhHant('服务器'), '服務器');
assert.equal(toZhHant('加载'), '加載');
assert.equal(toZhHant('50 年历史'), '50 年歷史');
assert.equal(toZhHant('发布于 {date}'), '發布於 {date}');
assert.equal(toZhHant('1 周/秒'), '1 週/秒');
assert.equal(toZhHant('已宣布紧急情况'), '已宣布緊急情況');
assert.equal(toZhHant('全部 {n} 个中'), '全部 {n} 個中');
// 併道 only where the English key is about merging.
assert.equal(toZhHant('前方并道路段', 'Merge ahead'), '前方併道路段');
assert.equal(
toZhHant('事故并道路封闭', 'Crash, road closed'),
'事故並道路封閉',
);
assert.equal(toZhHant('挥手并道谢', 'Waved and thanked'), '揮手並道謝');
assert.deepEqual(
zhHantCatalog({
'Merge {direction} onto {road}': '{direction}并道,进入 {road}',
'maneuver|Merge': '并道',
'Closed and apologized': '已关闭并道歉',
}),
{
'Merge {direction} onto {road}': '{direction}併道,進入 {road}',
'maneuver|Merge': '併道',
'Closed and apologized': '已關閉並道歉',
},
);
});
test('checkZhHant names each entry that is not the conversion of zh-CN', () => {
const zhCN = {
Video: '视频',
Server: '服务器',
'{count} ships': { other: '{count} 艘船' },
};
const generated = zhHantCatalog(zhCN);
assert.deepEqual(generated, {
Video: '視頻',
Server: '服務器',
'{count} ships': { other: '{count} 艘船' },
});
assert.deepEqual(checkZhHant(zhCN, generated), []);
const fix =
'zh-Hant is generated: edit zh-CN, then run npm run i18n -- --zh-hant';
const { Server, ...withoutServer } = generated;
assert.deepEqual(
checkZhHant(zhCN, {
...withoutServer,
Video: '影片',
'{count} ships': { other: '{count} 艘船隻' },
Extra: '多餘',
}),
[
`"Video" is "影片", not zh-CN converted ("視頻"). ${fix}`,
`"Server" is in zh-CN but not here. ${fix}`,
`"{count} ships" is {"other":"{count} 艘船隻"}, not zh-CN converted ({"other":"{count} 艘船"}). ${fix}`,
`"Extra" is not in zh-CN. ${fix}`,
],
);
assert.deepEqual(checkZhHant(zhCN, { Server, ...withoutServer }), [
'entries leave the zh-CN order at "Video": run npm run i18n -- --zh-hant',
]);
// A key checkCatalog already lists as missing is not reported twice.
assert.deepEqual(checkZhHant(zhCN, withoutServer, new Set(['Server'])), []);
});
test('a zh-Hant entry still in English points to zh-CN and its same-as-English line', () => {
const fixture = new Map([['Bloom', { plural: false }]]);
const errors = (locale) =>
checkCatalog(locale, { Bloom: 'Bloom' }, fixture, new Set()).errors;
assert.deepEqual(errors('zh-Hant'), [
'"Bloom" is still English: translate it in zh-CN and run npm run i18n -- --zh-hant, or list it under "zh-Hant" in src/i18n/same-as-english.json as under "zh-CN"',
]);
assert.match(
errors('zh-CN')[0],
/^"Bloom" is still English: translate it, or/,
);
});
test('every UI string is marked for translation or kept on purpose (npm run i18n)', () => {
assert.deepEqual(
findUnmarked().map(({ where, text }) => `${where} ${text}`),
+92 -12
View File
@@ -77,8 +77,22 @@
"{severity} only": "{severity} فقط",
"All categories": "كل الفئات",
"Reading the news…": "جارٍ قراءة الأخبار…",
"News, last {hours} hours": "الأخبار، الساعات الأخيرة: {hours}",
"Last {hours} h": "آخر {hours} س",
"News, last {hours} hours": {
"zero": "الأخبار، آخر {hours} ساعة",
"one": "الأخبار، آخر ساعة ({hours})",
"two": "الأخبار، آخر ساعتين ({hours})",
"few": "الأخبار، آخر {hours} ساعات",
"many": "الأخبار، آخر {hours} ساعة",
"other": "الأخبار، آخر {hours} ساعة"
},
"Last {hours} h": {
"zero": "آخر {hours} ساعة",
"one": "آخر ساعة ({hours})",
"two": "آخر ساعتين ({hours})",
"few": "آخر {hours} ساعات",
"many": "آخر {hours} ساعة",
"other": "آخر {hours} ساعة"
},
"Time window": "الفترة الزمنية",
"Conflicts": "النزاعات",
"Local": "محلي",
@@ -87,9 +101,23 @@
"Hotspots": "بؤر ساخنة",
"Severity": "الخطورة",
"Category": "الفئة",
"Nothing reported near here in the last {hours} h": "لم يُبلَّغ عن شيء قريب من هنا في آخر {hours} س",
"Nothing reported near here in the last {hours} h": {
"zero": "لم يُبلَّغ عن شيء قريب من هنا في آخر {hours} ساعة",
"one": "لم يُبلَّغ عن شيء قريب من هنا في آخر ساعة ({hours})",
"two": "لم يُبلَّغ عن شيء قريب من هنا في آخر ساعتين ({hours})",
"few": "لم يُبلَّغ عن شيء قريب من هنا في آخر {hours} ساعات",
"many": "لم يُبلَّغ عن شيء قريب من هنا في آخر {hours} ساعة",
"other": "لم يُبلَّغ عن شيء قريب من هنا في آخر {hours} ساعة"
},
"Latest news": "آخر الأخبار",
"No news matches these filters in the last {hours} h": "لا أخبار تطابق هذه المرشحات في آخر {hours} س",
"No news matches these filters in the last {hours} h": {
"zero": "لا أخبار تطابق هذه المرشحات في آخر {hours} ساعة",
"one": "لا أخبار تطابق هذه المرشحات في آخر ساعة ({hours})",
"two": "لا أخبار تطابق هذه المرشحات في آخر ساعتين ({hours})",
"few": "لا أخبار تطابق هذه المرشحات في آخر {hours} ساعات",
"many": "لا أخبار تطابق هذه المرشحات في آخر {hours} ساعة",
"other": "لا أخبار تطابق هذه المرشحات في آخر {hours} ساعة"
},
"Load older news": "تحميل أخبار أقدم",
"How to read the map": "كيف تقرأ الخريطة",
"Colour: severity · icon: type of event": "اللون: الخطورة · الرمز: نوع الحدث",
@@ -259,7 +287,14 @@
"ALTITUDE": "الارتفاع",
"CONTACT": "الهدف",
"CONTACTS · 250 KM": "الأهداف · 250 كم",
"RINGS {spacing} NM": "الحلقات كل {spacing} ميل بحري",
"RINGS {spacing} NM": {
"zero": "الحلقات كل {spacing} ميل بحري",
"one": "الحلقات كل ميل بحري ({spacing})",
"two": "الحلقات كل ميلين بحريين ({spacing})",
"few": "الحلقات كل {spacing} أميال بحرية",
"many": "الحلقات كل {spacing} ميلًا بحريًا",
"other": "الحلقات كل {spacing} ميل بحري"
},
"{count} CONTACTS": {
"zero": "لا أهداف ({count})",
"one": "هدف واحد ({count})",
@@ -388,7 +423,14 @@
"ROUTE DATA UNAVAILABLE": "بيانات المسار غير متاحة",
"CONTACT NAVIGATION OFF": "التنقل بين الأهداف متوقف",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "تبقى غرفة القيادة مع السفينة المحددة",
"{range} NM": "{range} ميل بحري",
"{range} NM": {
"zero": "{range} ميل بحري",
"one": "ميل بحري واحد ({range})",
"two": "ميلان بحريان ({range})",
"few": "{range} أميال بحرية",
"many": "{range} ميلًا بحريًا",
"other": "{range} ميل بحري"
},
"AIS DESTINATION · CREW REPORTED": "وجهة AIS · أبلغ عنها الطاقم",
"FROM": "من",
"TO": "إلى",
@@ -472,6 +514,7 @@
"Current style: {style} — click for next": "النمط الحالي: {style} — انقر للتالي",
"TRACK ACQUIRED": "تم التقاط الهدف",
"{label} · COURSE {heading}°": "{label} · المسار {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · المسار {heading}°",
"{label} · HEADING {heading}°": "{label} · الاتجاه {heading}°",
"{label} · NO HEADING": "{label} · لا اتجاه",
"{label} · NADIR VIEW": "{label} · عرض باتجاه النظير",
@@ -673,6 +716,7 @@
"NEAREST": "الأقرب",
"CCTV camera": "كاميرا CCTV",
"FOCUS": "تركيز",
"site status|FOCUS": "تركيز",
"COVERAGE OFF": "التغطية متوقفة",
"AUTO HOP OFF": "التنقل التلقائي متوقف",
"PROJECTION ON": "الإسقاط مفعّل",
@@ -1065,6 +1109,7 @@
"awaiting first AIS message…": "بانتظار أول رسالة AIS…",
"EST. DOWNRANGE": "تقدير على امتداد المسار",
"CONFIRMED": "مؤكَّد",
"sightings filter|CONFIRMED": "مؤكَّدة",
"PAD / RTLS": "منصة الإطلاق / RTLS",
"Pick a shape, then click the map.": "اختر شكلًا، ثم انقر على الخريطة.",
"Enter to place the pin, Esc to cancel.": "Enter لوضع الدبوس، وEsc للإلغاء.",
@@ -1100,6 +1145,10 @@
"Fast jet": "نفاثة سريعة",
"Business jet": "طائرة رجال أعمال",
"Drone": "طائرة مسيّرة",
"Airport vehicle": "مركبة مطار",
"Ground station / obstacle": "محطة أرضية / عائق",
"Airport vehicles": "مركبات المطار",
"Ground stations / obstacles": "محطات أرضية / عوائق",
"General emergency": "طوارئ عامة",
"Unlawful interference": "تدخل غير مشروع",
"Radio failure": "عطل في الاتصال اللاسلكي",
@@ -2537,7 +2586,7 @@
"RESUME": "استئناف",
"Clear reading": "مسح القراءة",
"Observed history": "سجل الأرصاد",
"Latest": "الأحدث",
"news list|Latest": "الأحدث",
"Imagery on Esri · Google 3D returns when cleared": "الصور على Esri · تعود Google 3D عند المسح",
"Point the camera at the ground to use the view": "وجّه الكاميرا نحو الأرض لاستخدام العرض",
"That point cannot anchor a box": "لا يمكن تثبيت منطقة على تلك النقطة",
@@ -3706,7 +3755,14 @@
"Photo of {name}": "صورة {name}",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "المشاهدات في نطاق العرض: {count}",
"{count} sightings in view": {
"zero": "{count} مشاهدة في نطاق العرض",
"one": "مشاهدة واحدة ({count}) في نطاق العرض",
"two": "مشاهدتان ({count}) في نطاق العرض",
"few": "{count} مشاهدات في نطاق العرض",
"many": "{count} مشاهدة في نطاق العرض",
"other": "{count} مشاهدة في نطاق العرض"
},
"Close sighting": "إغلاق المشاهدة",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "حياة برية شوهدت خلال 48 ساعة (الحيتان 7 أيام). يوضح اللون ورمز الشارة المجموعة التصنيفية. تُعرض الأنواع الحساسة في خلايا بحجم 0.2° فقط؛ وتُقرّب مشاهدات الثدييات البحرية في بحر ساليش عبر Acartia إلى 0.01°. ليست إحصاءً شاملًا.",
"Open {name} on iNaturalist": "فتح {name} على iNaturalist",
@@ -3717,20 +3773,37 @@
"{days}d": "{days} ي",
"All markers": "كل العلامات",
"Show markers of every age": "عرض العلامات من جميع الأعمار",
"Maximum event age: {days}d; undated markers are kept": "الحد الأقصى لعمر الحدث: {days} ي؛ تبقى العلامات غير المؤرخة ظاهرة",
"Maximum event age: {days}d; undated markers are kept": {
"zero": "الحد الأقصى لعمر الحدث: {days} يوم؛ تبقى العلامات غير المؤرخة ظاهرة",
"one": "الحد الأقصى لعمر الحدث: يوم واحد ({days})؛ تبقى العلامات غير المؤرخة ظاهرة",
"two": "الحد الأقصى لعمر الحدث: يومان ({days})؛ تبقى العلامات غير المؤرخة ظاهرة",
"few": "الحد الأقصى لعمر الحدث: {days} أيام؛ تبقى العلامات غير المؤرخة ظاهرة",
"many": "الحد الأقصى لعمر الحدث: {days} يومًا؛ تبقى العلامات غير المؤرخة ظاهرة",
"other": "الحد الأقصى لعمر الحدث: {days} يوم؛ تبقى العلامات غير المؤرخة ظاهرة"
},
"event age filter|All": "الكل",
"Event age": "عمر الحدث",
"Event age: {days}d · undated kept": "عمر الحدث: {days} ي · غير المؤرخة تبقى ظاهرة",
"Event age: {days}d · undated kept": {
"zero": "عمر الحدث: {days} يوم · غير المؤرخة تبقى ظاهرة",
"one": "عمر الحدث: يوم واحد ({days}) · غير المؤرخة تبقى ظاهرة",
"two": "عمر الحدث: يومان ({days}) · غير المؤرخة تبقى ظاهرة",
"few": "عمر الحدث: {days} أيام · غير المؤرخة تبقى ظاهرة",
"many": "عمر الحدث: {days} يومًا · غير المؤرخة تبقى ظاهرة",
"other": "عمر الحدث: {days} يوم · غير المؤرخة تبقى ظاهرة"
},
"Close camera preview": "إغلاق معاينة الكاميرا",
"Refresh map still": "تحديث صورة الخريطة الثابتة",
"The map still uses a separate request and may show a different moment.": "تستخدم صورة الخريطة طلبًا منفصلًا وقد تعرض لحظة مختلفة.",
"Video plays from Québec 511, which sees your IP address.": "يُشغَّل الفيديو من Québec 511، الذي يرى عنوان IP الخاص بك.",
"Press OPEN to load the photo": "اضغط «فتح» لتحميل الصورة",
"Captured {month}": "التُقطت في {month}",
"this spot": "هذا الموضع",
"the view centre": "مركز العرض",
"{source} at {place}": "{source} في {place}",
"{source} at this spot": "{source} في هذا الموضع",
"{source} at the view centre": "{source} في مركز العرض",
"Street level at {place}": "مستوى الشارع في {place}",
"Street level at this spot": "مستوى الشارع في هذا الموضع",
"Street level at the view centre": "مستوى الشارع في مركز العرض",
"Switching map": "جارٍ تبديل الخريطة",
"Opening imagery": "جارٍ فتح الصور",
"Street View is ready: press {open} to load it": "Street View جاهز: اضغط «{open}» لتحميله",
@@ -3942,7 +4015,14 @@
"REMOVE ALL": "إزالة الكل",
"Confirm: remove every added entry from Data Layers": "تأكيد: إزالة كل الإدخالات المُضافة من طبقات البيانات",
"Remove every added entry from Data Layers": "إزالة كل الإدخالات المُضافة من طبقات البيانات",
"Showing {shown} of {total}": "عرض {shown} من {total}",
"Showing {shown} of {total}": {
"zero": "عرض {shown} من {total}",
"one": "عرض {shown} من {total}",
"two": "عرض {shown} من {total}",
"few": "عرض {shown} من {total}",
"many": "عرض {shown} من {total}",
"other": "عرض {shown} من {total}"
},
"BROWSE DATA LIBRARY": "تصفّح مكتبة البيانات",
"Atmosphere": "الغلاف الجوي",
"Day and night": "الليل والنهار",
+53 -13
View File
@@ -65,8 +65,14 @@
"{severity} only": "Nur {severity}",
"All categories": "Alle Kategorien",
"Reading the news…": "Nachrichten werden gelesen…",
"News, last {hours} hours": "Nachrichten, letzte {hours} h",
"Last {hours} h": "Letzte {hours} h",
"News, last {hours} hours": {
"one": "Nachrichten der letzten {hours} Stunde",
"other": "Nachrichten der letzten {hours} Stunden"
},
"Last {hours} h": {
"one": "Letzte {hours} h",
"other": "Letzte {hours} h"
},
"Time window": "Zeitraum",
"Conflicts": "Konflikte",
"Local": "Lokal",
@@ -75,9 +81,15 @@
"Hotspots": "Brennpunkte",
"Severity": "Schweregrad",
"Category": "Kategorie",
"Nothing reported near here in the last {hours} h": "In den letzten {hours} h nichts in der Nähe gemeldet",
"Nothing reported near here in the last {hours} h": {
"one": "In der letzten {hours} h nichts in der Nähe gemeldet",
"other": "In den letzten {hours} h nichts in der Nähe gemeldet"
},
"Latest news": "Neueste Nachrichten",
"No news matches these filters in the last {hours} h": "Keine Nachrichten der letzten {hours} h passen zu diesen Filtern",
"No news matches these filters in the last {hours} h": {
"one": "Keine Nachrichten der letzten {hours} h passen zu diesen Filtern",
"other": "Keine Nachrichten der letzten {hours} h passen zu diesen Filtern"
},
"Load older news": "Ältere Nachrichten laden",
"How to read the map": "So liest man die Karte",
"Colour: severity · icon: type of event": "Farbe: Schweregrad · Symbol: Art des Ereignisses",
@@ -197,6 +209,7 @@
"Previous — prior visited contact in the 250 km window": "Zurück: zuvor besuchter Kontakt im 250-km-Fenster",
"PREVIOUS": "ZURÜCK",
"FOCUS": "FOKUS",
"site status|FOCUS": "FOKUS",
"Next — nearest unvisited contact in the 250 km window": "Weiter: nächstgelegener unbesuchter Kontakt im 250-km-Fenster",
"NEXT": "WEITER",
"Open-source mapped/observed context. Missing broadcasts, unloaded map areas, or unmapped sites are not evidence of absence.": "Kontext aus offenen Quellen, kartiert/beobachtet. Fehlende Funksignale, nicht geladene Kartenbereiche oder nicht kartierte Standorte sind kein Beleg für Abwesenheit.",
@@ -301,7 +314,7 @@
"ORBITAL VELOCITY": "BAHNGESCHWINDIGKEIT",
"SUB-SATELLITE POINT": "SUBSATELLITENPUNKT",
"NORTH UP": "NORDEN OBEN",
"CURRENTLY OVER": "AKTUELL ÜBER",
"CURRENTLY OVER": "ÜBERFLUG",
"{division}, {country}": "{division}, {country}",
"{region} · near {place}": "{region} · nahe {place}",
"NORAD {id}": "NORAD {id}",
@@ -560,7 +573,10 @@
"ROUTE DATA UNAVAILABLE": "ROUTENDATEN NICHT VERFÜGBAR",
"CONTACT NAVIGATION OFF": "KONTAKTNAVIGATION AUS",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "DIE BRÜCKE BLEIBT BEIM GEWÄHLTEN SCHIFF",
"{range} NM": "{range} SM",
"{range} NM": {
"one": "{range} SM",
"other": "{range} SM"
},
"AIS DESTINATION · CREW REPORTED": "AIS-ZIEL · VON DER BESATZUNG GEMELDET",
"DEST {bearing}": "DEST {bearing}",
"Disable cockpit weather effects": "Cockpit-Wettereffekte deaktivieren",
@@ -606,6 +622,7 @@
"Reclassify as TR-3B": "Als TR-3B umklassifizieren",
"TRACK ACQUIRED": "TRACK ERFASST",
"{label} · COURSE {heading}°": "{label} · KURS {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · KURS {heading}°",
"{label} · HEADING {heading}°": "{label} · STEUERKURS {heading}°",
"{label} · NO HEADING": "{label} · KEIN STEUERKURS",
"{label} · NADIR VIEW": "{label} · NADIRANSICHT",
@@ -838,7 +855,10 @@
"Contact cockpit summary": "Cockpit-Zusammenfassung des Kontakts",
"CONTACT": "KONTAKT",
"CONTACTS · 250 KM": "KONTAKTE · 250 KM",
"RINGS {spacing} NM": "RINGE {spacing} SM",
"RINGS {spacing} NM": {
"one": "RINGE {spacing} SM",
"other": "RINGE {spacing} SM"
},
"{count} CONTACTS": {
"one": "{count} KONTAKT",
"other": "{count} KONTAKTE"
@@ -1060,6 +1080,10 @@
"Fast jet": "Kampfjet",
"Business jet": "Businessjet",
"Drone": "Drohne",
"Airport vehicle": "Flughafenfahrzeug",
"Ground station / obstacle": "Bodenstation / Hindernis",
"Airport vehicles": "Flughafenfahrzeuge",
"Ground stations / obstacles": "Bodenstationen / Hindernisse",
"General emergency": "Allgemeiner Notfall",
"Unlawful interference": "Widerrechtlicher Eingriff",
"Radio failure": "Funkausfall",
@@ -2397,7 +2421,7 @@
"RESUME": "FORTSETZEN",
"Clear reading": "Wert ausblenden",
"Observed history": "Beobachteter Verlauf",
"Latest": "Neueste",
"news list|Latest": "Neueste",
"Imagery on Esri · Google 3D returns when cleared": "Bilder auf Esri · nach LÖSCHEN wieder Google 3D",
"Point the camera at the ground to use the view": "Kamera auf den Boden richten, um die Ansicht zu verwenden",
"That point cannot anchor a box": "Dieser Punkt kann keinen Bereich verankern",
@@ -3122,6 +3146,7 @@
"Left panels": "Linke Bereiche",
"Right panels": "Rechte Bereiche",
"CONFIRMED": "BESTÄTIGT",
"sightings filter|CONFIRMED": "BESTÄTIGT",
"PAD / RTLS": "STARTPLATZ / RTLS",
"fire confidence filter|All": "Alle",
"fire confidence filter|Nominal+": "Mittel+",
@@ -3382,7 +3407,10 @@
"Photo of {name}": "Foto von {name}",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "Beobachtungen im Bild: {count}",
"{count} sightings in view": {
"one": "{count} Beobachtung im Bild",
"other": "{count} Beobachtungen im Bild"
},
"Close sighting": "Beobachtung schließen",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "In den letzten 48 h beobachtete Wildtiere (Wale 7 Tage). Farbe und Symbol der Markierung zeigen die Artengruppe. Empfindliche Arten erscheinen nur als 0,2°-Zellen; Acartia-Meldungen zu Meeressäugern aus der Salish-See werden auf 0,01° gerundet. Keine Bestandszählung.",
"Open {name} on iNaturalist": "{name} auf iNaturalist öffnen",
@@ -3393,20 +3421,29 @@
"{days}d": "{days} T",
"All markers": "Alle Markierungen",
"Show markers of every age": "Markierungen jeden Alters anzeigen",
"Maximum event age: {days}d; undated markers are kept": "Maximales Ereignisalter: {days} T; undatierte Markierungen bleiben erhalten",
"Maximum event age: {days}d; undated markers are kept": {
"one": "Maximales Ereignisalter: {days} Tag; undatierte Markierungen bleiben erhalten",
"other": "Maximales Ereignisalter: {days} Tage; undatierte Markierungen bleiben erhalten"
},
"event age filter|All": "Alle",
"Event age": "Ereignisalter",
"Event age: {days}d · undated kept": "Ereignisalter: {days} T · undatierte bleiben",
"Event age: {days}d · undated kept": {
"one": "Ereignisalter: {days} Tag · undatierte bleiben",
"other": "Ereignisalter: {days} Tage · undatierte bleiben"
},
"Close camera preview": "Kameravorschau schließen",
"Refresh map still": "Kartenstandbild aktualisieren",
"The map still uses a separate request and may show a different moment.": "Das Kartenstandbild wird separat abgerufen und kann einen anderen Moment zeigen.",
"Video plays from Québec 511, which sees your IP address.": "Das Video wird von Québec 511 abgespielt; die IP-Adresse ist für diesen Anbieter sichtbar.",
"Press OPEN to load the photo": "Auf ÖFFNEN klicken, um das Foto zu laden",
"Captured {month}": "Aufgenommen im {month}",
"this spot": "diese Stelle",
"the view centre": "die Bildmitte",
"{source} at {place}": "{source}: {place}",
"{source} at this spot": "{source} an dieser Stelle",
"{source} at the view centre": "{source} in der Bildmitte",
"Street level at {place}": "Straßenebene: {place}",
"Street level at this spot": "Straßenebene an dieser Stelle",
"Street level at the view centre": "Straßenebene in der Bildmitte",
"Switching map": "Karte wird gewechselt",
"Opening imagery": "Bilder werden geöffnet",
"Street View is ready: press {open} to load it": "Street View ist bereit: Auf {open} klicken, um es zu laden",
@@ -3594,7 +3631,10 @@
"REMOVE ALL": "ALLE ENTFERNEN",
"Confirm: remove every added entry from Data Layers": "Bestätigen: alle hinzugefügten Einträge aus Datenebenen entfernen",
"Remove every added entry from Data Layers": "Alle hinzugefügten Einträge aus Datenebenen entfernen",
"Showing {shown} of {total}": "{shown} von {total} angezeigt",
"Showing {shown} of {total}": {
"one": "{shown} von {total} angezeigt",
"other": "{shown} von {total} angezeigt"
},
"BROWSE DATA LIBRARY": "DATENBIBLIOTHEK DURCHSUCHEN",
"Atmosphere": "Atmosphäre",
"Day and night": "Tag und Nacht",
+62 -12
View File
@@ -68,8 +68,16 @@
"{severity} only": "Solo {severity}",
"All categories": "Todas las categorías",
"Reading the news…": "Leyendo las noticias…",
"News, last {hours} hours": "Noticias desde hace {hours} h",
"Last {hours} h": "Desde hace {hours} h",
"News, last {hours} hours": {
"one": "Noticias de la última {hours} hora",
"many": "Noticias de las últimas {hours} de horas",
"other": "Noticias de las últimas {hours} horas"
},
"Last {hours} h": {
"one": "Última {hours} h",
"many": "Últimas {hours} h",
"other": "Últimas {hours} h"
},
"Time window": "Periodo",
"Conflicts": "Conflictos",
"Local": "Local",
@@ -78,9 +86,17 @@
"Hotspots": "Focos",
"Severity": "Gravedad",
"Category": "Categoría",
"Nothing reported near here in the last {hours} h": "No hay noticias cerca de aquí desde hace {hours} h",
"Nothing reported near here in the last {hours} h": {
"one": "No hay noticias cerca de aquí en la última {hours} h",
"many": "No hay noticias cerca de aquí en las últimas {hours} h",
"other": "No hay noticias cerca de aquí en las últimas {hours} h"
},
"Latest news": "Últimas noticias",
"No news matches these filters in the last {hours} h": "Desde hace {hours} h no hay noticias que coincidan con estos filtros",
"No news matches these filters in the last {hours} h": {
"one": "En la última {hours} h no hay noticias que coincidan con estos filtros",
"many": "En las últimas {hours} h no hay noticias que coincidan con estos filtros",
"other": "En las últimas {hours} h no hay noticias que coincidan con estos filtros"
},
"Load older news": "Cargar noticias anteriores",
"How to read the map": "Cómo leer el mapa",
"Colour: severity · icon: type of event": "Color: gravedad · icono: tipo de suceso",
@@ -138,7 +154,11 @@
"ALTITUDE": "ALTITUD",
"CONTACT": "CONTACTO",
"CONTACTS · 250 KM": "CONTACTOS · 250 KM",
"RINGS {spacing} NM": "ANILLOS {spacing} MN",
"RINGS {spacing} NM": {
"one": "ANILLOS {spacing} MN",
"many": "ANILLOS {spacing} MN",
"other": "ANILLOS {spacing} MN"
},
"{count} CONTACTS": {
"one": "{count} CONTACTO",
"many": "{count} DE CONTACTOS",
@@ -265,7 +285,11 @@
"ROUTE DATA UNAVAILABLE": "DATOS DE RUTA NO DISPONIBLES",
"CONTACT NAVIGATION OFF": "NAVEGACIÓN DE CONTACTOS DESACTIVADA",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "EL PUENTE PERMANECE EN EL BUQUE SELECCIONADO",
"{range} NM": "{range} MN",
"{range} NM": {
"one": "{range} MN",
"many": "{range} MN",
"other": "{range} MN"
},
"AIS DESTINATION · CREW REPORTED": "DESTINO AIS · NOTIFICADO POR LA TRIPULACIÓN",
"FROM": "DESDE",
"TO": "HACIA",
@@ -351,6 +375,7 @@
"Current style: {style} — click for next": "Estilo actual: {style} — haz clic para el siguiente",
"TRACK ACQUIRED": "RASTREO ADQUIRIDO",
"{label} · COURSE {heading}°": "{label} · RUMBO {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · RUMBO {heading}°",
"{label} · HEADING {heading}°": "{label} · PROA {heading}°",
"{label} · NO HEADING": "{label} · PROA N/D",
"{label} · NADIR VIEW": "{label} · VISTA AL NADIR",
@@ -545,6 +570,7 @@
"NEAREST": "MÁS CERCANA",
"CCTV camera": "Cámara CCTV",
"FOCUS": "ENFOCAR",
"site status|FOCUS": "ENFOQUE",
"COVERAGE OFF": "COBERTURA DESACTIVADA",
"AUTO HOP OFF": "SALTO AUTO: NO",
"PROJECTION ON": "PROYECCIÓN ACTIVADA",
@@ -900,6 +926,7 @@
"awaiting first AIS message…": "esperando el primer mensaje AIS…",
"EST. DOWNRANGE": "DIST. ESTIMADA",
"CONFIRMED": "CONFIRMADA",
"sightings filter|CONFIRMED": "CONFIRMADOS",
"PAD / RTLS": "PLATAFORMA / RTLS",
"MISSION CONTROL · FIRST LAUNCH": "CENTRO DE MANDO · PRIMER INICIO",
"Choose your first view": "Elige tu primera vista",
@@ -1664,7 +1691,7 @@
"Station unavailable after directory refresh": "Emisora no disponible tras actualizar el directorio",
"Clear reading": "Borrar lectura",
"Observed history": "Historial observado",
"Latest": "Último",
"news list|Latest": "Últimas",
"S on another day replaces it · × unpins": "S en otro día lo reemplaza · × quita la fijación",
"← → preview · S shows the focused day": "← → vista previa · S muestra el día enfocado",
"Recent imagery": "Imágenes recientes",
@@ -2836,6 +2863,10 @@
"Fast jet": "Avión de alto rendimiento",
"Business jet": "Reactor ejecutivo",
"Drone": "Dron",
"Airport vehicle": "Vehículo de aeropuerto",
"Ground station / obstacle": "Estación terrestre / obstáculo",
"Airport vehicles": "Vehículos de aeropuerto",
"Ground stations / obstacles": "Estaciones terrestres / obstáculos",
"fire cause|Human": "humana",
"fire cause|Natural": "natural",
"fire cause|Undetermined": "indeterminada",
@@ -3463,7 +3494,11 @@
"Photo of {name}": "Foto de {name}",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "Avistamientos a la vista: {count}",
"{count} sightings in view": {
"one": "{count} avistamiento a la vista",
"many": "{count} de avistamientos a la vista",
"other": "{count} avistamientos a la vista"
},
"Close sighting": "Cerrar avistamiento",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "Fauna y flora observadas en las últimas 48 h (cetáceos 7 días). El color y el símbolo de la insignia indican el grupo taxonómico. Las especies sensibles solo se muestran en celdas de 0,2°; los informes de mamíferos marinos de Acartia en el mar de Salish se redondean a 0,01°. No es un censo.",
"Open {name} on iNaturalist": "Abrir {name} en iNaturalist",
@@ -3474,20 +3509,31 @@
"{days}d": "{days} d",
"All markers": "Todos los marcadores",
"Show markers of every age": "Mostrar marcadores de cualquier antigüedad",
"Maximum event age: {days}d; undated markers are kept": "Antigüedad máxima: {days} d; se conservan los marcadores sin fecha",
"Maximum event age: {days}d; undated markers are kept": {
"one": "Antigüedad máxima: {days} día; se conservan los marcadores sin fecha",
"many": "Antigüedad máxima: {days} de días; se conservan los marcadores sin fecha",
"other": "Antigüedad máxima: {days} días; se conservan los marcadores sin fecha"
},
"event age filter|All": "Todos",
"Event age": "Antigüedad",
"Event age: {days}d · undated kept": "Antigüedad: {days} d · se conservan los marcadores sin fecha",
"Event age: {days}d · undated kept": {
"one": "Antigüedad: {days} día · se conservan los marcadores sin fecha",
"many": "Antigüedad: {days} de días · se conservan los marcadores sin fecha",
"other": "Antigüedad: {days} días · se conservan los marcadores sin fecha"
},
"Close camera preview": "Cerrar vista previa de la cámara",
"Refresh map still": "Actualizar imagen fija del mapa",
"The map still uses a separate request and may show a different moment.": "La imagen del mapa usa una solicitud independiente y puede mostrar otro momento.",
"Video plays from Québec 511, which sees your IP address.": "El vídeo se reproduce desde Québec 511, que ve tu dirección IP.",
"Press OPEN to load the photo": "Pulsa ABRIR para cargar la foto",
"Captured {month}": "Capturada en {month}",
"this spot": "este punto",
"the view centre": "el centro de la vista",
"{source} at {place}": "{source} en {place}",
"{source} at this spot": "{source} en este punto",
"{source} at the view centre": "{source} en el centro de la vista",
"Street level at {place}": "A pie de calle en {place}",
"Street level at this spot": "A pie de calle en este punto",
"Street level at the view centre": "A pie de calle en el centro de la vista",
"Switching map": "Cambiando de mapa",
"Opening imagery": "Abriendo imágenes",
"Street View is ready: press {open} to load it": "Street View está listo: pulsa {open} para cargarlo",
@@ -3661,7 +3707,11 @@
"switch on a dataset to load features": "activa un conjunto de datos para cargar elementos",
"Data Library at a glance": "La biblioteca de datos de un vistazo",
"Map features": "Elementos del mapa",
"Showing {shown} of {total}": "Mostrando {shown} de {total}",
"Showing {shown} of {total}": {
"one": "Mostrando {shown} de {total}",
"many": "Mostrando {shown} de {total}",
"other": "Mostrando {shown} de {total}"
},
"Datasets": "Conjuntos de datos",
"Themes": "Temas",
"zoom in to load this layer": "acércate para cargar esta capa",
+62 -12
View File
@@ -68,8 +68,16 @@
"{severity} only": "{severity} uniquement",
"All categories": "Toutes les catégories",
"Reading the news…": "Lecture des actualités…",
"News, last {hours} hours": "Actualités sur {hours} h",
"Last {hours} h": "Sur {hours} h",
"News, last {hours} hours": {
"one": "Actualités de la dernière {hours} heure",
"many": "Actualités des dernières {hours} d'heures",
"other": "Actualités des dernières {hours} heures"
},
"Last {hours} h": {
"one": "Dernière {hours} h",
"many": "Dernières {hours} h",
"other": "Dernières {hours} h"
},
"Time window": "Période",
"Conflicts": "Conflits",
"Local": "Local",
@@ -78,9 +86,17 @@
"Hotspots": "Foyers",
"Severity": "Gravité",
"Category": "Catégorie",
"Nothing reported near here in the last {hours} h": "Rien de signalé près d'ici en {hours} h",
"Nothing reported near here in the last {hours} h": {
"one": "Rien de signalé près d'ici cette dernière {hours} h",
"many": "Rien de signalé près d'ici ces dernières {hours} h",
"other": "Rien de signalé près d'ici ces dernières {hours} h"
},
"Latest news": "Dernières actualités",
"No news matches these filters in the last {hours} h": "Aucune actualité ne correspond à ces filtres sur {hours} h",
"No news matches these filters in the last {hours} h": {
"one": "Aucune actualité de la dernière {hours} h ne correspond à ces filtres",
"many": "Aucune actualité des dernières {hours} h ne correspond à ces filtres",
"other": "Aucune actualité des dernières {hours} h ne correspond à ces filtres"
},
"Load older news": "Charger des actualités plus anciennes",
"How to read the map": "Comment lire la carte",
"Colour: severity · icon: type of event": "Couleur : gravité · icône : type d'événement",
@@ -127,6 +143,10 @@
"Fast jet": "Avion de chasse",
"Business jet": "Jet d'affaires",
"Drone": "Drone",
"Airport vehicle": "Véhicule d'aéroport",
"Ground station / obstacle": "Station au sol / obstacle",
"Airport vehicles": "Véhicules d'aéroport",
"Ground stations / obstacles": "Stations au sol / obstacles",
"General emergency": "Urgence générale",
"Unlawful interference": "Intervention illicite",
"Radio failure": "Panne radio",
@@ -580,6 +600,7 @@
"Previous — prior visited contact in the 250 km window": "Précédent — contact visité précédemment dans la fenêtre de 250 km",
"PREVIOUS": "PRÉC.",
"FOCUS": "CENTRER",
"site status|FOCUS": "CENTRÉ",
"Next — nearest unvisited contact in the 250 km window": "Suivant — contact non visité le plus proche dans la fenêtre de 250 km",
"NEXT": "SUIV.",
"Named areas ({n})": "Zones nommées ({n})",
@@ -1827,7 +1848,11 @@
"ROUTE DATA UNAVAILABLE": "DONNÉES DE ROUTE INDISPONIBLES",
"CONTACT NAVIGATION OFF": "NAVIGATION DES CONTACTS DÉSACTIVÉE",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "LA PASSERELLE RESTE SUR LE NAVIRE SÉLECTIONNÉ",
"{range} NM": "{range} NM",
"{range} NM": {
"one": "{range} NM",
"many": "{range} NM",
"other": "{range} NM"
},
"AIS DESTINATION · CREW REPORTED": "DESTINATION AIS · DÉCLARÉE PAR L'ÉQUIPAGE",
"DEST {bearing}": "DEST {bearing}",
"Disable cockpit weather effects": "Désactiver les effets météo du cockpit",
@@ -1875,6 +1900,7 @@
"Reclassify as TR-3B": "Reclasser en TR-3B",
"TRACK ACQUIRED": "PISTE ACQUISE",
"{label} · COURSE {heading}°": "{label} · ROUTE {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · ROUTE {heading}°",
"{label} · HEADING {heading}°": "{label} · CAP {heading}°",
"{label} · NO HEADING": "{label} · SANS CAP",
"{label} · NADIR VIEW": "{label} · VUE AU NADIR",
@@ -2144,7 +2170,7 @@
"Radio lifecycle is uncertain — use Enable or Disable to reconcile": "État de la Radio incertain — utilisez Activer ou Désactiver pour le rétablir",
"Clear reading": "Effacer le relevé",
"Observed history": "Historique des observations",
"Latest": "Dernière",
"news list|Latest": "Dernières",
"Imagery on Esri · Google 3D returns when cleared": "Sur Esri · EFFACER rétablit Google 3D",
"Point the camera at the ground to use the view": "Orientez la caméra vers le sol pour utiliser la vue",
"That point cannot anchor a box": "Ce point ne peut pas ancrer une zone",
@@ -2870,7 +2896,11 @@
"Contact cockpit summary": "Résumé cockpit du contact",
"CONTACT": "CONTACT",
"CONTACTS · 250 KM": "CONTACTS · 250 KM",
"RINGS {spacing} NM": "CERCLES {spacing} NM",
"RINGS {spacing} NM": {
"one": "CERCLES {spacing} NM",
"many": "CERCLES {spacing} NM",
"other": "CERCLES {spacing} NM"
},
"{count} CONTACTS": {
"one": "{count} CONTACT",
"many": "{count} DE CONTACTS",
@@ -3197,6 +3227,7 @@
"Left panels": "Panneaux de gauche",
"Right panels": "Panneaux de droite",
"CONFIRMED": "CONFIRMÉE",
"sightings filter|CONFIRMED": "CONFIRMÉES",
"PAD / RTLS": "PAS DE TIR / RTLS",
"fire confidence filter|All": "Toutes",
"fire confidence filter|Nominal+": "Nominale+",
@@ -3463,7 +3494,11 @@
"Photo of {name}": "Photo : {name}",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "Observations dans la vue : {count}",
"{count} sightings in view": {
"one": "{count} observation dans la vue",
"many": "{count} d'observations dans la vue",
"other": "{count} observations dans la vue"
},
"Close sighting": "Fermer l'observation",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "Faune observée au cours des dernières 48 h (cétacés 7 jours). La couleur et le pictogramme du badge indiquent le groupe taxonomique. Les espèces sensibles sont limitées à des cellules de 0,2° ; les signalements de mammifères marins en mer des Salish provenant d'Acartia sont arrondis à 0,01°. Pas un recensement.",
"Open {name} on iNaturalist": "Ouvrir {name} sur iNaturalist",
@@ -3474,20 +3509,31 @@
"{days}d": "{days} j",
"All markers": "Tous les marqueurs",
"Show markers of every age": "Afficher les marqueurs de tout âge",
"Maximum event age: {days}d; undated markers are kept": "Ancienneté maximale : {days} j ; marqueurs sans date conservés",
"Maximum event age: {days}d; undated markers are kept": {
"one": "Ancienneté maximale : {days} j ; marqueurs sans date conservés",
"many": "Ancienneté maximale : {days} j ; marqueurs sans date conservés",
"other": "Ancienneté maximale : {days} j ; marqueurs sans date conservés"
},
"event age filter|All": "Tous",
"Event age": "Ancienneté",
"Event age: {days}d · undated kept": "Ancienneté : {days} j · marqueurs sans date conservés",
"Event age: {days}d · undated kept": {
"one": "Ancienneté : {days} j · marqueurs sans date conservés",
"many": "Ancienneté : {days} j · marqueurs sans date conservés",
"other": "Ancienneté : {days} j · marqueurs sans date conservés"
},
"Close camera preview": "Fermer l'aperçu de la caméra",
"Refresh map still": "Actualiser l'image fixe sur la carte",
"The map still uses a separate request and may show a different moment.": "L'image fixe de la carte utilise une requête distincte et peut montrer un autre moment.",
"Video plays from Québec 511, which sees your IP address.": "La vidéo est lue depuis Québec 511, qui voit votre adresse IP.",
"Press OPEN to load the photo": "Appuyez sur OUVRIR pour charger la photo",
"Captured {month}": "Prise en {month}",
"this spot": "cet endroit",
"the view centre": "le centre de la vue",
"{source} at {place}": "{source} : {place}",
"{source} at this spot": "{source} à cet endroit",
"{source} at the view centre": "{source} au centre de la vue",
"Street level at {place}": "Niveau rue : {place}",
"Street level at this spot": "Niveau rue à cet endroit",
"Street level at the view centre": "Niveau rue au centre de la vue",
"Switching map": "Changement de carte",
"Opening imagery": "Ouverture des images",
"Street View is ready: press {open} to load it": "Street View est prêt : appuyez sur {open} pour le charger",
@@ -3681,7 +3727,11 @@
"REMOVE ALL": "TOUT RETIRER",
"Confirm: remove every added entry from Data Layers": "Confirmer : retirer du panneau Couches toutes les entrées ajoutées",
"Remove every added entry from Data Layers": "Retirer du panneau Couches toutes les entrées ajoutées",
"Showing {shown} of {total}": "Affichées : {shown} sur {total}",
"Showing {shown} of {total}": {
"one": "{shown} sur {total} affichée",
"many": "{shown} sur {total} affichées",
"other": "{shown} sur {total} affichées"
},
"BROWSE DATA LIBRARY": "PARCOURIR LA BIBLIOTHÈQUE DE DONNÉES",
"Atmosphere": "Atmosphère",
"Day and night": "Jour et nuit",
+62 -12
View File
@@ -52,6 +52,10 @@
"Fast jet": "מטוס סילון מהיר",
"Business jet": "מטוס מנהלים",
"Drone": "רחפן",
"Airport vehicle": "רכב שדה תעופה",
"Ground station / obstacle": "תחנה קרקעית / מכשול",
"Airport vehicles": "רכבי שדה תעופה",
"Ground stations / obstacles": "תחנות קרקעיות / מכשולים",
"General emergency": "חירום כללי",
"Unlawful interference": "התערבות בלתי חוקית",
"Radio failure": "כשל קשר",
@@ -474,6 +478,7 @@
"PREVIOUS": "הקודם",
"Previous — prior visited contact in the 250 km window": "הקודם — מגע שכבר ביקרת בו בחלון של 250 ק\"מ",
"FOCUS": "התמקד",
"site status|FOCUS": "מוקד",
"NEXT": "הבא",
"Next — nearest unvisited contact in the 250 km window": "הבא — המגע הקרוב ביותר שלא ביקרת בו בחלון של 250 ק\"מ",
"Named areas ({n})": "אזורים בעלי שם ({n})",
@@ -826,6 +831,7 @@
"ORBIT REPLAY · {mission}": "שחזור מסלול · {mission}",
"PAUSED · {title}": "מושהה · {title}",
"CONFIRMED": "מאושר",
"sightings filter|CONFIRMED": "מאושרות",
"PAD / RTLS": "כן שיגור / RTLS",
"UNSPECIFIED": "לא צוין",
"{value} KM DOWNRANGE": "{value} ק\"מ לאורך המסלול",
@@ -1263,7 +1269,11 @@
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "חיות בר נצפו ב-48 השעות האחרונות (לווייתנים · 7 ימים). הצבע וגליף התג מציגים את קבוצת הטקסון. מינים רגישים מוצגים כתאי 0.2° בלבד; דיווחי יונקי הים של Salish Sea דרך Acartia מעוגלים ל-0.01°. אינו מפקד אוכלוסין.",
"iNaturalist contributors · Acartia {count} (Salish Sea) · licences per record": "תורמי iNaturalist · Acartia {count} (Salish Sea) · רישיונות לכל רשומה",
"iNaturalist contributors · licences per record": "תורמי iNaturalist · רישיונות לכל רשומה",
"{count} sightings in view": "{count} תצפיות בתצוגה",
"{count} sightings in view": {
"one": "{count} תצפית בתצוגה",
"two": "{count} תצפיות בתצוגה",
"other": "{count} תצפיות בתצוגה"
},
"Zoom in for local sightings": "התקרב לתצפיות מקומיות",
"No recent sightings in view": "אין תצפיות אחרונות בתצוגה",
"Acartia feed unavailable": "פיד Acartia אינו זמין",
@@ -1732,6 +1742,7 @@
"SOURCE STATUS UNAVAILABLE": "מצב המקור אינו זמין",
"TRACK ACQUIRED": "המעקב ננעל",
"{label} · COURSE {heading}°": "{label} · מהלך {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · מהלך {heading}°",
"Context could not restore every layer; try again": "ההקשר לא שיחזר את כל השכבות; נסה שוב",
"No selected data layers": "אין שכבות נתונים נבחרות",
"{count} data layers could not be cleared": {
@@ -1989,7 +2000,7 @@
"READY": "מוכן",
"Clear reading": "ניקוי הקריאה",
"Observed history": "היסטוריה נצפית",
"Latest": "האחרונה",
"news list|Latest": "האחרונות",
"Imagery on Esri · Google 3D returns when cleared": "צילומים ב-Esri · Google 3D חוזר כשמנקים",
"Point the camera at the ground to use the view": "כוון את המצלמה אל הקרקע כדי להשתמש בתצוגה",
"That point cannot anchor a box": "אין אפשרות לעגן תיבה באותה נקודה",
@@ -3228,9 +3239,17 @@
"event age filter|All": "הכול",
"{days}d": "{days} ימ׳",
"Show markers of every age": "הצגת סמנים בכל גיל",
"Maximum event age: {days}d; undated markers are kept": "גיל אירוע מרבי: {days} ימ׳; סמנים ללא תאריך נשמרים",
"Maximum event age: {days}d; undated markers are kept": {
"one": "גיל אירוע מרבי: {days} יום; סמנים ללא תאריך נשמרים",
"two": "גיל אירוע מרבי: {days} ימים; סמנים ללא תאריך נשמרים",
"other": "גיל אירוע מרבי: {days} ימים; סמנים ללא תאריך נשמרים"
},
"All markers": "כל הסמנים",
"Event age: {days}d · undated kept": "גיל האירוע: {days} ימ׳ · ללא תאריך נשמרים",
"Event age: {days}d · undated kept": {
"one": "גיל האירוע: {days} יום · ללא תאריך נשמרים",
"two": "גיל האירוע: {days} ימים · ללא תאריך נשמרים",
"other": "גיל האירוע: {days} ימים · ללא תאריך נשמרים"
},
"30-DAY MISSION INDEX UNAVAILABLE": "רשימת המשימות ל-30 יום אינה זמינה",
"STATIONS": "תחנות",
"Crewed stations and the craft that visit them": "תחנות מאוישות והחלליות המבקרות בהן",
@@ -3266,7 +3285,11 @@
"LIVE AIS": "AIS חי",
"CONTACT NAVIGATION OFF": "ניווט המגעים כבוי",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "הגשר נשאר עם האונייה הנבחרת",
"{range} NM": "{range} NM",
"{range} NM": {
"one": "{range} NM",
"two": "{range} NM",
"other": "{range} NM"
},
"AIS DESTINATION · CREW REPORTED": "יעד AIS · דווח על ידי הצוות",
"FWD": "קדימה",
"AFT": "אחורה",
@@ -3285,10 +3308,13 @@
"Video plays from Québec 511, which sees your IP address.": "הווידאו זורם מ-Québec 511, שרואה את כתובת ה-IP שלך.",
"Press OPEN to load the photo": "לחץ על \"פתח\" כדי לטעון את התמונה",
"Captured {month}": "צולם ב-{month}",
"this spot": "המקום הזה",
"the view centre": "מרכז התצוגה",
"{source} at {place}": "{source}: {place}",
"{source} at this spot": "{source} במקום הזה",
"{source} at the view centre": "{source} במרכז התצוגה",
"Street level at {place}": "צילומי רחוב: {place}",
"Street level at this spot": "צילומי רחוב במקום הזה",
"Street level at the view centre": "צילומי רחוב במרכז התצוגה",
"Switching map": "מחליף מפה",
"Opening imagery": "פותח צילומים",
"Street View is ready: press {open} to load it": "Street View מוכן: לחץ על \"{open}\" כדי לטעון אותו",
@@ -3348,7 +3374,11 @@
"Zoom in (+)": "התקרבות (+)",
"Zoom to the imaging sensor swath": "זום אל רצועת הסריקה של חיישן הצילום",
"SENSOR": "חיישן",
"RINGS {spacing} NM": "טבעות {spacing} NM",
"RINGS {spacing} NM": {
"one": "טבעות {spacing} NM",
"two": "טבעות {spacing} NM",
"other": "טבעות {spacing} NM"
},
"{count} CONTACTS": {
"one": "{count} מגע",
"two": "{count} מגעים",
@@ -3477,20 +3507,36 @@
"{severity} and above": "{severity} ומעלה",
"{severity} only": "{severity} בלבד",
"All categories": "כל הקטגוריות",
"Last {hours} h": "{hours} שע׳ אחורה",
"Last {hours} h": {
"one": "השעה האחרונה ({hours})",
"two": "{hours} שע׳ אחרונות",
"other": "{hours} שע׳ אחרונות"
},
"News from {area}": "חדשות מ-{area}",
"Within {km} km of the view centre": "בטווח {km} ק\"מ ממרכז התצוגה",
"Reading the news…": "קורא את החדשות…",
"News, last {hours} hours": "חדשות, {hours} שע׳ אחורה",
"News, last {hours} hours": {
"one": "חדשות, השעה האחרונה ({hours})",
"two": "חדשות, {hours} השעות האחרונות",
"other": "חדשות, {hours} השעות האחרונות"
},
"Time window": "חלון זמן",
"News sections": "מדורי חדשות",
"Hotspots": "מוקדים",
"Severity": "חומרה",
"Category": "קטגוריה",
"Zoom in to see local news": "התקרב כדי לראות חדשות מקומיות",
"Nothing reported near here in the last {hours} h": "לא דווח דבר בסביבה בחלון של {hours} שע׳",
"Nothing reported near here in the last {hours} h": {
"one": "לא דווח דבר בסביבה בשעה האחרונה ({hours})",
"two": "לא דווח דבר בסביבה ב־{hours} השעות האחרונות",
"other": "לא דווח דבר בסביבה ב־{hours} השעות האחרונות"
},
"Latest news": "חדשות אחרונות",
"No news matches these filters in the last {hours} h": "אין חדשות התואמות למסננים אלה בחלון של {hours} שע׳",
"No news matches these filters in the last {hours} h": {
"one": "אין חדשות התואמות למסננים אלה בשעה האחרונה ({hours})",
"two": "אין חדשות התואמות למסננים אלה ב־{hours} השעות האחרונות",
"other": "אין חדשות התואמות למסננים אלה ב־{hours} השעות האחרונות"
},
"Load older news": "טעינת חדשות ישנות יותר",
"How to read the map": "איך לקרוא את המפה",
"Colour: severity · icon: type of event": "צבע: חומרה · סמל: סוג האירוע",
@@ -3681,7 +3727,11 @@
"REMOVE ALL": "הסרת הכול",
"Confirm: remove every added entry from Data Layers": "אישור: הסרת כל הפריטים שנוספו משכבות נתונים",
"Remove every added entry from Data Layers": "הסרת כל הפריטים שנוספו משכבות נתונים",
"Showing {shown} of {total}": "מוצגים {shown} מתוך {total}",
"Showing {shown} of {total}": {
"one": "מוצג {shown} מתוך {total}",
"two": "מוצגים {shown} מתוך {total}",
"other": "מוצגים {shown} מתוך {total}"
},
"BROWSE DATA LIBRARY": "עיון בספריית הנתונים",
"Atmosphere": "אטמוספרה",
"Day and night": "יום ולילה",
+63 -13
View File
@@ -68,8 +68,16 @@
"{severity} only": "Solo {severity}",
"All categories": "Tutte le categorie",
"Reading the news…": "Lettura delle notizie…",
"News, last {hours} hours": "Notizie, periodo in ore: {hours}",
"Last {hours} h": "Periodo: {hours} h",
"News, last {hours} hours": {
"one": "Notizie dell'ultima {hours} ora",
"many": "Notizie delle ultime {hours} di ore",
"other": "Notizie delle ultime {hours} ore"
},
"Last {hours} h": {
"one": "Ultima {hours} h",
"many": "Ultime {hours} h",
"other": "Ultime {hours} h"
},
"Time window": "Periodo",
"Conflicts": "Conflitti",
"Local": "Locale",
@@ -78,9 +86,17 @@
"Hotspots": "Focolai",
"Severity": "Gravità",
"Category": "Categoria",
"Nothing reported near here in the last {hours} h": "Nessuna segnalazione qui vicino · periodo: {hours} h",
"Nothing reported near here in the last {hours} h": {
"one": "Nessuna segnalazione qui vicino nell'ultima {hours} h",
"many": "Nessuna segnalazione qui vicino nelle ultime {hours} h",
"other": "Nessuna segnalazione qui vicino nelle ultime {hours} h"
},
"Latest news": "Ultime notizie",
"No news matches these filters in the last {hours} h": "Nessuna notizia corrisponde a questi filtri · periodo: {hours} h",
"No news matches these filters in the last {hours} h": {
"one": "Nessuna notizia dell'ultima {hours} h corrisponde a questi filtri",
"many": "Nessuna notizia delle ultime {hours} h corrisponde a questi filtri",
"other": "Nessuna notizia delle ultime {hours} h corrisponde a questi filtri"
},
"Load older news": "Carica notizie precedenti",
"How to read the map": "Come leggere la mappa",
"Colour: severity · icon: type of event": "Colore: gravità · icona: tipo di evento",
@@ -127,6 +143,10 @@
"Fast jet": "Jet ad alte prestazioni",
"Business jet": "Business jet",
"Drone": "Drone",
"Airport vehicle": "Veicolo aeroportuale",
"Ground station / obstacle": "Stazione a terra / ostacolo",
"Airport vehicles": "Veicoli aeroportuali",
"Ground stations / obstacles": "Stazioni a terra / ostacoli",
"General emergency": "Emergenza generale",
"Unlawful interference": "Interferenza illecita",
"Radio failure": "Avaria radio",
@@ -580,6 +600,7 @@
"Previous — prior visited contact in the 250 km window": "Precedente — contatto visitato in precedenza nella finestra di 250 km",
"PREVIOUS": "PREC",
"FOCUS": "FOCUS",
"site status|FOCUS": "PUNTAMENTO",
"Next — nearest unvisited contact in the 250 km window": "Successivo — contatto non visitato più vicino nella finestra di 250 km",
"NEXT": "SUCC",
"Named areas ({n})": "Aree con nome ({n})",
@@ -935,7 +956,7 @@
"ORBITAL VELOCITY": "VELOCITÀ ORBITALE",
"SUB-SATELLITE POINT": "PUNTO SUBSATELLITARE",
"NORTH UP": "NORD IN ALTO",
"CURRENTLY OVER": "ATTUALMENTE SOPRA",
"CURRENTLY OVER": "SORVOLO",
"{division}, {country}": "{division}, {country}",
"{region} · near {place}": "{region} · vicino a {place}",
"NORAD {id}": "NORAD {id}",
@@ -1827,7 +1848,11 @@
"ROUTE DATA UNAVAILABLE": "DATI ROTTA NON DISPONIBILI",
"CONTACT NAVIGATION OFF": "NAVIGAZIONE CONTATTI DISATTIVATA",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "LA PLANCIA RESTA SULLA NAVE SELEZIONATA",
"{range} NM": "{range} MN",
"{range} NM": {
"one": "{range} MN",
"many": "{range} MN",
"other": "{range} MN"
},
"AIS DESTINATION · CREW REPORTED": "DESTINAZIONE AIS · DICHIARATA DALL'EQUIPAGGIO",
"DEST {bearing}": "DEST {bearing}",
"Disable cockpit weather effects": "Disattiva gli effetti meteo del cockpit",
@@ -1875,6 +1900,7 @@
"Reclassify as TR-3B": "Riclassifica come TR-3B",
"TRACK ACQUIRED": "TRACCIA ACQUISITA",
"{label} · COURSE {heading}°": "{label} · ROTTA {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · ROTTA {heading}°",
"{label} · HEADING {heading}°": "{label} · PRUA {heading}°",
"{label} · NO HEADING": "{label} · PRUA N/D",
"{label} · NADIR VIEW": "{label} · VISTA AL NADIR",
@@ -2144,7 +2170,7 @@
"Radio lifecycle is uncertain — use Enable or Disable to reconcile": "Il ciclo di vita della Radio è incerto: usa Attiva o Disattiva per riconciliare",
"Clear reading": "Cancella la lettura",
"Observed history": "Storico osservato",
"Latest": "Più recente",
"news list|Latest": "Più recenti",
"Imagery on Esri · Google 3D returns when cleared": "Immagini su Esri · Google 3D torna con CANCELLA",
"Point the camera at the ground to use the view": "Punta la camera verso il suolo per usare la vista",
"That point cannot anchor a box": "Quel punto non può ancorare un riquadro",
@@ -2870,7 +2896,11 @@
"Contact cockpit summary": "Riepilogo contatto del cockpit",
"CONTACT": "CONTATTO",
"CONTACTS · 250 KM": "CONTATTI · 250 KM",
"RINGS {spacing} NM": "CERCHI {spacing} MN",
"RINGS {spacing} NM": {
"one": "CERCHI {spacing} MN",
"many": "CERCHI {spacing} MN",
"other": "CERCHI {spacing} MN"
},
"{count} CONTACTS": {
"one": "{count} CONTATTO",
"many": "{count} DI CONTATTI",
@@ -3197,6 +3227,7 @@
"Left panels": "Pannelli a sinistra",
"Right panels": "Pannelli a destra",
"CONFIRMED": "CONFERMATA",
"sightings filter|CONFIRMED": "CONFERMATI",
"PAD / RTLS": "RAMPA / RTLS",
"fire confidence filter|All": "Tutti",
"fire confidence filter|Nominal+": "Nominale+",
@@ -3463,7 +3494,11 @@
"Photo of {name}": "Foto di {name}",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "Avvistamenti nella vista: {count}",
"{count} sightings in view": {
"one": "{count} avvistamento nella vista",
"many": "{count} di avvistamenti nella vista",
"other": "{count} avvistamenti nella vista"
},
"Close sighting": "Chiudi avvistamento",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "Fauna osservata nelle ultime 48 h (cetacei 7 giorni). Colore e simbolo del contrassegno indicano il gruppo tassonomico. Le specie sensibili sono mostrate solo in celle di 0,2°; le segnalazioni di mammiferi marini di Acartia nel mar dei Salish sono arrotondate a 0,01°. Non è un censimento.",
"Open {name} on iNaturalist": "Apri {name} su iNaturalist",
@@ -3474,20 +3509,31 @@
"{days}d": "{days} g",
"All markers": "Tutti i marcatori",
"Show markers of every age": "Mostra i marcatori di qualsiasi età",
"Maximum event age: {days}d; undated markers are kept": "Età massima degli eventi: {days} g; marcatori senza data mantenuti",
"Maximum event age: {days}d; undated markers are kept": {
"one": "Età massima degli eventi: {days} giorno; marcatori senza data mantenuti",
"many": "Età massima degli eventi: {days} di giorni; marcatori senza data mantenuti",
"other": "Età massima degli eventi: {days} giorni; marcatori senza data mantenuti"
},
"event age filter|All": "Tutti",
"Event age": "Età degli eventi",
"Event age: {days}d · undated kept": "Età degli eventi: {days} g · senza data mantenuti",
"Event age: {days}d · undated kept": {
"one": "Età degli eventi: {days} giorno · senza data mantenuti",
"many": "Età degli eventi: {days} di giorni · senza data mantenuti",
"other": "Età degli eventi: {days} giorni · senza data mantenuti"
},
"Close camera preview": "Chiudi anteprima della telecamera",
"Refresh map still": "Aggiorna immagine fissa sulla mappa",
"The map still uses a separate request and may show a different moment.": "L'immagine sulla mappa usa una richiesta separata e può mostrare un momento diverso.",
"Video plays from Québec 511, which sees your IP address.": "Il video viene riprodotto da Québec 511, che vede il tuo indirizzo IP.",
"Press OPEN to load the photo": "Premi APRI per caricare la foto",
"Captured {month}": "Scattata: {month}",
"this spot": "questo punto",
"the view centre": "il centro della vista",
"{source} at {place}": "{source}: {place}",
"{source} at this spot": "{source} in questo punto",
"{source} at the view centre": "{source} al centro della vista",
"Street level at {place}": "Vista stradale: {place}",
"Street level at this spot": "Vista stradale in questo punto",
"Street level at the view centre": "Vista stradale al centro della vista",
"Switching map": "Cambio mappa",
"Opening imagery": "Apertura delle immagini",
"Street View is ready: press {open} to load it": "Street View è pronto: premi {open} per caricarlo",
@@ -3681,7 +3727,11 @@
"REMOVE ALL": "RIMUOVI TUTTO",
"Confirm: remove every added entry from Data Layers": "Conferma: rimuovi da Livelli dati tutte le voci aggiunte",
"Remove every added entry from Data Layers": "Rimuovi da Livelli dati tutte le voci aggiunte",
"Showing {shown} of {total}": "Mostrati: {shown} su {total}",
"Showing {shown} of {total}": {
"one": "{shown} di {total} mostrata",
"many": "{shown} di {total} mostrate",
"other": "{shown} di {total} mostrate"
},
"BROWSE DATA LIBRARY": "ESPLORA LIBRERIA DATI",
"Atmosphere": "Atmosfera",
"Day and night": "Giorno e notte",
+42 -12
View File
@@ -62,8 +62,12 @@
"{severity} only": "{severity}のみ",
"All categories": "すべてのカテゴリ",
"Reading the news…": "ニュースを読み込み中…",
"News, last {hours} hours": "直近{hours}時間のニュース",
"Last {hours} h": "直近{hours}時間",
"News, last {hours} hours": {
"other": "直近{hours}時間のニュース"
},
"Last {hours} h": {
"other": "直近{hours}時間"
},
"Time window": "期間",
"Conflicts": "紛争",
"Local": "ローカル",
@@ -72,9 +76,13 @@
"Hotspots": "ホットスポット",
"Severity": "深刻度",
"Category": "カテゴリ",
"Nothing reported near here in the last {hours} h": "直近{hours}時間、この付近の報道はありません",
"Nothing reported near here in the last {hours} h": {
"other": "直近{hours}時間、この付近の報道はありません"
},
"Latest news": "最新ニュース",
"No news matches these filters in the last {hours} h": "直近{hours}時間で条件に合うニュースはありません",
"No news matches these filters in the last {hours} h": {
"other": "直近{hours}時間で条件に合うニュースはありません"
},
"Load older news": "以前のニュースを読み込む",
"How to read the map": "地図の見方",
"Colour: severity · icon: type of event": "色:深刻度 · アイコン:出来事の種類",
@@ -119,6 +127,10 @@
"Fast jet": "高速ジェット機",
"Business jet": "ビジネスジェット",
"Drone": "ドローン",
"Airport vehicle": "空港車両",
"Ground station / obstacle": "地上局 / 障害物",
"Airport vehicles": "空港車両",
"Ground stations / obstacles": "地上局 / 障害物",
"General emergency": "緊急事態",
"Unlawful interference": "不法妨害",
"Radio failure": "通信機故障",
@@ -560,6 +572,7 @@
"Previous — prior visited contact in the 250 km window": "前へ:250 km圏内で直前に訪れたコンタクト",
"PREVIOUS": "前へ",
"FOCUS": "フォーカス",
"site status|FOCUS": "フォーカス",
"Next — nearest unvisited contact in the 250 km window": "次へ:250 km圏内で最も近い未訪問のコンタクト",
"NEXT": "次へ",
"Named areas ({n})": "名前付きエリア({n})",
@@ -1771,7 +1784,9 @@
"ROUTE DATA UNAVAILABLE": "経路データなし",
"CONTACT NAVIGATION OFF": "コンタクトナビゲーション オフ",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "ブリッジは選択中の船舶に固定",
"{range} NM": "{range}海里",
"{range} NM": {
"other": "{range}海里"
},
"AIS DESTINATION · CREW REPORTED": "AIS目的地 · 乗組員入力",
"DEST {bearing}": "目的地 {bearing}",
"Disable cockpit weather effects": "コックピットの天候エフェクトを無効にする",
@@ -1817,6 +1832,7 @@
"Reclassify as TR-3B": "TR-3Bに再分類",
"TRACK ACQUIRED": "追跡開始",
"{label} · COURSE {heading}°": "{label} · 対地針路 {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · 対地針路 {heading}°",
"{label} · HEADING {heading}°": "{label} · 船首方位 {heading}°",
"{label} · NO HEADING": "{label} · 船首方位なし",
"{label} · NADIR VIEW": "{label} · 直下視",
@@ -2070,7 +2086,7 @@
"Radio lifecycle is uncertain — use Enable or Disable to reconcile": "ラジオのライフサイクルが不明確です。有効化または無効化で再調整してください",
"Clear reading": "読み取り値を消去",
"Observed history": "観測履歴",
"Latest": "最新",
"news list|Latest": "最新",
"Imagery on Esri · Google 3D returns when cleared": "画像はEsri上に表示 · 消去するとGoogle 3Dに戻ります",
"Point the camera at the ground to use the view": "このビューを使うにはカメラを地面に向けてください",
"That point cannot anchor a box": "その地点は範囲の基点にできません",
@@ -2720,7 +2736,9 @@
"Contact cockpit summary": "コンタクトのコックピット概要",
"CONTACT": "コンタクト",
"CONTACTS · 250 KM": "コンタクト · 250 km",
"RINGS {spacing} NM": "距離環 {spacing}海里",
"RINGS {spacing} NM": {
"other": "距離環 {spacing}海里"
},
"{count} CONTACTS": {
"other": "コンタクト {count}件"
},
@@ -3047,6 +3065,7 @@
"Left panels": "左パネル",
"Right panels": "右パネル",
"CONFIRMED": "確認済み",
"sightings filter|CONFIRMED": "確認済み",
"PAD / RTLS": "射場 / RTLS",
"fire confidence filter|All": "すべて",
"fire confidence filter|Nominal+": "中以上",
@@ -3301,7 +3320,9 @@
"Photo of {name}": "{name}の写真",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "表示範囲に{count}件の目撃情報",
"{count} sightings in view": {
"other": "表示範囲に{count}件の目撃情報"
},
"Close sighting": "目撃情報を閉じる",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "過去48時間以内に観察された野生生物(クジラ類は7日間)。色とバッジのアイコンは分類群を表します。保護が必要な種は0.2°のセルとしてのみ表示し、セイリッシュ海のAcartiaによる海生哺乳類の目撃情報は0.01°に丸めます。個体数調査ではありません。",
"Open {name} on iNaturalist": "iNaturalistで{name}を開く",
@@ -3312,20 +3333,27 @@
"{days}d": "{days}日",
"All markers": "すべてのマーカー",
"Show markers of every age": "日付にかかわらずすべてのマーカーを表示",
"Maximum event age: {days}d; undated markers are kept": "イベントの最大経過日数:{days}日。日付のないマーカーは保持",
"Maximum event age: {days}d; undated markers are kept": {
"other": "イベントの最大経過日数:{days}日。日付のないマーカーは保持"
},
"event age filter|All": "すべて",
"Event age": "経過日数",
"Event age: {days}d · undated kept": "経過日数:{days}日以内 · 日付なしは保持",
"Event age: {days}d · undated kept": {
"other": "経過日数:{days}日以内 · 日付なしは保持"
},
"Close camera preview": "カメラのプレビューを閉じる",
"Refresh map still": "地図上の静止画を更新",
"The map still uses a separate request and may show a different moment.": "地図上の静止画は別のリクエストで取得されるため、異なる時点を表示する場合があります。",
"Video plays from Québec 511, which sees your IP address.": "動画はQuébec 511から再生され、お使いのIPアドレスはQuébec 511側から見えます。",
"Press OPEN to load the photo": "[開く]を押して写真を読み込む",
"Captured {month}": "{month}撮影",
"this spot": "この地点",
"the view centre": "表示中心",
"{source} at {place}": "{place}の{source}",
"{source} at this spot": "この地点の{source}",
"{source} at the view centre": "表示中心の{source}",
"Street level at {place}": "{place}のストリートレベル",
"Street level at this spot": "この地点のストリートレベル",
"Street level at the view centre": "表示中心のストリートレベル",
"Switching map": "地図を切り替え中",
"Opening imagery": "画像を開いています",
"Street View is ready: press {open} to load it": "ストリートビューの準備ができました:[{open}]を押して読み込んでください",
@@ -3507,7 +3535,9 @@
"REMOVE ALL": "すべて削除",
"Confirm: remove every added entry from Data Layers": "確認:追加したすべての項目をデータレイヤーから削除",
"Remove every added entry from Data Layers": "追加したすべての項目をデータレイヤーから削除",
"Showing {shown} of {total}": "{total}件中{shown}件を表示",
"Showing {shown} of {total}": {
"other": "{total}件中{shown}件を表示"
},
"BROWSE DATA LIBRARY": "データライブラリを見る",
"Atmosphere": "大気",
"Day and night": "昼と夜",
+64 -14
View File
@@ -68,8 +68,16 @@
"{severity} only": "Apenas {severity}",
"All categories": "Todas as categorias",
"Reading the news…": "Lendo as notícias…",
"News, last {hours} hours": "Notícias de até {hours} h atrás",
"Last {hours} h": "Até {hours} h atrás",
"News, last {hours} hours": {
"one": "Notícias da última {hours} hora",
"many": "Notícias das últimas {hours} de horas",
"other": "Notícias das últimas {hours} horas"
},
"Last {hours} h": {
"one": "Última {hours} h",
"many": "Últimas {hours} h",
"other": "Últimas {hours} h"
},
"Time window": "Período",
"Conflicts": "Conflitos",
"Local": "Local",
@@ -78,9 +86,17 @@
"Hotspots": "Focos",
"Severity": "Gravidade",
"Category": "Categoria",
"Nothing reported near here in the last {hours} h": "Nada noticiado aqui perto desde {hours} h atrás",
"Nothing reported near here in the last {hours} h": {
"one": "Nada noticiado aqui perto na última {hours} h",
"many": "Nada noticiado aqui perto nas últimas {hours} h",
"other": "Nada noticiado aqui perto nas últimas {hours} h"
},
"Latest news": "Últimas notícias",
"No news matches these filters in the last {hours} h": "Nenhuma notícia de até {hours} h atrás corresponde a estes filtros",
"No news matches these filters in the last {hours} h": {
"one": "Nenhuma notícia da última {hours} h corresponde a estes filtros",
"many": "Nenhuma notícia das últimas {hours} h corresponde a estes filtros",
"other": "Nenhuma notícia das últimas {hours} h corresponde a estes filtros"
},
"Load older news": "Carregar notícias anteriores",
"How to read the map": "Como ler o mapa",
"Colour: severity · icon: type of event": "Cor: gravidade · ícone: tipo de evento",
@@ -127,6 +143,10 @@
"Fast jet": "Jato de alto desempenho",
"Business jet": "Jato executivo",
"Drone": "Drone",
"Airport vehicle": "Veículo de aeroporto",
"Ground station / obstacle": "Estação terrestre / obstáculo",
"Airport vehicles": "Veículos de aeroporto",
"Ground stations / obstacles": "Estações terrestres / obstáculos",
"General emergency": "Emergência geral",
"Unlawful interference": "Interferência ilícita",
"Radio failure": "Falha de rádio",
@@ -580,6 +600,7 @@
"Previous — prior visited contact in the 250 km window": "Anterior — contato visitado anteriormente na janela de 250 km",
"PREVIOUS": "ANT.",
"FOCUS": "FOCAR",
"site status|FOCUS": "FOCO",
"Next — nearest unvisited contact in the 250 km window": "Próximo — contato não visitado mais próximo na janela de 250 km",
"NEXT": "PRÓX.",
"Named areas ({n})": "Áreas com nome ({n})",
@@ -933,7 +954,7 @@
"ORBITAL VELOCITY": "VELOCIDADE ORBITAL",
"SUB-SATELLITE POINT": "PONTO SUBSATÉLITE",
"NORTH UP": "NORTE PARA CIMA",
"CURRENTLY OVER": "SOBREVOANDO AGORA",
"CURRENTLY OVER": "SOBREVOO",
"{division}, {country}": "{division}, {country}",
"{region} · near {place}": "{region} · perto de {place}",
"NORAD {id}": "NORAD {id}",
@@ -1827,7 +1848,11 @@
"ROUTE DATA UNAVAILABLE": "DADOS DE ROTA INDISPONÍVEIS",
"CONTACT NAVIGATION OFF": "NAVEGAÇÃO DE CONTATOS DESLIGADA",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "O PASSADIÇO PERMANECE NA EMBARCAÇÃO SELECIONADA",
"{range} NM": "{range} MN",
"{range} NM": {
"one": "{range} MN",
"many": "{range} MN",
"other": "{range} MN"
},
"AIS DESTINATION · CREW REPORTED": "DESTINO AIS · INFORMADO PELA TRIPULAÇÃO",
"DEST {bearing}": "DEST {bearing}",
"Disable cockpit weather effects": "Desativar efeitos de clima na cabine",
@@ -1874,7 +1899,8 @@
"Restore real aircraft": "Restaurar a aeronave real",
"Reclassify as TR-3B": "Reclassificar como TR-3B",
"TRACK ACQUIRED": "RASTRO ADQUIRIDO",
"{label} · COURSE {heading}°": "{label} · RUMO {heading}°",
"{label} · COURSE {heading}°": "{label} · CURSO {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · RUMO {heading}°",
"{label} · HEADING {heading}°": "{label} · PROA {heading}°",
"{label} · NO HEADING": "{label} · SEM PROA",
"{label} · NADIR VIEW": "{label} · VISTA AO NADIR",
@@ -2144,7 +2170,7 @@
"Radio lifecycle is uncertain — use Enable or Disable to reconcile": "O ciclo de vida do rádio é incerto — use Ativar ou Desativar para reconciliar",
"Clear reading": "Limpar leitura",
"Observed history": "Histórico observado",
"Latest": "Mais recente",
"news list|Latest": "Mais recentes",
"Imagery on Esri · Google 3D returns when cleared": "Imagens sobre o Esri · LIMPAR restaura o Google 3D",
"Point the camera at the ground to use the view": "Aponte a câmera para o chão para usar a vista",
"That point cannot anchor a box": "Esse ponto não pode ancorar uma área",
@@ -2872,7 +2898,11 @@
"Contact cockpit summary": "Resumo do contato na cabine",
"CONTACT": "CONTATO",
"CONTACTS · 250 KM": "CONTATOS · 250 KM",
"RINGS {spacing} NM": "ANÉIS {spacing} MN",
"RINGS {spacing} NM": {
"one": "ANÉIS {spacing} MN",
"many": "ANÉIS {spacing} MN",
"other": "ANÉIS {spacing} MN"
},
"{count} CONTACTS": {
"one": "{count} CONTATO",
"many": "{count} DE CONTATOS",
@@ -3197,6 +3227,7 @@
"Left panels": "Painéis à esquerda",
"Right panels": "Painéis à direita",
"CONFIRMED": "CONFIRMADA",
"sightings filter|CONFIRMED": "CONFIRMADOS",
"PAD / RTLS": "PLATAFORMA / RTLS",
"fire confidence filter|All": "Todas",
"fire confidence filter|Nominal+": "Nominal+",
@@ -3463,7 +3494,11 @@
"Photo of {name}": "Foto de {name}",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "Avistamentos na vista: {count}",
"{count} sightings in view": {
"one": "{count} avistamento na vista",
"many": "{count} de avistamentos na vista",
"other": "{count} avistamentos na vista"
},
"Close sighting": "Fechar avistamento",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "Vida selvagem observada nas últimas 48 h (cetáceos 7 dias). A cor e o símbolo do emblema indicam o grupo taxonômico. Espécies sensíveis aparecem apenas em células de 0,2°; os relatos de mamíferos marinhos do mar de Salish via Acartia são arredondados para 0,01°. Não é um censo.",
"Open {name} on iNaturalist": "Abrir {name} no iNaturalist",
@@ -3474,20 +3509,31 @@
"{days}d": "{days} d",
"All markers": "Todos os marcadores",
"Show markers of every age": "Mostrar marcadores de qualquer idade",
"Maximum event age: {days}d; undated markers are kept": "Idade máxima do evento: {days} d; marcadores sem data são mantidos",
"Maximum event age: {days}d; undated markers are kept": {
"one": "Idade máxima do evento: {days} dia; marcadores sem data são mantidos",
"many": "Idade máxima do evento: {days} de dias; marcadores sem data são mantidos",
"other": "Idade máxima do evento: {days} dias; marcadores sem data são mantidos"
},
"event age filter|All": "Todos",
"Event age": "Idade do evento",
"Event age: {days}d · undated kept": "Idade do evento: {days} d · sem data mantidos",
"Event age: {days}d · undated kept": {
"one": "Idade do evento: {days} dia · sem data mantidos",
"many": "Idade do evento: {days} de dias · sem data mantidos",
"other": "Idade do evento: {days} dias · sem data mantidos"
},
"Close camera preview": "Fechar prévia da câmera",
"Refresh map still": "Atualizar imagem fixa no mapa",
"The map still uses a separate request and may show a different moment.": "A imagem no mapa usa uma solicitação separada e pode mostrar outro momento.",
"Video plays from Québec 511, which sees your IP address.": "O vídeo é reproduzido a partir do Québec 511, que vê o seu endereço IP.",
"Press OPEN to load the photo": "Clique em ABRIR para carregar a foto",
"Captured {month}": "Capturada em {month}",
"this spot": "este ponto",
"the view centre": "o centro da vista",
"{source} at {place}": "{source}: {place}",
"{source} at this spot": "{source} neste ponto",
"{source} at the view centre": "{source} no centro da vista",
"Street level at {place}": "Nível da rua: {place}",
"Street level at this spot": "Nível da rua neste ponto",
"Street level at the view centre": "Nível da rua no centro da vista",
"Switching map": "Mudando de mapa",
"Opening imagery": "Abrindo imagens",
"Street View is ready: press {open} to load it": "O Street View está pronto: clique em {open} para carregar",
@@ -3681,7 +3727,11 @@
"REMOVE ALL": "REMOVER TUDO",
"Confirm: remove every added entry from Data Layers": "Confirmar: remover de \"Camadas de dados\" todas as entradas adicionadas",
"Remove every added entry from Data Layers": "Remover de \"Camadas de dados\" todas as entradas adicionadas",
"Showing {shown} of {total}": "Mostrando {shown} de {total}",
"Showing {shown} of {total}": {
"one": "Mostrando {shown} de {total}",
"many": "Mostrando {shown} de {total}",
"other": "Mostrando {shown} de {total}"
},
"BROWSE DATA LIBRARY": "EXPLORAR BIBLIOTECA DE DADOS",
"Atmosphere": "Atmosfera",
"Day and night": "Dia e noite",
+72 -12
View File
@@ -71,8 +71,18 @@
"{severity} only": "Только: {severity}",
"All categories": "Все категории",
"Reading the news…": "Читаем новости…",
"News, last {hours} hours": "Новости за последние {hours} ч",
"Last {hours} h": "За {hours} ч",
"News, last {hours} hours": {
"one": "Новости за последний {hours} час",
"few": "Новости за последние {hours} часа",
"many": "Новости за последние {hours} часов",
"other": "Новости за последние {hours} часа"
},
"Last {hours} h": {
"one": "За {hours} ч",
"few": "За {hours} ч",
"many": "За {hours} ч",
"other": "За {hours} ч"
},
"Time window": "Период",
"Conflicts": "Конфликты",
"Local": "Местные",
@@ -81,9 +91,19 @@
"Hotspots": "Горячие точки",
"Severity": "Тяжесть",
"Category": "Категория",
"Nothing reported near here in the last {hours} h": "За последние {hours} ч поблизости ничего не сообщалось",
"Nothing reported near here in the last {hours} h": {
"one": "За последний {hours} ч поблизости ничего не сообщалось",
"few": "За последние {hours} ч поблизости ничего не сообщалось",
"many": "За последние {hours} ч поблизости ничего не сообщалось",
"other": "За последние {hours} ч поблизости ничего не сообщалось"
},
"Latest news": "Последние новости",
"No news matches these filters in the last {hours} h": "За последние {hours} ч нет новостей по этим фильтрам",
"No news matches these filters in the last {hours} h": {
"one": "За последний {hours} ч нет новостей по этим фильтрам",
"few": "За последние {hours} ч нет новостей по этим фильтрам",
"many": "За последние {hours} ч нет новостей по этим фильтрам",
"other": "За последние {hours} ч нет новостей по этим фильтрам"
},
"Load older news": "Загрузить более ранние новости",
"How to read the map": "Как читать карту",
"Colour: severity · icon: type of event": "Цвет: тяжесть · значок: тип события",
@@ -178,6 +198,7 @@
"Previous — prior visited contact in the 250 km window": "Назад — предыдущий посещённый контакт в радиусе 250 км",
"PREVIOUS": "ПРЕД.",
"FOCUS": "ФОКУС",
"site status|FOCUS": "ФОКУС",
"Next — nearest unvisited contact in the 250 km window": "Далее — ближайший непосещённый контакт в радиусе 250 км",
"NEXT": "СЛЕД.",
"Open-source mapped/observed context. Missing broadcasts, unloaded map areas, or unmapped sites are not evidence of absence.": "Контекст из открытых источников. Отсутствие трансляций, незагруженные области карты или неотмеченные объекты — не доказательство отсутствия.",
@@ -345,6 +366,7 @@
"Cancel replay": "Отменить повтор",
"EST. DOWNRANGE": "РАСЧЁТ ПО ТРАССЕ",
"CONFIRMED": "ПОДТВЕРЖДЕНО",
"sightings filter|CONFIRMED": "ПОДТВЕРЖДЕНО",
"PAD / RTLS": "ПЛОЩАДКА / RTLS",
"PLANNED · ": "ПЛАН · ",
"SUPPLIED TRAJECTORY POINTS": "ПРЕДОСТАВЛЕННЫЕ ТОЧКИ ТРАЕКТОРИИ",
@@ -546,7 +568,12 @@
"ROUTE DATA UNAVAILABLE": "ДАННЫЕ МАРШРУТА НЕДОСТУПНЫ",
"CONTACT NAVIGATION OFF": "НАВИГАЦИЯ ПО КОНТАКТАМ ВЫКЛЮЧЕНА",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "МОСТИК ОСТАЁТСЯ НА ВЫБРАННОМ СУДНЕ",
"{range} NM": "{range} МОР. МИЛ.",
"{range} NM": {
"one": "{range} МОР. МИЛЯ",
"few": "{range} МОР. МИЛИ",
"many": "{range} МОР. МИЛЬ",
"other": "{range} МОР. МИЛИ"
},
"AIS DESTINATION · CREW REPORTED": "ПУНКТ НАЗНАЧЕНИЯ AIS · УКАЗАН ЭКИПАЖЕМ",
"DEST {bearing}": "НАЗН. {bearing}",
"Disable cockpit weather effects": "Выключить погодные эффекты кабины",
@@ -592,6 +619,7 @@
"Select flight {title}": "Выбрать рейс {title}",
"TRACK ACQUIRED": "ЦЕЛЬ ЗАХВАЧЕНА",
"{label} · COURSE {heading}°": "{label} · ПУТЕВОЙ УГОЛ {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · ПУТЕВОЙ УГОЛ {heading}°",
"{label} · HEADING {heading}°": "{label} · КУРС {heading}°",
"{label} · NO HEADING": "{label} · НЕТ КУРСА",
"{label} · NADIR VIEW": "{label} · ВИД В НАДИР",
@@ -843,7 +871,12 @@
"EXIT BRIDGE": "ВЫЙТИ С МОСТИКА",
"EXIT ORBIT": "ВЫЙТИ С ОРБИТЫ",
"CONTACTS · 250 KM": "КОНТАКТЫ · 250 КМ",
"RINGS {spacing} NM": "КОЛЬЦА {spacing} МОР. МИЛ.",
"RINGS {spacing} NM": {
"one": "КОЛЬЦА {spacing} МОР. МИЛЯ",
"few": "КОЛЬЦА {spacing} МОР. МИЛИ",
"many": "КОЛЬЦА {spacing} МОР. МИЛЬ",
"other": "КОЛЬЦА {spacing} МОР. МИЛИ"
},
"{count} CONTACTS": {
"one": "{count} КОНТАКТ",
"few": "{count} КОНТАКТА",
@@ -1694,7 +1727,7 @@
"Station unavailable after directory refresh": "Станция недоступна после обновления каталога",
"Clear reading": "Очистить показания",
"Observed history": "История наблюдений",
"Latest": "Последние",
"news list|Latest": "Последние",
"S on another day replaces it · × unpins": "S в другой день заменяет его · × открепляет",
"← → preview · S shows the focused day": "← → просмотр · S показывает выбранный день",
"Recent imagery": "Свежие снимки",
@@ -2898,6 +2931,10 @@
"Fast jet": "Высокоманёвренный самолёт",
"Business jet": "Бизнес-джет",
"Drone": "Беспилотник",
"Airport vehicle": "Аэродромная машина",
"Ground station / obstacle": "Наземная станция / препятствие",
"Airport vehicles": "Аэродромные машины",
"Ground stations / obstacles": "Наземные станции / препятствия",
"fire cause|Human": "деятельность человека",
"fire cause|Natural": "природная",
"fire cause|Undetermined": "не установлена",
@@ -3544,7 +3581,12 @@
"Photo of {name}": "Фото: {name}",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "Наблюдений в кадре: {count}",
"{count} sightings in view": {
"one": "{count} наблюдение в кадре",
"few": "{count} наблюдения в кадре",
"many": "{count} наблюдений в кадре",
"other": "{count} наблюдения в кадре"
},
"Close sighting": "Закрыть наблюдение",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "Наблюдения живой природы за 48 ч (китообразные — 7 дней). Цвет и символ значка обозначают таксономическую группу. Уязвимые виды показаны только ячейками 0,2°; сообщения Acartia о морских млекопитающих моря Селиш округлены до 0,01°. Это не учёт численности.",
"Open {name} on iNaturalist": "Открыть {name} в iNaturalist",
@@ -3555,20 +3597,33 @@
"{days}d": "{days} дн.",
"All markers": "Все метки",
"Show markers of every age": "Показать метки любого возраста",
"Maximum event age: {days}d; undated markers are kept": "Максимальный возраст события: {days} дн.; метки без даты остаются",
"Maximum event age: {days}d; undated markers are kept": {
"one": "Максимальный возраст события: {days} дн.; метки без даты остаются",
"few": "Максимальный возраст события: {days} дн.; метки без даты остаются",
"many": "Максимальный возраст события: {days} дн.; метки без даты остаются",
"other": "Максимальный возраст события: {days} дн.; метки без даты остаются"
},
"event age filter|All": "Все",
"Event age": "Возраст события",
"Event age: {days}d · undated kept": "Возраст события: {days} дн. · метки без даты остаются",
"Event age: {days}d · undated kept": {
"one": "Возраст события: {days} дн. · метки без даты остаются",
"few": "Возраст события: {days} дн. · метки без даты остаются",
"many": "Возраст события: {days} дн. · метки без даты остаются",
"other": "Возраст события: {days} дн. · метки без даты остаются"
},
"Close camera preview": "Закрыть просмотр камеры",
"Refresh map still": "Обновить кадр на карте",
"The map still uses a separate request and may show a different moment.": "Кадр на карте запрашивается отдельно и может показывать другой момент.",
"Video plays from Québec 511, which sees your IP address.": "Видео воспроизводится с Québec 511, который видит ваш IP-адрес.",
"Press OPEN to load the photo": "Нажмите ОТКРЫТЬ, чтобы загрузить снимок",
"Captured {month}": "Снято: {month}",
"this spot": "эта точка",
"the view centre": "центр вида",
"{source} at {place}": "{source}: {place}",
"{source} at this spot": "{source} в этой точке",
"{source} at the view centre": "{source} в центре вида",
"Street level at {place}": "Уличные снимки: {place}",
"Street level at this spot": "Уличные снимки в этой точке",
"Street level at the view centre": "Уличные снимки в центре вида",
"Switching map": "Смена карты",
"Opening imagery": "Открытие снимков",
"Street View is ready: press {open} to load it": "Просмотр улиц готов: нажмите {open}, чтобы загрузить",
@@ -3748,7 +3803,12 @@
"switch on a dataset to load features": "включите набор данных, чтобы загрузить объекты",
"Data Library at a glance": "Библиотека данных вкратце",
"Map features": "Объекты на карте",
"Showing {shown} of {total}": "Показано {shown} из {total}",
"Showing {shown} of {total}": {
"one": "Показано {shown} из {total}",
"few": "Показано {shown} из {total}",
"many": "Показано {shown} из {total}",
"other": "Показано {shown} из {total}"
},
"Datasets": "Наборы данных",
"Themes": "Темы",
"zoom in to load this layer": "приблизьте, чтобы загрузить этот слой",
+52 -12
View File
@@ -67,18 +67,30 @@
"{severity} and above": "{severity} och uppåt",
"{severity} only": "Endast ”{severity}”",
"All categories": "Alla kategorier",
"Last {hours} h": "Senaste {hours} h",
"Last {hours} h": {
"one": "Senaste {hours} h",
"other": "Senaste {hours} h"
},
"Reading the news…": "Läser in nyheterna …",
"News, last {hours} hours": "Nyheter, senaste {hours} h",
"News, last {hours} hours": {
"one": "Nyheter, senaste {hours} h",
"other": "Nyheter, senaste {hours} h"
},
"Time window": "Tidsfönster",
"News sections": "Nyhetssektioner",
"Hotspots": "Oroshärdar",
"Severity": "Allvarlighetsgrad",
"Category": "Kategori",
"Zoom in to see local news": "Zooma in för att se lokala nyheter",
"Nothing reported near here in the last {hours} h": "Inget rapporterat i närheten senaste {hours} h",
"Nothing reported near here in the last {hours} h": {
"one": "Inget rapporterat i närheten senaste {hours} h",
"other": "Inget rapporterat i närheten senaste {hours} h"
},
"Latest news": "Senaste nyheterna",
"No news matches these filters in the last {hours} h": "Inga nyheter matchar filtren senaste {hours} h",
"No news matches these filters in the last {hours} h": {
"one": "Inga nyheter matchar filtren senaste {hours} h",
"other": "Inga nyheter matchar filtren senaste {hours} h"
},
"Load older news": "Ladda äldre nyheter",
"How to read the map": "Så läses kartan",
"Colour: severity · icon: type of event": "Färg: allvarlighetsgrad · ikon: typ av händelse",
@@ -197,6 +209,7 @@
"Previous — prior visited contact in the 250 km window": "Förra – senast besökta kontakt inom 250 km",
"PREVIOUS": "FÖRRA",
"FOCUS": "FOKUS",
"site status|FOCUS": "FOKUS",
"Next — nearest unvisited contact in the 250 km window": "Nästa – närmaste obesökta kontakt inom 250 km",
"NEXT": "NÄSTA",
"Open-source mapped/observed context. Missing broadcasts, unloaded map areas, or unmapped sites are not evidence of absence.": "Kartlagd/observerad kontext från öppna källor. Uteblivna sändningar, kartområden som inte har laddats eller platser som inte är kartlagda bevisar inte att något saknas.",
@@ -566,6 +579,7 @@
"Reclassify as TR-3B": "Klassa om som TR-3B",
"TRACK ACQUIRED": "SPÅR LÅST",
"{label} · COURSE {heading}°": "{label} · FÄRDRIKTNING {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · FÄRDRIKTNING {heading}°",
"Context could not restore every layer; try again": "Läget ”Kontext” kunde inte återställa alla lager – försök igen",
"No selected data layers": "Inga valda datalager",
"{count} data layers could not be cleared": {
@@ -982,6 +996,10 @@
"Fast jet": "Stridsflygplan",
"Business jet": "Affärsjet",
"Drone": "Drönare",
"Airport vehicle": "Flygplatsfordon",
"Ground station / obstacle": "Markstation / hinder",
"Airport vehicles": "Flygplatsfordon",
"Ground stations / obstacles": "Markstationer / hinder",
"General emergency": "Allmänt nödläge",
"Unlawful interference": "Olagligt ingripande",
"Radio failure": "Radiobortfall",
@@ -2319,7 +2337,7 @@
"RESUME": "FORTSÄTT",
"Clear reading": "Rensa avläsningen",
"Observed history": "Observerad historik",
"Latest": "Senaste",
"news list|Latest": "Senaste",
"Imagery on Esri · Google 3D returns when cleared": "Bilder på Esri · Google 3D återkommer när de rensas",
"Point the camera at the ground to use the view": "Rikta kameran mot marken för att använda vyn",
"That point cannot anchor a box": "Den punkten kan inte förankra ett område",
@@ -3039,6 +3057,7 @@
"Left panels": "Vänstra paneler",
"Right panels": "Högra paneler",
"CONFIRMED": "BEKRÄFTAD",
"sightings filter|CONFIRMED": "BEKRÄFTADE",
"PAD / RTLS": "RAMP / RTLS",
"fire confidence filter|All": "Alla",
"fire confidence filter|Nominal+": "Normal+",
@@ -3299,7 +3318,10 @@
"Photo of {name}": "Foto av {name}",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "Observationer i vyn: {count}",
"{count} sightings in view": {
"one": "{count} observation i vyn",
"other": "{count} observationer i vyn"
},
"Close sighting": "Stäng observationen",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "Djur, växter och svampar observerade de senaste 48 h (valar 7 d). Färg och symbol visar artgruppen. Känsliga arter visas bara som rutor på 0,2°; rapporter om marina däggdjur i Salish Sea via Acartia avrundas till 0,01°. Ingen inventering.",
"Open {name} on iNaturalist": "Öppna {name} på iNaturalist",
@@ -3310,20 +3332,29 @@
"{days}d": "{days} d",
"All markers": "Alla markörer",
"Show markers of every age": "Visa markörer oavsett ålder",
"Maximum event age: {days}d; undated markers are kept": "Högsta ålder på händelser: {days} d; markörer utan datum behålls",
"Maximum event age: {days}d; undated markers are kept": {
"one": "Högsta ålder på händelser: {days} d; markörer utan datum behålls",
"other": "Högsta ålder på händelser: {days} d; markörer utan datum behålls"
},
"event age filter|All": "Alla",
"Event age": "Händelsernas ålder",
"Event age: {days}d · undated kept": "Händelsernas ålder: {days} d · utan datum behålls",
"Event age: {days}d · undated kept": {
"one": "Händelsernas ålder: {days} d · utan datum behålls",
"other": "Händelsernas ålder: {days} d · utan datum behålls"
},
"Close camera preview": "Stäng förhandsvisningen av kameran",
"Refresh map still": "Uppdatera stillbilden på kartan",
"The map still uses a separate request and may show a different moment.": "Stillbilden på kartan hämtas separat och kan visa ett annat ögonblick.",
"Video plays from Québec 511, which sees your IP address.": "Videon spelas upp från Québec 511, som ser din IP-adress.",
"Press OPEN to load the photo": "Tryck på ÖPPNA för att ladda fotot",
"Captured {month}": "Tagen {month}",
"this spot": "den här platsen",
"the view centre": "vyns mitt",
"{source} at {place}": "{source} vid {place}",
"{source} at this spot": "{source} på den här platsen",
"{source} at the view centre": "{source} i vyns mitt",
"Street level at {place}": "Gatunivå vid {place}",
"Street level at this spot": "Gatunivå på den här platsen",
"Street level at the view centre": "Gatunivå i vyns mitt",
"Switching map": "Byter karta",
"Opening imagery": "Öppnar bilder",
"Street View is ready: press {open} to load it": "Street View är redo: tryck på {open} för att ladda den",
@@ -3357,7 +3388,10 @@
"LIVE AIS": "LIVE-AIS",
"CONTACT NAVIGATION OFF": "KONTAKTNAVIGERING AV",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "BRYGGAN STANNAR PÅ DET VALDA FARTYGET",
"{range} NM": "{range} NM",
"{range} NM": {
"one": "{range} NM",
"other": "{range} NM"
},
"AIS DESTINATION · CREW REPORTED": "AIS-DESTINATION · ANGIVEN AV BESÄTTNINGEN",
"{label} · NADIR VIEW": "{label} · NADIRVY",
"SITES STANDBY": "PLATSER I VÄNTLÄGE",
@@ -3436,7 +3470,10 @@
"Zoom in (+)": "Zooma in (+)",
"Zoom to the imaging sensor swath": "Zooma till sensorns avbildningsstråk",
"SENSOR": "SENSOR",
"RINGS {spacing} NM": "RINGAR {spacing} NM",
"RINGS {spacing} NM": {
"one": "RINGAR {spacing} NM",
"other": "RINGAR {spacing} NM"
},
"{count} CONTACTS": {
"one": "{count} KONTAKT",
"other": "{count} KONTAKTER"
@@ -3594,7 +3631,10 @@
"REMOVE ALL": "TA BORT ALLA",
"Confirm: remove every added entry from Data Layers": "Bekräfta: ta bort alla tillagda poster från Datalager",
"Remove every added entry from Data Layers": "Ta bort alla tillagda poster från Datalager",
"Showing {shown} of {total}": "Visar {shown} av {total}",
"Showing {shown} of {total}": {
"one": "Visar {shown} av {total}",
"other": "Visar {shown} av {total}"
},
"BROWSE DATA LIBRARY": "BLÄDDRA I DATABIBLIOTEKET",
"Atmosphere": "Atmosfär",
"Day and night": "Dag och natt",
+73 -13
View File
@@ -71,8 +71,18 @@
"{severity} only": "Лише {severity}",
"All categories": "Усі категорії",
"Reading the news…": "Читаємо новини…",
"News, last {hours} hours": "Новини за {hours} год",
"Last {hours} h": "За {hours} год",
"News, last {hours} hours": {
"one": "Новини за останню {hours} годину",
"few": "Новини за останні {hours} години",
"many": "Новини за останні {hours} годин",
"other": "Новини за останні {hours} години"
},
"Last {hours} h": {
"one": "За {hours} год",
"few": "За {hours} год",
"many": "За {hours} год",
"other": "За {hours} год"
},
"Time window": "Період",
"Conflicts": "Конфлікти",
"Local": "Місцеві",
@@ -81,9 +91,19 @@
"Hotspots": "Гарячі точки",
"Severity": "Тяжкість",
"Category": "Категорія",
"Nothing reported near here in the last {hours} h": "За {hours} год поблизу нічого не повідомлялося",
"Nothing reported near here in the last {hours} h": {
"one": "За останню {hours} год поблизу нічого не повідомлялося",
"few": "За останні {hours} год поблизу нічого не повідомлялося",
"many": "За останні {hours} год поблизу нічого не повідомлялося",
"other": "За останні {hours} год поблизу нічого не повідомлялося"
},
"Latest news": "Останні новини",
"No news matches these filters in the last {hours} h": "За {hours} год немає новин за цими фільтрами",
"No news matches these filters in the last {hours} h": {
"one": "За останню {hours} год немає новин за цими фільтрами",
"few": "За останні {hours} год немає новин за цими фільтрами",
"many": "За останні {hours} год немає новин за цими фільтрами",
"other": "За останні {hours} год немає новин за цими фільтрами"
},
"Load older news": "Завантажити давніші новини",
"How to read the map": "Як читати карту",
"Colour: severity · icon: type of event": "Колір: тяжкість · значок: тип події",
@@ -131,6 +151,10 @@
"Fast jet": "Швидкісний реактивний літак",
"Business jet": "Бізнес-джет",
"Drone": "Безпілотник",
"Airport vehicle": "Аеродромний автомобіль",
"Ground station / obstacle": "Наземна станція / перешкода",
"Airport vehicles": "Аеродромні автомобілі",
"Ground stations / obstacles": "Наземні станції / перешкоди",
"General emergency": "Загальна аварійна ситуація",
"Unlawful interference": "Незаконне втручання",
"Radio failure": "Відмова радіозвʼязку",
@@ -590,6 +614,7 @@
"Previous — prior visited contact in the 250 km window": "Назад — попередній переглянутий контакт у радіусі 250 км",
"PREVIOUS": "НАЗАД",
"FOCUS": "ФОКУС",
"site status|FOCUS": "ФОКУС",
"Next — nearest unvisited contact in the 250 km window": "Далі — найближчий ще не переглянутий контакт у радіусі 250 км",
"NEXT": "ДАЛІ",
"Named areas ({n})": "Іменовані зони ({n})",
@@ -950,7 +975,7 @@
"ORBITAL VELOCITY": "ОРБІТАЛЬНА ШВИДКІСТЬ",
"SUB-SATELLITE POINT": "ПІДСУПУТНИКОВА ТОЧКА",
"NORTH UP": "ПІВНІЧ УГОРІ",
"CURRENTLY OVER": "ЗАРАЗ НАД",
"CURRENTLY OVER": "ПРОЛІТ",
"{division}, {country}": "{division}, {country}",
"{region} · near {place}": "{region} · поблизу: {place}",
"NORAD {id}": "NORAD {id}",
@@ -1854,7 +1879,12 @@
"ROUTE DATA UNAVAILABLE": "ДАНІ МАРШРУТУ НЕДОСТУПНІ",
"CONTACT NAVIGATION OFF": "НАВІГАЦІЮ КОНТАКТАМИ ВИМКНЕНО",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "МІСТОК ЗАЛИШАЄТЬСЯ НА ВИБРАНОМУ СУДНІ",
"{range} NM": "{range} МОР. МИЛ.",
"{range} NM": {
"one": "{range} МОР. МИЛЯ",
"few": "{range} МОР. МИЛІ",
"many": "{range} МОР. МИЛЬ",
"other": "{range} МОР. МИЛІ"
},
"AIS DESTINATION · CREW REPORTED": "ПРИЗНАЧЕННЯ AIS · ВКАЗАНО ЕКІПАЖЕМ",
"DEST {bearing}": "ПРИЗН. {bearing}",
"Disable cockpit weather effects": "Вимкнути погодні ефекти кабіни",
@@ -1903,6 +1933,7 @@
"Reclassify as TR-3B": "Перекласифікувати як TR-3B",
"TRACK ACQUIRED": "ТРЕК ЗАХОПЛЕНО",
"{label} · COURSE {heading}°": "{label} · ШЛЯХОВИЙ КУТ {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · ШЛЯХОВИЙ КУТ {heading}°",
"{label} · HEADING {heading}°": "{label} · КУРС {heading}°",
"{label} · NO HEADING": "{label} · НЕМАЄ КУРСУ",
"{label} · NADIR VIEW": "{label} · ВИГЛЯД У НАДИР",
@@ -2180,7 +2211,7 @@
"Radio lifecycle is uncertain — use Enable or Disable to reconcile": "Стан радіо невизначений — звірте через «Увімкнути» або «Вимкнути»",
"Clear reading": "Очистити покази",
"Observed history": "Історія спостережень",
"Latest": "Останні",
"news list|Latest": "Останні",
"Imagery on Esri · Google 3D returns when cleared": "Підкладка: Esri · скидання поверне Google 3D",
"Point the camera at the ground to use the view": "Наведіть камеру на землю, щоб вибрати видиму область",
"That point cannot anchor a box": "Від цієї точки не можна побудувати область",
@@ -2944,7 +2975,12 @@
"Contact cockpit summary": "Зведення контакту в кабіні",
"CONTACT": "КОНТАКТ",
"CONTACTS · 250 KM": "КОНТАКТИ · 250 КМ",
"RINGS {spacing} NM": "КІЛЬЦЯ {spacing} МОР. МИЛ.",
"RINGS {spacing} NM": {
"one": "КІЛЬЦЯ {spacing} МОР. МИЛЯ",
"few": "КІЛЬЦЯ {spacing} МОР. МИЛІ",
"many": "КІЛЬЦЯ {spacing} МОР. МИЛЬ",
"other": "КІЛЬЦЯ {spacing} МОР. МИЛІ"
},
"{count} CONTACTS": {
"one": "{count} КОНТАКТ",
"few": "{count} КОНТАКТИ",
@@ -3285,6 +3321,7 @@
"Left panels": "Ліві панелі",
"Right panels": "Праві панелі",
"CONFIRMED": "ПІДТВЕРДЖЕНО",
"sightings filter|CONFIRMED": "ПІДТВЕРДЖЕНО",
"PAD / RTLS": "МІСЦЕ ЗАПУСКУ / RTLS",
"Name of {name}": "Назва: {name}",
"Change the colour of {name}": "Змінити колір: {name}",
@@ -3544,7 +3581,12 @@
"Photo of {name}": "Фото {name}",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "Спостережень у кадрі: {count}",
"{count} sightings in view": {
"one": "{count} спостереження в кадрі",
"few": "{count} спостереження в кадрі",
"many": "{count} спостережень у кадрі",
"other": "{count} спостереження в кадрі"
},
"Close sighting": "Закрити спостереження",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "Спостереження живої природи за 48 год (китоподібні — 7 днів). Колір і символ значка позначають таксономічну групу. Вразливі види показано лише комірками 0,2°; повідомлення Acartia про морських ссавців моря Селіш округлено до 0,01°. Не перепис.",
"Open {name} on iNaturalist": "Відкрити {name} в iNaturalist",
@@ -3555,20 +3597,33 @@
"{days}d": "{days} дн",
"All markers": "Усі мітки",
"Show markers of every age": "Показати мітки будь-якого віку",
"Maximum event age: {days}d; undated markers are kept": "Максимальний вік події: {days} дн; мітки без дати залишаються",
"Maximum event age: {days}d; undated markers are kept": {
"one": "Максимальний вік події: {days} дн; мітки без дати залишаються",
"few": "Максимальний вік події: {days} дн; мітки без дати залишаються",
"many": "Максимальний вік події: {days} дн; мітки без дати залишаються",
"other": "Максимальний вік події: {days} дн; мітки без дати залишаються"
},
"event age filter|All": "Усі",
"Event age": "Вік події",
"Event age: {days}d · undated kept": "Вік події: {days} дн · мітки без дати залишаються",
"Event age: {days}d · undated kept": {
"one": "Вік події: {days} дн · мітки без дати залишаються",
"few": "Вік події: {days} дн · мітки без дати залишаються",
"many": "Вік події: {days} дн · мітки без дати залишаються",
"other": "Вік події: {days} дн · мітки без дати залишаються"
},
"Close camera preview": "Закрити перегляд камери",
"Refresh map still": "Оновити кадр на карті",
"The map still uses a separate request and may show a different moment.": "Кадр на карті запитується окремо та може показувати інший момент.",
"Video plays from Québec 511, which sees your IP address.": "Відео відтворюється з Québec 511, який бачить вашу IP-адресу.",
"Press OPEN to load the photo": "Натисніть «ВІДКРИТИ», щоб завантажити фото",
"Captured {month}": "Знято: {month}",
"this spot": "це місце",
"the view centre": "центр карти",
"{source} at {place}": "{source}: {place}",
"{source} at this spot": "{source} у цьому місці",
"{source} at the view centre": "{source} у центрі карти",
"Street level at {place}": "Вуличні знімки: {place}",
"Street level at this spot": "Вуличні знімки в цьому місці",
"Street level at the view centre": "Вуличні знімки в центрі карти",
"Switching map": "Перемикання карти",
"Opening imagery": "Відкриття знімків",
"Street View is ready: press {open} to load it": "Перегляд вулиць готовий: натисніть «{open}», щоб завантажити",
@@ -3768,7 +3823,12 @@
"REMOVE ALL": "ВИДАЛИТИ ВСЕ",
"Confirm: remove every added entry from Data Layers": "Підтвердити: видалити всі додані записи з «Шарів даних»",
"Remove every added entry from Data Layers": "Видалити всі додані записи з «Шарів даних»",
"Showing {shown} of {total}": "Показано {shown} з {total}",
"Showing {shown} of {total}": {
"one": "Показано {shown} з {total}",
"few": "Показано {shown} з {total}",
"many": "Показано {shown} з {total}",
"other": "Показано {shown} з {total}"
},
"BROWSE DATA LIBRARY": "ВІДКРИТИ БІБЛІОТЕКУ ДАНИХ",
"Atmosphere": "Атмосфера",
"Day and night": "День і ніч",
+42 -12
View File
@@ -62,8 +62,12 @@
"{severity} only": "仅{severity}",
"All categories": "所有类别",
"Reading the news…": "正在读取新闻…",
"News, last {hours} hours": "最近 {hours} 小时的新闻",
"Last {hours} h": "最近 {hours} 小时",
"News, last {hours} hours": {
"other": "最近 {hours} 小时的新闻"
},
"Last {hours} h": {
"other": "最近 {hours} 小时"
},
"Time window": "时间范围",
"Conflicts": "冲突",
"Local": "本地",
@@ -72,9 +76,13 @@
"Hotspots": "热点",
"Severity": "严重程度",
"Category": "类别",
"Nothing reported near here in the last {hours} h": "最近 {hours} 小时附近无报道",
"Nothing reported near here in the last {hours} h": {
"other": "最近 {hours} 小时附近无报道"
},
"Latest news": "最新新闻",
"No news matches these filters in the last {hours} h": "最近 {hours} 小时没有符合这些筛选条件的新闻",
"No news matches these filters in the last {hours} h": {
"other": "最近 {hours} 小时没有符合这些筛选条件的新闻"
},
"Load older news": "加载更早的新闻",
"How to read the map": "如何解读地图",
"Colour: severity · icon: type of event": "颜色:严重程度 · 图标:事件类型",
@@ -119,6 +127,10 @@
"Fast jet": "喷气战机",
"Business jet": "公务机",
"Drone": "无人机",
"Airport vehicle": "机场车辆",
"Ground station / obstacle": "地面站 / 障碍物",
"Airport vehicles": "机场车辆",
"Ground stations / obstacles": "地面站 / 障碍物",
"General emergency": "一般紧急情况",
"Unlawful interference": "非法干扰",
"Radio failure": "无线电失效",
@@ -559,6 +571,7 @@
"Previous — prior visited contact in the 250 km window": "上一个:250 km 范围内先前访问过的目标",
"PREVIOUS": "上一个",
"FOCUS": "聚焦",
"site status|FOCUS": "聚焦",
"Next — nearest unvisited contact in the 250 km window": "下一个:250 km 范围内最近的未访问目标",
"NEXT": "下一个",
"Named areas ({n})": "已命名区域({n})",
@@ -923,6 +936,7 @@
"Cancel replay": "取消回放",
"EST. DOWNRANGE": "预估落点距离",
"CONFIRMED": "已确认",
"sightings filter|CONFIRMED": "已确认",
"PAD / RTLS": "发射台 / RTLS",
"PLANNED · ": "计划 · ",
"SUPPLIED TRAJECTORY POINTS": "提供的轨迹点",
@@ -1745,7 +1759,9 @@
"ROUTE DATA UNAVAILABLE": "航线数据不可用",
"CONTACT NAVIGATION OFF": "目标导航已关闭",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "驾驶台保持在所选船舶上",
"{range} NM": "{range} 海里",
"{range} NM": {
"other": "{range} 海里"
},
"AIS DESTINATION · CREW REPORTED": "AIS 目的地 · 船员申报",
"DEST {bearing}": "目的地 {bearing}",
"Disable cockpit weather effects": "停用座舱天气效果",
@@ -1791,6 +1807,7 @@
"Reclassify as TR-3B": "重新归类为 TR-3B",
"TRACK ACQUIRED": "已获取航迹",
"{label} · COURSE {heading}°": "{label} · 对地航向 {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · 对地航向 {heading}°",
"{label} · HEADING {heading}°": "{label} · 船首向 {heading}°",
"{label} · NO HEADING": "{label} · 无船首向",
"{label} · NADIR VIEW": "{label} · 天底视图",
@@ -2040,7 +2057,7 @@
"Radio lifecycle is uncertain — use Enable or Disable to reconcile": "电台生命周期状态不确定——请使用“启用”或“停用”进行核对",
"Clear reading": "清除读数",
"Observed history": "观测历史",
"Latest": "最新",
"news list|Latest": "最新",
"Imagery on Esri · Google 3D returns when cleared": "影像显示在 Esri 底图上 · 清除后恢复 Google 3D",
"Point the camera at the ground to use the view": "将相机对准地面才能使用当前视野",
"That point cannot anchor a box": "该点无法作为框选锚点",
@@ -2619,7 +2636,9 @@
"Contact cockpit summary": "目标座舱摘要",
"CONTACT": "目标",
"CONTACTS · 250 KM": "目标 · 250 km",
"RINGS {spacing} NM": "距标圈 {spacing} 海里",
"RINGS {spacing} NM": {
"other": "距标圈 {spacing} 海里"
},
"{count} CONTACTS": {
"other": "{count} 个目标"
},
@@ -3301,7 +3320,9 @@
"Photo of {name}": "{name} 的照片",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "视野内有 {count} 次目击",
"{count} sightings in view": {
"other": "视野内有 {count} 次目击"
},
"Close sighting": "关闭目击记录",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "近 48 小时内观察到的野生生物(鲸类为 7 天)。颜色与徽章图标表示分类群。敏感物种仅以 0.2° 网格显示;Acartia 提供的萨利希海海洋哺乳动物目击位置四舍五入到 0.01°。并非种群普查。",
"Open {name} on iNaturalist": "在 iNaturalist 上打开 {name}",
@@ -3312,20 +3333,27 @@
"{days}d": "{days} 天",
"All markers": "所有标记",
"Show markers of every age": "显示所有时间的标记",
"Maximum event age: {days}d; undated markers are kept": "仅显示 {days} 天内的事件;保留无日期标记",
"Maximum event age: {days}d; undated markers are kept": {
"other": "仅显示 {days} 天内的事件;保留无日期标记"
},
"event age filter|All": "全部",
"Event age": "事件时间",
"Event age: {days}d · undated kept": "事件时间:{days} 天内 · 保留无日期标记",
"Event age: {days}d · undated kept": {
"other": "事件时间:{days} 天内 · 保留无日期标记"
},
"Close camera preview": "关闭摄像头预览",
"Refresh map still": "刷新地图静止画面",
"The map still uses a separate request and may show a different moment.": "地图静止画面通过单独的请求获取,可能显示不同的时刻。",
"Video plays from Québec 511, which sees your IP address.": "视频从 Québec 511 播放,Québec 511 会看到你的 IP 地址。",
"Press OPEN to load the photo": "点击“打开”加载照片",
"Captured {month}": "拍摄于 {month}",
"this spot": "此处",
"the view centre": "视野中心",
"{source} at {place}": "{place} 的 {source}",
"{source} at this spot": "此处的 {source}",
"{source} at the view centre": "视图中心的 {source}",
"Street level at {place}": "{place} 的街景",
"Street level at this spot": "此处的街景",
"Street level at the view centre": "视图中心的街景",
"Switching map": "正在切换地图",
"Opening imagery": "正在打开影像",
"Street View is ready: press {open} to load it": "街景已就绪:点击“{open}”加载",
@@ -3507,7 +3535,9 @@
"REMOVE ALL": "全部移除",
"Confirm: remove every added entry from Data Layers": "确认:从数据图层中移除所有已添加条目",
"Remove every added entry from Data Layers": "从数据图层中移除所有已添加条目",
"Showing {shown} of {total}": "显示 {shown} / {total}",
"Showing {shown} of {total}": {
"other": "显示 {shown} / {total}"
},
"BROWSE DATA LIBRARY": "浏览数据资源库",
"Atmosphere": "大气",
"Day and night": "昼夜",
+158 -128
View File
@@ -62,8 +62,12 @@
"{severity} only": "僅{severity}",
"All categories": "所有類別",
"Reading the news…": "正在讀取新聞…",
"News, last {hours} hours": "最近 {hours} 小時的新聞",
"Last {hours} h": "最近 {hours} 小時",
"News, last {hours} hours": {
"other": "最近 {hours} 小時的新聞"
},
"Last {hours} h": {
"other": "最近 {hours} 小時"
},
"Time window": "時間範圍",
"Conflicts": "衝突",
"Local": "本地",
@@ -72,9 +76,13 @@
"Hotspots": "熱點",
"Severity": "嚴重程度",
"Category": "類別",
"Nothing reported near here in the last {hours} h": "最近 {hours} 小時附近無報道",
"Nothing reported near here in the last {hours} h": {
"other": "最近 {hours} 小時附近無報道"
},
"Latest news": "最新新聞",
"No news matches these filters in the last {hours} h": "最近 {hours} 小時沒有符合這些篩選條件的新聞",
"No news matches these filters in the last {hours} h": {
"other": "最近 {hours} 小時沒有符合這些篩選條件的新聞"
},
"Load older news": "加載更早的新聞",
"How to read the map": "如何解讀地圖",
"Colour: severity · icon: type of event": "顏色:嚴重程度 · 圖標:事件類型",
@@ -119,6 +127,10 @@
"Fast jet": "噴氣戰機",
"Business jet": "公務機",
"Drone": "無人機",
"Airport vehicle": "機場車輛",
"Ground station / obstacle": "地面站 / 障礙物",
"Airport vehicles": "機場車輛",
"Ground stations / obstacles": "地面站 / 障礙物",
"General emergency": "一般緊急情況",
"Unlawful interference": "非法干擾",
"Radio failure": "無線電失效",
@@ -559,6 +571,7 @@
"Previous — prior visited contact in the 250 km window": "上一個:250 km 範圍內先前訪問過的目標",
"PREVIOUS": "上一個",
"FOCUS": "聚焦",
"site status|FOCUS": "聚焦",
"Next — nearest unvisited contact in the 250 km window": "下一個:250 km 範圍內最近的未訪問目標",
"NEXT": "下一個",
"Named areas ({n})": "已命名區域({n})",
@@ -608,6 +621,7 @@
"Cyclone advisories unavailable": "氣旋公告不可用",
"Cyclone data unavailable": "氣旋數據不可用",
"Potential tropical cyclone": "潛在熱帶氣旋",
"Post-tropical cyclone": "後熱帶氣旋",
"Hurricane": "颶風",
"Tropical storm": "熱帶風暴",
"Tropical depression": "熱帶低壓",
@@ -705,11 +719,15 @@
"Merge onto {road}": "併入 {road}",
"maneuver|Merge": "併道",
"Take the ramp on the {direction} onto {road}": "{direction}駛入匝道,進入 {road}",
"Take the ramp {direction} onto {road}": "{direction}駛入匝道,進入 {road}",
"Take the ramp on the {direction}": "{direction}駛入匝道",
"Take the ramp {direction}": "{direction}駛入匝道",
"Take the ramp onto {road}": "駛入匝道,進入 {road}",
"Take the ramp": "駛入匝道",
"Take the exit on the {direction} onto {road}": "從出口{direction}駛出,進入 {road}",
"Take the exit {direction} onto {road}": "從出口{direction}駛出,進入 {road}",
"Take the exit on the {direction}": "從出口{direction}駛出",
"Take the exit {direction}": "從出口{direction}駛出",
"Take the exit onto {road}": "從出口駛出,進入 {road}",
"Take the exit": "從出口駛出",
"At the roundabout, take the {exit} exit onto {road}": "在環島從{exit}出口駛出,進入 {road}",
@@ -918,6 +936,7 @@
"Cancel replay": "取消回放",
"EST. DOWNRANGE": "預估落點距離",
"CONFIRMED": "已確認",
"sightings filter|CONFIRMED": "已確認",
"PAD / RTLS": "發射臺 / RTLS",
"PLANNED · ": "計劃 · ",
"SUPPLIED TRAJECTORY POINTS": "提供的軌跡點",
@@ -1594,6 +1613,9 @@
"LIVE SIGNALS": "實時信號",
"CCTV layer unavailable": "CCTV 圖層不可用",
"Link copied!": "鏈接已複製!",
"Link shared": "鏈接已分享",
"This share link can't be opened": "無法打開此分享鏈接",
"Shared vessel is unavailable": "分享的船舶不可用",
"Copy failed": "複製失敗",
"Return map to straight-down view": "將地圖恢復為垂直俯視",
"Tilt map to oblique view": "將地圖傾斜至斜視角",
@@ -1737,7 +1759,9 @@
"ROUTE DATA UNAVAILABLE": "航線數據不可用",
"CONTACT NAVIGATION OFF": "目標導航已關閉",
"THE BRIDGE STAYS WITH THE SELECTED VESSEL": "駕駛臺保持在所選船舶上",
"{range} NM": "{range} 海里",
"{range} NM": {
"other": "{range} 海里"
},
"AIS DESTINATION · CREW REPORTED": "AIS 目的地 · 船員申報",
"DEST {bearing}": "目的地 {bearing}",
"Disable cockpit weather effects": "停用座艙天氣效果",
@@ -1783,6 +1807,7 @@
"Reclassify as TR-3B": "重新歸類為 TR-3B",
"TRACK ACQUIRED": "已獲取航跡",
"{label} · COURSE {heading}°": "{label} · 對地航向 {heading}°",
"vessel|{label} · COURSE {heading}°": "{label} · 對地航向 {heading}°",
"{label} · HEADING {heading}°": "{label} · 船首向 {heading}°",
"{label} · NO HEADING": "{label} · 無船首向",
"{label} · NADIR VIEW": "{label} · 天底視圖",
@@ -1947,6 +1972,8 @@
"ORBIT": "環繞",
"Location not found": "未找到位置",
"Search failed": "搜索失敗",
"Check the spelling and press Enter to search again.": "請檢查拼寫,然後按 Enter 重新搜索。",
"Press Enter to try again.": "按 Enter 重試。",
"Detailed outline unavailable": "無法獲取詳細輪廓",
"Fly to a POI first": "請先飛往一個 POI",
"Reset to full globe view": "重置為完整地球視圖",
@@ -2030,7 +2057,7 @@
"Radio lifecycle is uncertain — use Enable or Disable to reconcile": "電臺生命週期狀態不確定——請使用“啟用”或“停用”進行核對",
"Clear reading": "清除讀數",
"Observed history": "觀測歷史",
"Latest": "最新",
"news list|Latest": "最新",
"Imagery on Esri · Google 3D returns when cleared": "影像顯示在 Esri 底圖上 · 清除後恢復 Google 3D",
"Point the camera at the ground to use the view": "將相機對準地面才能使用當前視野",
"That point cannot anchor a box": "該點無法作為框選錨點",
@@ -2322,7 +2349,7 @@
"Release Space to send": "鬆開空格鍵發送",
"Hold Space to talk": "按住空格鍵說話",
"Ask or command": "提問或下達指令",
"Voice is disabled in Stories.": "故事模式下語音控制已停用。",
"Voice is disabled in Stories.": "故事模式下語音控制已禁用。",
"Voice off": "語音已關閉",
"VOICE UNAVAILABLE": "語音不可用",
"VOICE ACTIVE": "語音已啟用",
@@ -2609,7 +2636,9 @@
"Contact cockpit summary": "目標座艙摘要",
"CONTACT": "目標",
"CONTACTS · 250 KM": "目標 · 250 km",
"RINGS {spacing} NM": "距標圈 {spacing} 海里",
"RINGS {spacing} NM": {
"other": "距標圈 {spacing} 海里"
},
"{count} CONTACTS": {
"other": "{count} 個目標"
},
@@ -2967,16 +2996,6 @@
"Search": "搜索",
"More": "更多",
"Panels": "面板",
"Post-tropical cyclone": "後熱帶氣旋",
"Take the ramp {direction} onto {road}": "{direction}駛入匝道,進入 {road}",
"Take the ramp {direction}": "{direction}駛入匝道",
"Take the exit {direction} onto {road}": "從出口{direction}駛出,進入 {road}",
"Take the exit {direction}": "從出口{direction}駛出",
"Link shared": "鏈接已分享",
"This share link can't be opened": "無法打開此分享鏈接",
"Shared vessel is unavailable": "分享的船舶不可用",
"Check the spelling and press Enter to search again.": "請檢查拼寫,然後按 Enter 重新搜索。",
"Press Enter to try again.": "按 Enter 重試。",
"Recent speech": "最近語音",
"Voice Settings": "語音設置",
"Preview": "預覽",
@@ -3015,8 +3034,19 @@
"other": "{count} 個地標"
},
"S2 Underground publishes these KMZ products to GitHub. New uploads are detected within seconds and replace the previous edition automatically. Click a marker for its report.": "S2 Underground 在 GitHub 發布這些 KMZ 產品。新上傳的內容會在數秒內被檢測到,並自動替換舊版本。點擊標記查看報告。",
"routing busy — too many routes at once": "路線服務繁忙:同時請求的路線過多",
"route proxy error": "路線代理出錯",
"fire confidence filter|All": "全部",
"fire confidence filter|Nominal+": "中+",
"fire confidence filter|High": "高",
"Every detection — many of the strongest fires are rated low confidence": "所有火點探測——許多強度最高的火點被評為低置信度",
"Nominal and high confidence detections": "中、高置信度的火點探測",
"High confidence detections only": "僅高置信度的火點探測",
"Fire intensity (FRP)": "火勢強度(FRP)",
"≥ {value} MW": "≥ {value} MW",
"Confidence": "置信度",
"Minimum fire radiative power, megawatts": "最小火輻射功率(兆瓦)",
"fire intensity filter|All": "全部",
"Detection confidence": "探測置信度",
"{shown} of {total} shown": "顯示 {shown} / {total}",
"{lower} to {upper}": "{lower} 至 {upper}",
"Up to {upper}": "最高 {upper}",
"From {lower}": "最低 {lower}",
@@ -3029,6 +3059,8 @@
"Prohibited": "禁區",
"Restricted": "限制區",
"Prohibited & Restricted Airspace": "禁區與限制區空域",
"routing busy — too many routes at once": "路線服務繁忙:同時請求的路線過多",
"route proxy error": "路線代理出錯",
"AUTHORING": "創作",
"Create and edit scenes": "創建和編輯場景",
"SCENE": "場景",
@@ -3054,19 +3086,6 @@
"Download this scene as JSON or an asset bundle": "將此場景下載為 JSON 或資源包",
"Left panels": "左側面板",
"Right panels": "右側面板",
"fire confidence filter|All": "全部",
"fire confidence filter|Nominal+": "中+",
"fire confidence filter|High": "高",
"Every detection — many of the strongest fires are rated low confidence": "所有火點探測——許多強度最高的火點被評為低置信度",
"Nominal and high confidence detections": "中、高置信度的火點探測",
"High confidence detections only": "僅高置信度的火點探測",
"Fire intensity (FRP)": "火勢強度(FRP)",
"≥ {value} MW": "≥ {value} MW",
"Confidence": "置信度",
"Minimum fire radiative power, megawatts": "最小火輻射功率(兆瓦)",
"fire intensity filter|All": "全部",
"Detection confidence": "探測置信度",
"{shown} of {total} shown": "顯示 {shown} / {total}",
"UTILITIES": "工具",
"Exit cockpit to fly to a drawing": "請先退出座艙,再飛往已繪製的形狀",
"Directions, drawing and your own files": "路線導航、繪製和你自己的文件",
@@ -3301,7 +3320,9 @@
"Photo of {name}": "{name} 的照片",
"Acartia": "Acartia",
"CC BY 4.0": "CC BY 4.0",
"{count} sightings in view": "視野內有 {count} 次目擊",
"{count} sightings in view": {
"other": "視野內有 {count} 次目擊"
},
"Close sighting": "關閉目擊記錄",
"Wildlife observed within 48 h (whales 7 d). Color and badge glyph show the taxon group. Sensitive species are shown only as 0.2° cells; Salish Sea marine mammal reports via Acartia are rounded to 0.01°. Not a census.": "近 48 小時內觀察到的野生生物(鯨類為 7 天)。顏色與徽章圖標表示分類群。敏感物種僅以 0.2° 網格顯示;Acartia 提供的薩利希海海洋哺乳動物目擊位置四捨五入到 0.01°。並非種群普查。",
"Open {name} on iNaturalist": "在 iNaturalist 上打開 {name}",
@@ -3312,20 +3333,27 @@
"{days}d": "{days} 天",
"All markers": "所有標記",
"Show markers of every age": "顯示所有時間的標記",
"Maximum event age: {days}d; undated markers are kept": "僅顯示 {days} 天內的事件;保留無日期標記",
"Maximum event age: {days}d; undated markers are kept": {
"other": "僅顯示 {days} 天內的事件;保留無日期標記"
},
"event age filter|All": "全部",
"Event age": "事件時間",
"Event age: {days}d · undated kept": "事件時間:{days} 天內 · 保留無日期標記",
"Event age: {days}d · undated kept": {
"other": "事件時間:{days} 天內 · 保留無日期標記"
},
"Close camera preview": "關閉攝像頭預覽",
"Refresh map still": "刷新地圖靜止畫面",
"The map still uses a separate request and may show a different moment.": "地圖靜止畫面通過單獨的請求獲取,可能顯示不同的時刻。",
"Video plays from Québec 511, which sees your IP address.": "視頻從 Québec 511 播放,Québec 511 會看到你的 IP 地址。",
"Press OPEN to load the photo": "點擊“打開”加載照片",
"Captured {month}": "拍攝於 {month}",
"this spot": "此處",
"the view centre": "視野中心",
"{source} at {place}": "{place} 的 {source}",
"{source} at this spot": "此處的 {source}",
"{source} at the view centre": "視圖中心的 {source}",
"Street level at {place}": "{place} 的街景",
"Street level at this spot": "此處的街景",
"Street level at the view centre": "視圖中心的街景",
"Switching map": "正在切換地圖",
"Opening imagery": "正在打開影像",
"Street View is ready: press {open} to load it": "街景已就緒:點擊“{open}”加載",
@@ -3507,7 +3535,9 @@
"REMOVE ALL": "全部移除",
"Confirm: remove every added entry from Data Layers": "確認:從數據圖層中移除所有已添加條目",
"Remove every added entry from Data Layers": "從數據圖層中移除所有已添加條目",
"Showing {shown} of {total}": "顯示 {shown} / {total}",
"Showing {shown} of {total}": {
"other": "顯示 {shown} / {total}"
},
"BROWSE DATA LIBRARY": "瀏覽數據資源庫",
"Atmosphere": "大氣",
"Day and night": "晝夜",
@@ -3518,7 +3548,7 @@
"The globe stopped drawing": "地球已停止繪製",
"The browser took back the globe's 3D graphics. Layers and controls still work, but the map cannot draw until the page reloads.": "瀏覽器收回了地球的 3D 圖形。圖層和控件仍可使用,但在重新加載頁面之前地圖無法繪製。",
"Rendering stopped after an error. Layers and controls still work, but the map is not updating.": "渲染因錯誤而停止。圖層和控件仍可使用,但地圖不再更新。",
"Reset view reloads the app without the view restored from the address bar.": "「重置視圖」會重新加載應用,不使用從地址欄恢復的視圖。",
"Reset view reloads the app without the view restored from the address bar.": "“重置視圖”會重新加載應用,不使用從地址欄恢復的視圖。",
"Reload": "重新加載",
"Retry": "重試",
"Reset view": "重置視圖",
@@ -3528,26 +3558,26 @@
"Funicular": "纜索鐵路",
"Gondola": "纜車",
"Move panels back beside the rail": "將面板移回側欄旁",
"Move panels over the rail, to the edge": "將面板移到側欄上方,貼齊邊緣",
"Move panels over the rail, to the edge": "將面板移到側欄上方,貼靠邊緣",
"panel|VISUAL": "視覺",
"Look": "外觀",
"Overlay": "疊加層",
"Effects": "效果",
"Scope opacity": "視域不透明度",
"How dark the scope shades the view outside the keyhole": "視域遮罩使視域之外的畫面變暗的程度",
"Reset to default": "還原預設",
"Reset Visual to its defaults: Normal look, HUD, scope, labels and effects": "將視覺還原為預設設定:常規外觀、HUD、視域、標籤和效果",
"Reset to default": "恢復默認",
"Reset Visual to its defaults: Normal look, HUD, scope, labels and effects": "將視覺恢復為默認設置:常規外觀、HUD、視域、標籤和效果",
"All layers": "全部圖層",
"On": "已開啟",
"Off": "已關閉",
"Search layers": "搜尋圖層",
"Search layers": "搜索圖層",
"Filter layers": "篩選圖層",
"Status": "狀態",
"Search layers…": "搜尋圖層…",
"Search layers…": "搜索圖層…",
"Layer groups": "圖層分組",
"Jump to {name}": "跳至{name}",
"No layers match": "沒有符合的圖層",
"A GEV scene, played on the live globe.": "在即時地球上播放的 GEV 場景。",
"Jump to {name}": "跳轉到{name}",
"No layers match": "沒有匹配的圖層",
"A GEV scene, played on the live globe.": "在實時地球上播放的 GEV 場景。",
"Drag the map to explore · Resume any time": "拖動地圖進行探索 · 隨時可繼續",
"Region": "地區",
"Europe": "歐洲",
@@ -3583,13 +3613,13 @@
"Filters": "篩選",
"Search stories": "搜索故事",
"Search stories, places, creators": "搜索故事、地點、創作者",
"Clear search": "清除搜尋",
"Clear search": "清除搜索",
"Topics": "主題",
"Filter stories": "篩選故事",
"Show {count} stories": {
"other": "顯示 {count} 個故事"
},
"No stories match": "沒有符合的故事",
"No stories match": "沒有匹配的故事",
"Try another word or clear the filters.": "請換個關鍵詞或清除篩選。",
"Clear all": "全部清除",
"STORY": "故事",
@@ -3610,12 +3640,12 @@
"Share": "分享",
"Back to GEV": "返回 GEV",
"Chapter {n}": "第 {n} 章",
"Context. Swipe up or press to open": "背景資訊。上滑或按下以打開",
"Context. Swipe down or press to close": "背景資訊。下滑或按下以關閉",
"Context. Swipe up or press to open": "背景信息。上滑或按下以打開",
"Context. Swipe down or press to close": "背景信息。下滑或按下以關閉",
"Search this story": "在此故事中搜索",
"Voice search (not in this build)": "語音搜索 (此版本不支援)",
"Voice search (not in this build)": "語音搜索 (此版本不支持)",
"Search results": "搜索結果",
"Nothing in this story matches.": "此故事中沒有符合項目。",
"Nothing in this story matches.": "此故事中沒有匹配項。",
"Chapters": "章節",
"now": "現在",
"About": "簡介",
@@ -3639,25 +3669,25 @@
"Minimise card": "最小化卡片",
"Expand card": "展開卡片",
"Card pages": "卡片頁面",
"Resize context panel": "調整背景資訊面板大小",
"Swipe up for context": "上滑查看背景資訊",
"Resize context panel": "調整背景信息面板大小",
"Swipe up for context": "上滑查看背景信息",
"Chapter start": "章節開始",
"Story time": "故事時間",
"chapter": "章節",
"Key moment: {label}": "關鍵時刻:{label}",
"Exit expanded map": "退出放大地圖",
"Expand map": "放大地圖",
"Exit cockpit to open Stories": "請先退出座艙,再開啟故事",
"Stories could not load. Check the connection and try again.": "無法載入故事。請檢查網路連線後重試。",
"Exit cockpit to open Stories": "請先退出座艙,再打開故事",
"Stories could not load. Check the connection and try again.": "無法加載故事。請檢查網絡連接後重試。",
"Shot {n} of {total}": "鏡頭 {n}/{total}",
"GEV scene": "GEV 場景",
"SAVE TO STORIES": "儲存到 STORIES",
"SAVE TO STORIES": "保存到 STORIES",
"REMOVE FROM STORIES": "從 STORIES 移除",
"Show this scene on the Stories page": "在 Stories 頁面顯示此場景",
"Take this scene off the Stories page": "將此場景從 Stories 頁面移除",
"Saved to Stories": "已儲存到 Stories",
"Saved to Stories": "已保存到 Stories",
"Removed from Stories": "已從 Stories 移除",
"A scene you made in GEV, played on the live globe.": "你在 GEV 中製作的場景,在即時地球上播放。",
"A scene you made in GEV, played on the live globe.": "你在 GEV 中製作的場景,在實時地球上播放。",
"Floods": "洪水",
"Wildfires": "山火",
"Storms": "風暴",
@@ -3666,20 +3696,20 @@
"Space": "太空",
"Conflict": "衝突",
"Climate": "氣候",
"Switch to Esri World Imagery to capture a thumbnail": "請切換至 Esri World Imagery 以擷取縮圖",
"Thumbnail could not be captured": "無法擷取縮圖",
"Thumbnail captured": "已擷取縮圖",
"Switch to Esri World Imagery to capture a thumbnail": "請切換至 Esri World Imagery 以截取縮略圖",
"Thumbnail could not be captured": "無法截取縮略圖",
"Thumbnail captured": "已截取縮略圖",
"Stories tags": "故事標籤",
"Story thumbnail": "故事縮圖",
"Use the current view as the Stories card image": "將目前檢視用作故事卡片圖片",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "飛機位置來自 ADS-B:OpenSky Network 的全球快照,OpenSky 沒有資料的地方由 adsb.lol 補充。",
"Live-flight fallback (ODbL 1.0)": "即時航班備用來源 (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "衛星軌道根據 CelesTrak 目前的軌道根數推算。",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "地震資料來自美國地質調查局 (USGS) 的即時資料流。",
"Story thumbnail": "故事縮略圖",
"Use the current view as the Stories card image": "將當前視圖用作故事卡片圖片",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "飛機位置來自 ADS-B:OpenSky Network 的全球快照,OpenSky 沒有數據的地方由 adsb.lol 補充。",
"Live-flight fallback (ODbL 1.0)": "實時航班備用來源 (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "衛星軌道根據 CelesTrak 當前的軌道根數推算。",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "地震數據來自美國地質調查局 (USGS) 的實時數據流。",
"Traffic": "交通",
"Road traffic; live congestion needs your own TomTom key.": "道路交通;即時壅塞需要你自己的 TomTom 金鑰。",
"Live traffic flow, with your own key": "即時交通流量,需使用你自己的金鑰",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "全球即時空中交通:大西洋、歐洲、日本和舊金山。",
"Road traffic; live congestion needs your own TomTom key.": "道路交通;實時擁堵需要你自己的 TomTom 密鑰。",
"Live traffic flow, with your own key": "實時交通流量,需使用你自己的密鑰",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "全球實時空中交通:大西洋、歐洲、日本和舊金山。",
"The Atlantic": "大西洋",
"Western Europe": "西歐",
"Japan": "日本",
@@ -3690,30 +3720,30 @@
"Over Africa": "非洲上空",
"Over Tokyo": "東京上空",
"Over Paris": "巴黎上空",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "熱成像風格下的近期地震:加利福尼亞、日本、紐西蘭和葡萄牙外海。",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "熱成像風格下的近期地震:加利福尼亞、日本、新西蘭和葡萄牙近海。",
"California": "加利福尼亞",
"New Zealand": "紐西蘭",
"Off Portugal": "葡萄牙外海",
"New Zealand": "新西蘭",
"Off Portugal": "葡萄牙近海",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "紐約、洛杉磯和倫敦上空的航班、衛星與交通。",
"New York, closer": "紐約,更近",
"New York, closer still": "紐約,再近一些",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "同時顯示所有即時圖層,從東京拉遠到整個地球。",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "同時顯示所有實時圖層,從東京拉遠到整個地球。",
"Tokyo, pulling back": "東京,拉遠",
"Japan and East Asia": "日本與東亞",
"South China Sea": "南海",
"The whole globe": "整個地球",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "2026 年 8 月 26 日尼泊爾 Bhote Koshi 潰決洪水,沿河谷而下追蹤至 Trishuli。",
"Reconstructed flood path (CC BY-NC 4.0)": "重建的洪水路徑 (CC BY-NC 4.0)",
"THUMBNAIL": "縮圖",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "全球即時航班快照(非商業研究與教育授權)",
"Satellite element sets and catalogue (U.S. government data)": "衛星軌道根數與目錄(美國政府資料)",
"Satellite operators, owners and purposes": "衛星營運者、擁有者與用途",
"Earthquake feed (U.S. public domain)": "地震資料流(美國公有領域)",
"THUMBNAIL": "縮略圖",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "全球實時航班快照(非商業研究與教育許可)",
"Satellite element sets and catalogue (U.S. government data)": "衛星軌道根數與目錄(美國政府數據)",
"Satellite operators, owners and purposes": "衛星運營者、所有者與用途",
"Earthquake feed (U.S. public domain)": "地震數據流(美國公有領域)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "歷史與事件後衛星影像 (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "這是 2026 年 8 月 26 日 Bhote Koshi 潰決洪水的視覺化,並非官方災害模型。歷史(2021 年)與事件後畫面為 Vantor WorldView 影像;河流路徑為 GeoPera 的重建結果。目擊者影片連結到其原始貼文,拍攝時間未經核實。",
"That story is not available here": "該故事在此處無法使用",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "這是 2026 年 8 月 26 日 Bhote Koshi 潰決洪水的可視化,並非官方災害模型。歷史(2021 年)與事件後視圖為 Vantor WorldView 影像;河流路徑為 GeoPera 的重建結果。目擊者視頻鏈接到其原始帖子,拍攝時間未經核實。",
"That story is not available here": "該故事在此處不可用",
"DRAFT": "草稿",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "尚未儲存為故事的草稿。在「創作」中使用「儲存到 STORIES」即可儲存。",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "尚未保存為故事的草稿。在“創作”中使用“保存到 STORIES”即可保存。",
"Heading to next stop": "前往下一站",
"Arriving at a stop": "即將到站",
"Stopped at a stop": "停靠站點",
@@ -3724,12 +3754,12 @@
"Flight level": "飛行高度層",
"Mach": "馬赫",
"Squawk {code}": "應答機編碼 {code}",
"Signal": "訊號",
"Signal": "信號",
"Civilian, in the air": "民用,空中",
"Military, in the air": "軍用,空中",
"On the ground": "地面",
"Motion": "運動",
"Operator": "營運商",
"Operator": "運營商",
"Last reported": "最近報告",
"Crowding": "擁擠程度",
"Class": "類別",
@@ -3742,7 +3772,7 @@
"Wildfire": "野火",
"{n} acres": "{n} 英畝",
"{n}% contained": "已控制 {n}%",
"prescribed burn": "計畫燒除",
"prescribed burn": "計劃燒除",
"{count} satellite fire hits": {
"other": "{count} 個衛星火點"
},
@@ -3758,45 +3788,45 @@
"Snow showers": "陣雪",
"Thunderstorm": "雷暴",
"Mixed conditions": "天氣多變",
"Search {name} and nearby": "搜尋 {name} 及附近",
"Search what is in view": "搜尋視野內內容",
"Close Context search": "關閉態勢搜尋",
"Search in Context": "在態勢中搜尋",
"Close search": "關閉搜尋",
"Search {name} and nearby": "搜索 {name} 及附近",
"Search what is in view": "搜索視野內內容",
"Close Context search": "關閉態勢搜索",
"Search in Context": "在態勢中搜索",
"Close search": "關閉搜索",
"Shrink Context back to a panel": "將態勢縮回面板",
"Expand Context to a full-height column": "將態勢展開為全高欄",
"Context tabs": "態勢分頁",
"Context tabs": "態勢標籤頁",
"Inspector": "檢查器",
"Properties": "屬性",
"Level": "等級",
"Last {n} min": "最近 {n} 分鐘",
"Just now": "剛剛",
"Since selected": "自選取起",
"Since selected": "自選中起",
"Altitude": "高度",
"Heading": "航向",
"Field of view": "視野",
"Camera frame": "攝影機畫面",
"Acquiring frame…": "正在取得畫面…",
"Show a bigger view": "放大檢視",
"Camera view": "攝影機視圖",
"More info": "更多資訊",
"Field of view": "視場",
"Camera frame": "攝像頭畫面",
"Acquiring frame…": "正在獲取畫面…",
"Show a bigger view": "放大查看",
"Camera view": "攝像頭視圖",
"More info": "更多信息",
"{n} s ago": "{n} 秒前",
"{n} min ago": "{n} 分鐘前",
"{n} h ago": "{n} 小時前",
"{n} d ago": "{n} 天前",
"Out of feed · last reading": "已離開資料源 · 最後讀數",
"Out of feed · last reading": "已離開數據源 · 最後讀數",
"Live · {age}": "實時 · {age}",
"{n} m": "{n} m",
"{n} km": "{n} km",
"updated {age}": "更新於 {age}",
"Selected on the map": "地圖上的選取項",
"Selected on the map": "地圖上的選中項",
"Close card": "關閉卡片",
"{n}% flown": "已飛 {n}%",
"to go": "剩餘",
"The scheduled route for this flight number does not match where the plane is; it may be another leg of the same flight.": "該航班號的計畫航線與飛機位置不符,可能是同一航班的另一航段。",
"Scheduled · unverified: does not match where the plane is": "計畫 · 未核實:與飛機位置不符",
"Nothing in this item’s details matches “{text}”.": "此項詳情中沒有與「{text}」相符的內容。",
"Matching details": "相符的詳情",
"The scheduled route for this flight number does not match where the plane is; it may be another leg of the same flight.": "該航班號的計劃航線與飛機位置不符,可能是同一航班的另一航段。",
"Scheduled · unverified: does not match where the plane is": "計劃 · 未核實:與飛機位置不符",
"Nothing in this item’s details matches “{text}”.": "此項詳情中沒有與“{text}”匹配的內容。",
"Matching details": "匹配的詳情",
"Enter orbital view": "進入軌道視圖",
"Enter Cockpit": "進入座艙",
"Fly to": "飛往",
@@ -3812,10 +3842,10 @@
"Conditions here": "此處狀況",
"feels {n}°": "體感 {n}°",
"Reading conditions here…": "正在讀取此處狀況…",
"No weather reading here.": "此處沒有天氣資料。",
"No weather reading here.": "此處沒有天氣數據。",
"Local solar time": "當地太陽時",
"Nearby radius": "附近半徑",
"How far out the nearby lists look": "附近清單的範圍",
"How far out the nearby lists look": "附近列表的範圍",
"Hazards within {radius}": "{radius} 內的災害",
"Turns the layer on": "開啟該圖層",
"No earthquakes, tropical storms or wildfires reported within {radius}.": "{radius} 內未報告地震、熱帶風暴或野火。",
@@ -3833,29 +3863,29 @@
"{things} in view from {layers}": "視野內有來自 {layers} 的 {things}",
"{n} km up": "高 {n} km",
"{n} m up": "高 {n} m",
"This view": "目前視圖",
"This view": "當前視圖",
"Day": "白天",
"Twilight": "晨昏",
"Night": "夜間",
"Daylight": "日照",
"sun {n}°": "太陽 {n}°",
"Of {n} read, {total} loaded": "讀取 {n} 個,已載入 {total} 個",
"Of {n} read, {total} loaded": "讀取 {n} 個,已加載 {total} 個",
"Of all {n}": "全部 {n} 個中",
"Of {n} in view": "視野內 {n} 個中",
"Error": "錯誤",
"Stale": "已過時",
"In view": "視野內",
"Globe view": "地球視圖",
"Nothing selected": "未選取任何內容",
"Worldwide now": "全球目前",
"Nothing selected": "未選中任何內容",
"Worldwide now": "全球當前",
"Turn on {name}": "開啟 {name}",
"{n} loaded": "已載入 {n}",
"{n} loaded": "已加載 {n}",
"{n} in view": "視野內 {n}",
"Turn off {name}": "關閉 {name}",
"Camera height": "相機高度",
"Nothing in view matches “{text}”.": "視野內沒有與「{text}」相符的內容。",
"Nothing from the layers that are on is in view here. Zoom out to see more.": "已開啟的圖層在此處視野內沒有內容。縮小以檢視更多。",
"No loaded layer has anything in view. Turn some on in Data Layers.": "已載入的圖層在視野內都沒有內容。請在數據圖層中開啟一些。",
"Nothing in view matches “{text}”.": "視野內沒有與“{text}”匹配的內容。",
"Nothing from the layers that are on is in view here. Zoom out to see more.": "已開啟的圖層在此處視野內沒有內容。縮小以查看更多。",
"No loaded layer has anything in view. Turn some on in Data Layers.": "已加載的圖層在視野內都沒有內容。請在數據圖層中開啟一些。",
"Places in view": "視野內的地點",
"Show here": "在此顯示",
"Ask GEV what's here": "問問 GEV 這裡有什麼",
@@ -3863,19 +3893,19 @@
"vessel": "船舶",
"launch": "發射",
"fire": "火點",
"Fire detection": "火點偵測",
"Fire detection": "火點探測",
"fire perimeter": "火場範圍",
"earthquake": "地震",
"storm": "風暴",
"air quality station": "空氣品質站",
"air quality station": "空氣質量站",
"installation": "設施",
"dam": "水壩",
"data centre": "資料中心",
"data centre": "數據中心",
"place": "地點",
"vehicle": "車輛",
"bike station": "單車站",
"plate reader": "車牌辨識器",
"camera": "攝影機",
"plate reader": "車牌識別器",
"camera": "攝像頭",
"airspace": "空域",
"sighting": "目擊",
"Callsign": "呼號",
@@ -3893,8 +3923,8 @@
"Place": "地點",
"Fire power": "火點功率",
"Satellite": "衛星",
"Sensor": "感測器",
"Detected": "偵測時間",
"Sensor": "傳感器",
"Detected": "探測時間",
"Contained": "已控制",
"Discovered": "發現時間",
"Basin": "海域",
@@ -3932,7 +3962,7 @@
"Typhoon": "颱風",
"Super typhoon": "超強颱風",
"Tropical cyclone": "熱帶氣旋",
"Prescribed burn": "計畫燒除",
"Prescribed burn": "計劃燒除",
"Atlantic": "大西洋",
"Eastern Pacific": "東太平洋",
"Central Pacific": "中太平洋",
@@ -3969,7 +3999,7 @@
"Emergency: {kind}": "緊急情況:{kind}",
"Emergency declared": "已宣布緊急情況",
"Tsunami warning issued": "已發布海嘯警報",
"VFR, no flight plan": "VFR,無飛行計畫",
"VFR, no flight plan": "VFR,無飛行計劃",
"VFR conspicuity": "VFR 識別碼",
"IFR, no code yet": "IFR,尚未分配編碼",
"Hijack": "劫機",
@@ -3977,12 +4007,12 @@
"Descending {n} ft/min": "下降 {n} ft/min",
"Cruising, level": "巡航,平飛",
"Airliners": "客機",
"Widebodies": "廣體機",
"Widebodies": "寬體機",
"Business jets": "公務機",
"Helicopters": "直升機",
"Turboprops": "渦槳飛機",
"Fast jets": "高速噴射機",
"Four-engine jets": "四發噴射機",
"Fast jets": "高速噴氣機",
"Four-engine jets": "四發噴氣機",
"M6 and above": "M6 及以上",
"M5 to 6": "M5 至 6",
"M4 to 5": "M4 至 5",
+145
View File
@@ -0,0 +1,145 @@
// The zh-Hant branches of `npm run i18n` (main in scripts/i18n.mjs), run in a
// throwaway repository like stale-index.test.mjs.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { execFileSync, spawnSync } from 'node:child_process';
import {
copyFileSync,
mkdirSync,
mkdtempSync,
readFileSync,
rmSync,
symlinkSync,
writeFileSync,
} from 'node:fs';
import { createRequire } from 'node:module';
import { tmpdir } from 'node:os';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const REPO = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
'../..',
);
const json = (catalog) => `${JSON.stringify(catalog, null, 2)}\n`;
function sandbox(zhCN, { modules = true } = {}) {
const root = mkdtempSync(path.join(tmpdir(), 'zh-hant-cli-'));
const write = (file, text) => {
mkdirSync(path.dirname(path.join(root, file)), { recursive: true });
writeFileSync(path.join(root, file), text);
};
mkdirSync(path.join(root, 'scripts'));
copyFileSync(
path.join(REPO, 'scripts/i18n.mjs'),
path.join(root, 'scripts/i18n.mjs'),
);
if (modules) {
// The package wherever node finds it, from its dist/umd entry; a junction
// needs no symlink privilege on Windows.
const entry = createRequire(import.meta.url).resolve('opencc-js/cn2t');
mkdirSync(path.join(root, 'node_modules'));
symlinkSync(
path.resolve(path.dirname(entry), '../..'),
path.join(root, 'node_modules/opencc-js'),
'junction',
);
}
write('.gitignore', 'node_modules\n');
write('src/a.js', "export const a = [t('Video'), t('Server')];\n");
write('src/i18n/same-as-english.json', '{}\n');
write('src/i18n/locales/zh-CN.json', json(zhCN));
const git = (...args) =>
execFileSync('git', args, { cwd: root, encoding: 'utf8' });
git('init', '-q');
return {
git,
write,
read: (file) => readFileSync(path.join(root, file), 'utf8'),
run: (...args) =>
spawnSync(process.execPath, ['scripts/i18n.mjs', ...args], {
cwd: root,
encoding: 'utf8',
}),
done: () => rmSync(root, { recursive: true, force: true }),
};
}
const ZH_CN = { Video: '视频', Server: '服务器' };
const ZH_HANT = { Video: '視頻', Server: '服務器' };
test('--missing zh-Hant points to --zh-hant instead of printing a template', () => {
const box = sandbox(ZH_CN);
try {
for (const locale of ['zh-Hant', 'zh-hant']) {
const result = box.run('--missing', locale);
assert.equal(result.status, 1);
assert.equal(result.stdout, '');
assert.match(result.stderr, /then run npm run i18n -- --zh-hant/);
}
} finally {
box.done();
}
});
test('--zh-hant writes zh-CN converted, in its key order, indent 2 and a final newline', () => {
const box = sandbox(ZH_CN);
try {
const result = box.run('--zh-hant');
assert.equal(result.status, 0, result.stdout + result.stderr);
assert.equal(box.read('src/i18n/locales/zh-Hant.json'), json(ZH_HANT));
assert.match(result.stdout, /zh-Hant: 2 messages, complete/);
} finally {
box.done();
}
});
test('--prune drops a stale entry from both catalogs, whichever git lists first', () => {
const box = sandbox({ ...ZH_CN, Old: '旧' });
try {
// zh-CN tracked and zh-Hant not: git ls-files lists zh-Hant first.
box.git('add', '-A');
box.run('--zh-hant');
const result = box.run('--prune');
assert.equal(result.status, 0, result.stdout + result.stderr);
assert.match(result.stdout, /zh-CN: pruned 1 unused entries/);
assert.match(result.stdout, /zh-Hant: pruned 1 unused entries/);
assert.equal(box.read('src/i18n/locales/zh-Hant.json'), json(ZH_HANT));
} finally {
box.done();
}
});
test('a missing zh-Hant entry says to add it to zh-CN only when zh-CN lacks it too', () => {
for (const [zhCN, fill] of [
[ZH_CN, 'run npm run i18n -- --zh-hant'],
[{ Video: '视频' }, 'add them to zh-CN, then npm run i18n -- --zh-hant'],
]) {
const box = sandbox(zhCN);
try {
box.write('src/i18n/locales/zh-Hant.json', json({ Video: '視頻' }));
const result = box.run();
assert.equal(result.status, 1);
assert.ok(
result.stdout.includes(`zh-Hant: 1 missing (${fill}):`),
result.stdout,
);
} finally {
box.done();
}
}
});
test('without node_modules the zh-Hant check says to install and the other checks still run', () => {
const box = sandbox(ZH_CN, { modules: false });
try {
box.write('src/i18n/locales/zh-Hant.json', json(ZH_HANT));
box.write('index.html', '<p>Unmarked words</p>\n');
const result = box.run();
assert.equal(result.status, 1);
assert.match(result.stdout, /zh-Hant: .*run npm ci/);
assert.match(result.stdout, /1 UI strings not marked for translation/);
} finally {
box.done();
}
});
+55 -1
View File
@@ -27,6 +27,60 @@ export function createClockFollow({ flightState, services, parts }) {
flightState._lastCamPoseSig = '';
}
/**
* The contacts drawn now that the first live snapshot after the clock came
* back to live lacks (the tracked one too): the snapshot judges them as a
* poll judges any absence (see the snapshot renderer).
* @param {{records: Array<{id: string}>}} snapshot
* @returns {Set<string>}
*/
function absentAtHandover(snapshot) {
const present = new Set(snapshot.records.map((record) => record.id));
const drawn = [...(flightState._icons?.ids() ?? [])];
if (flightState._trackedIcao) drawn.push(flightState._trackedIcao);
return new Set(drawn.filter((id) => !present.has(id)));
}
/**
* Back at live: forget how every contact moved, as at a jump, but keep the
* tracked trail, and keep the contacts `kept` (absentAtHandover) as they
* were: their record, fixes and course. Each was last seen at its newest
* fix, not when it was loaded, so absence judges how old it really is.
* @param {Set<string>} kept
*/
function handOverMotion(kept) {
const held = [];
for (const id of kept)
held.push([
id,
flightState.records.data.get(id),
flightState._positionHistory.get(id),
flightState._displayCourse.get(id),
]);
forgetPlacedAircraft(
services?.placement,
[...flightState._positionHistory.keys()].filter((id) => !kept.has(id)),
);
flightState.records.reset();
flightState._positionHistory.clear();
flightState._displayCourse.clear();
flightState._groundSnap.clear();
flightState._displayFloorState.clear();
flightState._drReconcileValid = false;
flightState._cachedDRFrame = -1;
flightState._cachedDRPosition = null;
flightState._lastCamPoseSig = '';
for (const [id, meta, history, course] of held) {
if (meta)
flightState.records.data.set(id, {
...meta,
observedReceiptMs: meta.newestFixMs ?? meta.observedReceiptMs,
});
if (history) flightState._positionHistory.set(id, history);
if (course !== undefined) flightState._displayCourse.set(id, course);
}
}
/** Drop every contact: the time has none to show, or the clock went live. */
function clear() {
if (flightState._trackedIcao)
@@ -40,5 +94,5 @@ export function createClockFollow({ flightState, services, parts }) {
flightState.feed._lastUpdate = null;
}
return { resetMotion, clear };
return { resetMotion, absentAtHandover, handOverMotion, clear };
}
+14 -4
View File
@@ -12,7 +12,10 @@ import { createEvidence } from './evidence.js';
import { createTesting } from './testing.js';
import { createQueries } from './queries.js';
import { createClockFollow } from './clockFollow.js';
import { createSnapshotTimeline } from '../../time/snapshotTimeline.js';
import {
createSnapshotTimeline,
snapshotAnswer,
} from '../../time/snapshotTimeline.js';
import { worldClock } from '../../time/worldClock.js';
/** Compose one civil-flight layer with application-owned scene services. */
export function createCivilFlightLayer({
@@ -53,10 +56,19 @@ export function createCivilFlightLayer({
getQuery: (viewer) =>
parts.controller._flightQuery(viewer || flightState._viewer),
applySnapshot: (snapshot, viewer, options) => {
// At another time the snapshot takes the place of every contact: how
// each moved belongs to the time the clock left. Back at live too, but
// the contacts it lacks are kept as they were for it to judge.
if (options?.replace) parts.clockFollow.resetMotion();
if (options?.handover) {
parts.clockFollow.handOverMotion(
parts.clockFollow.absentAtHandover(snapshot),
);
}
return applySnapshot(snapshot, viewer, options);
},
followsClock: () => flightState.timeline.active(),
timedAnswer: snapshotAnswer,
setSourceLabel: (source) => {
layer.source = source;
},
@@ -72,9 +84,7 @@ export function createCivilFlightLayer({
load: (atMs, { signal, replace }) =>
parts.ingestion.methods.loadAt(atMs, { signal, replace }),
clear: () => parts.clockFollow.clear(),
resumeLive: () => {
layer.update(flightState._viewer).catch(() => {});
},
resumeLive: () => parts.ingestion.methods.resumeLive(flightState._viewer),
});
Object.assign(
+26 -5
View File
@@ -12,6 +12,7 @@ export function createIngestion({
setSourceLabel,
applyPendingTrackingRestore,
followsClock = () => false,
timedAnswer = () => true,
}) {
const methods = {
async update(viewer, { signal = null } = {}) {
@@ -21,13 +22,27 @@ export function createIngestion({
await acquire(viewer, { signal });
},
/**
* Back at live from another time: poll at once, and let this live
* snapshot stand in for every contact. Those it has keep their
* icon and model and move on from where they are drawn; those it lacks
* go. Resolves true once it is applied, else false (nothing to poll yet,
* or the poll failed); rejects with an AbortError when it was dropped.
* @param {object} [viewer]
* @returns {Promise<boolean>}
*/
async resumeLive(viewer) {
return (await acquire(viewer, { handover: true })) === true;
},
/**
* Apply the source's snapshot at world time `atMs` (its timeline says it
* can answer one), in place of every contact when `replace`. Resolves
* whether it was applied.
* whether it was applied: `{ reachMs }`, the newest fix its records
* carry, when they carry fixes; else true, or false when it was not.
* @param {number} atMs
* @param {{signal?: AbortSignal|null, replace?: boolean, viewer?: object}} [options]
* @returns {Promise<boolean>}
* @returns {Promise<boolean|{reachMs: number}>}
*/
async loadAt(atMs, { signal = null, replace = false, viewer = null } = {}) {
// Whatever polls or loads for another time no longer applies.
@@ -38,7 +53,10 @@ export function createIngestion({
},
};
async function acquire(viewer, { signal = null, atMs, replace = false }) {
async function acquire(
viewer,
{ signal = null, atMs, replace = false, handover = false },
) {
const nowMs = Date.now();
const timed = atMs !== undefined;
const trackingRefreshEpoch = ++feed._trackingRefreshEpoch;
@@ -85,7 +103,9 @@ export function createIngestion({
setSourceLabel(feed._lastSource);
const accepted = timed
? applySnapshot(snapshot, viewer, { replace })
: applySnapshot(snapshot, viewer);
: handover
? applySnapshot(snapshot, viewer, { handover: true })
: applySnapshot(snapshot, viewer);
feed._count = accepted.count;
// Freshness belongs to the source snapshot, not the moment this browser
// received a cached 200 response.
@@ -99,7 +119,8 @@ export function createIngestion({
};
console.log(`[Data:Flights] Updated: ${feed._count} aircraft`);
applyPendingTrackingRestore();
return true;
// At a time, what the clock's follower is told of it.
return timed ? timedAnswer(snapshot) : true;
} catch (e) {
if (updateSignal.aborted || e?.name === 'AbortError') {
throw new DOMException('Flights update aborted', 'AbortError');
+266
View File
@@ -0,0 +1,266 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { createFlightSnapshotRenderer } from './snapshotRenderer.js';
import { createMotion } from './motion.js';
import { createFlightState } from './state.js';
import { createFlightFeed, createIngestion } from './ingestion.js';
import { createClockFollow } from './clockFollow.js';
// Back at live from another time, the first live snapshot stands in for
// every contact: those it has keep their icon and ease on from where they
// are drawn, and only those it lacks go (src/time/snapshotTimeline.js).
/** Any property is a no-op function unless given. */
function stub(overrides = {}) {
return new Proxy(overrides, {
get: (target, key) => (key in target ? target[key] : () => undefined),
});
}
function harness() {
const iconIds = new Set();
const calls = [];
const landed = new Set();
const groundFloor = stub({
cachedGroundFloor: () => null,
floorAltitudeM: (altitude) => altitude,
GROUND_FLOOR_LIFT_M: 0.5,
});
const services = stub({
geoid: { geoidHeight: () => 0 },
camera: stub(),
focus: stub(),
groundFloor,
meshFloor: stub(),
groundSnap: stub({ createGroundSnap: () => stub() }),
placement: null,
});
const flightState = createFlightState({
services,
source: { label: 'Fixture aircraft' },
});
flightState._icons = {
has: (id) => iconIds.has(id),
ids: () => [...iconIds],
get count() {
return iconIds.size;
},
};
const parts = {
rendering: stub({ _modelOwnsVisual: () => false }),
icons: stub({
_addIcon: (id) => {
calls.push(['add', id]);
iconIds.add(id);
},
_forgetContact: (id) => {
calls.push(['forget', id]);
iconIds.delete(id);
},
_planIcon: (id, options) => calls.push(['plan', id, options]),
}),
tracking: stub({
_militaryLayerSuppresses: () => false,
_appendTrailFix: () => calls.push(['trail-append']),
_startTrail: (id) => calls.push(['trail-start', id]),
_clearTrail: () => calls.push(['trail-clear']),
}),
};
parts.motion = createMotion({ flightState, services, parts, layer: {} });
const apply = createFlightSnapshotRenderer({
flightState,
records: flightState.records,
militaryRegistry: stub({ isMilitaryIcao: () => false }),
groundFloor,
rendering: parts.rendering,
tracking: parts.tracking,
motion: parts.motion,
icons: parts.icons,
enrichment: stub(),
queries: stub({ _likelyLanded: (id) => landed.has(id) }),
});
const clockFollow = createClockFollow({ flightState, services, parts });
return {
calls,
iconIds,
flightState,
clockFollow,
landed,
// `ids`: an id, or [id, fix age ms, on the ground].
snapshot: (ids, fields = {}) => ({
observedAtMs: Date.now(),
records: ids.map((entry, k) => {
const [id, ageMs = 5_000, onGround = false] = [entry].flat();
return {
id,
reference: id,
longitude: -115 + k,
latitude: 36,
callsign: 'TEST1',
baroAltitudeM: onGround ? 0 : 9_000,
onGround,
speedMps: onGround ? 5 : 220,
courseDeg: 90,
positionTimeMs: Date.now() - ageMs,
};
}),
complete: true,
...fields,
}),
apply(ids, options, fields) {
calls.length = 0;
return apply(this.snapshot(ids, fields), null, options);
},
// Back at live, as the layer applies its first live snapshot.
handOver(ids, fields) {
calls.length = 0;
const snapshot = this.snapshot(ids, fields);
clockFollow.handOverMotion(clockFollow.absentAtHandover(snapshot));
return apply(snapshot, null, { handover: true });
},
};
}
test('the first live snapshot keeps the icons of contacts it has and drops only those it lacks', () => {
const h = harness();
h.apply(['a00001', 'a00002']);
assert.deepEqual([...h.iconIds].sort(), ['a00001', 'a00002']);
const accepted = h.handOver(['a00001', 'a00003']);
assert.deepEqual([...h.iconIds].sort(), ['a00001', 'a00003']);
assert.equal(accepted.count, 2);
// The contact it has keeps its icon: no remove and add, and its motion is
// planned as a handover, easing from where it is drawn.
assert.equal(
h.calls.some(
([kind, id]) => id === 'a00001' && (kind === 'add' || kind === 'forget'),
),
false,
);
assert.deepEqual(
h.calls.find(([kind, id]) => kind === 'plan' && id === 'a00001'),
['plan', 'a00001', { handover: true }],
);
assert.ok(h.calls.some(([kind, id]) => kind === 'forget' && id === 'a00002'));
assert.ok(h.calls.some(([kind, id]) => kind === 'add' && id === 'a00003'));
});
test('a plain live poll keeps a missing contact as its absence rules say', () => {
const h = harness();
h.apply(['a00001', 'a00002']);
h.apply(['a00001']);
assert.deepEqual([...h.iconIds].sort(), ['a00001', 'a00002']);
assert.deepEqual(
h.calls.find(([kind]) => kind === 'plan'),
['plan', 'a00001', undefined],
);
});
test('back at live, only the first live snapshot applied takes over; a failed poll says so', async () => {
const applied = [];
let fail = false;
const feed = createFlightFeed({
async getSnapshot() {
if (fail) throw new Error('down');
return { records: [], observedAtMs: Date.now(), freshness: 'current' };
},
});
const { methods } = createIngestion({
feed,
getQuery: () => ({}),
applySnapshot: (_snapshot, _viewer, options) => {
applied.push(options);
return { count: 0, ids: new Set() };
},
setSourceLabel: () => {},
applyPendingTrackingRestore: () => {},
});
assert.equal(await methods.resumeLive(null), true);
await methods.update(null);
assert.deepEqual(applied, [{ handover: true }, undefined]);
fail = true;
const warn = console.warn;
console.warn = () => {};
try {
assert.equal(await methods.resumeLive(null), false);
} finally {
console.warn = warn;
}
});
test('back at live, the tracked contact and those the snapshot retains stay, stale, and a partial snapshot drops none', () => {
const h = harness();
h.apply(['a00001', 'a00002', 'a00003', 'a00004']);
h.flightState._trackedIcao = 'a00001';
const history = [{ epochMs: Date.now() - 60_000 }];
h.flightState._positionHistory.set('a00001', history);
h.handOver(['a00004'], { retainIds: new Set(['a00002']) });
assert.deepEqual([...h.iconIds].sort(), ['a00001', 'a00002', 'a00004']);
assert.equal(
h.flightState._positionHistory.get('a00001'),
history,
'the tracked contact keeps its fixes for the next poll to judge',
);
assert.ok(h.flightState.records.data.has('a00001'));
assert.equal(
h.calls.some(([kind]) => kind === 'trail-clear' || kind === 'trail-start'),
false,
'its trail goes on',
);
const partial = harness();
partial.apply(['a00001', 'a00002']);
partial.handOver(['a00003'], { complete: false });
assert.deepEqual([...partial.iconIds].sort(), ['a00001', 'a00002', 'a00003']);
});
test('back at live, the tracked contact the snapshot has goes on adding to its trail', () => {
const h = harness();
h.apply(['a00001']);
h.flightState._trackedIcao = 'a00001';
h.handOver(['a00001']);
assert.deepEqual(
h.calls.filter(([kind]) => kind.startsWith('trail')),
[['trail-append']],
);
});
const HOURS_3 = 3 * 3_600_000;
test('back at live, a partial snapshot keeps only contacts whose newest fix is recent, by the real absence rules', () => {
const h = harness();
// Shown from a time three hours back, and one from a minute ago.
h.apply([
['a00001', HOURS_3],
['a00002', 60_000],
]);
h.handOver(['a00003'], { complete: false });
assert.deepEqual(
[...h.iconIds].sort(),
['a00002', 'a00003'],
'the three-hour-old contact is no ghost',
);
});
test('back at live, a tracked aircraft is kept only while its newest fix is recent and it has not landed', () => {
for (const [label, setUp, kept] of [
['recent', (h) => h.apply([['a00001', 60_000]]), true],
['three hours old', (h) => h.apply([['a00001', HOURS_3]]), false],
[
'landed',
(h) => {
h.apply([['a00001', 120_000]]);
h.apply([['a00001', 60_000, true]]);
h.landed.add('a00001');
},
false,
],
]) {
const h = harness();
setUp(h);
h.flightState._trackedIcao = 'a00001';
h.handOver(['a00002']);
assert.equal(h.iconIds.has('a00001'), kept, label);
}
});
+1 -4
View File
@@ -42,7 +42,6 @@ import {
limitCourseStep,
corridorPathLatLon,
} from '../../data/motionModel.js';
import { CLASS_SCALE_2D } from '../../data/aircraftClass.js';
import { placeLiveAircraft } from './placed.js';
import {
modelVisualAnchor,
@@ -424,9 +423,7 @@ export function createMotion({
const sprite = readEntityRecord(flightState._trackedEntity)?.sprite;
const width = sprite?.width ?? 28;
const height = sprite?.height ?? 28;
const scale =
sprite?.scale ??
(CLASS_SCALE_2D[flightState.records.data.get(icao24)?.klass] || 1);
const scale = sprite?.scale ?? 1;
const scaleByDistance =
sprite?.scaleByDistance ?? TRACKED_BILLBOARD_SCALE_BY_DISTANCE;
const distanceScale = nearFarScalarValueAtDistance(scaleByDistance, rangeM);
+5
View File
@@ -1,5 +1,6 @@
import { EMERGENCY_TINT_CSS } from '../../data/aircraftEmergency.js';
import { cssColor } from '../../render/color.js';
import { VEHICLE_TINT_CSS } from '../../data/aircraftClass.js';
/** A CSS colour as frozen `[r, g, b, a]`, 0..1 (the renderer's `Color`). */
const rgba = (css, alpha) =>
@@ -13,6 +14,10 @@ export const FOCUS_EVIDENCE_DEV = import.meta.env?.DEV === true;
export const MIL_TINT = rgba('#FFB800');
/** Amber tint for airport vehicles (type ZVEH, emitter C1/C2), apart from aircraft. */
export const VEHICLE_TINT = rgba(VEHICLE_TINT_CSS);
/** Red tint for aircraft broadcasting an emergency (7500/7600/7700 or ADS-B status). */
export const EMERGENCY_TINT = rgba(EMERGENCY_TINT_CSS);
+52 -11
View File
@@ -123,9 +123,14 @@ export class FlightRecords {
stickyText(callsign, prevMeta?.callsign),
);
const feedType = observation.typeCode || null;
const typeCode =
airframe?.typeCode ??
(feedType && groundModel(feedType) ? feedType : null);
// The feed's type is kept for what it names itself, not for a surface
// category: a C1 contact whose feed names an airliner type stays a vehicle.
const keepFeedType =
Boolean(feedType) &&
(groundCategory(category)
? GROUND_FEED_TYPES.has(feedType.trim().toUpperCase())
: groundModel(feedType));
const typeCode = airframe?.typeCode ?? (keepFeedType ? feedType : null);
const onGround =
on_ground === true ||
(!Number.isFinite(baro_alt) &&
@@ -280,7 +285,8 @@ export class FlightRecords {
const groundFlipped =
!!prevMeta && (prevMeta.onGround === true) !== onGround;
// Store flight metadata for click-to-track labels
const cat = stickyNumber(category, prevMeta?.category, null);
// OpenSky's integer category, or a feed's ADS-B emitter category ("C1").
const cat = stickyCategory(category, prevMeta?.category);
const nextCallsign = stickyText(callsign, prevMeta?.callsign);
// A route (and its airline) belongs to the callsign it was looked up for;
// a new callsign drops it, so an old flight's route never shows under it.
@@ -325,11 +331,9 @@ export class FlightRecords {
),
courseAnchor: course.anchor,
category: cat,
// An adsbdb-enriched type code outranks the coarse OpenSky category.
klass: classifyAircraft({
typeCode: airframe?.typeCode ?? null,
category: cat,
}),
// An adsbdb-enriched type code outranks the coarse OpenSky category;
// a feed's own ground type (ZVEH, GRND) classes it from the first fix.
klass: classifyAircraft({ typeCode, category: cat }),
turnRateDps: prevMeta?.turnRateDps || 0,
verticalRate: stickyNumber(vertical_rate, prevMeta?.verticalRate, null),
// Analyst seam: OpenSky origin_country (state[2]) — additive, sticky
@@ -452,13 +456,46 @@ export class FlightRecords {
}
}
/** An ADS-B emitter category as a feed gives it ("A3", "C1"). */
const EMITTER_CATEGORY = /^[A-D][0-7]$/;
/**
* A contact's category, kept across polls that omit it: OpenSky's integer
* category or an ADS-B emitter category string, else the last one, else null.
* @param {*} next
* @param {*} prev
* @returns {number|string|null}
*/
function stickyCategory(next, prev) {
if (Number.isFinite(next)) return next;
const text = typeof next === 'string' ? next.trim().toUpperCase() : '';
if (EMITTER_CATEGORY.test(text)) return text;
return prev ?? null;
}
/** The types a feed gives airport vehicles (ZVEH) and ground stations (GRND). */
const GROUND_FEED_TYPES = new Set(['ZVEH', 'GRND']);
/** Per loaded fleet model set: whether a type, category and callsign rule draw a ground model. */
const groundModelCaches = new WeakMap();
/**
* Whether an emitter category is a surface one: a vehicle or an obstacle
* (ADS-B C1 to C5, OpenSky 16 to 20).
* @param {string|number|null} category
* @returns {boolean}
*/
function groundCategory(category) {
if (Number.isInteger(category)) return category >= 16 && category <= 20;
return typeof category === 'string' && /^C[1-5]$/i.test(category.trim());
}
/**
* Whether an aircraft of this type, emitter category and callsign is drawn
* with a model built standing on the ground (catalog category `other`: an
* airport vehicle, a ground station's mast). False before the set loads.
* airport vehicle, a ground station's mast). A surface emitter category
* (C1 to C5, OpenSky 16 to 20) always is. Otherwise, before the set loads,
* whether the type is one a feed gives ground vehicles and stations.
* Answered once per type, category and callsign rule matched.
* @param {object|null} set The loaded fleet model set.
* @param {string|null} typeCode
@@ -467,7 +504,11 @@ const groundModelCaches = new WeakMap();
* @returns {boolean}
*/
function drawnAsGroundModel(set, typeCode, category, callsign) {
if (!set || !typeCode) return false;
if (groundCategory(category)) return true;
if (!typeCode) return false;
// Before the set loads, the feed's own ground types: an airport vehicle
// must not be drawn as an aircraft until the set says what it is.
if (!set) return GROUND_FEED_TYPES.has(typeCode.trim().toUpperCase());
let cache = groundModelCaches.get(set);
if (!cache) groundModelCaches.set(set, (cache = new Map()));
const rule = aircraftCallsignRule(set.types, typeCode, callsign);
+74 -3
View File
@@ -312,12 +312,83 @@ test('a ground vehicle or station with no altitude stands on the ground; an airc
view(),
).meta;
assert.equal(reported.onGround, false);
// Before the model set loads nothing is grounded by its model.
const unloaded = records().receive(
// Before the model set loads, the feed's ground types already count: an
// airport vehicle is never drawn as an aircraft first.
const early = records();
const unloaded = early.receive(
observation({ id: 'v3', typeCode: 'ZVEH', ...noAltitude }),
view(),
).meta;
assert.equal(unloaded.onGround, false);
assert.equal(unloaded.onGround, true);
assert.equal(unloaded.typeCode, 'ZVEH');
const earlyPlane = early.receive(
observation({ id: 'p2', typeCode: 'A320', ...noAltitude }),
view(),
).meta;
assert.equal(earlyPlane.onGround, false);
assert.equal(earlyPlane.typeCode, null);
});
test('airport vehicles and ground stations take their class from the first fix', () => {
// Before the model set loads, and after.
for (const store of [records(), records(() => fleetSet)]) {
const klass = (fields) =>
store.receive(observation({ callsign: '', ...fields }), view()).meta
.klass;
assert.equal(klass({ id: 'v1', typeCode: 'ZVEH' }), 'vehicle');
assert.equal(
klass({ id: 'v2', typeCode: 'ZVEH', callsign: 'FIRE 2' }),
'vehicle',
);
assert.equal(klass({ id: 'v3', category: 'C1' }), 'vehicle');
assert.equal(klass({ id: 'v4', category: 'C2' }), 'vehicle');
assert.equal(klass({ id: 'm1', typeCode: 'GRND' }), 'station');
assert.equal(klass({ id: 'm2', category: 'C4' }), 'station');
// An aircraft's feed type still waits for the airframe lookup.
assert.equal(
klass({ id: 'p1', typeCode: 'A320', category: 'A7' }),
'helicopter',
);
}
});
test('a surface emitter category stands on the ground, before and after the model set loads', () => {
const noAltitude = { baroAltitudeM: null, ellipsoidAltitudeM: null };
for (const store of [records(), records(() => fleetSet)]) {
for (const [id, category] of [
['c1', 'C1'],
['c2', 'C2'],
['c3', 'C3'],
['c5', 'C5'],
['o16', 16],
['o20', 20],
]) {
const meta = store.receive(
observation({ id, category, callsign: '', ...noAltitude }),
view(),
).meta;
assert.equal(meta.onGround, true, `${id} stands on the ground`);
assert.equal(meta.altitude, 0, id);
}
// An aircraft category with no altitude keeps the airborne default.
const plane = store.receive(
observation({ id: 'a3', category: 'A3', ...noAltitude }),
view(),
).meta;
assert.equal(plane.onGround, false);
// A feed's aircraft type on a surface category does not make it an aircraft.
const odd = store.receive(
observation({
id: 'c9',
category: 'C1',
typeCode: 'A320',
...noAltitude,
}),
view(),
).meta;
assert.equal(odd.klass, 'vehicle');
assert.equal(odd.onGround, true);
}
});
test('a contact reported with no course faces the way its newer fixes went', () => {
+8 -9
View File
@@ -2,11 +2,11 @@ import {
aircraftLayerModelSpec,
aircraftModelSpecCacheKey,
} from './modelSpec.js';
import { CLASS_SCALE_2D } from '../../data/aircraftClass.js';
import { isEmergency } from '../../data/aircraftEmergency.js';
import {
MIL_TINT,
EMERGENCY_TINT,
VEHICLE_TINT,
FLEET_TINT,
TRACKED_CYAN,
GROUND_SCALE,
@@ -32,14 +32,16 @@ export function createRendering({
}
/** Fleet (untracked) billboard tint: red while broadcasting an emergency,
* amber for known-military, white otherwise.
* Ground traffic gets NO special tint (owner verdict 2026-07-03 field test). */
* orange amber for an airport vehicle, amber for known-military, white
* otherwise. Grounded aircraft get NO special tint (owner verdict
* 2026-07-03 field test). */
function _fleetBillboardColor(
icao24,
info = flightState.records.data.get(icao24),
) {
if (_isEmergency(icao24, info)) return EMERGENCY_TINT;
if (info?.klass === 'vehicle') return VEHICLE_TINT;
return isMilitaryIcao(icao24) ? MIL_TINT : FLEET_TINT;
}
@@ -53,13 +55,10 @@ export function createRendering({
return isMilitaryIcao(icao24) ? MIL_TINT : COCKPIT_CIVILIAN_COLOR;
}
/** Fleet billboard scale: per-class scale, ×GROUND_SCALE while grounded. */
/** Fleet billboard scale: one size for every class, ×GROUND_SCALE while grounded. */
function _fleetBillboardScale(icao24, klass) {
return (
(CLASS_SCALE_2D[klass] || 1) *
(flightState.records.data.get(icao24)?.onGround ? GROUND_SCALE : 1)
);
function _fleetBillboardScale(icao24) {
return flightState.records.data.get(icao24)?.onGround ? GROUND_SCALE : 1;
}
/** The fleet model an aircraft draws with, by its type and emitter category. */
+43
View File
@@ -0,0 +1,43 @@
// src/layers/flights/rendering.test.mjs
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { createRendering as createFlightsRendering } from './rendering.js';
import { createRendering as createMilitaryRendering } from '../military/rendering.js';
function rendering(create) {
const data = new Map([
['light', { klass: 'light' }],
['quadjet', { klass: 'quadjet' }],
['vehicle', { klass: 'vehicle' }],
['parked', { klass: 'quadjet', onGround: true }],
]);
return create({
flightState: { records: { data } },
services: {
militaryRegistry: { isMilitaryIcao: () => false },
aircraftPresentation: { tr3bIconKind: () => null },
focus: { focusNowMs: () => 0, getFocusTarget: () => null },
},
parts: {},
layer: {},
resolveAsset: (url) => url,
});
}
test('Flights draws every class at one size, smaller on the ground', () => {
const r = rendering(createFlightsRendering);
for (const id of ['light', 'quadjet', 'vehicle']) {
assert.equal(r._fleetBillboardScale(id), 1, id);
}
assert.equal(r._fleetBillboardScale('parked'), 0.8);
});
test('Military draws every class at its one size, smaller on the ground', () => {
const r = rendering(createMilitaryRendering);
const size = r._fleetBillboardScale('light');
for (const id of ['quadjet', 'vehicle']) {
assert.equal(r._fleetBillboardScale(id), size, id);
}
assert.ok(Math.abs(r._fleetBillboardScale('parked') - size * 0.8) < 1e-12);
});
+38 -10
View File
@@ -56,8 +56,16 @@ export function createFlightSnapshotRenderer({
/**
* `replace`: the snapshot is the world at another time (the world clock
* jumped), so it stands in for every contact: one it lacks is gone at once.
* `handover`: the first live snapshot after the clock came back to live: it
* stands in for every contact too, and those it has keep their icon and
* model and ease on from where they are drawn; of those it lacks, only
* those absence keeps (judged by their newest fix) stay.
*/
return function applySnapshot(snapshot, viewer, { replace = false } = {}) {
return function applySnapshot(
snapshot,
viewer,
{ replace = false, handover = false } = {},
) {
// Before init (or after destroy) there is no icon set to draw into.
if (!flightState._icons) return { count: 0, ids: new Set() };
const currentIcaos = new Set();
@@ -254,7 +262,7 @@ export function createFlightSnapshotRenderer({
// freshness change and the cockpit contract all land on the row's
// style; motion re-plans from the updated history.
icons._applyIconPresentation(icao24);
icons._planIcon(icao24);
icons._planIcon(icao24, handover ? { handover } : undefined);
// Poll-path type or category change: same model resync rule as the
// enrichment path — the fleet model or its scale may have changed.
if (
@@ -294,6 +302,23 @@ export function createFlightSnapshotRenderer({
// EXCEPTION: likely-landed planes (last fix low + slow) get only
// LANDED_MISSING_POLL_LIMIT — their disappearance means "landed", not a
// feed gap, and the full grace left phantom planes parked at airports.
// Back at live, a contact it lacks is from the time the clock left: it
// goes at once, unless absence keeps it as any poll would (a partial or
// retaining snapshot, the tracked aircraft), judged by its newest fix.
// No missed-poll grace, and a landed tracked aircraft is not kept.
const absenceAtHandover = (icao24) => {
const likelyLanded = queries._likelyLanded(icao24);
const judged = records.absence(icao24, {
complete: snapshot.complete,
retainIds: snapshot.retainIds,
likelyLanded,
tracked: icao24 === flightState._trackedIcao && !likelyLanded,
nowMs: flightState.now?.(),
});
return judged === 'stale' && icao24 !== flightState._trackedIcao
? 'remove'
: judged;
};
const absentIds = [];
for (const icao24 of flightState._icons.ids()) {
if (!currentIcaos.has(icao24)) absentIds.push(icao24);
@@ -301,13 +326,15 @@ export function createFlightSnapshotRenderer({
for (const icao24 of absentIds) {
const absence = replace
? 'remove'
: records.absence(icao24, {
complete: snapshot.complete,
retainIds: snapshot.retainIds,
likelyLanded: queries._likelyLanded(icao24),
tracked: icao24 === flightState._trackedIcao,
nowMs: flightState.now?.(),
});
: handover
? absenceAtHandover(icao24)
: records.absence(icao24, {
complete: snapshot.complete,
retainIds: snapshot.retainIds,
likelyLanded: queries._likelyLanded(icao24),
tracked: icao24 === flightState._trackedIcao,
nowMs: flightState.now?.(),
});
if (absence === 'retain') continue;
if (absence === 'stale') {
icons._applyIconPresentation(icao24); // the faded freshness alpha
@@ -334,7 +361,8 @@ export function createFlightSnapshotRenderer({
icons._forgetContact(icao24); // aged out: its 3D model goes too (no orphan / cap leak)
}
// The tracked contact at the new time: its trail starts there.
// The tracked contact at the new time: its trail starts there. Back at
// live its trail goes on.
if (
replace &&
flightState._trackedIcao &&
+3 -4
View File
@@ -919,10 +919,7 @@ export function createTracking({
width: look.size[0],
height: look.size[1],
get scale() {
return parts.rendering._fleetBillboardScale(
icao24,
flightState.records.data.get(icao24)?.klass,
);
return parts.rendering._fleetBillboardScale(icao24);
},
scaleByDistance: look.scaleByDistance,
};
@@ -1099,6 +1096,8 @@ export function createTracking({
const pos = getTrackedPosition();
if (!tracked || !pos || !flightState._viewer)
return flightState._lastTrackedRotation;
// A ground station's mast stands upright.
if (tracked.klass === 'station') return 0;
const projected = courseScreenRotation(
_pose(),
pos,
+7 -4
View File
@@ -857,9 +857,12 @@ export function createGhostMapsLayer({
title:
days === null
? t('Show markers of every age')
: t('Maximum event age: {days}d; undated markers are kept', {
days: formatNumber(days),
}),
: tn(
days,
'Maximum event age: {days}d; undated markers are kept',
'Maximum event age: {days}d; undated markers are kept',
{ days: formatNumber(days) },
),
active: days === _ageDays,
onClick: () => setAgeDays(days),
})),
@@ -894,7 +897,7 @@ export function createGhostMapsLayer({
};
}),
legend: [],
info: `${_ageDays === null ? t('All markers') : t('Event age: {days}d · undated kept', { days: formatNumber(_ageDays) })} · ${info}`,
info: `${_ageDays === null ? t('All markers') : tn(_ageDays, 'Event age: {days}d · undated kept', 'Event age: {days}d · undated kept', { days: formatNumber(_ageDays) })} · ${info}`,
infoTitle: t(
'S2 Underground publishes these KMZ products to GitHub. New uploads are detected within seconds and replace the previous edition automatically. Click a marker for its report.',
),
+30
View File
@@ -1,5 +1,6 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { setLocale } from '../../i18n/index.js';
import { createGhostMapsLayer } from './index.js';
import { bindFakeDraw } from '../../testSupport/fakeDrawPort.mjs';
import { GHOSTMAPS_PRODUCTS, GHOSTMAPS_LATEST_DROP } from './catalog.js';
@@ -310,6 +311,35 @@ test('age controls default to seven days and widening restores filtered and expi
assert.equal(ageChip(layer, null).active, true);
});
test('the event age agrees with its number of days', async (t) => {
t.after(() => setLocale('en'));
const { layer, viewer } = fixture(t, { reports: [{ name: 'Undated' }] });
await layer.update(viewer);
const info = () =>
layer.getRowControls().info.split(' · ').slice(0, 2).join(' · ');
assert.equal(
ageChip(layer, 1).title,
'Maximum event age: 1d; undated markers are kept',
);
setLocale('de');
assert.equal(
ageChip(layer, 1).title,
'Maximales Ereignisalter: 1 Tag; undatierte Markierungen bleiben erhalten',
);
assert.equal(
ageChip(layer, 7).title,
'Maximales Ereignisalter: 7 Tage; undatierte Markierungen bleiben erhalten',
);
assert.equal(info(), 'Ereignisalter: 7 Tage · undatierte bleiben');
await ageChip(layer, 1).onClick();
assert.equal(info(), 'Ereignisalter: 1 Tag · undatierte bleiben');
setLocale('es');
assert.equal(
info(),
'Antigüedad: 1 día · se conservan los marcadores sin fecha',
);
});
test('age preferences persist independently of product choices and reject invalid storage', async (t) => {
const values = new Map([['gev.ghostmaps.products', '["cip"]']]);
const storage = {
@@ -69,3 +69,38 @@ test('the mission panel translates only the fallback status', (t) => {
assert.equal(shownStatus(UNKNOWN_LAUNCH_STATUS), 'Desconocido');
assert.equal(shownStatus('Launch Successful'), 'Launch Successful');
});
test('a confirmed landing position is worded apart from the CONFIRMED sightings chip', (t) => {
t.after(() => setLocale('en'));
const position = () =>
createPanel({
state: {
_selectedLaunchId: 'mission-1',
_launches: [
{
id: 'mission-1',
name: 'Example',
status: 'Launch Successful',
payloads: [],
recoveryStages: [
{
name: 'B1080',
endpoint: { lat: 28.41, lon: -80.6, accuracy: 'CONFIRMED' },
},
],
},
],
_replayTracks: new Map(),
},
parts: {
overlays: { shortMissionLabel: (name) => name },
policyHelpers: { missionPathPresentation: () => ({}) },
replay: { presentReplay: () => ({}) },
},
}).presentMission().stages[0].position;
assert.match(position(), / · CONFIRMED$/);
// One landing, singular: sv BEKRÄFTAD, where the sightings chip says
// BEKRÄFTADE.
setLocale('sv');
assert.match(position(), / · BEKRÄFTAD$/);
});
+2 -1
View File
@@ -24,7 +24,8 @@ export function localAdsbClass(record, meta = null) {
const category = record?.category || null;
return {
klass: classifyAircraft({ typeCode, category }),
evidence: Boolean(typeCode) || /^(?:A[1-7]|B1)$/.test(category || ''),
evidence:
Boolean(typeCode) || /^(?:A[1-7]|B1|C[1-5])$/.test(category || ''),
};
}
+29 -10
View File
@@ -1,5 +1,7 @@
import { CLASS_SCALE_2D } from '../../data/aircraftClass.js';
import { VEHICLE_TINT_CSS } from '../../data/aircraftClass.js';
import { aircraftIcon } from '../../data/aircraftIcons.js';
import { rotorFrame } from '../../data/rotorFrames.js';
import { KNOT_MPS } from '../../data/units.js';
import {
courseScreenRotation,
stabilizeScreenRotation,
@@ -133,6 +135,8 @@ export function createLocalAdsbLayer({
} = services.context;
const { registerPickOwner, unregisterPickOwner } = services.picking;
const color = hexColor(LOCAL_ADSB_COLOR);
// An airport vehicle's tint, as in the Flights layer.
const vehicleColor = hexColor(VEHICLE_TINT_CSS);
const uatRingColor = hexColor(LOCAL_ADSB_UAT_RING_COLOR);
let viewer = null;
@@ -265,9 +269,7 @@ export function createLocalAdsbLayer({
}
function billboardScale(marker) {
return (
(CLASS_SCALE_2D[marker.klass] || 1) * (marker.onGround ? GROUND_SCALE : 1)
);
return marker.onGround ? GROUND_SCALE : 1;
}
/** Class silhouette and per-class scale (×0.8 on the ground), magenta. */
@@ -350,18 +352,34 @@ export function createLocalAdsbLayer({
};
}
/** A marker's icon, where and how it now draws. */
function markerItem(marker, basis) {
/**
* A marker's icon, where and how it now draws: a helicopter's rotor frame
* at `at` (still on the ground), an airport vehicle in its own tint, a
* ground station's mast upright.
*/
function markerItem(marker, basis, at) {
const kind = marker.iconKind ?? 'airliner';
return {
id: marker.id,
pos: marker.position,
image: aircraftIcon(marker.iconKind ?? 'airliner'),
image: aircraftIcon(
kind,
undefined,
kind === 'helicopter'
? rotorFrame(marker.id, at, {
onGround: marker.onGround,
speedMps: Number.isFinite(marker.record?.groundSpeedKt)
? marker.record.groundSpeedKt * KNOT_MPS
: null,
})
: undefined,
),
size: [MARKER_SPRITE.width, MARKER_SPRITE.height],
scale: marker.iconScale ?? 1,
color,
color: kind === 'vehicle' ? vehicleColor : color,
scaleByDistance: MARKER_SPRITE.scaleByDistance,
rotationMode: 'screen',
rotation: markerRotation(marker, basis),
rotation: kind === 'station' ? 0 : markerRotation(marker, basis),
// The 3D model, once loaded and placed, is the visual instead.
show: !marker.modelOwnsVisual,
disableDepthTest: Number.POSITIVE_INFINITY,
@@ -390,11 +408,12 @@ export function createLocalAdsbLayer({
function drawMarkers() {
if (!sets) return;
const basis = cameraBasis();
const at = now();
const icons = [];
const rings = [];
for (const marker of markers.values()) {
if (!marker.position) continue;
icons.push(markerItem(marker, basis));
icons.push(markerItem(marker, basis, at));
if (marker.uat) rings.push(ringItem(marker));
}
if (icons.length) sets.markers.upsert(icons);
+45 -5
View File
@@ -2,9 +2,10 @@ import assert from 'node:assert/strict';
import test from 'node:test';
import * as Cesium from 'cesium';
import { CLASS_SCALE_2D } from '../../data/aircraftClass.js';
import { VEHICLE_TINT_CSS } from '../../data/aircraftClass.js';
import { layerFeedState } from '../../data/feedState.js';
import { aircraftIcon } from '../../data/aircraftIcons.js';
import { ROTOR_STILL_FRAME, rotorFrame } from '../../data/rotorFrames.js';
import {
createLocalAdsbLayer,
HEARD_BY_RECEIVER,
@@ -239,7 +240,7 @@ test('enabling Local ADS-B asks the shared tuner for 1090 MHz; disabling leaves
);
});
test('local aircraft use their class silhouette and scale in magenta', async (t) => {
test('local aircraft use their class silhouette at one size in magenta', async (t) => {
const receiver = fakeReceiver({ mode: 'adsb', connected: true });
const clock = { now: 100_000 };
const { layer, draw, calls } = await enabledLayer(receiver, clock);
@@ -266,8 +267,17 @@ test('local aircraft use their class silhouette and scale in magenta', async (t)
assert.equal(typeof readEntityRecord(carrier)?.displayPosition, 'function');
const heli = () => iconOf(draw, 'local-adsb:a0b702');
assert.equal(heli().image, aircraftIcon('helicopter'));
assert.equal(heli().scale, CLASS_SCALE_2D.helicopter);
// Airborne, its rotor turns: the frame of its own phase at the layer's time.
assert.equal(
heli().image,
aircraftIcon(
'helicopter',
undefined,
rotorFrame('local-adsb:a0b702', clock.now),
),
);
assert.equal(heli().scale, 1, 'every class draws at one size');
assert.equal(icon.scale, heli().scale);
assert.deepEqual(
heli().color,
MAGENTA,
@@ -286,18 +296,48 @@ test('local aircraft use their class silhouette and scale in magenta', async (t)
icao: 'a0b702',
category: 'A7',
onGround: true,
groundSpeedKt: 0,
lastPositionAt: 100_500,
}),
],
});
await layer.update();
assert.equal(heli().scale, CLASS_SCALE_2D.helicopter * 0.8);
assert.equal(heli().scale, 0.8);
// Parked on the ground its rotor holds still.
assert.equal(
heli().image,
aircraftIcon('helicopter', undefined, ROTOR_STILL_FRAME),
);
const [detectable] = layer.getDetectableObjects();
assert.equal(detectable.sourceId, 'a0b702');
assert.equal(detectable.type, 'AIR');
});
test('local airport vehicles draw the amber vehicle sprite, ground stations the upright mast', async (t) => {
const receiver = fakeReceiver({ mode: 'adsb', connected: true });
const clock = { now: 100_000 };
const { layer, draw } = await enabledLayer(receiver, clock);
t.after(() => layer.destroy());
receiver.set({
aircraft: [
record({ icao: 'a0c001', category: 'C1', trackDeg: 90 }),
record({ icao: 'a0c002', category: 'C2', trackDeg: 90 }),
record({ icao: 'a0c003', category: 'C3', trackDeg: 90 }),
],
});
await layer.update();
for (const id of ['a0c001', 'a0c002']) {
const icon = iconOf(draw, `local-adsb:${id}`);
assert.equal(icon.image, aircraftIcon('vehicle'), id);
assert.deepEqual(icon.color, hexColor(VEHICLE_TINT_CSS), id);
}
const mast = iconOf(draw, 'local-adsb:a0c003');
assert.equal(mast.image, aircraftIcon('station'));
assert.deepEqual(mast.color, MAGENTA);
assert.equal(mast.rotation, 0, 'upright whatever its track');
});
test('the heading slews toward a new track instead of snapping', async (t) => {
const receiver = fakeReceiver({ mode: 'adsb', connected: true });
const clock = { now: 100_000 };
+39 -1
View File
@@ -8,7 +8,13 @@ import {
sub,
} from '../../geo/vector.js';
import { aircraftLayerModelSpec } from '../flights/modelSpec.js';
import { fleetModelSet, loadFleetModelSet } from '../../data/fleetModels.js';
import {
fleetModelSet,
fleetPartTable,
loadFleetModelSet,
} from '../../data/fleetModels.js';
import { aircraftLayerPartState } from '../../data/modelPartDrivers.js';
import { KNOT_MPS } from '../../data/units.js';
import {
FLEET_DR_INTERVAL_MS,
MODEL_ADD_M,
@@ -162,6 +168,36 @@ export function createLocalAdsbModels({
}
}
/**
* The moving parts an aircraft's model is posed with, from its record
* (`aircraftLayerPartState`). The receiver knows no ground height, so its gear
* follows the approach rule by its reported altitude, climb and speed. An
* airport vehicle is a road vehicle (`groundVehiclePartState`): its wheels
* roll with its speed.
*/
function partsOf(marker, spec) {
const table = fleetPartTable(fleetModelSet(), spec.model);
if (!table) return undefined;
const record = marker.record ?? {};
const finite = (v) => (Number.isFinite(v) ? v : null);
const speedMps =
finite(record.groundSpeedKt) === null
? null
: record.groundSpeedKt * KNOT_MPS;
return aircraftLayerPartState(table, {
klass: marker.klass,
onGround: marker.onGround === true,
heightAboveGroundM: null,
altitudeM:
finite(record.altitudeFt) === null ? null : record.altitudeFt * 0.3048,
verticalRateMps:
finite(record.verticalRateFpm) === null
? null
: (record.verticalRateFpm * 0.3048) / 60,
speedMps,
});
}
function regime(preferences, pose) {
if (!preferences?.models3d) return false;
return pose.height < MODEL_ALT_CEIL_M;
@@ -241,6 +277,7 @@ export function createLocalAdsbModels({
const gltf = fleetModelSet()?.bytes?.get(spec.model);
noteAsset(record, url, spec.bellyM);
const position = placement(id, marker);
const parts = partsOf(marker, spec);
const shown =
Boolean(position) && horizon.isPointVisible(marker.position);
items.push({
@@ -262,6 +299,7 @@ export function createLocalAdsbModels({
tint: WHITE,
colorBlend: aircraftModelBlend(false),
environmentMap: AIRCRAFT_ENVIRONMENT_MAP_OPTIONS.enabled,
...(parts ? { parts } : {}),
show: shown,
});
if (shown && record.ready) marker.modelOwnsVisual = true;
+54 -1
View File
@@ -26,6 +26,59 @@ export function createClockFollow({ flightState, services, parts }) {
flightState._lastCamPoseSig = '';
}
/**
* The contacts drawn now that the first live snapshot after the clock came
* back to live lacks (the tracked one too): the snapshot judges them as a
* poll judges any absence (see the snapshot renderer).
* @param {{records: Array<{id: string}>}} snapshot
* @returns {Set<string>}
*/
function absentAtHandover(snapshot) {
const present = new Set(snapshot.records.map((record) => record.id));
const drawn = [...(flightState._icons?.ids() ?? [])];
if (flightState._trackedIcao) drawn.push(flightState._trackedIcao);
return new Set(drawn.filter((id) => !present.has(id)));
}
/**
* Back at live: forget how every contact moved, as at a jump, but keep the
* tracked trail, and keep the contacts `kept` (absentAtHandover) as they
* were: their record, fixes and course. Each was last seen at its newest
* fix, not when it was loaded, so absence judges how old it really is.
* @param {Set<string>} kept
*/
function handOverMotion(kept) {
const held = [];
for (const id of kept)
held.push([
id,
flightState.records.data.get(id),
flightState._positionHistory.get(id),
flightState._displayCourse.get(id),
]);
forgetPlacedAircraft(
services?.placement,
[...flightState._positionHistory.keys()].filter((id) => !kept.has(id)),
);
flightState.records.reset();
flightState._positionHistory.clear();
flightState._displayCourse.clear();
flightState._groundSnap.clear();
flightState._drReconcileValid = false;
flightState._cachedDRFrame = -1;
flightState._cachedDRPosition = null;
flightState._lastCamPoseSig = '';
for (const [id, meta, history, course] of held) {
if (meta)
flightState.records.data.set(id, {
...meta,
observedReceiptMs: meta.newestFixMs ?? meta.observedReceiptMs,
});
if (history) flightState._positionHistory.set(id, history);
if (course !== undefined) flightState._displayCourse.set(id, course);
}
}
/** Drop every contact: the time has none to show, or the clock went live. */
function clear() {
if (flightState._trackedIcao)
@@ -39,5 +92,5 @@ export function createClockFollow({ flightState, services, parts }) {
flightState.feed._lastUpdate = null;
}
return { resetMotion, clear };
return { resetMotion, absentAtHandover, handOverMotion, clear };
}
+14 -4
View File
@@ -10,7 +10,10 @@ import { createLifecycle } from './lifecycle.js';
import { createTesting } from './testing.js';
import { createQueries } from './queries.js';
import { createClockFollow } from './clockFollow.js';
import { createSnapshotTimeline } from '../../time/snapshotTimeline.js';
import {
createSnapshotTimeline,
snapshotAnswer,
} from '../../time/snapshotTimeline.js';
import { worldClock } from '../../time/worldClock.js';
/** Compose one military-flight layer with application-owned scene services. */
export function createMilitaryFlightLayer({
@@ -46,10 +49,19 @@ export function createMilitaryFlightLayer({
parts.ingestion = createIngestion({
feed: flightState.feed,
applySnapshot: (snapshot, viewer, options) => {
// At another time the snapshot takes the place of every contact: how
// each moved belongs to the time the clock left. Back at live too, but
// the contacts it lacks are kept as they were for it to judge.
if (options?.replace) parts.clockFollow.resetMotion();
if (options?.handover) {
parts.clockFollow.handOverMotion(
parts.clockFollow.absentAtHandover(snapshot),
);
}
return applySnapshot(snapshot, viewer, options);
},
followsClock: () => flightState.timeline.active(),
timedAnswer: snapshotAnswer,
setSourceLabel: (source) => {
layer.source = source;
},
@@ -65,9 +77,7 @@ export function createMilitaryFlightLayer({
load: (atMs, { signal, replace }) =>
parts.ingestion.methods.loadAt(atMs, { signal, replace }),
clear: () => parts.clockFollow.clear(),
resumeLive: () => {
layer.update(flightState._viewer).catch(() => {});
},
resumeLive: () => parts.ingestion.methods.resumeLive(flightState._viewer),
});
Object.assign(
+26 -5
View File
@@ -11,6 +11,7 @@ export function createIngestion({
setSourceLabel,
applyPendingTrackingRestore,
followsClock = () => false,
timedAnswer = () => true,
}) {
const methods = {
async update(viewer, { signal = null } = {}) {
@@ -20,13 +21,27 @@ export function createIngestion({
await acquire(viewer, { signal });
},
/**
* Back at live from another time: poll at once, and let this live
* snapshot stand in for every contact. Those it has keep their
* icon and model and move on from where they are drawn; those it lacks
* go. Resolves true once it is applied, else false (nothing to poll yet,
* or the poll failed); rejects with an AbortError when it was dropped.
* @param {object} [viewer]
* @returns {Promise<boolean>}
*/
async resumeLive(viewer) {
return (await acquire(viewer, { handover: true })) === true;
},
/**
* Apply the source's snapshot at world time `atMs` (its timeline says it
* can answer one), in place of every contact when `replace`. Resolves
* whether it was applied.
* whether it was applied: `{ reachMs }`, the newest fix its records
* carry, when they carry fixes; else true, or false when it was not.
* @param {number} atMs
* @param {{signal?: AbortSignal|null, replace?: boolean, viewer?: object}} [options]
* @returns {Promise<boolean>}
* @returns {Promise<boolean|{reachMs: number}>}
*/
async loadAt(atMs, { signal = null, replace = false, viewer = null } = {}) {
// Whatever polls or loads for another time no longer applies.
@@ -37,7 +52,10 @@ export function createIngestion({
},
};
async function acquire(viewer, { signal = null, atMs, replace = false }) {
async function acquire(
viewer,
{ signal = null, atMs, replace = false, handover = false },
) {
const nowMs = Date.now();
const timed = atMs !== undefined;
const trackingRefreshEpoch = ++feed._trackingRefreshEpoch;
@@ -77,7 +95,9 @@ export function createIngestion({
: null);
const accepted = timed
? applySnapshot(snapshot, viewer, { replace })
: applySnapshot(snapshot, viewer);
: handover
? applySnapshot(snapshot, viewer, { handover: true })
: applySnapshot(snapshot, viewer);
feed._count = accepted.count;
feed._lastUpdate = snapshot.observedAtMs;
feed._lastTrackingRefreshOutcome = {
@@ -88,7 +108,8 @@ export function createIngestion({
};
console.log(`[Data:Military] Updated: ${feed._count} aircraft`);
applyPendingTrackingRestore();
return true;
// At a time, what the clock's follower is told of it.
return timed ? timedAnswer(snapshot) : true;
} catch (e) {
if (updateSignal.aborted || e?.name === 'AbortError') {
throw new DOMException('Military update aborted', 'AbortError');
+180
View File
@@ -0,0 +1,180 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { createMilitarySnapshotRenderer } from './snapshotRenderer.js';
import { createMotion } from './motion.js';
import { createIngestion, createMilitaryFeed } from './ingestion.js';
import { MilitaryFlightRecords } from './records.js';
import { createClockFollow } from './clockFollow.js';
// Back at live from another time, the first live snapshot stands in for
// every military contact: those it has keep their icon, and only those it
// lacks go (src/time/snapshotTimeline.js).
function harness() {
const iconIds = new Set();
const calls = [];
const flightState = {
_viewer: null,
_icons: {
has: (id) => iconIds.has(id),
ids: () => [...iconIds],
get count() {
return iconIds.size;
},
},
_positionHistory: new Map(),
_groundSnap: { forget() {} },
_models: new Map(),
_trackedModel: null,
_trackedIcao: null,
records: { data: new Map() },
};
const parts = {
rendering: {
_modelOwnsVisual: () => false,
_syncModelToClass() {},
_groundSampleExclusions: () => ({ sets: [] }),
},
icons: {
_addIcon: (id) => {
calls.push(['add', id]);
iconIds.add(id);
},
_applyIconPresentation() {},
_planIcon: (id, options) => calls.push(['plan', id, options]),
_forgetContact: (id) => {
calls.push(['forget', id]);
iconIds.delete(id);
},
},
};
const services = {
camera: { trackedModelScaleForPixelCap: () => 1 },
focus: {},
groundFloor: { cachedGroundFloor: () => null, GROUND_FLOOR_LIFT_M: 0.5 },
meshFloor: { sampleMeshFloorCells() {} },
};
parts.motion = createMotion({ flightState, services, parts, layer: {} });
const records = new MilitaryFlightRecords({
geoidHeight: () => 0,
cachedGroundFloor: () => null,
floorAltitudeM: (altitude) => altitude,
now: () => Date.now(),
});
flightState.records = records;
flightState.now = () => Date.now();
flightState._displayCourse = new Map();
flightState._groundSnap.clear = () => {};
const apply = createMilitarySnapshotRenderer({
flightState,
records,
groundFloor: { warmGroundFloor() {}, cachedGroundFloor: () => null },
militaryRegistry: { registerMilitaryIcaos() {} },
rendering: parts.rendering,
tracking: {},
motion: parts.motion,
icons: parts.icons,
queries: { _likelyLanded: () => false },
});
const clockFollow = createClockFollow({
flightState,
services: { placement: null },
parts: { tracking: { _clearTrail() {} } },
});
// `ids`: an id, or [id, fix age ms].
const snapshot = (ids, fields) => ({
observedAtMs: Date.now(),
records: ids.map((entry, k) => {
const [id, ageMs = 5_000] = [entry].flat();
return {
id,
reference: id,
longitude: -97 + k,
latitude: 30,
baroAltitudeM: 3_000,
onGround: false,
speedMps: 200,
courseDeg: 90,
positionTimeMs: Date.now() - ageMs,
};
}),
complete: true,
...fields,
});
return {
calls,
iconIds,
apply(ids, options, fields) {
calls.length = 0;
return apply(snapshot(ids, fields), null, options);
},
// Back at live, as the layer applies its first live snapshot.
handOver(ids, fields) {
calls.length = 0;
const live = snapshot(ids, fields);
clockFollow.handOverMotion(clockFollow.absentAtHandover(live));
return apply(live, null, { handover: true });
},
};
}
test('the first live military snapshot keeps the icons of contacts it has and drops only those it lacks', () => {
const h = harness();
h.apply(['ae0001', 'ae0002']);
h.handOver(['ae0001', 'ae0003']);
assert.deepEqual([...h.iconIds].sort(), ['ae0001', 'ae0003']);
assert.equal(
h.calls.some(
([kind, id]) => id === 'ae0001' && (kind === 'add' || kind === 'forget'),
),
false,
);
assert.deepEqual(
h.calls.find(([kind, id]) => kind === 'plan' && id === 'ae0001'),
['plan', 'ae0001', { handover: true }],
);
// A plain poll keeps a missing contact as its absence rules say.
h.apply(['ae0001']);
assert.deepEqual([...h.iconIds].sort(), ['ae0001', 'ae0003']);
});
test('back at live, only the first live military snapshot applied takes over; a failed poll says so', async () => {
const applied = [];
let fail = false;
const feed = createMilitaryFeed({
async getSnapshot() {
if (fail) throw new Error('down');
return { records: [], observedAtMs: Date.now(), freshness: 'current' };
},
});
const { methods } = createIngestion({
feed,
applySnapshot: (_snapshot, _viewer, options) => {
applied.push(options);
return { count: 0, ids: new Set() };
},
setSourceLabel: () => {},
applyPendingTrackingRestore: () => {},
});
assert.equal(await methods.resumeLive(null), true);
await methods.update(null);
assert.deepEqual(applied, [{ handover: true }, undefined]);
fail = true;
const warn = console.warn;
console.warn = () => {};
try {
assert.equal(await methods.resumeLive(null), false);
} finally {
console.warn = warn;
}
});
test('back at live, a partial military snapshot keeps only contacts whose newest fix is recent', () => {
const h = harness();
h.apply([
['ae0001', 3 * 3_600_000],
['ae0002', 60_000],
]);
h.handOver(['ae0003'], { complete: false });
assert.deepEqual([...h.iconIds].sort(), ['ae0002', 'ae0003']);
});
+1 -5
View File
@@ -35,7 +35,6 @@ import {
recoveryMs,
limitCourseStep,
} from '../../data/motionModel.js';
import { CLASS_SCALE_2D } from '../../data/aircraftClass.js';
import { placeLiveAircraft } from '../flights/placed.js';
import {
modelVisualAnchor,
@@ -321,10 +320,7 @@ export function createMotion({
const sprite = readEntityRecord(flightState._trackedEntity)?.sprite;
const width = sprite?.width ?? 28;
const height = sprite?.height ?? 28;
const scale =
sprite?.scale ??
BILLBOARD_SCALE *
(CLASS_SCALE_2D[flightState.records.data.get(icao24)?.klass] || 1);
const scale = sprite?.scale ?? BILLBOARD_SCALE;
const scaleByDistance =
sprite?.scaleByDistance ?? TRACKED_BILLBOARD_SCALE_BY_DISTANCE;
const distanceScale = nearFarScalarValueAtDistance(scaleByDistance, rangeM);
+2 -7
View File
@@ -1,4 +1,3 @@
import { CLASS_SCALE_2D } from '../../data/aircraftClass.js';
import {
aircraftLayerModelSpec,
aircraftModelSpecCacheKey,
@@ -41,15 +40,11 @@ export function createRendering({
return spec;
}
/** Fleet icon scale: per-class scale, ×GROUND_SCALE while grounded. */
/** Fleet icon scale: one size for every class, ×GROUND_SCALE while grounded. */
function _fleetBillboardScale(icao24) {
const meta = flightState.records.data.get(icao24);
return (
BILLBOARD_SCALE *
(CLASS_SCALE_2D[meta?.klass] || 1) *
(meta?.onGround ? GROUND_SCALE : 1)
);
return BILLBOARD_SCALE * (meta?.onGround ? GROUND_SCALE : 1);
}
/** Sprite kind for one contact's icon. Identity for every aircraft except
+38 -10
View File
@@ -55,8 +55,16 @@ export function createMilitarySnapshotRenderer({
/**
* `replace`: the snapshot is the world at another time (the world clock
* jumped), so it stands in for every contact: one it lacks is gone at once.
* `handover`: the first live snapshot after the clock came back to live: it
* stands in for every contact too, and those it has keep their icon and
* model and ease on from where they are drawn; of those it lacks, only
* those absence keeps (judged by their newest fix) stay.
*/
return function applySnapshot(snapshot, viewer, { replace = false } = {}) {
return function applySnapshot(
snapshot,
viewer,
{ replace = false, handover = false } = {},
) {
// Before init (or after destroy) there is no icon set to draw into.
if (!flightState._icons) return { count: 0, ids: new Set() };
const currentIcaos = new Set();
@@ -223,7 +231,7 @@ export function createMilitarySnapshotRenderer({
// freshness change and the cockpit contract all land on the row's
// style; motion re-plans from the updated history.
icons._applyIconPresentation(icao24);
icons._planIcon(icao24);
icons._planIcon(icao24, handover ? { handover } : undefined);
// Per-type fleet models: a type or category change can mean a
// different model OR scale — resync the live model, any in-flight
// load, and the tracked standalone (mirror of flights.js).
@@ -279,6 +287,23 @@ export function createMilitarySnapshotRenderer({
// EXCEPTION: likely-landed planes (last fix low + slow) get only
// LANDED_MISSING_POLL_LIMIT — their disappearance means "landed", not a
// feed gap, and the full grace left phantom planes parked at airports.
// Back at live, a contact it lacks is from the time the clock left: it
// goes at once, unless absence keeps it as any poll would (a partial or
// retaining snapshot, the tracked aircraft), judged by its newest fix.
// No missed-poll grace, and a landed tracked aircraft is not kept.
const absenceAtHandover = (icao24) => {
const likelyLanded = queries._likelyLanded(icao24);
const judged = records.absence(icao24, {
complete: snapshot.complete,
retainIds: snapshot.retainIds,
likelyLanded,
tracked: icao24 === flightState._trackedIcao && !likelyLanded,
nowMs: flightState.now?.(),
});
return judged === 'stale' && icao24 !== flightState._trackedIcao
? 'remove'
: judged;
};
const absentIds = [];
for (const icao24 of flightState._icons.ids()) {
if (!currentIcaos.has(icao24)) absentIds.push(icao24);
@@ -286,13 +311,15 @@ export function createMilitarySnapshotRenderer({
for (const icao24 of absentIds) {
const absence = replace
? 'remove'
: records.absence(icao24, {
complete: snapshot.complete,
retainIds: snapshot.retainIds,
likelyLanded: queries._likelyLanded(icao24),
tracked: icao24 === flightState._trackedIcao,
nowMs: flightState.now?.(),
});
: handover
? absenceAtHandover(icao24)
: records.absence(icao24, {
complete: snapshot.complete,
retainIds: snapshot.retainIds,
likelyLanded: queries._likelyLanded(icao24),
tracked: icao24 === flightState._trackedIcao,
nowMs: flightState.now?.(),
});
if (absence === 'retain') continue;
if (absence === 'stale') {
icons._applyIconPresentation(icao24); // the faded freshness alpha
@@ -319,7 +346,8 @@ export function createMilitarySnapshotRenderer({
icons._forgetContact(icao24); // aged out: its 3D model goes too (no orphan / cap leak)
}
// The tracked contact at the new time: its trail starts there.
// The tracked contact at the new time: its trail starts there. Back at
// live its trail goes on.
if (
replace &&
flightState._trackedIcao &&
+3 -4
View File
@@ -410,10 +410,7 @@ export function createTracking({
width: look.size[0],
height: look.size[1],
get scale() {
return parts.rendering._fleetBillboardScale(
icao24,
flightState.records.data.get(icao24)?.klass,
);
return parts.rendering._fleetBillboardScale(icao24);
},
scaleByDistance: look.scaleByDistance,
};
@@ -1066,6 +1063,8 @@ export function createTracking({
const pos = getTrackedPosition();
if (!tracked || !pos || !flightState._viewer)
return flightState._lastTrackedRotation;
// A ground station's mast stands upright.
if (tracked.klass === 'station') return 0;
const projected = courseScreenRotation(
_pose(),
pos,
+21
View File
@@ -0,0 +1,21 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const source = (layer) =>
readFileSync(new URL(`../${layer}/tracking.js`, import.meta.url), 'utf8');
for (const layer of ['military', 'flights']) {
test(`${layer}: a tracked ground station's mast is never turned`, () => {
// The tracked billboard's rotation answers 0 for a station before any
// course is projected on screen.
const rotation = /rotation: \(\) => \{[\s\S]*?courseScreenRotation\(/.exec(
source(layer),
)?.[0];
assert.ok(rotation, 'the tracked billboard turns by a rotation callback');
assert.match(
rotation,
/if \(tracked\.klass === 'station'\) return 0;\s*const projected = courseScreenRotation\(/,
);
});
}
+20
View File
@@ -48,6 +48,7 @@ import {
transitModelSpec,
} from '../../data/fleetModels.js';
import { createFleetModelLayer } from '../../data/fleetModelInstances.js';
import { groundVehiclePartState } from '../../data/modelPartDrivers.js';
/** How often the trains near enough for a model are gathered again (wall ms). */
const MODEL_CANDIDATES_MS = 500;
@@ -924,6 +925,25 @@ export function createRendering({ state, services, parts }) {
display: fleet.display,
policy: fleet.policy,
resolveAsset: fleet.resolveAsset,
partState: vehiclePartState,
});
}
/**
* Wheels rolling at the speed it is drawn moving at (else its reported
* one), doors open while it stands at a stop.
*/
function vehiclePartState(item, table) {
const entry = item.entry;
const drawn = entry?.sample?.segmentSpeedMps;
const reported = entry?.record?.speedMps;
return groundVehiclePartState(table, {
speedMps: Number.isFinite(drawn)
? drawn
: Number.isFinite(reported)
? reported
: null,
atStop: entry?.record?.status === 'STOPPED_AT',
});
}
+20
View File
@@ -43,6 +43,7 @@ import {
transitModelSpec,
} from '../../data/fleetModels.js';
import { createFleetModelLayer } from '../../data/fleetModelInstances.js';
import { groundVehiclePartState } from '../../data/modelPartDrivers.js';
/** Layers built so far, so each one's draw sets have ids of their own. */
let instances = 0;
@@ -944,6 +945,25 @@ export function createRendering({ state, services, parts }) {
display: fleet.display,
policy: fleet.policy,
resolveAsset: fleet.resolveAsset,
partState: vehiclePartState,
});
}
/**
* Wheels rolling at the speed it is drawn moving at (else its reported
* one), doors open while it stands at a stop.
*/
function vehiclePartState(item, table) {
const entry = item.entry;
const drawn = entry?.sample?.segmentSpeedMps;
const reported = entry?.record?.speedMps;
return groundVehiclePartState(table, {
speedMps: Number.isFinite(drawn)
? drawn
: Number.isFinite(reported)
? reported
: null,
atStop: entry?.record?.status === 'STOPPED_AT',
});
}
+84
View File
@@ -216,3 +216,87 @@ test('back at live, the live poll goes out at once even while a snapshot at a ti
assert.equal(Object.hasOwn(queries[1], 'atMs'), false);
assert.equal(probe.applied.at(-1).rows.length, 1);
});
test('back at live, only the first live vessel rows applied take over; a poll that fails or brings none says so', async () => {
let answer = 'rows';
const probe = ingestion({
async getSnapshot() {
if (answer === 'fail') throw new Error('down');
return {
records:
answer === 'rows'
? [{ id: '111', latitude: 1, longitude: 2, observedAtMs: 5 }]
: [],
observedAtMs: 5,
freshness: 'current',
complete: true,
transportStatus: 'live',
};
},
});
assert.equal(await probe.resumeLive({}), true);
await probe.methods.update();
assert.deepEqual(
probe.applied.map(({ options }) => options),
[{ complete: true, handover: true }, { complete: true }],
);
answer = 'none';
assert.equal(await probe.resumeLive({}), false);
answer = 'fail';
const warn = console.warn;
console.warn = () => {};
try {
assert.equal(await probe.resumeLive({}), false);
} finally {
console.warn = warn;
}
});
test('back at live while a live poll is already out, that poll takes over and its answer is awaited', async () => {
let answer;
const probe = ingestion({
getSnapshot: () =>
new Promise((resolve) => {
answer = () =>
resolve({
records: [
{ id: '111', latitude: 1, longitude: 2, observedAtMs: 5 },
],
observedAtMs: 5,
freshness: 'current',
complete: true,
transportStatus: 'live',
});
}),
});
const poll = probe.methods.update();
const resumed = probe.resumeLive({});
answer();
assert.equal(await resumed, true);
await poll;
assert.deepEqual(
probe.applied.map(({ options }) => options),
[{ complete: true, handover: true }],
);
});
test('without AbortSignal.any a vessel request still gives up after its timeout', async (t) => {
t.mock.timers.enable({ apis: ['setTimeout'] });
const any = AbortSignal.any;
AbortSignal.any = undefined;
try {
const probe = ingestion({
getSnapshot: (_query, { signal }) =>
new Promise((_, reject) =>
signal.addEventListener('abort', () => reject(signal.reason)),
),
});
const resumed = probe.resumeLive({});
await Promise.resolve();
t.mock.timers.tick(10_000);
assert.equal(await resumed, false);
assert.equal(probe.feed.loading, false);
} finally {
AbortSignal.any = any;
}
});
+6 -4
View File
@@ -12,7 +12,10 @@ import { createTesting } from './testing.js';
import { createEvidence } from './evidence.js';
import { createQueries } from './queries.js';
import { followsClock } from './policy.js';
import { createSnapshotTimeline } from '../../time/snapshotTimeline.js';
import {
createSnapshotTimeline,
snapshotAnswer,
} from '../../time/snapshotTimeline.js';
import { worldClock } from '../../time/worldClock.js';
/** Compose one vessel layer with application-owned scene services. */
export function createVesselLayer({ source, services, options = {} } = {}) {
@@ -58,6 +61,7 @@ export function createVesselLayer({ source, services, options = {} } = {}) {
layer.source = source;
},
followsClock: () => followsClock(vesselState),
timedAnswer: snapshotAnswer,
reloadAtClock: () => vesselState.timeline.reload(),
});
// Vessels follow the world clock while the source declares a timeline.
@@ -77,9 +81,7 @@ export function createVesselLayer({ source, services, options = {} } = {}) {
state.feed.count = state.records.all.length;
state.feed.lastUpdate = null;
},
resumeLive: () => {
void parts.ingestion.loadLivePositions(vesselState.state.viewer);
},
resumeLive: () => parts.ingestion.resumeLive(vesselState.state.viewer),
});
Object.assign(
layer,
+81 -16
View File
@@ -1,6 +1,9 @@
import { AIS_FIRST_CONNECT_LABEL } from './recordPolicy.js';
import { viewAreaMovedEnough } from './viewArea.js';
/** Longest a vessel request may take before it is given up. */
const REQUEST_TIMEOUT_MS = 10_000;
// A portable export (package.json): no i18n here. The text stays English data
// and the layer panel shows it translated.
const msg = (text) => text;
@@ -23,14 +26,47 @@ export function createIngestion({
setSourceLabel,
followsClock = () => false,
reloadAtClock = () => {},
timedAnswer = () => true,
}) {
async function loadLivePositions(viewer) {
// The live load in flight: its result, and its request, whose `handover`
// may still be set while it loads (see resumeLive).
let liveLoad = null;
async function loadLivePositions(viewer, { handover = false } = {}) {
// Following the world clock, the layer shows the snapshots loadAt applies.
if (followsClock()) return;
if (followsClock()) return false;
// Back at live, a snapshot at a time still loading no longer applies:
// it would hold the live poll back until the next refresh.
if (feed.loading && feed.loadingAtTime) dropLoad();
await loadPositions(viewer);
// A live load already out answers this one too.
if (feed.loading && liveLoad) {
if (handover) liveLoad.request.handover = true;
return liveLoad.promise;
}
const request = { handover };
const promise = loadPositions(viewer, { request });
const load = { request, promise };
liveLoad = load;
try {
return await promise;
} finally {
if (liveLoad === load) liveLoad = null;
}
}
/**
* Back at live from another time: poll at once (or take the live poll
* already out), and let its snapshot stand in for every vessel. Those it has keep their
* icon and model and move on from where they are; those it lacks go.
* Resolves true once it is applied, else false (it could not be had).
* @param {object} [viewer]
* @returns {Promise<boolean>}
*/
async function resumeLive(viewer) {
const applied = await loadLivePositions(viewer || readViewer(), {
handover: true,
});
return applied === true;
}
/** Let go of the load in flight, so another can start now. */
@@ -44,10 +80,11 @@ export function createIngestion({
/**
* Apply the source's snapshot at world time `atMs` (its timeline says it
* can answer one), in place of every vessel when `replace`. Resolves
* whether it was applied.
* whether it was applied: `{ reachMs }`, the newest fix its records carry,
* when they carry fixes; else true, or false when it was not.
* @param {number} atMs
* @param {{signal?: AbortSignal|null, replace?: boolean}} [options]
* @returns {Promise<boolean>}
* @returns {Promise<boolean|{reachMs: number}>}
*/
async function loadAt(atMs, { signal = null, replace = false } = {}) {
// Whatever polls or loads for another time no longer applies: the
@@ -56,7 +93,10 @@ export function createIngestion({
return loadPositions(readViewer(), { atMs, replace, signal });
}
async function loadPositions(viewer, { atMs, replace = false, signal } = {}) {
async function loadPositions(
viewer,
{ atMs, replace = false, signal, request = null } = {},
) {
const timed = atMs !== undefined;
if (!viewer || feed.loading) return false;
feed.loading = true;
@@ -65,18 +105,35 @@ export function createIngestion({
const requestController = new AbortController();
const requestSessionId = feed.sessionId;
feed.abort = requestController;
let timeout = null;
try {
// Combine the layer's teardown-abort with a hard timeout so a hung upstream
// can't wedge the poll indefinitely (parity with the track fetch + flights).
const requestSignal =
typeof AbortSignal.any === 'function'
? AbortSignal.any([
requestController.signal,
AbortSignal.timeout(10000),
...(signal ? [signal] : []),
])
: requestController.signal;
let requestSignal;
if (typeof AbortSignal.any === 'function')
requestSignal = AbortSignal.any([
requestController.signal,
AbortSignal.timeout(REQUEST_TIMEOUT_MS),
...(signal ? [signal] : []),
]);
else {
// Without it, the request's own controller takes the timeout and
// the caller's abort.
timeout = setTimeout(
() =>
requestController.abort(
new DOMException('Vessel request timed out', 'TimeoutError'),
),
REQUEST_TIMEOUT_MS,
);
signal?.addEventListener(
'abort',
() => requestController.abort(signal.reason),
{ once: true },
);
requestSignal = requestController.signal;
}
// Ask for the vessels in view; a wide view asks for every vessel.
const area = readArea(viewer);
feed.lastArea = area;
@@ -92,9 +149,10 @@ export function createIngestion({
if (signal?.aborted) return false;
// The clock left the live edge while this poll was out.
if (!timed && followsClock()) return false;
const takesOver = !timed && request?.handover === true;
setSourceLabel(snapshot.source);
// Map observations into the existing display store; source fields stop here.
applyAisFeedSnapshot(viewer, {
const applied = applyAisFeedSnapshot(viewer, {
rows: snapshot.records.map(vesselDisplayRow),
observedAtMs: snapshot.observedAtMs,
freshness: snapshot.freshness,
@@ -112,8 +170,12 @@ export function createIngestion({
silentForMs: snapshot.silentForMs,
reconnectAttempt: snapshot.reconnectAttempt,
...(replace && { replace }),
...(takesOver && { handover: true }),
});
return true;
// Back at live, a snapshot that placed no vessel could not take over.
if (takesOver) return applied.reconciled;
// At a time, what the clock's follower is told of it.
return timed ? timedAnswer(snapshot) : true;
} catch (error) {
// A snapshot at a time the source dropped for a newer one is no failure.
if (timed && error?.name === 'AbortError') throw error;
@@ -130,6 +192,7 @@ export function createIngestion({
}
return false;
} finally {
if (timeout !== null) clearTimeout(timeout);
if (
feed.abort === requestController &&
feed.sessionId === requestSessionId
@@ -197,6 +260,7 @@ export function createIngestion({
applyRows(viewer, snapshot.acceptedRows, {
complete: payload?.complete !== false,
...(payload?.replace && { replace: true }),
...(payload?.handover && { handover: true }),
});
feed.count = readCount();
feed.stale =
@@ -266,6 +330,7 @@ export function createIngestion({
return {
loadLivePositions,
resumeLive,
loadAt,
refreshIfMoved,
ownsAisRequest,
+28 -12
View File
@@ -7,6 +7,10 @@ import { createVesselIconBook } from './iconBook.js';
import { liftedForHorizon } from '../../geo/horizon.js';
import { bindFakeCesiumCamera } from '../../testSupport/fakeCameraPort.mjs';
import { fakeDrawPort } from '../../testSupport/fakeDrawPort.mjs';
import { aidSprite, vesselSprite } from '../../data/vesselSprites.js';
import { VESSEL_KIND_STYLES } from '../../data/vesselTypes.js';
import { AID_TO_NAVIGATION_STYLE } from '../../data/vesselLabels.js';
import { cssColor } from '../../render/color.js';
/** A query port with nothing on screen: the viewer doubles have no scene. */
const offscreen = {
@@ -90,7 +94,7 @@ const snapshot = (records, extra = {}) => ({
...extra,
});
test('vessel construction is inert and each instance owns its records, icon cache and clock', () => {
test('vessel construction is inert and each instance owns its records and clock', () => {
let requested = 0;
const source = {
getSnapshot() {
@@ -99,8 +103,7 @@ test('vessel construction is inert and each instance owns its records, icon cach
};
const one = createVesselState({ source, services: services() });
const two = createVesselState({ source, services: services() });
for (const key of ['state', 'shipIconCache'])
assert.notEqual(one[key], two[key]);
assert.notEqual(one.state, two.state);
assert.notEqual(one.state.records.byId, two.state.records.byId);
assert.notEqual(one.state.feed, two.state.feed);
assert.notEqual(one.state.records.all, two.state.records.all);
@@ -557,7 +560,7 @@ test('AIS feed rows stay keyed by their MMSI', async () => {
);
});
test('an aid to navigation is drawn as a disc, a vessel as its chevron', async () => {
test('an aid to navigation is drawn as the upright buoy, a vessel as its kind’s hull turned with course', async () => {
const aid = {
...observation('993672001'),
mmsi: '993672001',
@@ -565,26 +568,39 @@ test('an aid to navigation is drawn as a disc, a vessel as its chevron', async (
speedMps: 0,
};
const ship = { ...observation('366999002'), type: 'Cargo' };
const sailing = { ...observation('366999003'), type: '36' };
const { layer, icons } = setup({
async getSnapshot() {
return snapshot([aid, ship]);
return snapshot([aid, ship, sailing]);
},
});
await layer.update();
const svgOf = (id) => {
const itemOf = (id) => {
assert.ok(icons.has(id), id);
return atob(icons.item(id).image.split(',')[1]);
return icons.item(id);
};
assert.match(svgOf('993672001'), /<circle/);
const buoy = itemOf('993672001');
assert.equal(buoy.image, aidSprite());
assert.equal(buoy.rotationMode, 'screen', 'upright');
assert.equal(buoy.rotation, 0, 'never turned');
assert.deepEqual(buoy.color, cssColor(AID_TO_NAVIGATION_STYLE.css));
// The source's virtual flag reaches the layer's record.
const recordOf = (id) => layer.testing._vesselRecordForTest(id);
assert.equal(recordOf('993672001').virtual, false);
assert.equal(recordOf('366999002').virtual, false);
assert.doesNotMatch(svgOf('993672001'), /<path/);
assert.match(svgOf('366999002'), /<path/);
const cargo = itemOf('366999002');
assert.equal(cargo.image, vesselSprite('cargo'));
assert.equal(cargo.rotationMode, 'course');
assert.deepEqual(cargo.color, cssColor(VESSEL_KIND_STYLES.cargo.css));
const sail = itemOf('366999003');
assert.equal(sail.image, vesselSprite('sailing'));
assert.deepEqual(sail.color, cssColor(VESSEL_KIND_STYLES.sailing.css));
// Every vessel and aid draws the same size before its speed scale.
assert.deepEqual(cargo.size, buoy.size);
assert.deepEqual(sail.size, buoy.size);
});
test('a virtual aid to navigation keeps its disc and its virtual flag', async () => {
test('a virtual aid to navigation keeps its buoy and its virtual flag', async () => {
const aid = {
...observation('993672009'),
mmsi: '993672009',
@@ -599,7 +615,7 @@ test('a virtual aid to navigation keeps its disc and its virtual flag', async ()
await layer.update();
assert.ok(icons.has('993672009'));
assert.equal(layer.testing._vesselRecordForTest('993672009').virtual, true);
assert.match(atob(icons.item('993672009').image.split(',')[1]), /<circle/);
assert.equal(icons.item('993672009').image, aidSprite());
});
test('a feed with no AISStream key reports its key as required, and a live one does not', async () => {
+70 -4
View File
@@ -20,6 +20,7 @@ function harness({ placement = null, following = false } = {}) {
const visuals = [];
const state = { selectedRecord: null, trailId: null };
const records = new VesselRecords({ now: () => 5_000_000 });
const primitives = [];
const rendering = {
ensureCollections() {},
makeOccluder: () => null,
@@ -28,8 +29,12 @@ function harness({ placement = null, following = false } = {}) {
visuals.push(record.id);
return { billboard: null };
},
addRecordPrimitives() {},
removeRecordPrimitives() {},
addRecordPrimitives(record) {
primitives.push(['add', record.id]);
},
removeRecordPrimitives(record) {
primitives.push(['remove', record.id]);
},
shipIcon: () => 'icon',
shipScale: () => 1,
syncRecordIcon() {},
@@ -41,12 +46,15 @@ function harness({ placement = null, following = false } = {}) {
records,
rendering,
tracking: {},
selection: {},
cards: {},
selection: { clearVesselInspection() {} },
cards: { updateSelectedVesselHud() {} },
followsClock: () => following,
});
return {
visuals,
primitives,
state,
records,
reconcile: (rows, options) => renderer.reconcileVessels({}, rows, options),
};
}
@@ -105,3 +113,61 @@ test('following the world clock, or rows at another time, tell the placement not
harness({ placement }).reconcile([row('a')], { replace: true });
assert.deepEqual(told, []);
});
test('back at live, the first live vessel rows keep the vessels they have, drop the rest, and are told to the placement', () => {
const { told, forgotten, placement } = recording();
const probe = harness({ placement });
probe.reconcile([row('a'), row('b')]);
probe.primitives.length = 0;
told.length = 0;
probe.reconcile(
[row('a', { lat: 52, last_position_epoch: 1_060 }), row('c')],
{ handover: true },
);
// The vessel it has keeps its icon; the one it lacks goes; a new one is
// added.
assert.deepEqual(probe.primitives, [
['add', 'c'],
['remove', 'b'],
]);
assert.deepEqual(forgotten, ['b']);
assert.deepEqual(
told.map(([id]) => id),
['a', 'c'],
'live fixes, told to the placement',
);
});
test('back at live, partial vessel rows keep the vessels they lack whose newest fix is recent; complete rows pin the selected one', () => {
const probe = harness();
// The records' clock reads 5 000 s: 'recent' was fixed 100 s before it,
// 'old' and 'picked' over an hour before.
probe.reconcile([
row('recent', { last_position_epoch: 4_900 }),
row('old'),
row('picked'),
]);
probe.state.selectedRecord = probe.records.byId.get('picked');
probe.primitives.length = 0;
probe.reconcile([row('c', { last_position_epoch: 4_990 })], {
complete: false,
handover: true,
});
// Partial rows prove no absence for a recent fix; an old one is gone.
assert.ok(probe.records.byId.has('recent'));
assert.equal(probe.records.byId.get('recent').motion, null);
assert.equal(probe.records.byId.has('old'), false);
const complete = harness();
complete.reconcile([
row('recent', { last_position_epoch: 4_900 }),
row('picked'),
]);
complete.state.selectedRecord = complete.records.byId.get('picked');
complete.reconcile([row('c', { last_position_epoch: 4_990 })], {
handover: true,
});
// Complete rows judge as a refresh does: the selected vessel is pinned for
// a few refreshes, the rest go.
assert.deepEqual([...complete.records.byId.keys()].sort(), ['c', 'picked']);
});
+15 -2
View File
@@ -103,7 +103,12 @@ export class VesselRecords {
* between the two (see motion.js). `replace`: the rows are the world at
* another time (the clock jumped), so they stand in for every vessel: one
* they lack is gone at once, selected or not, and none moves from where it
* was at the time the clock left.
* was at the time the clock left. `handover`: the first live rows after the
* clock came back to live: a vessel they have moves to its live fix, not
* from where it was at the time the clock left; one they lack is judged
* as any live refresh judges it (a partial refresh, the selected vessel),
* by how old its newest fix is rather than when it was loaded, and holds
* at its last position meanwhile.
*/
reconcile(
rows,
@@ -112,6 +117,7 @@ export class VesselRecords {
selectedRecord = null,
cap = Infinity,
replace = false,
handover = false,
follow = false,
},
effects,
@@ -152,7 +158,7 @@ export class VesselRecords {
record.fixReceivedAtMs = next.fixReceivedAtMs;
record.fixFeedEpoch = next.fixFeedEpoch;
}
if (replace) {
if (replace || handover) {
record.motion = null;
record.fixes = next.fixes;
} else if (follow) {
@@ -195,6 +201,13 @@ export class VesselRecords {
}
for (const [id, record] of this.byId) {
if (seen.has(id)) continue;
if (handover) {
record.motion = null;
record.fixes = null;
// Loaded for another time: last seen at its newest fix.
const fixMs = finiteNumber(record.lastPositionEpoch);
if (fixMs !== null) record.receivedAtMs = fixMs * 1000;
}
if (replace) {
effects.remove(record, record === selectedRecord);
this.byId.delete(id);
+48 -35
View File
@@ -43,7 +43,11 @@ import {
vesselModelSpec,
} from '../../data/fleetModels.js';
import { createFleetModelLayer } from '../../data/fleetModelInstances.js';
import { isAidToNavigation } from '../../data/vesselTypes.js';
import { vesselPartState } from '../../data/modelPartDrivers.js';
import { isAidToNavigation, vesselKind } from '../../data/vesselTypes.js';
import { aidSprite, vesselSprite } from '../../data/vesselSprites.js';
import { cssColor } from '../../render/color.js';
import { KNOT_MPS } from '../../data/units.js';
/** A moving vessel's next frame is asked for once it would move this far on
* screen (pixels), so it glides when it moves visibly and the scene idles
@@ -55,11 +59,16 @@ const PLACEMENT_FRAME_MS = 1000;
* ms), so one that comes into view is judged where it is. */
const HIDDEN_FOLLOW_MS = 250;
/** The ship artwork's own raster size (px). */
/** A vessel or aid sprite's drawn size before its scale (CSS px). */
const SHIP_ICON_PX = 32;
/** A selected vessel's or aid's tint. */
const SELECTED_TINT = Object.freeze([1, 1, 1, 1]);
let instances = 0;
/** Tint by CSS colour: a handful of type colours. */
const tints = new Map();
/** How often the vessels near enough for a model are gathered again (wall ms). */
const MODEL_CANDIDATES_MS = 500;
@@ -405,6 +414,7 @@ export function createRendering({
/** The icon item a record draws, as it now is. */
function iconItem(record, visual) {
const selected = record === state.selectedRecord;
const aid = isAidToNavigation(record);
const courseDeg = vesselCourseDeg(record);
// Following the clock, not there yet at the time drawn.
visual.seen = seenYet(record);
@@ -418,11 +428,14 @@ export function createRendering({
// is not there yet.
show: !isCockpitSubject(record) && !visual.modelOwnsVisual && visual.seen,
pos: plan?.pos ?? visual.position,
image: shipIcon(record, selected),
image: shipIcon(record),
size: [SHIP_ICON_PX, SHIP_ICON_PX],
// Selection changes the colour only, never the size.
// Tinted by type; selection changes the colour only, never the size.
color: selected ? SELECTED_TINT : shipTint(record),
scale: shipScale(record),
rotationMode: 'course',
// An aid's buoy stands upright on screen; a vessel turns with course.
rotationMode: aid ? 'screen' : 'course',
rotation: 0,
// Held on course, or along its track on the renderer's clock;
// `course` for renderers without motion segments.
course: courseDeg,
@@ -519,40 +532,33 @@ export function createRendering({
}
/**
* Build (and cache) a chevron/delta-wing SVG data URL tinted for the vessel.
* The shape points north (up) so the row's course maps directly to heading.
* An aid to navigation, which has no heading, is a ringed disc instead.
* One icon is generated per color+variant and shares one atlas slot.
* @param {Object} record - Vessel record (drives per-type tint).
* @param {boolean} selected - True for the white/brighter selected variant.
* The sprite a vessel is drawn as: the white hull of its kind
* (`vesselKind`), bow up so the row's course turns it to its heading, or
* for an aid to navigation the buoy. The layer tints it
* (`shipTint`), so each shape takes one icon-atlas slot.
* @param {Object} record - Vessel record.
* @returns {string} SVG data URL.
*/
function shipIcon(record, selected) {
const aid = isAidToNavigation(record);
const cssColor = selected
? '#ffffff'
: aid
? AID_TO_NAVIGATION_STYLE.css
: vesselTypeCss(record.type);
const key = `${cssColor}:${selected ? 'selected' : 'normal'}:${aid ? 'aid' : 'ship'}`;
if (vesselState.shipIconCache.has(key))
return vesselState.shipIconCache.get(key);
function shipIcon(record) {
return isAidToNavigation(record)
? aidSprite()
: vesselSprite(vesselKind(record.type));
}
const stroke = selected ? 'rgba(6,26,32,0.95)' : 'rgba(4,18,24,0.9)';
const strokeWidth = selected ? 1.1 : 0.7;
const shape = aid
? `<circle r="8" fill="${cssColor}" stroke="${stroke}" stroke-width="${strokeWidth * 2}"/>
<circle r="3" fill="${stroke}"/>`
: `<path d="M0,-14 L11,10 L4,7 L0,14 L-4,7 L-11,10 Z" fill="${cssColor}" stroke="${stroke}" stroke-width="${strokeWidth}" stroke-linejoin="round"/>`;
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<g transform="translate(16,16)">
${shape}
</g>
</svg>`;
const icon = 'data:image/svg+xml;base64,' + btoa(svg);
vesselState.shipIconCache.set(key, icon);
return icon;
/**
* A vessel's tint, `[r, g, b, a]`: its type's colour (vesselLabels.js,
* shared with its card), an aid's bone white.
* @param {Object} record - Vessel record.
*/
function shipTint(record) {
const css = isAidToNavigation(record)
? AID_TO_NAVIGATION_STYLE.css
: vesselTypeCss(record.type);
let tint = tints.get(css);
if (!tint) tints.set(css, (tint = Object.freeze(cssColor(css))));
return tint;
}
// Under the DISPLAY rail's 3D toggle, vessels near the camera are drawn as
@@ -578,6 +584,13 @@ export function createRendering({
resolveAsset: fleet.resolveAsset,
// A hull below the waterline would show through a plain globe.
waterline: true,
// Its radar sweeps while it is under way (speed in knots).
partState: (item, table) =>
vesselPartState(table, {
speedMps: Number.isFinite(item.record?.speed)
? item.record.speed * KNOT_MPS
: null,
}),
});
}
+9 -3
View File
@@ -1,4 +1,5 @@
const KNOT_MPS = 1852 / 3600;
import { KNOT_MPS } from '../../data/units.js';
const finiteOrNaN = (value) =>
typeof value === 'number' && Number.isFinite(value) ? value : NaN;
@@ -34,11 +35,15 @@ export function createVesselSnapshotRenderer({
cards,
followsClock = () => false,
}) {
/** `replace`: the rows are the world at another time (see VesselRecords). */
/**
* `replace`: the rows are the world at another time (see VesselRecords).
* `handover`: the first live rows after the clock came back to live (see
* VesselRecords); they are live fixes.
*/
function reconcileVessels(
viewer,
rows,
{ complete = true, replace = false } = {},
{ complete = true, replace = false, handover = false } = {},
) {
rendering.ensureCollections(viewer);
const occluder = rendering.makeOccluder();
@@ -57,6 +62,7 @@ export function createVesselSnapshotRenderer({
selectedRecord: state.selectedRecord,
cap: rendering.renderRowLimit(),
...(replace && { replace }),
...(handover && { handover }),
...(follow && { follow }),
},
{
-4
View File
@@ -53,10 +53,6 @@ export function createVesselState({ source, services }) {
vesselState._geoidReady = false;
/** @type {Map<string, string>} `${cssColor}:${variant}` -> chevron SVG data URL */
vesselState.shipIconCache = new Map();
/** Row ids for unkeyed (no-id) records, which are rebuilt every poll. */
vesselState._unkeyedIconSequence = 0;
Loaded 100 of 137 files, more files were not shown because too many files have changed in this diff. Show more