Keep an application's Cockpit subject steady in the camera and HUD

- A height the entry frame gave holds while later frames give none and the
  floor is still cold, so the view no longer waits and ends.
- A subject's camera update advances by the time since the last one, up to
  its interval plus a second: at 5 frames a second an inertial subject no
  longer falls behind (700 m in a minute at 30 m/s), while a hidden tab
  still counts as one late update.
- A provider's Live Signals rows change where they stand and come back
  after newer rows pushed them off, so a changing ETA no longer hides a
  steady warning; the built-in rows log as before.
- Progress labels give full-width glyphs (CJK, kana, Hangul) about 1 em,
  so such stop names no longer overlap.
- A provider's labels, entry face and look start from the words checked at
  registration, so one that fails on its next read keeps them.

The double-click test on a selected vessel now projects through
SceneTransforms, as the scene query port does, with a control that enters
the bridge.
This commit is contained in:
German Khokhlov committed 2026-11-17 19:34:32 +04:00
1 parent 624c229bc2
commit a2a61c506f
12 files changed
+329 -58

No files matched your search

+18 -1
View File
@@ -4,7 +4,10 @@
// the travelled part.
import test from 'node:test';
import assert from 'node:assert/strict';
import { cockpitProgressLayout } from './cockpitProgress.js';
import {
cockpitProgressLayout,
estimateProgressLabelPx,
} from './cockpitProgress.js';
const tick = (at, label = null, tone = 'normal') => ({ at, tone, label });
const label = (text, priority, align = 'center', detail = '') => ({
@@ -142,3 +145,17 @@ test('a long run of calls still lays out, every one a tick or part of one', () =
assert.ok(narrow.ticks.length < wide.ticks.length);
assert.equal(wide.ticks.length, 60);
});
test('a CJK stop name gets the width its full-width glyphs need', () => {
const text = '中央駅前広場東口'; // 8 full-width glyphs
// 10 px type, 0.06 em apart.
const needPx = text.length * (10 + 0.6);
const givenPx = estimateProgressLabelPx({ text, detail: '' });
assert.ok(
givenPx >= needPx,
`${givenPx} px given, about ${needPx} px needed`,
);
// Latin, and half-width katakana, keep the narrower estimate.
assert.equal(estimateProgressLabelPx({ text: 'CENTRAL' }), 7 * 6.4 + 8);
assert.equal(estimateProgressLabelPx({ text: 'カタカナ' }), 4 * 6.4 + 8);
});