mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
Airport vehicles and ground stations must behave as such
A feed's ZVEH type held for any contact, so a test transponder at 77 m/s drew as a car driving at airliner speed and a drone at 762 m as a car in the air; a GRND station reporting 11,880 m drew as a mast in the sky. ZVEH now holds only for a contact reported on the ground (or with no altitude) at up to 40 m/s; anything else is classed as an aircraft. A GRND station stands on the ground whatever height it reports.
This commit is contained in:
1 parent
783d45c148
commit
d9b187bf9a
3 files changed
+55
-8
No files matched your search
@@ -283,6 +283,7 @@ test('a ground vehicle or station with no altitude stands on the ground; an airc
|
||||
observation({
|
||||
id: 'v1',
|
||||
typeCode: 'ZVEH',
|
||||
speedMps: 8,
|
||||
callsign: 'FIRE 2',
|
||||
...noAltitude,
|
||||
}),
|
||||
@@ -306,17 +307,44 @@ test('a ground vehicle or station with no altitude stands on the ground; an airc
|
||||
assert.equal(plane.onGround, false);
|
||||
assert.equal(plane.altitude, 10000);
|
||||
assert.equal(plane.typeCode, 'A320');
|
||||
// A vehicle reporting an altitude is placed by it.
|
||||
// An "airport vehicle" reported airborne is no vehicle (a drone, a test
|
||||
// transponder): it is placed by its altitude and classed as an aircraft.
|
||||
const reported = store.receive(
|
||||
observation({ id: 'v2', typeCode: 'ZVEH', baroAltitudeM: 12 }),
|
||||
observation({ id: 'v2', typeCode: 'ZVEH', baroAltitudeM: 762 }),
|
||||
view(),
|
||||
).meta;
|
||||
assert.equal(reported.onGround, false);
|
||||
assert.equal(reported.typeCode, null);
|
||||
assert.notEqual(reported.klass, 'vehicle');
|
||||
// Nor is one on the ground faster than a vehicle drives.
|
||||
const fast = store.receive(
|
||||
observation({
|
||||
id: 'v4',
|
||||
typeCode: 'ZVEH',
|
||||
onGround: true,
|
||||
speedMps: 77,
|
||||
...noAltitude,
|
||||
}),
|
||||
view(),
|
||||
).meta;
|
||||
assert.notEqual(fast.klass, 'vehicle');
|
||||
// A ground station stands on the ground whatever height it reports.
|
||||
const high = store.receive(
|
||||
observation({ id: 'm2', typeCode: 'GRND', baroAltitudeM: 11880 }),
|
||||
view(),
|
||||
).meta;
|
||||
assert.equal(high.onGround, true);
|
||||
assert.equal(high.klass, 'station');
|
||||
assert.equal(high.altitude, 0);
|
||||
assert.ok(
|
||||
!(high.renderAltitudeM > 1000),
|
||||
`drawn at ${high.renderAltitudeM} m`,
|
||||
);
|
||||
// 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 }),
|
||||
observation({ id: 'v3', typeCode: 'ZVEH', speedMps: 8, ...noAltitude }),
|
||||
view(),
|
||||
).meta;
|
||||
assert.equal(unloaded.onGround, true);
|
||||
@@ -335,9 +363,11 @@ test('airport vehicles and ground stations take their class from the first fix',
|
||||
const klass = (fields) =>
|
||||
store.receive(observation({ callsign: '', ...fields }), view()).meta
|
||||
.klass;
|
||||
assert.equal(klass({ id: 'v1', typeCode: 'ZVEH' }), 'vehicle');
|
||||
// An airport vehicle reports itself on the ground, at a vehicle's speed.
|
||||
const driving = { onGround: true, speedMps: 8 };
|
||||
assert.equal(klass({ id: 'v1', typeCode: 'ZVEH', ...driving }), 'vehicle');
|
||||
assert.equal(
|
||||
klass({ id: 'v2', typeCode: 'ZVEH', callsign: 'FIRE 2' }),
|
||||
klass({ id: 'v2', typeCode: 'ZVEH', callsign: 'FIRE 2', ...driving }),
|
||||
'vehicle',
|
||||
);
|
||||
assert.equal(klass({ id: 'v3', category: 'C1' }), 'vehicle');
|
||||
|
||||
Reference in new issue
Block a user