@ksp-gonogo/sitrep-sdk 1.0.0-rc.21 → 2.0.0-rc.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/__generated__/command-map.d.ts +140 -11
- package/dist/__generated__/command-map.d.ts.map +1 -1
- package/dist/__generated__/command-map.js +6 -3
- package/dist/__generated__/command-map.js.map +1 -1
- package/dist/__generated__/contract.d.ts +591 -425
- package/dist/__generated__/contract.d.ts.map +1 -1
- package/dist/__generated__/contract.js +34 -4
- package/dist/__generated__/contract.js.map +1 -1
- package/dist/__generated__/error-codes.d.ts +46 -55
- package/dist/__generated__/error-codes.d.ts.map +1 -1
- package/dist/__generated__/error-codes.js +76 -69
- package/dist/__generated__/error-codes.js.map +1 -1
- package/dist/__generated__/test-theme.d.ts +3 -0
- package/dist/__generated__/test-theme.d.ts.map +1 -1
- package/dist/__generated__/test-theme.js +3 -0
- package/dist/__generated__/test-theme.js.map +1 -1
- package/dist/__generated__/topic-map.d.ts +90 -2
- package/dist/__generated__/topic-map.d.ts.map +1 -1
- package/dist/__generated__/topic-map.js +2 -0
- package/dist/__generated__/topic-map.js.map +1 -1
- package/dist/__generated__/units.d.ts.map +1 -1
- package/dist/__generated__/units.js +89 -47
- package/dist/__generated__/units.js.map +1 -1
- package/dist/api/alarm-request.d.ts +6 -1
- package/dist/api/alarm-request.d.ts.map +1 -1
- package/dist/api/alarm-request.js +7 -1
- package/dist/api/alarm-request.js.map +1 -1
- package/dist/api/contribution-slots.d.ts +87 -17
- package/dist/api/contribution-slots.d.ts.map +1 -1
- package/dist/api/coverage/CoverageMaskCache.d.ts +1 -1
- package/dist/api/coverage/CoverageMaskCache.js +1 -1
- package/dist/api/coverage-source.d.ts +3 -1
- package/dist/api/coverage-source.d.ts.map +1 -1
- package/dist/api/coverage-source.js +3 -1
- package/dist/api/coverage-source.js.map +1 -1
- package/dist/api/framework-reads.d.ts +20 -0
- package/dist/api/framework-reads.d.ts.map +1 -0
- package/dist/api/framework-reads.js +30 -0
- package/dist/api/framework-reads.js.map +1 -0
- package/dist/api/host.d.ts +8 -5
- package/dist/api/host.d.ts.map +1 -1
- package/dist/api/host.js.map +1 -1
- package/dist/api/index.d.ts +96 -17
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +91 -10
- package/dist/api/index.js.map +1 -1
- package/dist/api/logger.d.ts +14 -2
- package/dist/api/logger.d.ts.map +1 -1
- package/dist/api/logger.js +14 -2
- package/dist/api/logger.js.map +1 -1
- package/dist/api/plot-layers.d.ts +81 -6
- package/dist/api/plot-layers.d.ts.map +1 -1
- package/dist/api/plot-layers.js +4 -3
- package/dist/api/plot-layers.js.map +1 -1
- package/dist/api/plots.d.ts +19 -0
- package/dist/api/plots.d.ts.map +1 -1
- package/dist/api/registry.d.ts +11 -0
- package/dist/api/registry.d.ts.map +1 -1
- package/dist/api/registry.js.map +1 -1
- package/dist/api/settings/SettingsContext.d.ts +5 -4
- package/dist/api/settings/SettingsContext.d.ts.map +1 -1
- package/dist/api/settings/SettingsContext.js +13 -4
- package/dist/api/settings/SettingsContext.js.map +1 -1
- package/dist/api/settings/SettingsService.d.ts +3 -0
- package/dist/api/settings/SettingsService.d.ts.map +1 -1
- package/dist/api/settings/SettingsService.js +3 -0
- package/dist/api/settings/SettingsService.js.map +1 -1
- package/dist/api/settings/store.d.ts +3 -1
- package/dist/api/settings/store.d.ts.map +1 -1
- package/dist/api/settings/store.js +3 -1
- package/dist/api/settings/store.js.map +1 -1
- package/dist/api/slots.d.ts +94 -17
- package/dist/api/slots.d.ts.map +1 -1
- package/dist/api/station-brokers.d.ts +2 -1
- package/dist/api/station-brokers.d.ts.map +1 -1
- package/dist/api/station-brokers.js +2 -1
- package/dist/api/station-brokers.js.map +1 -1
- package/dist/api/stock-bodies.d.ts.map +1 -1
- package/dist/api/stock-bodies.js +6 -0
- package/dist/api/stock-bodies.js.map +1 -1
- package/dist/api/tiny-size.d.ts +2 -0
- package/dist/api/tiny-size.d.ts.map +1 -1
- package/dist/api/tiny-size.js +6 -1
- package/dist/api/tiny-size.js.map +1 -1
- package/dist/api/tone.d.ts +7 -4
- package/dist/api/tone.d.ts.map +1 -1
- package/dist/api/tone.js.map +1 -1
- package/dist/api/transport.d.ts +10 -2
- package/dist/api/transport.d.ts.map +1 -1
- package/dist/api/types.d.ts +179 -120
- package/dist/api/types.d.ts.map +1 -1
- package/dist/binary-frame.d.ts +26 -25
- package/dist/binary-frame.d.ts.map +1 -1
- package/dist/binary-frame.js +25 -25
- package/dist/binary-frame.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/combine-readings.d.ts +8 -4
- package/dist/combine-readings.d.ts.map +1 -1
- package/dist/combine-readings.js +6 -4
- package/dist/combine-readings.js.map +1 -1
- package/dist/command-delay.d.ts +6 -0
- package/dist/command-delay.d.ts.map +1 -1
- package/dist/command-delay.js.map +1 -1
- package/dist/commands.d.ts +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/compat-versions.d.ts +1 -1
- package/dist/compat-versions.d.ts.map +1 -1
- package/dist/compat-versions.js +2 -2
- package/dist/compat-versions.js.map +1 -1
- package/dist/contract-enum-names.d.ts +2 -3
- package/dist/contract-enum-names.d.ts.map +1 -1
- package/dist/contract-enum-names.js +2 -3
- package/dist/contract-enum-names.js.map +1 -1
- package/dist/enum-names.d.ts +5 -3
- package/dist/enum-names.d.ts.map +1 -1
- package/dist/enum-names.js +5 -3
- package/dist/enum-names.js.map +1 -1
- package/dist/envelope.d.ts +3 -3
- package/dist/envelope.d.ts.map +1 -1
- package/dist/flight/BufferedDataSource.d.ts.map +1 -1
- package/dist/flight/BufferedDataSource.js +4 -2
- package/dist/flight/BufferedDataSource.js.map +1 -1
- package/dist/flight/types.d.ts +3 -2
- package/dist/flight/types.d.ts.map +1 -1
- package/dist/frames/index.d.ts +19 -17
- package/dist/frames/index.d.ts.map +1 -1
- package/dist/frames/index.js +13 -12
- package/dist/frames/index.js.map +1 -1
- package/dist/index.d.ts +20 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/ksp-enum-names.d.ts +23 -8
- package/dist/ksp-enum-names.d.ts.map +1 -1
- package/dist/ksp-enum-names.js +20 -8
- package/dist/ksp-enum-names.js.map +1 -1
- package/dist/media/radio-support.d.ts +12 -3
- package/dist/media/radio-support.d.ts.map +1 -1
- package/dist/media/radio-support.js +12 -3
- package/dist/media/radio-support.js.map +1 -1
- package/dist/perf/PerfBudget.d.ts +7 -5
- package/dist/perf/PerfBudget.d.ts.map +1 -1
- package/dist/perf/PerfBudget.js +8 -6
- package/dist/perf/PerfBudget.js.map +1 -1
- package/dist/reading.d.ts +12 -2
- package/dist/reading.d.ts.map +1 -1
- package/dist/reading.js +7 -2
- package/dist/reading.js.map +1 -1
- package/dist/reads-index.json +3675 -0
- package/dist/spine/body-pose.d.ts +85 -0
- package/dist/spine/body-pose.d.ts.map +1 -0
- package/dist/spine/body-pose.js +166 -0
- package/dist/spine/body-pose.js.map +1 -0
- package/dist/spine/capability-lock.d.ts +6 -2
- package/dist/spine/capability-lock.d.ts.map +1 -1
- package/dist/spine/capability-lock.js +8 -2
- package/dist/spine/capability-lock.js.map +1 -1
- package/dist/spine/catalogue-elements.d.ts +28 -0
- package/dist/spine/catalogue-elements.d.ts.map +1 -0
- package/dist/spine/catalogue-elements.js +63 -0
- package/dist/spine/catalogue-elements.js.map +1 -0
- package/dist/spine/celestial-facts.d.ts +5 -7
- package/dist/spine/celestial-facts.d.ts.map +1 -1
- package/dist/spine/celestial-facts.js +10 -21
- package/dist/spine/celestial-facts.js.map +1 -1
- package/dist/spine/client-timeline.d.ts +10 -12
- package/dist/spine/client-timeline.d.ts.map +1 -1
- package/dist/spine/client-timeline.js.map +1 -1
- package/dist/spine/client.d.ts +31 -0
- package/dist/spine/client.d.ts.map +1 -1
- package/dist/spine/client.js +97 -19
- package/dist/spine/client.js.map +1 -1
- package/dist/spine/command-gate.d.ts +13 -11
- package/dist/spine/command-gate.d.ts.map +1 -1
- package/dist/spine/command-gate.js +2 -2
- package/dist/spine/command-gate.js.map +1 -1
- package/dist/spine/command-group.d.ts +62 -0
- package/dist/spine/command-group.d.ts.map +1 -0
- package/dist/spine/command-group.js +172 -0
- package/dist/spine/command-group.js.map +1 -0
- package/dist/spine/comms-delay-reckoning.js.map +1 -1
- package/dist/spine/comms-journey.d.ts +9 -0
- package/dist/spine/comms-journey.d.ts.map +1 -1
- package/dist/spine/comms-journey.js +27 -0
- package/dist/spine/comms-journey.js.map +1 -1
- package/dist/spine/comms-path-geometry.d.ts +3 -3
- package/dist/spine/comms-path-geometry.d.ts.map +1 -1
- package/dist/spine/comms-path-geometry.js.map +1 -1
- package/dist/spine/connection-error-warning.d.ts +1 -1
- package/dist/spine/connection-error-warning.js +1 -1
- package/dist/spine/context.d.ts.map +1 -1
- package/dist/spine/context.js +4 -0
- package/dist/spine/context.js.map +1 -1
- package/dist/spine/contributions.d.ts +13 -13
- package/dist/spine/contributions.js +13 -13
- package/dist/spine/core-reckoners.d.ts.map +1 -1
- package/dist/spine/core-reckoners.js +2 -2
- package/dist/spine/core-reckoners.js.map +1 -1
- package/dist/spine/held-command-actions.d.ts +3 -0
- package/dist/spine/held-command-actions.d.ts.map +1 -1
- package/dist/spine/held-command-actions.js +12 -7
- package/dist/spine/held-command-actions.js.map +1 -1
- package/dist/spine/impact-point.d.ts.map +1 -1
- package/dist/spine/impact-point.js +6 -29
- package/dist/spine/impact-point.js.map +1 -1
- package/dist/spine/index.d.ts +5 -0
- package/dist/spine/index.d.ts.map +1 -1
- package/dist/spine/index.js +5 -0
- package/dist/spine/index.js.map +1 -1
- package/dist/spine/kepler-reckoning.d.ts +2 -2
- package/dist/spine/kepler-reckoning.d.ts.map +1 -1
- package/dist/spine/kepler-reckoning.js.map +1 -1
- package/dist/spine/kepler.d.ts +8 -6
- package/dist/spine/kepler.d.ts.map +1 -1
- package/dist/spine/kepler.js +3 -1
- package/dist/spine/kepler.js.map +1 -1
- package/dist/spine/lagrange.d.ts +6 -6
- package/dist/spine/lagrange.d.ts.map +1 -1
- package/dist/spine/lagrange.js.map +1 -1
- package/dist/spine/lifecycle.d.ts +14 -0
- package/dist/spine/lifecycle.d.ts.map +1 -1
- package/dist/spine/lifecycle.js.map +1 -1
- package/dist/spine/lock-scope.d.ts +11 -1
- package/dist/spine/lock-scope.d.ts.map +1 -1
- package/dist/spine/lock-scope.js.map +1 -1
- package/dist/spine/map-command.d.ts +3 -11
- package/dist/spine/map-command.d.ts.map +1 -1
- package/dist/spine/map-command.js +3 -11
- package/dist/spine/map-command.js.map +1 -1
- package/dist/spine/mod-settings.d.ts.map +1 -1
- package/dist/spine/mod-settings.js +1 -0
- package/dist/spine/mod-settings.js.map +1 -1
- package/dist/spine/never-reckonable.d.ts.map +1 -1
- package/dist/spine/never-reckonable.js +8 -6
- package/dist/spine/never-reckonable.js.map +1 -1
- package/dist/spine/orbit-patches.d.ts +16 -4
- package/dist/spine/orbit-patches.d.ts.map +1 -1
- package/dist/spine/orbit-patches.js +12 -5
- package/dist/spine/orbit-patches.js.map +1 -1
- package/dist/spine/orbit-trajectory.d.ts +60 -3
- package/dist/spine/orbit-trajectory.d.ts.map +1 -1
- package/dist/spine/orbit-trajectory.js +133 -40
- package/dist/spine/orbit-trajectory.js.map +1 -1
- package/dist/spine/orbital-solve.js +1 -1
- package/dist/spine/own-craft-vantage.d.ts.map +1 -1
- package/dist/spine/own-craft-vantage.js +1 -0
- package/dist/spine/own-craft-vantage.js.map +1 -1
- package/dist/spine/past-track.d.ts +7 -7
- package/dist/spine/past-track.js +7 -7
- package/dist/spine/phase-angle.d.ts +19 -0
- package/dist/spine/phase-angle.d.ts.map +1 -0
- package/dist/spine/phase-angle.js +47 -0
- package/dist/spine/phase-angle.js.map +1 -0
- package/dist/spine/powered-reckoning.js.map +1 -1
- package/dist/spine/processors.d.ts +4 -1
- package/dist/spine/processors.d.ts.map +1 -1
- package/dist/spine/processors.js.map +1 -1
- package/dist/spine/reckoners.d.ts +3 -6
- package/dist/spine/reckoners.d.ts.map +1 -1
- package/dist/spine/reckoners.js +3 -6
- package/dist/spine/reckoners.js.map +1 -1
- package/dist/spine/reference-frame.d.ts +14 -14
- package/dist/spine/reference-frame.d.ts.map +1 -1
- package/dist/spine/reference-frame.js +3 -64
- package/dist/spine/reference-frame.js.map +1 -1
- package/dist/spine/settings-registry.d.ts +17 -9
- package/dist/spine/settings-registry.d.ts.map +1 -1
- package/dist/spine/settings-registry.js.map +1 -1
- package/dist/spine/settings-tabs.d.ts +4 -3
- package/dist/spine/settings-tabs.d.ts.map +1 -1
- package/dist/spine/settings-tabs.js.map +1 -1
- package/dist/spine/target-range-reckoning.d.ts.map +1 -1
- package/dist/spine/target-range-reckoning.js.map +1 -1
- package/dist/spine/timeline-store.d.ts +3 -1
- package/dist/spine/timeline-store.d.ts.map +1 -1
- package/dist/spine/timeline-store.js +2 -2
- package/dist/spine/timeline-store.js.map +1 -1
- package/dist/spine/topic-ownership.d.ts +2 -2
- package/dist/spine/topic-ownership.js +2 -2
- package/dist/spine/uplink-clients.d.ts +4 -4
- package/dist/spine/uplink-clients.d.ts.map +1 -1
- package/dist/spine/uplink-clients.js +1 -0
- package/dist/spine/uplink-clients.js.map +1 -1
- package/dist/spine/use-body-states.d.ts +3 -7
- package/dist/spine/use-body-states.d.ts.map +1 -1
- package/dist/spine/use-body-states.js +3 -7
- package/dist/spine/use-body-states.js.map +1 -1
- package/dist/spine/use-command.d.ts.map +1 -1
- package/dist/spine/use-command.js +151 -109
- package/dist/spine/use-command.js.map +1 -1
- package/dist/spine/use-data-sources.d.ts +2 -5
- package/dist/spine/use-data-sources.d.ts.map +1 -1
- package/dist/spine/use-data-sources.js.map +1 -1
- package/dist/spine/use-late-telemetry-subscribe.d.ts.map +1 -1
- package/dist/spine/use-late-telemetry-subscribe.js +1 -0
- package/dist/spine/use-late-telemetry-subscribe.js.map +1 -1
- package/dist/spine/use-orbit-curve.d.ts +33 -0
- package/dist/spine/use-orbit-curve.d.ts.map +1 -0
- package/dist/spine/use-orbit-curve.js +28 -0
- package/dist/spine/use-orbit-curve.js.map +1 -0
- package/dist/spine/use-orbit-trajectory.d.ts +6 -1
- package/dist/spine/use-orbit-trajectory.d.ts.map +1 -1
- package/dist/spine/use-orbit-trajectory.js +44 -2
- package/dist/spine/use-orbit-trajectory.js.map +1 -1
- package/dist/spine/use-selected-vantage.d.ts.map +1 -1
- package/dist/spine/use-selected-vantage.js +1 -0
- package/dist/spine/use-selected-vantage.js.map +1 -1
- package/dist/spine/use-system-instant.d.ts +16 -0
- package/dist/spine/use-system-instant.d.ts.map +1 -0
- package/dist/spine/use-system-instant.js +20 -0
- package/dist/spine/use-system-instant.js.map +1 -0
- package/dist/spine/use-transmissions.d.ts.map +1 -1
- package/dist/spine/use-transmissions.js +1 -0
- package/dist/spine/use-transmissions.js.map +1 -1
- package/dist/spine/view-clock.d.ts +1 -1
- package/dist/spine/view-clock.d.ts.map +1 -1
- package/dist/spine/view-clock.js +13 -3
- package/dist/spine/view-clock.js.map +1 -1
- package/dist/system-instant.d.ts +16 -0
- package/dist/system-instant.d.ts.map +1 -0
- package/dist/system-instant.js +20 -0
- package/dist/system-instant.js.map +1 -0
- package/dist/testing/console-logger.d.ts +3 -3
- package/dist/testing/console-logger.js +3 -3
- package/dist/testing/fake-wall-clock.d.ts +4 -2
- package/dist/testing/fake-wall-clock.d.ts.map +1 -1
- package/dist/testing/fake-wall-clock.js +4 -2
- package/dist/testing/fake-wall-clock.js.map +1 -1
- package/dist/testing/install-act-gate-stretch.d.ts +9 -0
- package/dist/testing/install-act-gate-stretch.d.ts.map +1 -1
- package/dist/testing/install-act-gate-stretch.js +9 -0
- package/dist/testing/install-act-gate-stretch.js.map +1 -1
- package/dist/testing/install-real-test-host.d.ts +4 -1
- package/dist/testing/install-real-test-host.d.ts.map +1 -1
- package/dist/testing/install-real-test-host.js +2 -0
- package/dist/testing/install-real-test-host.js.map +1 -1
- package/dist/testing/memory-storage.d.ts +2 -3
- package/dist/testing/memory-storage.d.ts.map +1 -1
- package/dist/testing/memory-storage.js +6 -5
- package/dist/testing/memory-storage.js.map +1 -1
- package/dist/testing/mock-data-source.d.ts +2 -2
- package/dist/testing/render.d.ts +4 -2
- package/dist/testing/render.d.ts.map +1 -1
- package/dist/testing/render.js +4 -2
- package/dist/testing/render.js.map +1 -1
- package/dist/testing/stub-transport.d.ts +6 -0
- package/dist/testing/stub-transport.d.ts.map +1 -1
- package/dist/testing/stub-transport.js +64 -52
- package/dist/testing/stub-transport.js.map +1 -1
- package/dist/timeline.d.ts +14 -6
- package/dist/timeline.d.ts.map +1 -1
- package/dist/topic-fields.d.ts +1 -0
- package/dist/topic-fields.d.ts.map +1 -1
- package/dist/topic-fields.js.map +1 -1
- package/dist/topics.d.ts +42 -2
- package/dist/topics.d.ts.map +1 -1
- package/dist/topics.js +33 -24
- package/dist/topics.js.map +1 -1
- package/dist/unit-system/registry.d.ts +11 -0
- package/dist/unit-system/registry.d.ts.map +1 -1
- package/dist/unit-system/registry.js.map +1 -1
- package/dist/unit-system/value.d.ts +3 -0
- package/dist/unit-system/value.d.ts.map +1 -1
- package/dist/unit-system/value.js.map +1 -1
- package/dist/units.js +1 -1
- package/dist/uplink-externals.d.ts +9 -4
- package/dist/uplink-externals.d.ts.map +1 -1
- package/dist/uplink-externals.js +9 -4
- package/dist/uplink-externals.js.map +1 -1
- package/dist/uplink-manifest.d.ts +62 -16
- package/dist/uplink-manifest.d.ts.map +1 -1
- package/dist/uplink-manifest.js.map +1 -1
- package/package.json +4 -3
- package/src/__generated__/command-map.ts +140 -10
- package/src/__generated__/contract.ts +598 -429
- package/src/__generated__/error-codes.ts +76 -69
- package/src/__generated__/test-theme.ts +3 -0
- package/src/__generated__/topic-map.ts +92 -0
- package/src/__generated__/units.json +630 -52
- package/src/__generated__/units.ts +89 -47
- package/src/api/alarm-request.ts +7 -1
- package/src/api/contribution-slots.ts +95 -20
- package/src/api/coverage/CoverageMaskCache.ts +1 -1
- package/src/api/coverage-source.ts +3 -1
- package/src/api/framework-reads.ts +29 -0
- package/src/api/host.ts +13 -4
- package/src/api/index.ts +113 -14
- package/src/api/logger.ts +14 -2
- package/src/api/plot-layers.ts +72 -6
- package/src/api/plots.ts +19 -0
- package/src/api/registry.ts +11 -0
- package/src/api/settings/SettingsContext.tsx +17 -5
- package/src/api/settings/SettingsService.ts +3 -0
- package/src/api/settings/store.ts +3 -1
- package/src/api/slots.ts +97 -28
- package/src/api/station-brokers.ts +2 -1
- package/src/api/stock-bodies.ts +6 -0
- package/src/api/tiny-size.ts +6 -1
- package/src/api/tone.ts +7 -4
- package/src/api/transport.ts +13 -2
- package/src/api/types.ts +214 -154
- package/src/binary-frame.ts +26 -25
- package/src/client.ts +2 -0
- package/src/combine-readings.ts +8 -4
- package/src/command-delay.ts +6 -0
- package/src/compat-versions.ts +2 -2
- package/src/contract-enum-names.ts +2 -3
- package/src/enum-names.ts +5 -3
- package/src/envelope.ts +9 -1
- package/src/flight/BufferedDataSource.ts +4 -2
- package/src/flight/types.ts +3 -2
- package/src/frames/index.ts +29 -16
- package/src/index.ts +32 -0
- package/src/ksp-enum-names.ts +23 -8
- package/src/media/radio-support.ts +12 -3
- package/src/perf/PerfBudget.ts +8 -6
- package/src/reading.ts +20 -4
- package/src/spine/body-pose.ts +251 -0
- package/src/spine/capability-lock.ts +17 -4
- package/src/spine/catalogue-elements.ts +75 -0
- package/src/spine/celestial-facts.ts +10 -35
- package/src/spine/client-timeline.ts +10 -12
- package/src/spine/client.ts +127 -19
- package/src/spine/command-gate.ts +13 -11
- package/src/spine/command-group.ts +278 -0
- package/src/spine/comms-delay-reckoning.ts +2 -2
- package/src/spine/comms-journey.ts +29 -0
- package/src/spine/comms-path-geometry.ts +4 -4
- package/src/spine/connection-error-warning.ts +1 -1
- package/src/spine/context.tsx +4 -0
- package/src/spine/contributions.ts +13 -13
- package/src/spine/core-reckoners.ts +2 -5
- package/src/spine/held-command-actions.ts +18 -6
- package/src/spine/impact-point.ts +8 -35
- package/src/spine/index.ts +5 -0
- package/src/spine/kepler-reckoning.ts +2 -2
- package/src/spine/kepler.ts +9 -7
- package/src/spine/lagrange.ts +6 -6
- package/src/spine/lifecycle.ts +14 -0
- package/src/spine/lock-scope.ts +11 -1
- package/src/spine/map-command.ts +3 -11
- package/src/spine/mod-settings.ts +1 -0
- package/src/spine/never-reckonable.ts +8 -6
- package/src/spine/orbit-patches.ts +33 -6
- package/src/spine/orbit-trajectory.ts +172 -57
- package/src/spine/orbital-solve.ts +1 -1
- package/src/spine/own-craft-vantage.tsx +1 -0
- package/src/spine/past-track.ts +7 -7
- package/src/spine/phase-angle.ts +51 -0
- package/src/spine/powered-reckoning.ts +16 -16
- package/src/spine/processors.ts +4 -1
- package/src/spine/reckoners.ts +3 -6
- package/src/spine/reference-frame.ts +49 -115
- package/src/spine/settings-registry.ts +17 -9
- package/src/spine/settings-tabs.ts +4 -3
- package/src/spine/target-range-reckoning.ts +3 -3
- package/src/spine/timeline-store.ts +6 -1
- package/src/spine/topic-ownership.ts +2 -2
- package/src/spine/uplink-clients.ts +5 -4
- package/src/spine/use-body-states.ts +3 -7
- package/src/spine/use-command.ts +167 -125
- package/src/spine/use-data-sources.ts +2 -5
- package/src/spine/use-late-telemetry-subscribe.ts +1 -0
- package/src/spine/use-orbit-curve.ts +49 -0
- package/src/spine/use-orbit-trajectory.ts +54 -2
- package/src/spine/use-selected-vantage.ts +1 -0
- package/src/spine/use-system-instant.ts +20 -0
- package/src/spine/use-transmissions.ts +1 -0
- package/src/spine/view-clock.ts +20 -3
- package/src/system-instant.ts +20 -0
- package/src/testing/console-logger.ts +3 -3
- package/src/testing/fake-wall-clock.ts +4 -2
- package/src/testing/install-act-gate-stretch.ts +9 -0
- package/src/testing/install-real-test-host.ts +6 -1
- package/src/testing/memory-storage.ts +6 -5
- package/src/testing/mock-data-source.ts +2 -2
- package/src/testing/render.tsx +4 -2
- package/src/testing/stub-transport.ts +66 -52
- package/src/timeline.ts +14 -6
- package/src/topic-fields.ts +1 -0
- package/src/topics.ts +59 -26
- package/src/unit-system/registry.ts +11 -0
- package/src/unit-system/value.ts +3 -0
- package/src/units.ts +1 -1
- package/src/uplink-externals.ts +9 -4
- package/src/uplink-manifest.ts +62 -16
package/src/spine/context.tsx
CHANGED
|
@@ -406,6 +406,7 @@ export function useTelemetryClientOptional(): TelemetryClient | undefined {
|
|
|
406
406
|
export function useStreamRecorder(
|
|
407
407
|
options?: StreamRecorderOptions,
|
|
408
408
|
): StreamRecorder | undefined {
|
|
409
|
+
// gonogo:reads none
|
|
409
410
|
const client = useTelemetryClientOptional();
|
|
410
411
|
const recordAllTopics = options?.recordAllTopics ?? false;
|
|
411
412
|
return useMemo(
|
|
@@ -534,6 +535,7 @@ function removeLast<Item>(stack: Item[], item: Item): void {
|
|
|
534
535
|
}
|
|
535
536
|
|
|
536
537
|
export function useViewClock(): ViewClockView {
|
|
538
|
+
// gonogo:reads none
|
|
537
539
|
return useTelemetryStore().clock;
|
|
538
540
|
}
|
|
539
541
|
|
|
@@ -546,6 +548,7 @@ export function useViewClock(): ViewClockView {
|
|
|
546
548
|
* provider being in the tree.
|
|
547
549
|
*/
|
|
548
550
|
export function useViewClockOptional(): ViewClockView | undefined {
|
|
551
|
+
// gonogo:reads none
|
|
549
552
|
return useTelemetryStoreOptional()?.clock;
|
|
550
553
|
}
|
|
551
554
|
|
|
@@ -652,6 +655,7 @@ function useFrameInstant(
|
|
|
652
655
|
* predicted" distinction to wait out.
|
|
653
656
|
*/
|
|
654
657
|
export function useUtNow(): number | undefined {
|
|
658
|
+
// gonogo:reads none
|
|
655
659
|
const store = useTelemetryStoreOptional();
|
|
656
660
|
const clock = store?.clock;
|
|
657
661
|
const [utNow, setUtNow] = useState<number | undefined>(() => {
|
|
@@ -120,29 +120,29 @@ export const DEFAULT_CONTRIBUTION_PRIORITY = 1;
|
|
|
120
120
|
* Every contribution that WINS the slot: the highest priority band present, in
|
|
121
121
|
* registration order.
|
|
122
122
|
*
|
|
123
|
-
*
|
|
123
|
+
* Equal priority is not a tie to break. Everyone in the winning band renders,
|
|
124
124
|
* which is what lets two mutually-unaware mods both put their vessels on one
|
|
125
125
|
* diagram; only a STRICTLY higher band displaces. Nothing sets a priority unless
|
|
126
126
|
* it means to, so the ordinary case is one band holding every contributor,
|
|
127
|
-
* exactly as before
|
|
127
|
+
* exactly as before.
|
|
128
128
|
*
|
|
129
|
-
*
|
|
129
|
+
* What the band buys is a host widget filling its OWN slot. It contributes
|
|
130
130
|
* what it can read at one below {@link DEFAULT_CONTRIBUTION_PRIORITY}, so a
|
|
131
131
|
* career overhaul that can answer where the host cannot displaces it instead of
|
|
132
132
|
* appearing beside it as a second copy of the same list. It is the contribution
|
|
133
133
|
* twin of `AugmentDefinition.suppressesVanillaBase`, and it is declared by the
|
|
134
134
|
* contributor rather than by the host for the same reason: the host cannot know
|
|
135
|
-
* which of its guests supersedes it
|
|
135
|
+
* which of its guests supersedes it.
|
|
136
136
|
*
|
|
137
|
-
*
|
|
138
|
-
* by taking the host's band explicitly
|
|
137
|
+
* A contribution that means to render ALONGSIDE the host's own rows says so
|
|
138
|
+
* by taking the host's band explicitly.
|
|
139
139
|
*
|
|
140
|
-
*
|
|
140
|
+
* Self-contributing has a cost, and it is worth knowing before choosing it: a
|
|
141
141
|
* widget that reads its own data this way no longer renders anything without a
|
|
142
142
|
* `WidgetMetaContext` and a `ContributionsProvider` above it, and it fails by
|
|
143
143
|
* drawing an empty widget rather than by raising. See `useContributions`
|
|
144
144
|
* (`@ksp-gonogo/ui-kit`) for what that costs a test, and `clearContributions`
|
|
145
|
-
* below for the other half of it
|
|
145
|
+
* below for the other half of it.
|
|
146
146
|
*/
|
|
147
147
|
export function getContributionsForSlot(slot: string): AnyContribution[] {
|
|
148
148
|
const inSlot = Array.from(state().entries.values()).filter(
|
|
@@ -192,18 +192,18 @@ export function getContributionSettings(
|
|
|
192
192
|
/**
|
|
193
193
|
* For use in tests only, resets the contribution registry to empty.
|
|
194
194
|
*
|
|
195
|
-
*
|
|
196
|
-
* makes to its own slot
|
|
195
|
+
* **It empties the registry, which includes the contributions a HOST widget
|
|
196
|
+
* makes to its own slot.** Those register as a module side effect, at import,
|
|
197
197
|
* and nothing re-runs an import. So a test file that clears between cases leaves
|
|
198
198
|
* every case after the first rendering a host with none of its own data, which
|
|
199
199
|
* surfaces as a widget that draws its chrome and no content, and reads as a
|
|
200
|
-
* telemetry fault rather than as a registry that was emptied on purpose
|
|
200
|
+
* telemetry fault rather than as a registry that was emptied on purpose.
|
|
201
201
|
*
|
|
202
|
-
*
|
|
202
|
+
* A self-contributing widget therefore exports a function that performs its
|
|
203
203
|
* registration, for a test to call after clearing;
|
|
204
204
|
* `SpaceCenterStatus/facilitiesContribution.ts`'s
|
|
205
205
|
* `registerStockFacilityContribution` is the worked example. Re-registering the
|
|
206
|
-
* identical def is a no-op, so calling it when nothing was cleared is safe
|
|
206
|
+
* identical def is a no-op, so calling it when nothing was cleared is safe.
|
|
207
207
|
*/
|
|
208
208
|
export function clearContributions(): void {
|
|
209
209
|
const s = state();
|
|
@@ -716,7 +716,7 @@ function registerCommsDelayReckoner(): void {
|
|
|
716
716
|
observed,
|
|
717
717
|
craft: orbitPoint.payload,
|
|
718
718
|
peer: located,
|
|
719
|
-
facts: deriveCelestialFacts(bodiesPoint?.payload?.bodies
|
|
719
|
+
facts: deriveCelestialFacts(bodiesPoint?.payload?.bodies),
|
|
720
720
|
});
|
|
721
721
|
if ("declined" in fit) return fit;
|
|
722
722
|
return {
|
|
@@ -780,10 +780,7 @@ function registerTargetRosterReckoner(): void {
|
|
|
780
780
|
return { declined: { reason: "input-absent", input: "@vessel.orbit" } };
|
|
781
781
|
}
|
|
782
782
|
const craft = orbitPoint.payload;
|
|
783
|
-
const facts = deriveCelestialFacts(
|
|
784
|
-
bodiesPoint?.payload?.bodies,
|
|
785
|
-
reckonUt,
|
|
786
|
-
);
|
|
783
|
+
const facts = deriveCelestialFacts(bodiesPoint?.payload?.bodies);
|
|
787
784
|
const known = knownCraftOrbits(entries, facts).filter((k) =>
|
|
788
785
|
Number.isFinite(knownCraftRangeAt(craft, k, facts, reckonUt)),
|
|
789
786
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
2
|
import { isUnit } from "../unit-system/guards";
|
|
3
3
|
import { isValue, type Value } from "../unit-system/value";
|
|
4
|
+
import type { TelemetryClient } from "./client";
|
|
4
5
|
import { type HeldCommand, JOURNEY_TOPIC, readJourney } from "./comms-journey";
|
|
5
6
|
import { useTelemetryClientOptional } from "./context";
|
|
6
7
|
import { useLatestValue } from "./use-stream";
|
|
@@ -58,6 +59,21 @@ export function readUplinkActionReply(result: unknown): UplinkActionOutcome {
|
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
/** Sends a cancel or a send again for timeline `epoch`, and reads the reply. */
|
|
63
|
+
export async function sendUplinkAction(
|
|
64
|
+
client: TelemetryClient,
|
|
65
|
+
epoch: Value<"count">,
|
|
66
|
+
command: string,
|
|
67
|
+
args: Record<string, unknown>,
|
|
68
|
+
): Promise<UplinkActionOutcome> {
|
|
69
|
+
const { result } = client.dispatch(command, { epoch, ...args });
|
|
70
|
+
try {
|
|
71
|
+
return readUplinkActionReply(await result);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
return { refusal: error instanceof Error ? error.message : "refused" };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
61
77
|
/** The two actions a held command offers, bound to this session's client and the current timeline. */
|
|
62
78
|
export interface HeldCommandActions {
|
|
63
79
|
/** Cancels the command, or it and every later command on its lane. */
|
|
@@ -75,6 +91,7 @@ export interface HeldCommandActions {
|
|
|
75
91
|
* game load is refused rather than applied to a different game.
|
|
76
92
|
*/
|
|
77
93
|
export function useHeldCommandActions(): HeldCommandActions {
|
|
94
|
+
// gonogo:reads none
|
|
78
95
|
const client = useTelemetryClientOptional();
|
|
79
96
|
const journeyPayload = useLatestValue<unknown>(JOURNEY_TOPIC);
|
|
80
97
|
const epoch = useMemo(
|
|
@@ -90,12 +107,7 @@ export function useHeldCommandActions(): HeldCommandActions {
|
|
|
90
107
|
if (!client || epoch === undefined) {
|
|
91
108
|
return { refusal: "not connected" };
|
|
92
109
|
}
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
return readUplinkActionReply(await result);
|
|
96
|
-
} catch (error) {
|
|
97
|
-
return { refusal: error instanceof Error ? error.message : "refused" };
|
|
98
|
-
}
|
|
110
|
+
return sendUplinkAction(client, epoch, command, args);
|
|
99
111
|
},
|
|
100
112
|
[client, epoch],
|
|
101
113
|
);
|
|
@@ -24,12 +24,7 @@ import {
|
|
|
24
24
|
Quality,
|
|
25
25
|
} from "../__generated__/contract";
|
|
26
26
|
import { magnitudeOr, type Quantityish } from "../magnitude";
|
|
27
|
-
import {
|
|
28
|
-
canPropagate,
|
|
29
|
-
rotatePerifocalToInertial,
|
|
30
|
-
type Vector3,
|
|
31
|
-
} from "./kepler";
|
|
32
|
-
import { buildElements } from "./kepler-reckoning";
|
|
27
|
+
import { canPropagate, type Vec3Tuple } from "./kepler";
|
|
33
28
|
import {
|
|
34
29
|
groundTrackSamples,
|
|
35
30
|
type PatchSpan,
|
|
@@ -332,10 +327,9 @@ function lerpPoint(
|
|
|
332
327
|
* bound.
|
|
333
328
|
*
|
|
334
329
|
* A latitude and longitude need the point in a frame whose z axis is the
|
|
335
|
-
* body's spin axis and whose centre is the body itself. The
|
|
336
|
-
* can arrive in that
|
|
337
|
-
*
|
|
338
|
-
* they are measured in, and that inertial frame directly. Any other frame, a
|
|
330
|
+
* body's spin axis and whose centre is the body itself. The one frame an arc
|
|
331
|
+
* can arrive in that gives that is the body-centred inertial frame the elements
|
|
332
|
+
* are measured in. Any other frame, a
|
|
339
333
|
* different centre, or lengths that are not metres answers no impact rather
|
|
340
334
|
* than a guess, and never falls back to a conic the provider did not offer.
|
|
341
335
|
*
|
|
@@ -361,29 +355,8 @@ function arcImpact(
|
|
|
361
355
|
) {
|
|
362
356
|
return null;
|
|
363
357
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
return (p) => [p.x, p.y, p.z];
|
|
367
|
-
}
|
|
368
|
-
if (frame.kind === TrajectoryFrameKindLike.Perifocal) {
|
|
369
|
-
const { inc, lan, argPe } = buildElements(orbit);
|
|
370
|
-
const pHat = rotatePerifocalToInertial(1, 0, inc, lan, argPe);
|
|
371
|
-
const qHat = rotatePerifocalToInertial(0, 1, inc, lan, argPe);
|
|
372
|
-
const wHat: Vector3 = [
|
|
373
|
-
pHat[1] * qHat[2] - pHat[2] * qHat[1],
|
|
374
|
-
pHat[2] * qHat[0] - pHat[0] * qHat[2],
|
|
375
|
-
pHat[0] * qHat[1] - pHat[1] * qHat[0],
|
|
376
|
-
];
|
|
377
|
-
return (p) => [
|
|
378
|
-
p.x * pHat[0] + p.y * qHat[0] + p.z * wHat[0],
|
|
379
|
-
p.x * pHat[1] + p.y * qHat[1] + p.z * wHat[1],
|
|
380
|
-
p.x * pHat[2] + p.y * qHat[2] + p.z * wHat[2],
|
|
381
|
-
];
|
|
382
|
-
}
|
|
383
|
-
return null;
|
|
384
|
-
};
|
|
385
|
-
const lift = resolveLift();
|
|
386
|
-
if (!lift) return null;
|
|
358
|
+
if (frame.kind !== TrajectoryFrameKindLike.BodyCentredInertial) return null;
|
|
359
|
+
const lift = (p: TrajectoryPoint): Vec3Tuple => [p.x, p.y, p.z];
|
|
387
360
|
|
|
388
361
|
const surface = bodyRadius + MIN_IMPACT_ALT_M;
|
|
389
362
|
const endUt = ref.ut + walkSec;
|
|
@@ -404,7 +377,7 @@ function arcImpact(
|
|
|
404
377
|
rotationPeriod,
|
|
405
378
|
);
|
|
406
379
|
|
|
407
|
-
let previous: { at:
|
|
380
|
+
let previous: { at: Vec3Tuple; ut: number } = { at: start, ut: ref.ut };
|
|
408
381
|
for (let i = startAt; i < points.length; i++) {
|
|
409
382
|
const next = { at: lift(points[i]), ut: points[i].ut };
|
|
410
383
|
if (next.ut <= previous.ut) continue;
|
|
@@ -415,7 +388,7 @@ function arcImpact(
|
|
|
415
388
|
const f = (rPrev - surface) / (rPrev - rNext);
|
|
416
389
|
const ut = previous.ut + (next.ut - previous.ut) * f;
|
|
417
390
|
if (ut > endUt) return null;
|
|
418
|
-
const at:
|
|
391
|
+
const at: Vec3Tuple = [
|
|
419
392
|
previous.at[0] + (next.at[0] - previous.at[0]) * f,
|
|
420
393
|
previous.at[1] + (next.at[1] - previous.at[1]) * f,
|
|
421
394
|
previous.at[2] + (next.at[2] - previous.at[2]) * f,
|
package/src/spine/index.ts
CHANGED
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
export * from "../rail-tags";
|
|
51
51
|
export * from "./atmospheric-reckoning";
|
|
52
52
|
export * from "./body-derivations";
|
|
53
|
+
export * from "./body-pose";
|
|
53
54
|
export * from "./capability-lock";
|
|
54
55
|
export * from "./celestial-facts";
|
|
55
56
|
export * from "./channel-error-warning";
|
|
@@ -58,6 +59,7 @@ export * from "./client-reading";
|
|
|
58
59
|
export * from "./client-timeline";
|
|
59
60
|
export * from "./clock";
|
|
60
61
|
export * from "./command-gate";
|
|
62
|
+
export * from "./command-group";
|
|
61
63
|
export * from "./comms-delay-reckoning";
|
|
62
64
|
export * from "./comms-journey";
|
|
63
65
|
export * from "./comms-path-geometry";
|
|
@@ -91,6 +93,7 @@ export * from "./orbit-trajectory";
|
|
|
91
93
|
export * from "./orbital-solve";
|
|
92
94
|
export * from "./own-craft-vantage";
|
|
93
95
|
export * from "./past-track";
|
|
96
|
+
export * from "./phase-angle";
|
|
94
97
|
export * from "./processorEvaluator";
|
|
95
98
|
export * from "./processors";
|
|
96
99
|
export * from "./propagation";
|
|
@@ -120,12 +123,14 @@ export * from "./use-body-states";
|
|
|
120
123
|
export * from "./use-command";
|
|
121
124
|
export * from "./use-data-sources";
|
|
122
125
|
export * from "./use-late-telemetry-subscribe";
|
|
126
|
+
export * from "./use-orbit-curve";
|
|
123
127
|
export * from "./use-orbit-trajectory";
|
|
124
128
|
export * from "./use-processor";
|
|
125
129
|
export * from "./use-route-commands";
|
|
126
130
|
export * from "./use-selected-vantage";
|
|
127
131
|
export * from "./use-stream";
|
|
128
132
|
export * from "./use-stream-event";
|
|
133
|
+
export * from "./use-system-instant";
|
|
129
134
|
export * from "./use-telemetry";
|
|
130
135
|
export * from "./use-transmissions";
|
|
131
136
|
export * from "./view-clock";
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
OrbitElements,
|
|
9
9
|
PropagationHorizonLike,
|
|
10
10
|
StateVector,
|
|
11
|
-
|
|
11
|
+
Vec3Tuple,
|
|
12
12
|
} from "./kepler";
|
|
13
13
|
import {
|
|
14
14
|
canPropagate,
|
|
@@ -549,7 +549,7 @@ export function underPhysics(input: string, note: string): ReckoningDecline {
|
|
|
549
549
|
}
|
|
550
550
|
|
|
551
551
|
/** The length of a bare three-component vector. */
|
|
552
|
-
export function magnitude(v:
|
|
552
|
+
export function magnitude(v: Vec3Tuple): number {
|
|
553
553
|
return Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
|
|
554
554
|
}
|
|
555
555
|
|
package/src/spine/kepler.ts
CHANGED
|
@@ -189,7 +189,7 @@ export interface OrbitElements {
|
|
|
189
189
|
*
|
|
190
190
|
* @category Frames of reference
|
|
191
191
|
*/
|
|
192
|
-
export type
|
|
192
|
+
export type Vec3Tuple = readonly [x: number, y: number, z: number];
|
|
193
193
|
|
|
194
194
|
/**
|
|
195
195
|
* A position and velocity relative to the parent body, at one instant, in
|
|
@@ -198,8 +198,8 @@ export type Vector3 = readonly [x: number, y: number, z: number];
|
|
|
198
198
|
* @category Orbits and trajectories
|
|
199
199
|
*/
|
|
200
200
|
export interface StateVector {
|
|
201
|
-
position:
|
|
202
|
-
velocity:
|
|
201
|
+
position: Vec3Tuple;
|
|
202
|
+
velocity: Vec3Tuple;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
/**
|
|
@@ -418,7 +418,7 @@ export function solve(orbit: OrbitElements, ut: number): StateVector {
|
|
|
418
418
|
* Starts from a high-eccentricity guess where it needs one, so it converges
|
|
419
419
|
* just after periapsis on a near-parabolic orbit too.
|
|
420
420
|
*
|
|
421
|
-
*
|
|
421
|
+
* **Exported as ARITHMETIC, not as propagation.** It takes a mean anomaly
|
|
422
422
|
* and an eccentricity and returns an angle: no elements, no frame, no time, so
|
|
423
423
|
* it cannot say "where is this craft" and is not a way around the propagation
|
|
424
424
|
* seam. That question goes through a provider, and on the C# side the
|
|
@@ -484,6 +484,8 @@ function solveWrappedEccentricAnomaly(
|
|
|
484
484
|
* `zPf` is the part along the orbit normal. A conic has none, so it is left
|
|
485
485
|
* out and the vector is planar; an integrated arc leaves the osculating plane
|
|
486
486
|
* and passes it.
|
|
487
|
+
*
|
|
488
|
+
* @category Orbits and trajectories
|
|
487
489
|
*/
|
|
488
490
|
export function rotatePerifocalToInertial(
|
|
489
491
|
xPf: number,
|
|
@@ -492,7 +494,7 @@ export function rotatePerifocalToInertial(
|
|
|
492
494
|
lan: number,
|
|
493
495
|
argPe: number,
|
|
494
496
|
zPf = 0,
|
|
495
|
-
):
|
|
497
|
+
): Vec3Tuple {
|
|
496
498
|
const cosLan = Math.cos(lan);
|
|
497
499
|
const sinLan = Math.sin(lan);
|
|
498
500
|
const cosArgPe = Math.cos(argPe);
|
|
@@ -539,11 +541,11 @@ export function rotatePerifocalToInertial(
|
|
|
539
541
|
* a conic does not.
|
|
540
542
|
*/
|
|
541
543
|
export function rotateInertialToPerifocal(
|
|
542
|
-
v:
|
|
544
|
+
v: Vec3Tuple,
|
|
543
545
|
inc: number,
|
|
544
546
|
lan: number,
|
|
545
547
|
argPe: number,
|
|
546
|
-
):
|
|
548
|
+
): Vec3Tuple {
|
|
547
549
|
const cosLan = Math.cos(lan);
|
|
548
550
|
const sinLan = Math.sin(lan);
|
|
549
551
|
const cosArgPe = Math.cos(argPe);
|
package/src/spine/lagrange.ts
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
import { PerfBudget } from "../perf/PerfBudget";
|
|
48
48
|
import type { CelestialBody, CelestialFacts } from "./celestial-facts";
|
|
49
|
-
import type {
|
|
49
|
+
import type { Vec3Tuple } from "./kepler";
|
|
50
50
|
import {
|
|
51
51
|
type FrameInstant,
|
|
52
52
|
frameInstantAt,
|
|
@@ -139,9 +139,9 @@ export interface LibrationPoint {
|
|
|
139
139
|
* The point in the pair's rotating-pulsating frame: multiples of the pair's
|
|
140
140
|
* separation, and CONSTANT for as long as the pair's mass ratio is.
|
|
141
141
|
*/
|
|
142
|
-
frame:
|
|
142
|
+
frame: Vec3Tuple;
|
|
143
143
|
/** The same point in root-centred inertial metres at the answer's `ut`. */
|
|
144
|
-
inertial:
|
|
144
|
+
inertial: Vec3Tuple;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
/**
|
|
@@ -221,7 +221,7 @@ export type LibrationStationKeeping = "on-station" | "drifting" | "elsewhere";
|
|
|
221
221
|
export interface LibrationOffset {
|
|
222
222
|
nearest: LagrangePointName;
|
|
223
223
|
/** The craft in the pair's frame: multiples of the separation. */
|
|
224
|
-
vesselFrame:
|
|
224
|
+
vesselFrame: Vec3Tuple;
|
|
225
225
|
/** Straight-line distance from the craft to that point at the answer's `ut`, metres. */
|
|
226
226
|
distanceMetres: number;
|
|
227
227
|
/** The same distance as a multiple of the pair's separation. */
|
|
@@ -334,7 +334,7 @@ const COLLINEAR_BRACKET_GAP = 1e-9;
|
|
|
334
334
|
*/
|
|
335
335
|
export function librationPositionsFor(
|
|
336
336
|
massRatio: number,
|
|
337
|
-
): readonly { name: LagrangePointName; frame:
|
|
337
|
+
): readonly { name: LagrangePointName; frame: Vec3Tuple }[] | null {
|
|
338
338
|
const mu = massRatio;
|
|
339
339
|
if (!(mu > 0 && mu < 1)) return null;
|
|
340
340
|
const primaryX = -mu;
|
|
@@ -501,7 +501,7 @@ export function lagrangePointsAt(
|
|
|
501
501
|
*/
|
|
502
502
|
export function librationOffsetOf(
|
|
503
503
|
answer: LibrationAnswer,
|
|
504
|
-
vesselInertial:
|
|
504
|
+
vesselInertial: Vec3Tuple | null | undefined,
|
|
505
505
|
): LibrationOffset | null {
|
|
506
506
|
if (answer.refusal !== LIBRATION_REFUSALS.NotRefused) return null;
|
|
507
507
|
if (answer.frame === null || vesselInertial == null) return null;
|
package/src/spine/lifecycle.ts
CHANGED
|
@@ -13,6 +13,8 @@ import type { CommandErrorCode } from "../__generated__/error-codes";
|
|
|
13
13
|
* The code picks the sentence and the breach fills it in. Neither is much use
|
|
14
14
|
* alone: a code cannot say "16 of 16", and a pair of numbers does not say which
|
|
15
15
|
* sentence they belong in.
|
|
16
|
+
*
|
|
17
|
+
* @category Commands
|
|
16
18
|
*/
|
|
17
19
|
export interface CommandRefusalDetail {
|
|
18
20
|
/** The command id that was dispatched, e.g. `career.facility.upgrade`. */
|
|
@@ -47,6 +49,8 @@ export interface CommandRefusalDetail {
|
|
|
47
49
|
* The `id` is the dispatch's own `requestId`, so the same `dismiss(id)` clears a
|
|
48
50
|
* refusal and a dead in-flight command, and the operator has one gesture rather
|
|
49
51
|
* than two that look alike.
|
|
52
|
+
*
|
|
53
|
+
* @category Commands
|
|
50
54
|
*/
|
|
51
55
|
export interface CommandRefusal extends CommandRefusalDetail {
|
|
52
56
|
id: string;
|
|
@@ -70,6 +74,8 @@ export interface CommandRefusal extends CommandRefusalDetail {
|
|
|
70
74
|
*
|
|
71
75
|
* The `id` is the dispatch's own `requestId`, so one `dismiss(id)` clears a
|
|
72
76
|
* loss, a refusal and a dead in-flight command alike.
|
|
77
|
+
*
|
|
78
|
+
* @category Commands
|
|
73
79
|
*/
|
|
74
80
|
export interface CommandLoss {
|
|
75
81
|
id: string;
|
|
@@ -96,6 +102,8 @@ export interface CommandLoss {
|
|
|
96
102
|
*
|
|
97
103
|
* It carries everything the loss did, so a surface drawing the loss can draw
|
|
98
104
|
* this in its place, plus the transport's own reason.
|
|
105
|
+
*
|
|
106
|
+
* @category Commands
|
|
99
107
|
*/
|
|
100
108
|
export interface CommandUndelivered extends CommandLoss {
|
|
101
109
|
/** Why it will never go, in the transport's own words. */
|
|
@@ -110,6 +118,8 @@ export interface CommandUndelivered extends CommandLoss {
|
|
|
110
118
|
* Not a refusal, which is the game's verdict on the command itself, and not a
|
|
111
119
|
* loss, which carries no news at all. The mod said what became of it, and
|
|
112
120
|
* `code` says which of those it was.
|
|
121
|
+
*
|
|
122
|
+
* @category Commands
|
|
113
123
|
*/
|
|
114
124
|
export interface CommandFailure extends CommandLoss {
|
|
115
125
|
/** The fault the mod answered with, a `FaultCode` id. `describeErrorCode` gives its sentence. */
|
|
@@ -131,6 +141,8 @@ export interface CommandFailure extends CommandLoss {
|
|
|
131
141
|
* that proves it. Nothing here prevents or undoes the execution; the command ran
|
|
132
142
|
* (or was refused, or broke) exactly as it would have done had the reply arrived
|
|
133
143
|
* on time, and the only thing that was ever wrong was our silence about it.
|
|
144
|
+
*
|
|
145
|
+
* @category Commands
|
|
134
146
|
*/
|
|
135
147
|
export type CommandFound = CommandLoss & CommandFoundOutcome;
|
|
136
148
|
|
|
@@ -152,6 +164,8 @@ export type CommandFound = CommandLoss & CommandFoundOutcome;
|
|
|
152
164
|
*
|
|
153
165
|
* Folding these together would repeat the mistake `CommandStatus` already
|
|
154
166
|
* refused to make when it kept `refused` out of `failed`.
|
|
167
|
+
*
|
|
168
|
+
* @category Commands
|
|
155
169
|
*/
|
|
156
170
|
export type CommandFoundOutcome =
|
|
157
171
|
| { outcome: "ran"; result: unknown }
|
package/src/spine/lock-scope.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { createContext, useContext, useLayoutEffect } from "react";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Something a widget uses that the save may not have unlocked: a topic it reads or a command it holds.
|
|
5
|
+
*
|
|
6
|
+
* @category Panel
|
|
7
|
+
*/
|
|
4
8
|
export type Capability =
|
|
5
9
|
| { kind: "topic"; id: string }
|
|
6
10
|
| { kind: "command"; id: string };
|
|
@@ -14,6 +18,12 @@ export type Capability =
|
|
|
14
18
|
export interface LockScopeRegistry {
|
|
15
19
|
/** Records a capability as used here. Returns its release. */
|
|
16
20
|
claim(capability: Capability): () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Hears a capability claimed in a scope nested inside this one, without
|
|
23
|
+
* counting it toward this scope's lock. Only a scope that records what a
|
|
24
|
+
* subtree uses needs it, so a scope may leave it out.
|
|
25
|
+
*/
|
|
26
|
+
observe?(capability: Capability): void;
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
/** The nearest lock scope, or `null` where none is mounted. */
|
package/src/spine/map-command.ts
CHANGED
|
@@ -2,17 +2,9 @@
|
|
|
2
2
|
* Whether a command rides signal delay at all, read off the mod's own
|
|
3
3
|
* declaration rather than restated here.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* because a key cannot carry an argument. Every caller now names its command and
|
|
9
|
-
* its arguments directly, so there is nothing left to translate.
|
|
10
|
-
*
|
|
11
|
-
* What is left is one question, and it is no longer answered by a list written
|
|
12
|
-
* here. It used to be: a hand-kept set naming two ids, against the fifty-four
|
|
13
|
-
* the mod ran the instant they arrived, so fifty-two commands were drawn with a
|
|
14
|
-
* countdown and an in-flight queue row that was a fiction about the operator's
|
|
15
|
-
* own order. The answer now comes off `commandRail`, which is fed by
|
|
5
|
+
* A hand-kept list of delayed commands would draw an undeclared command with
|
|
6
|
+
* a countdown and an in-flight queue row that is a fiction about the
|
|
7
|
+
* operator's own order, so the answer comes off `commandRail`, which is fed by
|
|
16
8
|
* the generated map codegen builds from the SAME `[SitrepCommand(Delayed = ...)]`
|
|
17
9
|
* the host dispatches by, and by whatever an Uplink registered from its own
|
|
18
10
|
* generated map. One declaration, both halves reading it.
|
|
@@ -19,6 +19,7 @@ export function modSettingsTopic(uplinkId: string): string {
|
|
|
19
19
|
export function useModSettings(
|
|
20
20
|
uplinkId: string,
|
|
21
21
|
): TopicReading<ModSettingsModel> {
|
|
22
|
+
// gonogo:reads settings.<uplinkId>
|
|
22
23
|
return useStream<ModSettingsModel>(modSettingsTopic(uplinkId));
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -97,12 +97,14 @@ export const NEVER_RECKONABLE = [
|
|
|
97
97
|
// -- Configuration and catalogues. They change when the GAME changes, never
|
|
98
98
|
// continuously, so a model has no dimension to move them along.
|
|
99
99
|
//
|
|
100
|
-
// `system.bodies` belongs here
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
100
|
+
// `system.bodies` belongs here, and the channel is the only thing that does:
|
|
101
|
+
// it never moves, so a reckoner would have to hand it a NEW set of elements
|
|
102
|
+
// each frame, and nothing does or should. Where a body IS at an instant is a
|
|
103
|
+
// different question, answered by `SYSTEM_POSES` on top of the channel the way
|
|
104
|
+
// `vessel.orbit`'s solve is on its own: evaluating the catalogue's elements at
|
|
105
|
+
// an instant reads a published fact rather than advancing a payload, and the
|
|
106
|
+
// pose it returns carries the currency (exact, modelled, held, withdrawn) the
|
|
107
|
+
// bare numbers cannot.
|
|
106
108
|
"system.bodies",
|
|
107
109
|
"time.calendar",
|
|
108
110
|
"game.dlc",
|
|
@@ -21,6 +21,20 @@ export type PatchConic = Pick<
|
|
|
21
21
|
| "period"
|
|
22
22
|
>;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* A patch with every element a propagation reads present. The wire sends
|
|
26
|
+
* `lan`, `argPe` and `meanAnomalyAtEpoch` as null where KSP left them
|
|
27
|
+
* undefined, and such a patch cannot be propagated.
|
|
28
|
+
*/
|
|
29
|
+
export type PropagablePatch = Omit<
|
|
30
|
+
PatchConic,
|
|
31
|
+
"lan" | "argPe" | "meanAnomalyAtEpoch"
|
|
32
|
+
> & {
|
|
33
|
+
[Element in "lan" | "argPe" | "meanAnomalyAtEpoch"]: NonNullable<
|
|
34
|
+
PatchConic[Element]
|
|
35
|
+
>;
|
|
36
|
+
};
|
|
37
|
+
|
|
24
38
|
/** A patch's conic with the window it holds for and the body it is around. */
|
|
25
39
|
export type PatchSpan = PatchConic &
|
|
26
40
|
Pick<OrbitPatch, "startUt" | "endUt" | "referenceBody">;
|
|
@@ -88,7 +102,10 @@ const FULL_TURN = value("rad", 2 * Math.PI);
|
|
|
88
102
|
* patch's window; nothing is clamped, so picking the patch is the caller's.
|
|
89
103
|
* Mean motion comes from the patch's own period.
|
|
90
104
|
*/
|
|
91
|
-
export function patchStateAt(
|
|
105
|
+
export function patchStateAt(
|
|
106
|
+
patch: PropagablePatch,
|
|
107
|
+
ut: number,
|
|
108
|
+
): InertialState {
|
|
92
109
|
const { trueAnomaly, radius } = solveConic(
|
|
93
110
|
patch,
|
|
94
111
|
FULL_TURN.dividedBy(patch.period),
|
|
@@ -117,9 +134,18 @@ export function geoFromInertial(
|
|
|
117
134
|
return { lat, lonInertial, alt: state.radius - bodyRadius };
|
|
118
135
|
}
|
|
119
136
|
|
|
120
|
-
/**
|
|
121
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Whether the elliptical solve can propagate a patch. Hyperbolic and parabolic
|
|
139
|
+
* patches it cannot, and neither can one whose `lan`, `argPe` or
|
|
140
|
+
* `meanAnomalyAtEpoch` is null.
|
|
141
|
+
*/
|
|
142
|
+
export function canPropagatePatch<Patch extends PatchConic>(
|
|
143
|
+
patch: Patch,
|
|
144
|
+
): patch is Patch & PropagablePatch {
|
|
122
145
|
return (
|
|
146
|
+
patch.lan != null &&
|
|
147
|
+
patch.argPe != null &&
|
|
148
|
+
patch.meanAnomalyAtEpoch != null &&
|
|
123
149
|
patch.ecc.lessThan(1) &&
|
|
124
150
|
patch.period.isFinite() &&
|
|
125
151
|
patch.period.isPositive()
|
|
@@ -137,7 +163,7 @@ export function patchHolds(patch: PatchSpan, ut: number): boolean {
|
|
|
137
163
|
* earlier than `notBeforeUt`. Empty when nothing of the window is left.
|
|
138
164
|
*/
|
|
139
165
|
export function patchArc(
|
|
140
|
-
patch: PatchSpan,
|
|
166
|
+
patch: PatchSpan & PropagablePatch,
|
|
141
167
|
samples: number,
|
|
142
168
|
notBeforeUt?: number,
|
|
143
169
|
): { ut: number; state: InertialState }[] {
|
|
@@ -180,7 +206,8 @@ export function* groundTrackSamples(
|
|
|
180
206
|
|
|
181
207
|
// Calibration needs a patch around the named body, or the inertial longitude is in another frame.
|
|
182
208
|
const calCandidates = calibrationPatches.filter(
|
|
183
|
-
(p)
|
|
209
|
+
(p): p is PatchSpan & PropagablePatch =>
|
|
210
|
+
p.referenceBody === bodyId && canPropagatePatch(p),
|
|
184
211
|
);
|
|
185
212
|
const refPatch =
|
|
186
213
|
calCandidates.find((p) => patchHolds(p, ref.ut)) ?? calCandidates[0];
|
|
@@ -195,7 +222,7 @@ export function* groundTrackSamples(
|
|
|
195
222
|
for (let patchIndex = 0; patchIndex < patches.length; patchIndex++) {
|
|
196
223
|
const patch = patches[patchIndex];
|
|
197
224
|
if (patch.referenceBody !== bodyId) return;
|
|
198
|
-
if (!
|
|
225
|
+
if (!canPropagatePatch(patch)) return;
|
|
199
226
|
const { start, end } = windowOf(patch);
|
|
200
227
|
if (end < ref.ut) continue;
|
|
201
228
|
if (start > endUT) return;
|