mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 18:22:25 +00:00
Smaller review items: comment placement, dead helpers, locale clock, LIVE republish, STATION keyboard and touch
- getLiveSubjectKeys no longer sits between trackById's comment and body. - issCommandSunPoses and issCommandStatusText go: nothing called them. - The STATION section's 'no signal since' time is formatted in the app's locale (formatDate), not the browser's. - LiveControls sends an unchanged view only once: the 2 s refresh resends nothing (tested). - The STATION mode radios take arrow keys and keep only the checked one in the tab order; the LIVE stream arrows are 44 px on a coarse pointer.
This commit is contained in:
1 parent
2c9a268694
commit
7d0f9f677f
7 files changed
+50
-48
No files matched your search
Vendored
+6
-6
@@ -440,12 +440,6 @@ export function createControls({ state: layerState, services, parts, source }) {
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Track a satellite by NORAD id (camera follow + orbit path + highlight),
|
||||
* same path as clicking its point.
|
||||
* @param {string|number} noradId NORAD catalog number.
|
||||
* @returns {boolean} True if tracking started.
|
||||
*/
|
||||
/**
|
||||
* The keys the LIVE section matches streams by for the tracked
|
||||
* satellite: a station is `station:<key>` (`station:iss`,
|
||||
@@ -458,6 +452,12 @@ export function createControls({ state: layerState, services, parts, source }) {
|
||||
return station ? [`station:${station.key}`] : [];
|
||||
},
|
||||
|
||||
/**
|
||||
* Track a satellite by NORAD id (camera follow + orbit path + highlight),
|
||||
* same path as clicking its point.
|
||||
* @param {string|number} noradId NORAD catalog number.
|
||||
* @returns {boolean} True if tracking started.
|
||||
*/
|
||||
trackById(noradId, { origin = 'programmatic' } = {}) {
|
||||
const id = Number(noradId);
|
||||
if (
|
||||
|
||||
@@ -5,36 +5,9 @@ const unit = (v) => {
|
||||
return v.map((c) => c / n);
|
||||
};
|
||||
|
||||
/**
|
||||
* The Sun positions Manual offers, on the model's axes (port, zenith,
|
||||
* forward), and whether the station is lit there.
|
||||
* @returns {Array<{label: string, sun: number[], sunlit: boolean}>}
|
||||
*/
|
||||
export function issCommandSunPoses() {
|
||||
return [
|
||||
{ label: t('Overhead'), sun: [0, 1, 0], sunlit: true },
|
||||
{ label: t('Ahead'), sun: unit([0, 0.05, 1]), sunlit: true },
|
||||
{ label: t('Behind'), sun: unit([0, 0.05, -1]), sunlit: true },
|
||||
{ label: t('Below'), sun: unit([0, -1, 0.05]), sunlit: true },
|
||||
{ label: t('Port side'), sun: unit([0.8, 0.5, 0.3]), sunlit: true },
|
||||
{ label: t('Starboard side'), sun: unit([-0.8, 0.5, 0.3]), sunlit: true },
|
||||
{ label: t('Night (shadow)'), sun: [0, -1, 0], sunlit: false },
|
||||
];
|
||||
}
|
||||
|
||||
/** Where "Zoom to the ISS" stops: the whole 109 m station fills the view. */
|
||||
export const ISS_COMMAND_ZOOM_RANGE_M = 260;
|
||||
|
||||
/**
|
||||
* The Automatic mode's status line.
|
||||
* @param {boolean|null} sunlit Null while the model has not been placed yet.
|
||||
* @returns {string}
|
||||
*/
|
||||
export function issCommandStatusText(sunlit) {
|
||||
if (sunlit === null) return '';
|
||||
return sunlit ? t('Now: in sunlight') : t("Now: in the Earth's shadow");
|
||||
}
|
||||
|
||||
/** Beyond this the camera counts as far, and the zoom button is offered. */
|
||||
export const ISS_COMMAND_FAR_M = 1000;
|
||||
|
||||
|
||||
@@ -45,14 +45,6 @@ test('the zoom is offered only from far away', async () => {
|
||||
assert.equal(issCommandOffersZoom(150), false);
|
||||
});
|
||||
|
||||
test('the status line says lit or in shadow, and nothing before the model is placed', async () => {
|
||||
const { issCommandStatusText } = await import('./issCommand.js');
|
||||
assert.equal(issCommandStatusText(null), '');
|
||||
assert.notEqual(issCommandStatusText(true), issCommandStatusText(false));
|
||||
assert.ok(issCommandStatusText(true).length > 0);
|
||||
assert.ok(issCommandStatusText(false).length > 0);
|
||||
});
|
||||
|
||||
test('an object docked to the ISS is the station too', async () => {
|
||||
const { issTrackedOnStation } = await import('./policy.js');
|
||||
const NAUKA = 49044;
|
||||
|
||||
Reference in new issue
Block a user