mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Sprites for helicopters, ground vehicles, stations and vessel types; history to live without an empty map; model parts in Cesium
Aircraft icons are one size; helicopters turn a three-frame rotor while airborne or moving; ADS-B ground vehicles share one amber sprite and stations/obstacles one mast; vessels get hull sprites by type and one buoy. Going live keeps contacts until the first live answer and replaces them by id; fast playback holds before the loaded positions end and prefetches ahead. Cesium models move their parts from the optional model part state.
This commit is contained in:
1 parent
624c229bc2
commit
7186f720df
97 files changed
+6586
-343
No files matched your search
@@ -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');
|
||||
});
|
||||
Reference in new issue
Block a user