mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 11:42:21 +00:00
ISS live telemetry, STATION and LIVE sections, Tiangong model, drawn through the renderer's draw port
Builds on the ISS 3D model (PR #1690) and brings it onto main's renderer seam: the station models are items of a `models` draw set, posed by heading, pitch and roll from the station's flight axes (`headingPitchRollOfAxes`), with the camera, canvas and clicks read from the renderer's ports; no satellites file reaches Cesium. The joint drivers write column-major matrices into node poses the model part keeps, for a renderer that can pose nodes; until the draw contract has that member the models draw rigid. - ISS joints take their angles from NASA's ISSLive telemetry, relayed by the server behind ISS_TELEMETRY_ENABLED. - STATION and LIVE sections of Context replace the floating command panel and player; both collapse like the Radio section. - Cockpit rides the ISS from mounts on its model; the LIVE page in the Cockpit briefing. - Tiangong as a second station model, with computed joints. - Installations: a label-box click selects the site.
This commit is contained in:
1 parent
fd3ca679ec
commit
9cc077964f
103 files changed
+12033
-1775
No files matched your search
@@ -23,8 +23,14 @@ import CockpitUtilityControls from './panels/CockpitUtilityControls.vue';
|
||||
// does, they show the state they start in. The controller also publishes
|
||||
// which surfaces are shown and the utility strip's measured layout; the
|
||||
// layout pass stays with it, and the controls keep its listeners.
|
||||
const { presence, instruments, route, vision, utilityLayout } =
|
||||
storeToRefs(useCockpitStore());
|
||||
const {
|
||||
presence,
|
||||
instruments,
|
||||
route,
|
||||
vision,
|
||||
utilityLayout,
|
||||
orbital: orbitalView,
|
||||
} = storeToRefs(useCockpitStore());
|
||||
const active = computed(() => Boolean(presence.value?.active));
|
||||
// A vessel subject swaps the aviation readouts for bridge ones.
|
||||
const bridge = computed(() => presence.value?.subjectKind === 'vessel');
|
||||
@@ -34,6 +40,9 @@ const orbital = computed(() => presence.value?.subjectKind === 'satellite');
|
||||
// window view whose readouts, labels and texts the provider words.
|
||||
const generic = computed(() => presence.value?.subjectGeneric === true);
|
||||
const labels = computed(() => presence.value?.subjectLabels ?? null);
|
||||
// The station is ridden from a mount on its 3D model: the arrows look about
|
||||
// it and Home returns to it, where the nadir picture tilts and returns to nadir.
|
||||
const stationView = computed(() => (orbitalView.value?.mount ?? null) !== null);
|
||||
const subject = computed(() =>
|
||||
generic.value
|
||||
? presence.value.subjectKind
|
||||
@@ -314,7 +323,7 @@ const tickStyle = (tick) =>
|
||||
<CockpitRadar />
|
||||
</div>
|
||||
<CockpitUtilityControls />
|
||||
<div class="cockpit-help"><bdi>{{ t('ESC EXIT') }}</bdi><template v-if="looks"> <span>·</span> <bdi>{{ t('ARROWS LOOK') }}</bdi> <span>·</span> <bdi>{{ t('HOME RESET') }}</bdi></template><template v-if="orbital"> <span>·</span> <bdi>{{ t('+/− ZOOM') }}</bdi> <span>·</span> <bdi>{{ t('ARROWS TILT') }}</bdi> <span>·</span> <bdi>{{ t('HOME NADIR') }}</bdi></template></div>
|
||||
<div class="cockpit-help"><bdi>{{ t('ESC EXIT') }}</bdi><template v-if="looks"> <span>·</span> <bdi>{{ t('ARROWS LOOK') }}</bdi> <span>·</span> <bdi>{{ t('HOME RESET') }}</bdi></template><template v-if="orbital"> <span>·</span> <bdi>{{ t('+/− ZOOM') }}</bdi> <span>·</span> <template v-if="stationView"><bdi>{{ t('ARROWS LOOK') }}</bdi> <span>·</span> <bdi>{{ t('HOME RESET') }}</bdi></template><template v-else><bdi>{{ t('ARROWS TILT') }}</bdi> <span>·</span> <bdi>{{ t('HOME NADIR') }}</bdi></template></template></div>
|
||||
</section>
|
||||
|
||||
<nav id="view-switcher" :aria-label="t('View switcher')">
|
||||
|
||||
@@ -12,7 +12,9 @@ import AwarenessPanel from './panels/AwarenessPanel.vue';
|
||||
import BhoteKoshiPanel from './panels/BhoteKoshiPanel.vue';
|
||||
import MissionDetail from './panels/MissionDetail.vue';
|
||||
import MissionRoster from './panels/MissionRoster.vue';
|
||||
import LivePanel from './panels/LivePanel.vue';
|
||||
import RadioPanel from './panels/RadioPanel.vue';
|
||||
import StationPanel from './panels/StationPanel.vue';
|
||||
import UiButton from '../kit/UiButton.vue';
|
||||
import { cockpitEntryFace } from '../cockpitPresentation.js';
|
||||
|
||||
@@ -79,6 +81,8 @@ const sceneRuntime = computed(() => scenePanel.value?.runtime ?? '');
|
||||
<MissionDetail />
|
||||
</div>
|
||||
</section>
|
||||
<StationPanel />
|
||||
<LivePanel />
|
||||
<RadioPanel />
|
||||
</div>
|
||||
</RailPanel>
|
||||
|
||||
@@ -4,6 +4,8 @@ import { computed, useTemplateRef } from 'vue';
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import { createBriefState } from '../../cockpitBriefPages.js';
|
||||
import { useCockpitStore } from '../../stores/cockpit.js';
|
||||
import { useLiveStore } from '../../stores/live.js';
|
||||
import CockpitLivePage from './CockpitLivePage.vue';
|
||||
import CockpitRoute from './CockpitRoute.vue';
|
||||
import CockpitSignalList from './CockpitSignalList.vue';
|
||||
import UiButton from '../../kit/UiButton.vue';
|
||||
@@ -11,8 +13,11 @@ import UiButton from '../../kit/UiButton.vue';
|
||||
// The Cockpit briefing card. The Cockpit controller presents its pages,
|
||||
// cycle toggle, regional news and local conditions; until it does, the card
|
||||
// shows the state it starts in. The controls keep the controller's
|
||||
// listeners. The route card and the signal rows render themselves.
|
||||
// listeners. The route card, the signal rows and the LIVE page render
|
||||
// themselves; the LIVE page and its tab are there only while the subject has
|
||||
// a stream (the live store's view), which the controller is told of.
|
||||
const { presence, brief } = storeToRefs(useCockpitStore());
|
||||
const { view: live } = storeToRefs(useLiveStore());
|
||||
const initial = createBriefState();
|
||||
const b = computed(() => brief.value ?? initial);
|
||||
// The card's collapse, which its toggle and data-collapsed show.
|
||||
@@ -79,6 +84,9 @@ function leaveSignals() {
|
||||
</div>
|
||||
<a class="cockpit-weather-credit" href="https://open-meteo.com/" target="_blank" rel="noopener">{{ t('Weather data by Open-Meteo.com') }}</a>
|
||||
</section>
|
||||
<section data-cockpit-brief-page="live" :aria-label="t('Live video')" :hidden="b.pageId !== 'live'">
|
||||
<CockpitLivePage v-if="live" />
|
||||
</section>
|
||||
</div>
|
||||
<footer class="cockpit-signal-footer">
|
||||
<span id="cockpit-brief-source">{{ b.source }}</span>
|
||||
@@ -86,6 +94,8 @@ function leaveSignals() {
|
||||
<button type="button" data-cockpit-brief-index="0" :aria-label="t('Show Live Signals')" :aria-current="String(b.pageIndex === 0)">{{ t('SIG') }}</button>
|
||||
<button type="button" data-cockpit-brief-index="1" :aria-label="t('Show Regional News')" :aria-current="brief ? String(b.pageIndex === 1) : undefined">{{ t('NEWS') }}</button>
|
||||
<button type="button" data-cockpit-brief-index="2" :aria-label="t('Show Local Info')" :aria-current="brief ? String(b.pageIndex === 2) : undefined">{{ t('LOCAL') }}</button>
|
||||
<!-- Always in the markup (the controller binds the tabs once); hidden without a stream. -->
|
||||
<button type="button" data-cockpit-brief-index="3" :hidden="!live" :aria-label="t('Show Live Video')" :aria-current="brief ? String(b.pageIndex === 3) : undefined">{{ t('LIVE') }}</button>
|
||||
</nav>
|
||||
</footer>
|
||||
</aside>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<script setup>
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import { useLiveScreen } from '../../liveScreen.js';
|
||||
|
||||
// The Cockpit briefing's LIVE page: the LIVE section of Context, in the
|
||||
// card's measure, for the ridden subject's streams. The briefing renders it
|
||||
// only while a stream is on offer. LiveControls builds the player into
|
||||
// `#cockpit-live-player-host` while the Cockpit is on (the right rail, and
|
||||
// the section's screen with it, is hidden there), and the page's controls
|
||||
// call LiveControls through the live store, as the section's do.
|
||||
const {
|
||||
view,
|
||||
act,
|
||||
playing,
|
||||
loading,
|
||||
offline,
|
||||
unavailable,
|
||||
badgeText,
|
||||
statusText,
|
||||
} = useLiveScreen();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<template v-if="view">
|
||||
<div class="cockpit-live-subject">
|
||||
<strong>{{ view.label }}</strong>
|
||||
<span class="live-badge"><span class="live-dot" :class="{ 'on-air': playing, waiting: loading }" aria-hidden="true"></span><span id="cockpit-live-badge-text">{{ badgeText }}</span></span>
|
||||
</div>
|
||||
<div class="cockpit-live-pick" role="group" :aria-label="t('Stream')">
|
||||
<button v-if="view.count > 1" id="cockpit-live-previous" type="button" class="live-step" @click="act('cycleLive', -1)" :aria-label="t('Previous stream')" :title="t('Previous stream')"><span class="material-symbols-outlined" aria-hidden="true">chevron_left</span></button>
|
||||
<span id="cockpit-live-stream-title" class="live-stream-title" aria-live="polite">{{ t(view.current.title) }}<small v-if="view.count > 1"> · {{ view.index + 1 }}/{{ view.count }}</small></span>
|
||||
<button v-if="view.count > 1" id="cockpit-live-next" type="button" class="live-step" @click="act('cycleLive', 1)" :aria-label="t('Next stream')" :title="t('Next stream')"><span class="material-symbols-outlined" aria-hidden="true">chevron_right</span></button>
|
||||
</div>
|
||||
<!-- The player's element stays put across re-renders: LiveControls mounts the player in it. -->
|
||||
<div class="live-screen" :class="{ active: playing || loading }">
|
||||
<div id="cockpit-live-player-host" class="live-player-host"></div>
|
||||
<div v-if="offline || unavailable" class="live-card" :class="{ offline, unavailable }">
|
||||
<span class="live-card-dot" aria-hidden="true"></span>
|
||||
<strong>{{ offline ? t('Stream is offline') : t('This stream cannot play here') }}</strong>
|
||||
<button v-if="offline" id="cockpit-live-retry" type="button" @click="act('retryLive')">{{ t('Try again') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<p id="cockpit-live-status" class="cockpit-live-status" role="status" aria-live="polite">{{ statusText }}</p>
|
||||
<p class="cockpit-live-credit"><a :href="view.current.ownerUrl" target="_blank" rel="noopener noreferrer">{{ view.current.owner }}</a> · <a id="cockpit-live-watch-link" :href="view.current.watchUrl" target="_blank" rel="noopener noreferrer">{{ t('Open on YouTube') }}</a></p>
|
||||
</template>
|
||||
</template>
|
||||
@@ -220,6 +220,8 @@ const shownMark = computed(() =>
|
||||
const identParts = computed(() => {
|
||||
const o = orbital.value;
|
||||
if (!o) return [];
|
||||
// A module with no catalog entry (the Cupola) shows its facts instead.
|
||||
if (Array.isArray(o.facts) && o.facts.length) return [...o.facts];
|
||||
const parts = [];
|
||||
if (o.noradId !== null && o.noradId !== undefined && o.noradId !== '')
|
||||
parts.push(t('NORAD {id}', { id: String(o.noradId) }));
|
||||
@@ -250,6 +252,11 @@ watch(
|
||||
|
||||
// The off-nadir tilt; an untilted view shows no readout or reset.
|
||||
const look = computed(() => orbital.value?.look || { offset: false });
|
||||
// Riding the station from a mount on its 3D model: the view's name, or null
|
||||
// for the straight-down picture every other satellite has.
|
||||
const mount = computed(() => orbital.value?.mount ?? null);
|
||||
// The station offers several views; with two or more, the arrows step through them.
|
||||
const mountViews = computed(() => orbital.value?.mountViews ?? 0);
|
||||
// A ground focus names its target in a polite live region; the angle,
|
||||
// which changes every update, is left out of it.
|
||||
const focusText = computed(() => {
|
||||
@@ -270,7 +277,8 @@ const lensStyle = computed(() => {
|
||||
<section id="cockpit-orbital" class="cockpit-orbital" :class="{ 'cockpit-orbital-focusing': transition.active }" :style="lensStyle" :aria-label="t('Orbital view')" :hidden="!orbital">
|
||||
<template v-if="orbital">
|
||||
<div class="cockpit-orbital-lens" aria-hidden="true"></div>
|
||||
<div class="cockpit-orbital-reticle" :class="{ 'cockpit-orbital-reticle-lock': transition.lockTick }" aria-hidden="true">
|
||||
<!-- The nadir reticle and its north pointer; a view from the station has no ground point at its centre. -->
|
||||
<div v-if="mount === null" class="cockpit-orbital-reticle" :class="{ 'cockpit-orbital-reticle-lock': transition.lockTick }" aria-hidden="true">
|
||||
<span class="cockpit-orbital-bracket cockpit-orbital-bracket-tl"></span>
|
||||
<span class="cockpit-orbital-bracket cockpit-orbital-bracket-tr"></span>
|
||||
<span class="cockpit-orbital-bracket cockpit-orbital-bracket-bl"></span>
|
||||
@@ -287,7 +295,7 @@ const lensStyle = computed(() => {
|
||||
<!-- Under the vision selector: where the ground track is. -->
|
||||
<p v-if="placeText" id="cockpit-orbital-over" class="cockpit-orbital-over"><span>{{ t('CURRENTLY OVER') }}</span> <strong>{{ placeText }}</strong></p>
|
||||
<div class="cockpit-orbital-readout">
|
||||
<p class="cockpit-orbital-kicker">{{ look.offset ? t('ORBITAL VIEW · OFF-NADIR') : t('ORBITAL VIEW · NADIR') }}</p>
|
||||
<p class="cockpit-orbital-kicker">{{ mount !== null ? t('STATION VIEW · {name}', { name: mount }) : look.offset ? t('ORBITAL VIEW · OFF-NADIR') : t('ORBITAL VIEW · NADIR') }}</p>
|
||||
<div class="cockpit-orbital-title">
|
||||
<span v-if="shownMark?.kind === 'flag'" class="cockpit-orbital-flag" role="img" :aria-label="shownMark.label" :title="shownMark.label" :style="shownMark.style"></span>
|
||||
<span v-else-if="shownMark?.kind === 'badge'" class="cockpit-orbital-owner-badge" :title="shownMark.title">{{ shownMark.label }}</span>
|
||||
@@ -315,11 +323,17 @@ const lensStyle = computed(() => {
|
||||
<dd class="cockpit-orbital-subpoint">{{ subPointText }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p class="cockpit-orbital-north">{{ trackUp ? t('TRACK UP') : t('NORTH UP') }}</p>
|
||||
<p v-if="mount === null" class="cockpit-orbital-north">{{ trackUp ? t('TRACK UP') : t('NORTH UP') }}</p>
|
||||
<!-- A station view: which one it is, and the step to the next. -->
|
||||
<div v-if="mount !== null && mountViews > 1" class="cockpit-orbital-look cockpit-orbital-views">
|
||||
<button id="cockpit-orbital-view-previous" type="button" class="cockpit-orbital-nadir cockpit-orbital-view-step" :aria-label="t('Previous station view')" :title="t('Previous station view')"><span class="material-symbols-outlined" aria-hidden="true">chevron_left</span></button>
|
||||
<span id="cockpit-orbital-view-name" class="cockpit-orbital-look-readout" aria-live="polite">{{ mount }}</span>
|
||||
<button id="cockpit-orbital-view-next" type="button" class="cockpit-orbital-nadir cockpit-orbital-view-step" :aria-label="t('Next station view')" :title="t('Next station view')"><span class="material-symbols-outlined" aria-hidden="true">chevron_right</span></button>
|
||||
</div>
|
||||
<!-- Shown only while the view is tilted off nadir: where it looks and the way back. -->
|
||||
<div v-if="look.offset" class="cockpit-orbital-look">
|
||||
<span id="cockpit-orbital-look-readout" class="cockpit-orbital-look-readout" :aria-live="look.focus ? 'off' : 'polite'">{{ look.readout }}</span>
|
||||
<button id="cockpit-orbital-nadir" ref="nadirButton" type="button" class="cockpit-orbital-nadir" :aria-label="t('Return the view to nadir')" :title="t('Return to nadir (Home or 0)')" aria-keyshortcuts="Home 0">{{ t('NADIR') }}</button>
|
||||
<button id="cockpit-orbital-nadir" ref="nadirButton" type="button" class="cockpit-orbital-nadir" :aria-label="mount !== null ? t('Return to the default view') : t('Return the view to nadir')" :title="mount !== null ? t('Return to the default view') : t('Return to nadir (Home or 0)')" aria-keyshortcuts="Home 0">{{ mount !== null ? t('RESET') : t('NADIR') }}</button>
|
||||
</div>
|
||||
<p id="cockpit-orbital-focus" class="cockpit-orbital-focus" aria-live="polite">{{ focusText }}</p>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import RailPanel from '../../rail/RailPanel.vue';
|
||||
import { vClassToggle } from '../../rail/classToggle.js';
|
||||
import { useLiveScreen } from '../../liveScreen.js';
|
||||
|
||||
// The LIVE section inside Context: the live streams attached to the selected
|
||||
// object (LiveControls publishes them), one at a time in the platform's own
|
||||
// player. It is there only while the selection has a stream, and the stream
|
||||
// starts as soon as one is chosen (useLiveScreen). The section starts
|
||||
// collapsed; its +/- hides and shows the body, and the player plays on,
|
||||
// muted, underneath. Its controls call LiveControls through the store.
|
||||
const PANEL_ID = 'live-panel';
|
||||
const {
|
||||
view,
|
||||
act,
|
||||
playing,
|
||||
loading,
|
||||
offline,
|
||||
unavailable,
|
||||
badgeText,
|
||||
statusText,
|
||||
} = useLiveScreen();
|
||||
const liveWords = computed(() => ({
|
||||
expandLabel: t('Expand Live section'),
|
||||
collapseLabel: t('Collapse Live section'),
|
||||
expandTitle: t('Expand Live'),
|
||||
collapseTitle: t('Collapse Live'),
|
||||
}));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RailPanel :id="PANEL_ID" tag="section" start-collapsed :hidden="!view" v-class-toggle="{ 'live-on-air': playing }" :aria-label="t('Live streams for the selected object')" :title="t('LIVE')" :toggle-words="liveWords" :glow="false" scroll>
|
||||
<template #badge><span class="live-badge"><span class="live-dot" :class="{ 'on-air': playing, waiting: loading }" aria-hidden="true"></span><span id="live-badge-text">{{ badgeText }}</span></span></template>
|
||||
<template v-if="view">
|
||||
<div class="live-subject">{{ view.label }}</div>
|
||||
<div class="live-pick" role="group" :aria-label="t('Stream')">
|
||||
<button v-if="view.count > 1" id="live-previous-btn" type="button" class="live-step" @click="act('cycleLive', -1)" :aria-label="t('Previous stream')" :title="t('Previous stream')"><span class="material-symbols-outlined" aria-hidden="true">chevron_left</span></button>
|
||||
<span id="live-stream-title" class="live-stream-title" aria-live="polite">{{ t(view.current.title) }}<small v-if="view.count > 1"> · {{ view.index + 1 }}/{{ view.count }}</small></span>
|
||||
<button v-if="view.count > 1" id="live-next-btn" type="button" class="live-step" @click="act('cycleLive', 1)" :aria-label="t('Next stream')" :title="t('Next stream')"><span class="material-symbols-outlined" aria-hidden="true">chevron_right</span></button>
|
||||
</div>
|
||||
<!-- The player's element stays put across re-renders: LiveControls mounts the player in it. -->
|
||||
<div class="live-screen" :class="{ active: playing || loading }">
|
||||
<div id="live-player-host" class="live-player-host"></div>
|
||||
<div v-if="offline || unavailable" class="live-card" :class="{ offline, unavailable }">
|
||||
<span class="live-card-dot" aria-hidden="true"></span>
|
||||
<strong>{{ offline ? t('Stream is offline') : t('This stream cannot play here') }}</strong>
|
||||
<button v-if="offline" id="live-retry-btn" type="button" @click="act('retryLive')">{{ t('Try again') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<p id="live-status" class="live-status" role="status" aria-live="polite">{{ statusText }}</p>
|
||||
<p class="live-credit"><a :href="view.current.ownerUrl" target="_blank" rel="noopener noreferrer">{{ view.current.owner }}</a> · <a id="live-watch-link" :href="view.current.watchUrl" target="_blank" rel="noopener noreferrer">{{ t('Open on YouTube') }}</a></p>
|
||||
<p class="live-privacy">{{ t('Video plays from YouTube, which sees your IP address.') }}</p>
|
||||
</template>
|
||||
</RailPanel>
|
||||
</template>
|
||||
@@ -0,0 +1,108 @@
|
||||
<script setup>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { computed } from 'vue';
|
||||
import { formatNumber, t } from '../../../i18n/index.js';
|
||||
import RailPanel from '../../rail/RailPanel.vue';
|
||||
import { vClassToggle } from '../../rail/classToggle.js';
|
||||
import UiSlider from '../../kit/UiSlider.js';
|
||||
import { useStationStore } from '../../stores/station.js';
|
||||
|
||||
// The STATION section inside Context: the selected space station's moving
|
||||
// parts. Automatic leaves them to their rules (NASA's telemetry where the
|
||||
// server relays it, computed from the Sun otherwise); Manual hands them to
|
||||
// the person. The satellites layer publishes the view; its controls call
|
||||
// the layer through the store. It is there only while a station is selected.
|
||||
const store = useStationStore();
|
||||
const { act } = store;
|
||||
const { view } = storeToRefs(store);
|
||||
const manual = computed(() => view.value?.mode === 'manual');
|
||||
|
||||
/** A duration as the status line words it. */
|
||||
const ago = (ms) => {
|
||||
if (!Number.isFinite(ms)) return '';
|
||||
const seconds = Math.max(0, Math.round(ms / 1000));
|
||||
return seconds < 90
|
||||
? t('{seconds} s', { seconds: formatNumber(seconds) })
|
||||
: t('{minutes} min', { minutes: formatNumber(Math.round(seconds / 60)) });
|
||||
};
|
||||
const clock = (ms) =>
|
||||
Number.isFinite(ms)
|
||||
? new Date(ms).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' })
|
||||
: '';
|
||||
const telemetry = computed(() => view.value?.telemetry ?? null);
|
||||
const telemetryText = computed(() => {
|
||||
const status = telemetry.value;
|
||||
if (!status) return '';
|
||||
if (manual.value) return t('Manual · telemetry paused');
|
||||
switch (status.state) {
|
||||
case 'live':
|
||||
return t('Telemetry · updated {ago} ago', { ago: ago(status.poseAgeMs) });
|
||||
case 'no-signal':
|
||||
return Number.isFinite(status.liveUntilMs)
|
||||
? t('No signal since {time} · computed values', { time: clock(status.liveUntilMs) })
|
||||
: t('No signal · computed values');
|
||||
case 'unavailable':
|
||||
return Number.isFinite(status.poseAgeMs)
|
||||
? t('Telemetry unavailable · last update {ago} ago · computed values', { ago: ago(status.poseAgeMs) })
|
||||
: t('Telemetry unavailable · computed values');
|
||||
case 'disabled':
|
||||
return t('Telemetry not enabled on this server · computed values');
|
||||
case 'none':
|
||||
return t('No public telemetry · computed values');
|
||||
case 'idle':
|
||||
return t('Telemetry reads while the model is on screen');
|
||||
default:
|
||||
return t('Connecting to telemetry…');
|
||||
}
|
||||
});
|
||||
const telemetryTone = computed(() => {
|
||||
if (manual.value) return 'manual';
|
||||
const state = telemetry.value?.state;
|
||||
return state === 'live' ? 'live' : state === 'no-signal' ? 'waiting' : state === 'pending' ? 'waiting' : 'off';
|
||||
});
|
||||
const sunText = computed(() => {
|
||||
const sunlit = view.value?.sunlit;
|
||||
if (sunlit === null || sunlit === undefined) return '';
|
||||
return sunlit ? t('Now: in sunlight') : t("Now: in the Earth's shadow");
|
||||
});
|
||||
const stationWords = computed(() => ({
|
||||
expandLabel: t('Expand Station section'),
|
||||
collapseLabel: t('Collapse Station section'),
|
||||
expandTitle: t('Expand Station'),
|
||||
collapseTitle: t('Collapse Station'),
|
||||
}));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RailPanel id="station-panel" tag="section" start-collapsed :hidden="!view" v-class-toggle="{ 'station-manual': manual }" :aria-label="t('Controls for the selected space station')" :title="t('STATION')" :toggle-words="stationWords" :glow="false" scroll>
|
||||
<template #badge><span id="station-badge" class="station-badge">{{ view ? view.title : '' }}</span></template>
|
||||
<template v-if="view">
|
||||
<div class="station-subject">{{ view.subject }}</div>
|
||||
<div class="station-modes" role="radiogroup" :aria-label="t('Mode')">
|
||||
<button id="station-automatic-btn" type="button" role="radio" class="station-mode" :aria-checked="String(!manual)" v-class-toggle="{ 'is-active': !manual }" @click="act('setStationMode', 'automatic')">{{ t('Automatic') }}</button>
|
||||
<button id="station-manual-btn" type="button" role="radio" class="station-mode" :aria-checked="String(manual)" v-class-toggle="{ 'is-active': manual }" @click="act('setStationMode', 'manual')">{{ t('Manual') }}</button>
|
||||
</div>
|
||||
<p id="station-telemetry" class="station-telemetry" :data-tone="telemetryTone" role="status" aria-live="polite"><span class="station-telemetry-dot" aria-hidden="true"></span>{{ telemetryText }}</p>
|
||||
<p v-if="!manual && sunText" id="station-sun" class="station-note">{{ sunText }}</p>
|
||||
<p v-if="!manual && view.note" class="station-note">{{ t(view.note) }}</p>
|
||||
<template v-if="manual">
|
||||
<div v-for="group in view.groups" :key="group.id" class="station-group">
|
||||
<div class="station-label">{{ t(group.label) }}</div>
|
||||
<div v-if="group.kind === 'choices'" class="station-row" role="group" :aria-label="t(group.label)">
|
||||
<button v-for="choice in group.choices" :key="choice.id" type="button" class="station-button" :data-station-choice="`${group.id}:${choice.id}`" v-class-toggle="{ 'is-active': choice.active }" :aria-pressed="String(choice.active)" @click="act('chooseStation', group.id, choice.id)">{{ t(choice.label) }}</button>
|
||||
</div>
|
||||
<div v-else class="station-sliders">
|
||||
<label v-for="slider in group.sliders" :key="slider.id" class="station-slider">
|
||||
<span>{{ t(slider.label) }}</span>
|
||||
<UiSlider :id="`station-slider-${slider.id}`" :min="slider.min" :max="slider.max" :model-value="slider.value" :aria-label="t(slider.label)" @update:model-value="act('slideStation', slider.id, $event)" />
|
||||
<output class="gev-slider-value">{{ formatNumber(slider.value) }}°</output>
|
||||
</label>
|
||||
<button v-if="group.resume" type="button" class="station-button" :data-station-resume="group.id" @click="act('resumeStationArm', group.id)">{{ t(group.resume) }}</button>
|
||||
</div>
|
||||
<p v-if="group.note" class="station-note">{{ t(group.note) }}</p>
|
||||
</div>
|
||||
</template>
|
||||
<button v-if="view.zoom.offered" id="station-zoom-btn" type="button" class="station-button station-zoom" @click="act('zoomStation')">{{ t(view.zoom.label) }}</button>
|
||||
</template>
|
||||
</RailPanel>
|
||||
</template>
|
||||
Reference in new issue
Block a user