Open the cockpit on a tracked Navara aircraft

This commit is contained in:
German Khokhlov committed 2026-11-02 22:04:23 +04:00
1 parent 8b179a7e01
commit 2087b55b47
19 files changed
+142 -65

No files matched your search

+2 -4
View File
@@ -229,7 +229,7 @@ const FRAME_TARGETS = new Map([
/**
* The tools that still need the Cesium viewer or a subsystem built on it:
* the scene director, annotations and routes over them, the camera verbs
* (orbit, pan, tilt), the cockpit, Contacts (the context mode), Radio and
* (orbit, pan, tilt), Contacts (the context mode), Radio and
* CCTV. Without a viewer (the Navara engine) each answers a structured
* refusal (UNAVAILABLE_ON_ENGINE) instead of running.
*/
@@ -239,7 +239,6 @@ export const VIEWER_ONLY_ACTIONS = Object.freeze([
'clear_annotations',
'fly_route',
'move_camera',
'control_cockpit',
'set_context_mode',
'control_radio',
'control_cctv',
@@ -265,7 +264,6 @@ export const UNAVAILABLE_FEATURES = Object.freeze({
clear_annotations: 'Map annotation',
fly_route: 'Route flying',
move_camera: 'Camera motion (orbit, pan, tilt)',
control_cockpit: 'The cockpit',
set_context_mode: 'The Contacts mode',
control_radio: 'Radio',
control_cctv: 'CCTV',
@@ -1078,7 +1076,7 @@ export function createGevActionRunner({
contextState?.mode === 'flights' &&
contextState?.active !== false &&
contextState?.changing !== true;
if (!contactsReady) {
if (!contactsReady && engine?.kind !== 'navara') {
const contextResult = await styleManager.setContextMode('flights', {
signal: runOptions.signal,
isCurrent: runOptions.isCurrent,
+18 -1
View File
@@ -94,7 +94,6 @@ test('the viewer-only actions are one exported list of real tools', () => {
'clear_annotations',
'fly_route',
'move_camera',
'control_cockpit',
'set_context_mode',
'control_radio',
'control_cctv',
@@ -105,6 +104,24 @@ test('the viewer-only actions are one exported list of real tools', () => {
assert.ok(tools.has(name), `${name} is a voice tool`);
});
test('Navara enters cockpit on the tracked aircraft without starting Contacts', async () => {
const engine = engineOverAustin({ kind: 'navara' });
const runner = runnerOn(engine, {
styleManager: {
getAircraftTrackingTarget: () => ({ layerId: 'flights', id: '507c84' }),
setContextMode: () => assert.fail('the selected flight already owns the camera'),
controlCockpit: (action, { rollbackTarget }) => {
assert.equal(action, 'enter');
assert.equal(rollbackTarget.id, '507c84');
return { ok: true, state: { active: true } };
},
},
});
const result = await runner('control_cockpit', { action: 'enter' });
assert.equal(result.ok, true);
assert.equal(result.state.active, true);
});
test('without a viewer the viewer-only actions refuse with a structured result', async () => {
const engine = engineOverAustin({ kind: 'navara' });
const touched = [];