@ksp-gonogo/sitrep-sdk 1.0.0-rc.45 → 1.0.0
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 +48 -93
- package/dist/__generated__/command-map.d.ts +247 -2
- package/dist/__generated__/command-map.d.ts.map +1 -1
- package/dist/__generated__/command-map.js +91 -19
- package/dist/__generated__/command-map.js.map +1 -1
- package/dist/__generated__/contract.d.ts +3062 -352
- package/dist/__generated__/contract.d.ts.map +1 -1
- package/dist/__generated__/contract.js +187 -3
- package/dist/__generated__/contract.js.map +1 -1
- package/dist/__generated__/delay-roles.d.ts +2 -2
- package/dist/__generated__/delay-roles.d.ts.map +1 -1
- package/dist/__generated__/delay-roles.js +12 -0
- package/dist/__generated__/delay-roles.js.map +1 -1
- package/dist/__generated__/error-codes.d.ts +11 -11
- package/dist/__generated__/error-codes.d.ts.map +1 -1
- package/dist/__generated__/error-codes.js +12 -12
- package/dist/__generated__/error-codes.js.map +1 -1
- package/dist/__generated__/frames.d.ts +40 -4
- package/dist/__generated__/frames.d.ts.map +1 -1
- package/dist/__generated__/frames.js +20 -4
- package/dist/__generated__/frames.js.map +1 -1
- package/dist/__generated__/reckonability.d.ts +3 -1
- package/dist/__generated__/reckonability.d.ts.map +1 -1
- package/dist/__generated__/reckonability.js +1 -1
- package/dist/__generated__/reckonability.js.map +1 -1
- package/dist/__generated__/sample-kinds.d.ts +18 -2
- package/dist/__generated__/sample-kinds.d.ts.map +1 -1
- package/dist/__generated__/sample-kinds.js +18 -2
- package/dist/__generated__/sample-kinds.js.map +1 -1
- package/dist/__generated__/topic-map.d.ts +41 -17
- package/dist/__generated__/topic-map.d.ts.map +1 -1
- package/dist/__generated__/topic-map.js +16 -3
- package/dist/__generated__/topic-map.js.map +1 -1
- package/dist/__generated__/units.d.ts +247 -6
- package/dist/__generated__/units.d.ts.map +1 -1
- package/dist/__generated__/units.js +949 -76
- package/dist/__generated__/units.js.map +1 -1
- package/dist/api/command-rejection.d.ts +2 -2
- package/dist/api/command-rejection.js +1 -1
- package/dist/api/contribution-slots.d.ts +122 -21
- package/dist/api/contribution-slots.d.ts.map +1 -1
- package/dist/api/contribution-slots.js +4 -4
- package/dist/api/contribution-slots.js.map +1 -1
- package/dist/api/error-codes.d.ts +3 -2
- package/dist/api/error-codes.d.ts.map +1 -1
- package/dist/api/error-codes.js +3 -2
- package/dist/api/error-codes.js.map +1 -1
- package/dist/api/framework-reads.d.ts +2 -2
- package/dist/api/framework-reads.d.ts.map +1 -1
- package/dist/api/framework-reads.js +6 -1
- package/dist/api/framework-reads.js.map +1 -1
- package/dist/api/host.d.ts +14 -6
- package/dist/api/host.d.ts.map +1 -1
- package/dist/api/host.js.map +1 -1
- package/dist/api/index.d.ts +70 -60
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +66 -54
- package/dist/api/index.js.map +1 -1
- package/dist/api/logger-contract.d.ts +2 -1
- package/dist/api/logger-contract.d.ts.map +1 -1
- package/dist/api/logger.d.ts +6 -3
- package/dist/api/logger.d.ts.map +1 -1
- package/dist/api/logger.js +6 -3
- package/dist/api/logger.js.map +1 -1
- package/dist/api/part-panels.d.ts +143 -0
- package/dist/api/part-panels.d.ts.map +1 -0
- package/dist/api/part-panels.js +104 -0
- package/dist/api/part-panels.js.map +1 -0
- package/dist/api/plot-layers.d.ts +1 -1
- package/dist/api/plot-layers.js +1 -1
- package/dist/api/registry.d.ts +4 -2
- package/dist/api/registry.d.ts.map +1 -1
- package/dist/api/registry.js +4 -2
- package/dist/api/registry.js.map +1 -1
- package/dist/api/settings/store.d.ts +1 -1
- package/dist/api/settings/store.d.ts.map +1 -1
- package/dist/api/settings/store.js +7 -2
- package/dist/api/settings/store.js.map +1 -1
- package/dist/api/slots.d.ts +150 -70
- package/dist/api/slots.d.ts.map +1 -1
- package/dist/api/station-brokers.d.ts +24 -15
- package/dist/api/station-brokers.d.ts.map +1 -1
- package/dist/api/station-brokers.js +24 -15
- package/dist/api/station-brokers.js.map +1 -1
- package/dist/api/tiny-size.d.ts +2 -1
- package/dist/api/tiny-size.d.ts.map +1 -1
- package/dist/api/tiny-size.js +2 -1
- package/dist/api/tiny-size.js.map +1 -1
- package/dist/api/tone.d.ts +1 -1
- package/dist/api/transport.d.ts +9 -0
- package/dist/api/transport.d.ts.map +1 -1
- package/dist/api/types.d.ts +356 -68
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/uplink-banner.d.ts +113 -0
- package/dist/api/uplink-banner.d.ts.map +1 -0
- package/dist/api/uplink-banner.js +69 -0
- package/dist/api/uplink-banner.js.map +1 -0
- package/dist/api/uplink-handles.d.ts +2 -12
- package/dist/api/uplink-handles.d.ts.map +1 -1
- package/dist/api/uplink-handles.js +2 -1
- package/dist/api/uplink-handles.js.map +1 -1
- package/dist/binary-frame.d.ts +4 -4
- package/dist/binary-frame.js +2 -2
- package/dist/combine-readings.d.ts +4 -3
- package/dist/combine-readings.d.ts.map +1 -1
- package/dist/combine-readings.js +4 -3
- package/dist/combine-readings.js.map +1 -1
- package/dist/command-delay.d.ts +81 -2
- package/dist/command-delay.d.ts.map +1 -1
- package/dist/command-delay.js +51 -8
- package/dist/command-delay.js.map +1 -1
- package/dist/command-value.d.ts +98 -0
- package/dist/command-value.d.ts.map +1 -0
- package/dist/command-value.js +87 -0
- package/dist/command-value.js.map +1 -0
- 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 +3 -3
- package/dist/compat-versions.js.map +1 -1
- package/dist/contract-enum-names.d.ts +2 -2
- package/dist/contract-enum-names.js +2 -2
- package/dist/contract-tags.d.ts +33 -2
- package/dist/contract-tags.d.ts.map +1 -1
- package/dist/contract-tags.js +54 -5
- package/dist/contract-tags.js.map +1 -1
- package/dist/data-rate.d.ts +84 -0
- package/dist/data-rate.d.ts.map +1 -0
- package/dist/data-rate.js +133 -0
- package/dist/data-rate.js.map +1 -0
- package/dist/delay-roles.d.ts +14 -1
- package/dist/delay-roles.d.ts.map +1 -1
- package/dist/delay-roles.js +5 -1
- package/dist/delay-roles.js.map +1 -1
- package/dist/dock-markers.d.ts +126 -0
- package/dist/dock-markers.d.ts.map +1 -0
- package/dist/dock-markers.js +100 -0
- package/dist/dock-markers.js.map +1 -0
- package/dist/envelope.d.ts +2 -2
- package/dist/envelope.d.ts.map +1 -1
- package/dist/flight/types.d.ts +31 -2
- package/dist/flight/types.d.ts.map +1 -1
- package/dist/flight/types.js.map +1 -1
- package/dist/frames/index.d.ts +1 -4
- package/dist/frames/index.d.ts.map +1 -1
- package/dist/frames/index.js +0 -3
- package/dist/frames/index.js.map +1 -1
- package/dist/go-no-go-countdown.d.ts +65 -0
- package/dist/go-no-go-countdown.d.ts.map +1 -0
- package/dist/go-no-go-countdown.js +71 -0
- package/dist/go-no-go-countdown.js.map +1 -0
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/ksp-enum-names.d.ts +35 -4
- package/dist/ksp-enum-names.d.ts.map +1 -1
- package/dist/ksp-enum-names.js +31 -4
- package/dist/ksp-enum-names.js.map +1 -1
- package/dist/locked.d.ts +1 -1
- package/dist/locked.js +1 -1
- package/dist/media/delayed-playout-buffer.d.ts +29 -4
- package/dist/media/delayed-playout-buffer.d.ts.map +1 -1
- package/dist/media/delayed-playout-buffer.js +12 -5
- package/dist/media/delayed-playout-buffer.js.map +1 -1
- package/dist/media/encoded-frame-delay.d.ts +21 -16
- package/dist/media/encoded-frame-delay.d.ts.map +1 -1
- package/dist/media/encoded-frame-delay.js +21 -14
- package/dist/media/encoded-frame-delay.js.map +1 -1
- package/dist/media/frame-delay.d.ts +119 -5
- package/dist/media/frame-delay.d.ts.map +1 -1
- package/dist/media/frame-delay.js +201 -15
- package/dist/media/frame-delay.js.map +1 -1
- package/dist/media/frame-stamp-timeline.d.ts +119 -0
- package/dist/media/frame-stamp-timeline.d.ts.map +1 -0
- package/dist/media/frame-stamp-timeline.js +194 -0
- package/dist/media/frame-stamp-timeline.js.map +1 -0
- package/dist/media/index.d.ts +4 -3
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +1 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/radio-support.d.ts +8 -7
- package/dist/media/radio-support.d.ts.map +1 -1
- package/dist/media/radio-support.js +5 -6
- package/dist/media/radio-support.js.map +1 -1
- package/dist/media/worker/delay-worker-client.d.ts +27 -1
- package/dist/media/worker/delay-worker-client.d.ts.map +1 -1
- package/dist/media/worker/delay-worker-client.js +53 -5
- package/dist/media/worker/delay-worker-client.js.map +1 -1
- package/dist/media/worker/delay-worker.d.ts +45 -8
- package/dist/media/worker/delay-worker.d.ts.map +1 -1
- package/dist/media/worker/delay-worker.js +644 -56
- package/dist/media/worker/delay-worker.js.map +4 -4
- package/dist/media/worker/frame-delay-report.d.ts +25 -0
- package/dist/media/worker/frame-delay-report.d.ts.map +1 -0
- package/dist/media/worker/frame-delay-report.js +112 -0
- package/dist/media/worker/frame-delay-report.js.map +1 -0
- package/dist/media/worker/lead-limit-report.d.ts +13 -0
- package/dist/media/worker/lead-limit-report.d.ts.map +1 -0
- package/dist/media/worker/lead-limit-report.js +19 -0
- package/dist/media/worker/lead-limit-report.js.map +1 -0
- package/dist/media/worker/presentation-pacer.d.ts +70 -1
- package/dist/media/worker/presentation-pacer.d.ts.map +1 -1
- package/dist/media/worker/presentation-pacer.js +167 -9
- package/dist/media/worker/presentation-pacer.js.map +1 -1
- package/dist/media/worker/worker-delay-clock.d.ts +4 -5
- package/dist/media/worker/worker-delay-clock.d.ts.map +1 -1
- package/dist/media/worker/worker-delay-clock.js +6 -2
- package/dist/media/worker/worker-delay-clock.js.map +1 -1
- package/dist/perf/PerfBudget.d.ts +2 -2
- package/dist/perf/PerfBudget.js +2 -2
- package/dist/rail-tags.d.ts +7 -0
- package/dist/rail-tags.d.ts.map +1 -1
- package/dist/rail-tags.js.map +1 -1
- package/dist/raw-field-split.d.ts +1 -1
- package/dist/raw-field-split.js +1 -1
- package/dist/reading.d.ts +6 -6
- package/dist/reading.js +5 -5
- package/dist/reads-index.json +446 -37
- package/dist/resource-transfer.d.ts +177 -0
- package/dist/resource-transfer.d.ts.map +1 -0
- package/dist/resource-transfer.js +190 -0
- package/dist/resource-transfer.js.map +1 -0
- package/dist/runtime-topic-registry.d.ts +2 -2
- package/dist/runtime-topic-registry.d.ts.map +1 -1
- package/dist/runtime-topic-registry.js +23 -2
- package/dist/runtime-topic-registry.js.map +1 -1
- package/dist/sample-step-tracker.d.ts +17 -0
- package/dist/sample-step-tracker.d.ts.map +1 -0
- package/dist/sample-step-tracker.js +38 -0
- package/dist/sample-step-tracker.js.map +1 -0
- package/dist/sha256-fallback.d.ts +6 -0
- package/dist/sha256-fallback.d.ts.map +1 -0
- package/dist/sha256-fallback.js +68 -0
- package/dist/sha256-fallback.js.map +1 -0
- package/dist/spine/arrival-deadline.d.ts +7 -0
- package/dist/spine/arrival-deadline.d.ts.map +1 -1
- package/dist/spine/arrival-deadline.js +12 -0
- package/dist/spine/arrival-deadline.js.map +1 -1
- package/dist/spine/bound-command.d.ts +58 -0
- package/dist/spine/bound-command.d.ts.map +1 -0
- package/dist/spine/bound-command.js +162 -0
- package/dist/spine/bound-command.js.map +1 -0
- package/dist/spine/capability-lock.d.ts +6 -1
- package/dist/spine/capability-lock.d.ts.map +1 -1
- package/dist/spine/capability-lock.js +56 -5
- package/dist/spine/capability-lock.js.map +1 -1
- package/dist/spine/catalog-fallback.d.ts +28 -0
- package/dist/spine/catalog-fallback.d.ts.map +1 -0
- package/dist/spine/catalog-fallback.js +120 -0
- package/dist/spine/catalog-fallback.js.map +1 -0
- package/dist/spine/celestial-facts.d.ts.map +1 -1
- package/dist/spine/celestial-facts.js +5 -2
- package/dist/spine/celestial-facts.js.map +1 -1
- package/dist/spine/centre-commands.d.ts +84 -0
- package/dist/spine/centre-commands.d.ts.map +1 -0
- package/dist/spine/centre-commands.js +236 -0
- package/dist/spine/centre-commands.js.map +1 -0
- package/dist/spine/client-reading.js +1 -1
- package/dist/spine/client-timeline.d.ts +48 -1
- package/dist/spine/client-timeline.d.ts.map +1 -1
- package/dist/spine/client-timeline.js +151 -3
- package/dist/spine/client-timeline.js.map +1 -1
- package/dist/spine/client.d.ts +154 -4
- package/dist/spine/client.d.ts.map +1 -1
- package/dist/spine/client.js +530 -34
- package/dist/spine/client.js.map +1 -1
- package/dist/spine/command-gate.d.ts +8 -0
- package/dist/spine/command-gate.d.ts.map +1 -1
- package/dist/spine/command-gate.js +36 -3
- package/dist/spine/command-gate.js.map +1 -1
- package/dist/spine/command-outcomes.d.ts +60 -0
- package/dist/spine/command-outcomes.d.ts.map +1 -0
- package/dist/spine/command-outcomes.js +256 -0
- package/dist/spine/command-outcomes.js.map +1 -0
- package/dist/spine/connectivity-history.d.ts +5 -3
- package/dist/spine/connectivity-history.d.ts.map +1 -1
- package/dist/spine/connectivity-history.js.map +1 -1
- package/dist/spine/context.d.ts +62 -11
- package/dist/spine/context.d.ts.map +1 -1
- package/dist/spine/context.js +125 -39
- package/dist/spine/context.js.map +1 -1
- package/dist/spine/core-reckoners.d.ts.map +1 -1
- package/dist/spine/core-reckoners.js +16 -39
- package/dist/spine/core-reckoners.js.map +1 -1
- package/dist/spine/delay-authority-context.d.ts +5 -0
- package/dist/spine/delay-authority-context.d.ts.map +1 -0
- package/dist/spine/delay-authority-context.js +7 -0
- package/dist/spine/delay-authority-context.js.map +1 -0
- package/dist/spine/delay-authority.d.ts +76 -1
- package/dist/spine/delay-authority.d.ts.map +1 -1
- package/dist/spine/delay-authority.js +217 -3
- package/dist/spine/delay-authority.js.map +1 -1
- package/dist/spine/delay-estimate.d.ts +41 -0
- package/dist/spine/delay-estimate.d.ts.map +1 -0
- package/dist/spine/delay-estimate.js +70 -0
- package/dist/spine/delay-estimate.js.map +1 -0
- package/dist/spine/delta-v-budget.js +2 -2
- package/dist/spine/delta-v-budget.js.map +1 -1
- package/dist/spine/dv-stage-resources.d.ts +32 -17
- package/dist/spine/dv-stage-resources.d.ts.map +1 -1
- package/dist/spine/dv-stage-resources.js +44 -37
- package/dist/spine/dv-stage-resources.js.map +1 -1
- package/dist/spine/index.d.ts +7 -1
- package/dist/spine/index.d.ts.map +1 -1
- package/dist/spine/index.js +11 -5
- package/dist/spine/index.js.map +1 -1
- package/dist/spine/kepler-reckoning.d.ts +56 -0
- package/dist/spine/kepler-reckoning.d.ts.map +1 -1
- package/dist/spine/kepler-reckoning.js +179 -3
- package/dist/spine/kepler-reckoning.js.map +1 -1
- package/dist/spine/kepler.d.ts +1 -1
- package/dist/spine/kepler.js +1 -1
- package/dist/spine/known-holds.d.ts +8 -0
- package/dist/spine/known-holds.d.ts.map +1 -0
- package/dist/spine/known-holds.js +78 -0
- package/dist/spine/known-holds.js.map +1 -0
- package/dist/spine/lagrange.d.ts +9 -34
- package/dist/spine/lagrange.d.ts.map +1 -1
- package/dist/spine/lagrange.js +4 -24
- package/dist/spine/lagrange.js.map +1 -1
- package/dist/spine/lifecycle.d.ts +21 -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 +2 -2
- package/dist/spine/map-topic.d.ts +3 -3
- package/dist/spine/map-topic.js +3 -3
- package/dist/spine/never-reckonable.js +1 -1
- package/dist/spine/never-reckonable.js.map +1 -1
- package/dist/spine/orbit-patches.d.ts +6 -4
- package/dist/spine/orbit-patches.d.ts.map +1 -1
- package/dist/spine/orbit-patches.js +45 -10
- package/dist/spine/orbit-patches.js.map +1 -1
- package/dist/spine/orbital-solve.d.ts +1 -1
- package/dist/spine/orbital-solve.d.ts.map +1 -1
- package/dist/spine/orbital-solve.js +35 -0
- package/dist/spine/orbital-solve.js.map +1 -1
- package/dist/spine/powered-reckoning.d.ts +5 -0
- package/dist/spine/powered-reckoning.d.ts.map +1 -1
- package/dist/spine/powered-reckoning.js.map +1 -1
- package/dist/spine/processorEvaluator.d.ts +29 -0
- package/dist/spine/processorEvaluator.d.ts.map +1 -1
- package/dist/spine/processorEvaluator.js +94 -71
- package/dist/spine/processorEvaluator.js.map +1 -1
- package/dist/spine/processors.d.ts +56 -4
- package/dist/spine/processors.d.ts.map +1 -1
- package/dist/spine/processors.js +110 -0
- package/dist/spine/processors.js.map +1 -1
- package/dist/spine/rail-registry.d.ts +1 -1
- package/dist/spine/rail-registry.d.ts.map +1 -1
- package/dist/spine/reckoner-generation.d.ts +5 -0
- package/dist/spine/reckoner-generation.d.ts.map +1 -0
- package/dist/spine/reckoner-generation.js +10 -0
- package/dist/spine/reckoner-generation.js.map +1 -0
- package/dist/spine/reckoners.d.ts.map +1 -1
- package/dist/spine/reckoners.js +3 -0
- package/dist/spine/reckoners.js.map +1 -1
- package/dist/spine/replay-session-controller.d.ts +1 -1
- package/dist/spine/replay-session-controller.d.ts.map +1 -1
- package/dist/spine/replay-session-controller.js +4 -6
- package/dist/spine/replay-session-controller.js.map +1 -1
- package/dist/spine/resolve-tracked.d.ts +20 -2
- package/dist/spine/resolve-tracked.d.ts.map +1 -1
- package/dist/spine/resolve-tracked.js +32 -2
- package/dist/spine/resolve-tracked.js.map +1 -1
- package/dist/spine/send-status.d.ts +2 -0
- package/dist/spine/send-status.d.ts.map +1 -1
- package/dist/spine/send-status.js.map +1 -1
- package/dist/spine/settings-registry.d.ts +7 -0
- package/dist/spine/settings-registry.d.ts.map +1 -1
- package/dist/spine/settings-registry.js.map +1 -1
- package/dist/spine/slot-ids.d.ts +1 -1
- package/dist/spine/slot-ids.d.ts.map +1 -1
- package/dist/spine/slot-ids.js +6 -3
- package/dist/spine/slot-ids.js.map +1 -1
- package/dist/spine/space-center-state.d.ts +17 -9
- package/dist/spine/space-center-state.d.ts.map +1 -1
- package/dist/spine/space-center-state.js +14 -15
- package/dist/spine/space-center-state.js.map +1 -1
- package/dist/spine/stage-countdown-store.d.ts +38 -0
- package/dist/spine/stage-countdown-store.d.ts.map +1 -0
- package/dist/spine/stage-countdown-store.js +53 -0
- package/dist/spine/stage-countdown-store.js.map +1 -0
- package/dist/spine/stream-status.d.ts +3 -3
- package/dist/spine/stream-status.js +3 -3
- package/dist/spine/subscribe-read.d.ts +1 -1
- package/dist/spine/subscribe-read.js +2 -2
- package/dist/spine/system-state.d.ts +13 -13
- package/dist/spine/system-state.d.ts.map +1 -1
- package/dist/spine/system-state.js +18 -18
- package/dist/spine/system-state.js.map +1 -1
- package/dist/spine/timeline-store.d.ts +304 -113
- package/dist/spine/timeline-store.d.ts.map +1 -1
- package/dist/spine/timeline-store.js +921 -223
- package/dist/spine/timeline-store.js.map +1 -1
- package/dist/spine/uplink-clients.d.ts +32 -16
- package/dist/spine/uplink-clients.d.ts.map +1 -1
- package/dist/spine/uplink-clients.js +8 -4
- package/dist/spine/uplink-clients.js.map +1 -1
- package/dist/spine/uplink-delays.d.ts +31 -0
- package/dist/spine/uplink-delays.d.ts.map +1 -0
- package/dist/spine/uplink-delays.js +46 -0
- package/dist/spine/uplink-delays.js.map +1 -0
- package/dist/spine/uplink-health.d.ts +109 -14
- package/dist/spine/uplink-health.d.ts.map +1 -1
- package/dist/spine/uplink-health.js +21 -17
- package/dist/spine/uplink-health.js.map +1 -1
- package/dist/spine/use-action-input.d.ts.map +1 -1
- package/dist/spine/use-action-input.js +14 -9
- package/dist/spine/use-action-input.js.map +1 -1
- package/dist/spine/use-body-states.d.ts.map +1 -1
- package/dist/spine/use-body-states.js +3 -3
- package/dist/spine/use-body-states.js.map +1 -1
- package/dist/spine/use-command.d.ts +94 -31
- package/dist/spine/use-command.d.ts.map +1 -1
- package/dist/spine/use-command.js +409 -197
- package/dist/spine/use-command.js.map +1 -1
- package/dist/spine/use-last-known-path.d.ts +36 -0
- package/dist/spine/use-last-known-path.d.ts.map +1 -0
- package/dist/spine/use-last-known-path.js +46 -0
- package/dist/spine/use-last-known-path.js.map +1 -0
- package/dist/spine/use-observed-vantage.d.ts +13 -0
- package/dist/spine/use-observed-vantage.d.ts.map +1 -0
- package/dist/spine/use-observed-vantage.js +20 -0
- package/dist/spine/use-observed-vantage.js.map +1 -0
- package/dist/spine/use-orbit-trajectory.d.ts +1 -1
- package/dist/spine/use-orbit-trajectory.d.ts.map +1 -1
- package/dist/spine/use-orbit-trajectory.js +17 -3
- package/dist/spine/use-orbit-trajectory.js.map +1 -1
- package/dist/spine/use-stream-connected.d.ts +8 -0
- package/dist/spine/use-stream-connected.d.ts.map +1 -0
- package/dist/spine/use-stream-connected.js +16 -0
- package/dist/spine/use-stream-connected.js.map +1 -0
- package/dist/spine/use-stream-event.d.ts +6 -1
- package/dist/spine/use-stream-event.d.ts.map +1 -1
- package/dist/spine/use-stream-event.js +5 -1
- package/dist/spine/use-stream-event.js.map +1 -1
- package/dist/spine/use-stream.d.ts +5 -2
- package/dist/spine/use-stream.d.ts.map +1 -1
- package/dist/spine/use-stream.js +7 -4
- package/dist/spine/use-stream.js.map +1 -1
- package/dist/spine/use-telemetry.d.ts +5 -1
- package/dist/spine/use-telemetry.d.ts.map +1 -1
- package/dist/spine/use-telemetry.js.map +1 -1
- package/dist/spine/use-topic-clock.d.ts +54 -0
- package/dist/spine/use-topic-clock.d.ts.map +1 -0
- package/dist/spine/use-topic-clock.js +137 -0
- package/dist/spine/use-topic-clock.js.map +1 -0
- package/dist/spine/use-transmissions.d.ts.map +1 -1
- package/dist/spine/use-transmissions.js +9 -4
- package/dist/spine/use-transmissions.js.map +1 -1
- package/dist/spine/vantage.d.ts +6 -0
- package/dist/spine/vantage.d.ts.map +1 -1
- package/dist/spine/vantage.js +6 -0
- package/dist/spine/vantage.js.map +1 -1
- package/dist/spine/view-clock.d.ts +23 -3
- package/dist/spine/view-clock.d.ts.map +1 -1
- package/dist/spine/view-clock.js +80 -2
- package/dist/spine/view-clock.js.map +1 -1
- package/dist/testing/fake-command.d.ts +48 -0
- package/dist/testing/fake-command.d.ts.map +1 -0
- package/dist/testing/fake-command.js +63 -0
- package/dist/testing/fake-command.js.map +1 -0
- package/dist/testing/index.d.ts +5 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/install-act-gate-stretch.d.ts +1 -2
- package/dist/testing/install-act-gate-stretch.d.ts.map +1 -1
- package/dist/testing/install-act-gate-stretch.js +1 -2
- package/dist/testing/install-act-gate-stretch.js.map +1 -1
- package/dist/testing/install-dom-stubs.d.ts +2 -5
- package/dist/testing/install-dom-stubs.d.ts.map +1 -1
- package/dist/testing/install-dom-stubs.js +2 -34
- package/dist/testing/install-dom-stubs.js.map +1 -1
- package/dist/testing/install-real-test-host.d.ts.map +1 -1
- package/dist/testing/install-real-test-host.js +7 -6
- package/dist/testing/install-real-test-host.js.map +1 -1
- package/dist/testing/recorded-uplink-banners.d.ts +49 -0
- package/dist/testing/recorded-uplink-banners.d.ts.map +1 -0
- package/dist/testing/recorded-uplink-banners.js +45 -0
- package/dist/testing/recorded-uplink-banners.js.map +1 -0
- package/dist/testing/render.d.ts +16 -3
- package/dist/testing/render.d.ts.map +1 -1
- package/dist/testing/render.js +16 -3
- package/dist/testing/render.js.map +1 -1
- package/dist/testing/stream-fixture.js +3 -3
- package/dist/testing/stream-fixture.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 +3 -0
- package/dist/testing/stub-transport.js.map +1 -1
- package/dist/timeline.d.ts +2 -98
- package/dist/timeline.d.ts.map +1 -1
- package/dist/topics.d.ts +68 -28
- package/dist/topics.d.ts.map +1 -1
- package/dist/topics.js +21 -18
- package/dist/topics.js.map +1 -1
- package/dist/unit-system/index.d.ts +1 -1
- package/dist/unit-system/index.d.ts.map +1 -1
- package/dist/unit-system/index.js +1 -1
- package/dist/unit-system/index.js.map +1 -1
- package/dist/unit-system/value.d.ts +26 -5
- package/dist/unit-system/value.d.ts.map +1 -1
- package/dist/unit-system/value.js +41 -21
- package/dist/unit-system/value.js.map +1 -1
- package/dist/units.d.ts.map +1 -1
- package/dist/units.js +2 -1
- package/dist/units.js.map +1 -1
- package/dist/uplink-externals.d.ts +17 -7
- package/dist/uplink-externals.d.ts.map +1 -1
- package/dist/uplink-externals.js +17 -7
- package/dist/uplink-externals.js.map +1 -1
- package/dist/uplink-load.d.ts +3 -2
- package/dist/uplink-load.d.ts.map +1 -1
- package/dist/uplink-load.js +9 -6
- package/dist/uplink-load.js.map +1 -1
- package/dist/uplink-manifest.d.ts +8 -3
- package/dist/uplink-manifest.d.ts.map +1 -1
- package/dist/uplink-manifest.js +5 -1
- package/dist/uplink-manifest.js.map +1 -1
- package/dist/wrap-units.d.ts.map +1 -1
- package/dist/wrap-units.js +3 -2
- package/dist/wrap-units.js.map +1 -1
- package/package.json +1 -1
- package/src/__generated__/command-map.ts +215 -19
- package/src/__generated__/contract.ts +3102 -330
- package/src/__generated__/delay-roles.ts +12 -0
- package/src/__generated__/error-codes.ts +13 -13
- package/src/__generated__/frames.ts +20 -4
- package/src/__generated__/reckonability.ts +3 -1
- package/src/__generated__/sample-kinds.ts +18 -2
- package/src/__generated__/topic-map.ts +68 -19
- package/src/__generated__/units.json +958 -94
- package/src/__generated__/units.ts +949 -76
- package/src/api/command-rejection.ts +2 -2
- package/src/api/contribution-slots.ts +128 -25
- package/src/api/error-codes.ts +3 -2
- package/src/api/framework-reads.ts +6 -1
- package/src/api/host.ts +14 -6
- package/src/api/index.ts +127 -67
- package/src/api/logger-contract.ts +2 -1
- package/src/api/logger.ts +6 -3
- package/src/api/part-panels.ts +221 -0
- package/src/api/plot-layers.ts +1 -1
- package/src/api/registry.ts +4 -2
- package/src/api/settings/store.ts +7 -2
- package/src/api/slots.ts +153 -70
- package/src/api/station-brokers.ts +24 -15
- package/src/api/tiny-size.ts +2 -1
- package/src/api/tone.ts +1 -1
- package/src/api/transport.ts +13 -0
- package/src/api/types.ts +388 -68
- package/src/api/uplink-banner.ts +128 -0
- package/src/api/uplink-handles.ts +4 -1
- package/src/binary-frame.ts +4 -4
- package/src/combine-readings.ts +4 -3
- package/src/command-delay.ts +144 -11
- package/src/command-value.ts +181 -0
- package/src/compat-versions.ts +3 -3
- package/src/contract-enum-names.ts +2 -2
- package/src/contract-tags.ts +67 -5
- package/src/data-rate.ts +178 -0
- package/src/delay-roles.ts +19 -2
- package/src/dock-markers.ts +182 -0
- package/src/envelope.ts +4 -0
- package/src/flight/types.ts +31 -2
- package/src/frames/index.ts +0 -4
- package/src/go-no-go-countdown.ts +116 -0
- package/src/index.ts +64 -4
- package/src/ksp-enum-names.ts +48 -3
- package/src/locked.ts +1 -1
- package/src/media/__fixtures__/hull-after-revert.json +1506 -0
- package/src/media/delayed-playout-buffer.ts +41 -9
- package/src/media/encoded-frame-delay.ts +29 -17
- package/src/media/frame-delay.ts +328 -22
- package/src/media/frame-stamp-timeline.ts +270 -0
- package/src/media/index.ts +5 -0
- package/src/media/radio-support.ts +8 -7
- package/src/media/worker/delay-worker-client.ts +104 -6
- package/src/media/worker/delay-worker.ts +228 -27
- package/src/media/worker/frame-delay-report.ts +141 -0
- package/src/media/worker/lead-limit-report.ts +27 -0
- package/src/media/worker/presentation-pacer.ts +216 -9
- package/src/media/worker/worker-delay-clock.ts +9 -6
- package/src/perf/PerfBudget.ts +2 -2
- package/src/rail-tags.ts +8 -0
- package/src/raw-field-split.ts +1 -1
- package/src/reading.ts +6 -6
- package/src/resource-transfer.ts +352 -0
- package/src/runtime-topic-registry.ts +23 -2
- package/src/sample-step-tracker.ts +38 -0
- package/src/sha256-fallback.ts +69 -0
- package/src/spine/__fixtures__/crash/crash-eva.json +224 -0
- package/src/spine/__fixtures__/crash/crash-separated-pod-pod-root.json +144 -0
- package/src/spine/__fixtures__/crash/crash-separated-pod.json +111 -0
- package/src/spine/__fixtures__/switch/back-to-craft.jsonl +101 -0
- package/src/spine/__fixtures__/switch/late-sent-frame.jsonl +16 -0
- package/src/spine/__fixtures__/switch/linked-craft.jsonl +63 -0
- package/src/spine/__fixtures__/switch/station-trim.jsonl +229 -0
- package/src/spine/__fixtures__/switch/switch-with-scene.jsonl +110 -0
- package/src/spine/__fixtures__/switch/unlinked-craft.jsonl +46 -0
- package/src/spine/arrival-deadline.ts +15 -0
- package/src/spine/bound-command.ts +243 -0
- package/src/spine/capability-lock.ts +65 -6
- package/src/spine/catalog-fallback.ts +152 -0
- package/src/spine/celestial-facts.ts +4 -2
- package/src/spine/centre-commands.ts +314 -0
- package/src/spine/client-reading.ts +1 -1
- package/src/spine/client-timeline.ts +165 -4
- package/src/spine/client.ts +615 -32
- package/src/spine/command-gate.ts +44 -3
- package/src/spine/command-outcomes.ts +303 -0
- package/src/spine/connectivity-history.ts +5 -3
- package/src/spine/context.tsx +154 -50
- package/src/spine/core-reckoners.ts +31 -50
- package/src/spine/delay-authority-context.ts +9 -0
- package/src/spine/delay-authority.ts +227 -3
- package/src/spine/delay-estimate.ts +88 -0
- package/src/spine/delta-v-budget.ts +2 -2
- package/src/spine/dv-stage-resources.ts +55 -43
- package/src/spine/index.ts +11 -5
- package/src/spine/kepler-reckoning.ts +245 -3
- package/src/spine/kepler.ts +1 -1
- package/src/spine/known-holds.ts +96 -0
- package/src/spine/lagrange.ts +10 -46
- package/src/spine/lifecycle.ts +22 -0
- package/src/spine/lock-scope.ts +2 -2
- package/src/spine/map-topic.ts +3 -3
- package/src/spine/never-reckonable.ts +1 -1
- package/src/spine/orbit-patches.ts +54 -10
- package/src/spine/orbital-solve.ts +53 -1
- package/src/spine/powered-reckoning.ts +5 -1
- package/src/spine/processorEvaluator.ts +106 -72
- package/src/spine/processors.ts +144 -4
- package/src/spine/rail-registry.ts +1 -1
- package/src/spine/reckoner-generation.ts +11 -0
- package/src/spine/reckoners.ts +3 -0
- package/src/spine/replay-session-controller.ts +4 -6
- package/src/spine/resolve-tracked.ts +50 -1
- package/src/spine/send-status.ts +2 -0
- package/src/spine/settings-registry.ts +7 -0
- package/src/spine/slot-ids.ts +6 -3
- package/src/spine/space-center-state.ts +17 -20
- package/src/spine/stage-countdown-store.ts +76 -0
- package/src/spine/stream-status.ts +4 -4
- package/src/spine/subscribe-read.ts +2 -2
- package/src/spine/system-state.ts +19 -21
- package/src/spine/timeline-store.ts +1119 -247
- package/src/spine/uplink-clients.ts +44 -22
- package/src/spine/uplink-delays.ts +57 -0
- package/src/spine/uplink-health.ts +59 -27
- package/src/spine/use-action-input.ts +13 -9
- package/src/spine/use-body-states.ts +5 -4
- package/src/spine/use-command.ts +620 -239
- package/src/spine/use-last-known-path.ts +75 -0
- package/src/spine/use-observed-vantage.ts +24 -0
- package/src/spine/use-orbit-trajectory.ts +22 -3
- package/src/spine/use-stream-connected.ts +23 -0
- package/src/spine/use-stream-event.ts +6 -2
- package/src/spine/use-stream.ts +7 -4
- package/src/spine/use-telemetry.ts +5 -1
- package/src/spine/use-topic-clock.ts +196 -0
- package/src/spine/use-transmissions.ts +37 -18
- package/src/spine/vantage.ts +7 -0
- package/src/spine/view-clock.ts +89 -3
- package/src/testing/fake-command.ts +109 -0
- package/src/testing/index.ts +12 -1
- package/src/testing/install-act-gate-stretch.ts +1 -2
- package/src/testing/install-dom-stubs.ts +2 -38
- package/src/testing/install-real-test-host.ts +10 -6
- package/src/testing/recorded-uplink-banners.ts +71 -0
- package/src/testing/render.tsx +16 -3
- package/src/testing/stream-fixture.tsx +3 -3
- package/src/testing/stub-transport.ts +9 -0
- package/src/timeline.ts +2 -103
- package/src/topics.ts +87 -26
- package/src/unit-system/index.ts +2 -0
- package/src/unit-system/value.ts +61 -21
- package/src/units.ts +2 -1
- package/src/uplink-externals.ts +17 -7
- package/src/uplink-load.ts +9 -8
- package/src/uplink-manifest.ts +8 -3
- package/src/wrap-units.ts +3 -9
- package/dist/spine/contributed-channels.d.ts +0 -56
- package/dist/spine/contributed-channels.d.ts.map +0 -1
- package/dist/spine/contributed-channels.js +0 -108
- package/dist/spine/contributed-channels.js.map +0 -1
- package/src/spine/contributed-channels.ts +0 -134
|
@@ -60,6 +60,41 @@ export interface ConicOrbitInput {
|
|
|
60
60
|
encounter?: { transitionUt: Quantityish } | LockedValue | null;
|
|
61
61
|
/** How far ahead the elements hold. */
|
|
62
62
|
horizon?: PropagationHorizonLike;
|
|
63
|
+
/** The patch chain, element 0 being the current patch, as `vessel.orbit` carries it. */
|
|
64
|
+
patches?: readonly ConicPatchInput[] | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* One entry of a `vessel.orbit` patch chain, with the fields needed to carry
|
|
69
|
+
* the craft onto it. Useful for deciding where the craft is after the
|
|
70
|
+
* sphere-of-influence change that ends the current patch. Taken by
|
|
71
|
+
* {@link keplerAdmissibilityAcrossPatches}.
|
|
72
|
+
*
|
|
73
|
+
* @category Reckoners
|
|
74
|
+
*/
|
|
75
|
+
export interface ConicPatchInput {
|
|
76
|
+
/** Index into `trackingStation.bodies` of the body the patch is around. Absent on a patch recorded without it. */
|
|
77
|
+
referenceBodyIndex?: number | null;
|
|
78
|
+
/** Semi-major axis. */
|
|
79
|
+
sma: Quantityish;
|
|
80
|
+
/** Eccentricity. */
|
|
81
|
+
ecc: Quantityish;
|
|
82
|
+
/** Inclination. */
|
|
83
|
+
inc: Quantityish;
|
|
84
|
+
/** Longitude of the ascending node. */
|
|
85
|
+
lan?: Quantityish | null;
|
|
86
|
+
/** Argument of periapsis. */
|
|
87
|
+
argPe?: Quantityish | null;
|
|
88
|
+
/** Mean anomaly at `epoch`. Absent on a patch recorded without it. */
|
|
89
|
+
meanAnomalyAtEpoch?: Quantityish | null;
|
|
90
|
+
/** The instant the elements are given for. */
|
|
91
|
+
epoch: Quantityish;
|
|
92
|
+
/** The universal time the patch begins. */
|
|
93
|
+
startUt: Quantityish;
|
|
94
|
+
/** The universal time the patch ends. Not a number on a patch that never ends. */
|
|
95
|
+
endUt?: Quantityish | null;
|
|
96
|
+
/** The body's gravitational parameter. Absent on a patch recorded without it. */
|
|
97
|
+
mu?: Quantityish | null;
|
|
63
98
|
}
|
|
64
99
|
|
|
65
100
|
/**
|
|
@@ -385,6 +420,9 @@ function trajectoryAuthority(
|
|
|
385
420
|
*
|
|
386
421
|
* - the propagation provider says the orbit holds forever but is not a fixed
|
|
387
422
|
* ellipse, or does not say what it is
|
|
423
|
+
* - an element is absent or not a number, or the elements describe no orbit:
|
|
424
|
+
* a negative eccentricity, a gravitational parameter of zero or below, or a
|
|
425
|
+
* semi-major axis that does not fit the eccentricity
|
|
388
426
|
* - the craft is being fully simulated by the game, and `coast` does not show
|
|
389
427
|
* that its engines are cold, that the elements were taken after the last
|
|
390
428
|
* burn ended, that it is above the atmosphere, and that no command reaches
|
|
@@ -394,6 +432,7 @@ function trajectoryAuthority(
|
|
|
394
432
|
* - the orbit is outside its body's sphere of influence at `viewUt`
|
|
395
433
|
* - the orbit is inside the atmosphere at `viewUt`, or under the surface of a
|
|
396
434
|
* body with none, or passed through either since the elements were taken
|
|
435
|
+
* - no position can be solved at `viewUt`, as for parabolic elements
|
|
397
436
|
*
|
|
398
437
|
* A missing `bodies` or encounter is not a reason to decline. A burn that
|
|
399
438
|
* nothing has reported, such as by a craft out of contact, cannot be seen
|
|
@@ -414,6 +453,8 @@ export function keplerAdmissibility(
|
|
|
414
453
|
}
|
|
415
454
|
const authority = trajectoryAuthority(orbitPoint.payload.horizon);
|
|
416
455
|
if (authority !== null) return { declined: authority };
|
|
456
|
+
const unsolvable = unsolvableElements(orbitPoint.payload);
|
|
457
|
+
if (unsolvable !== null) return { declined: unsolvable };
|
|
417
458
|
if (orbitPoint.meta.quality !== Quality.OnRails) {
|
|
418
459
|
const loaded = loadedCoastDecline(
|
|
419
460
|
orbitPoint,
|
|
@@ -433,7 +474,7 @@ export function keplerAdmissibility(
|
|
|
433
474
|
declined: {
|
|
434
475
|
reason: "beyond-horizon",
|
|
435
476
|
input: "@vessel.orbit",
|
|
436
|
-
note:
|
|
477
|
+
note: PATCH_END_NOTE,
|
|
437
478
|
},
|
|
438
479
|
};
|
|
439
480
|
}
|
|
@@ -450,13 +491,29 @@ export function keplerAdmissibility(
|
|
|
450
491
|
const elements = buildElements(orbit);
|
|
451
492
|
const solved = trySolve(elements, viewUt);
|
|
452
493
|
const radius = solved == null ? Number.NaN : magnitude(solved.position);
|
|
494
|
+
if (!Number.isFinite(radius)) {
|
|
495
|
+
return {
|
|
496
|
+
declined:
|
|
497
|
+
solved == null
|
|
498
|
+
? {
|
|
499
|
+
reason: "model-inapplicable",
|
|
500
|
+
input: "@vessel.orbit#ecc",
|
|
501
|
+
note: "parabolic elements: there is no position to carry forward",
|
|
502
|
+
}
|
|
503
|
+
: {
|
|
504
|
+
reason: "model-inapplicable",
|
|
505
|
+
input: "@vessel.orbit",
|
|
506
|
+
note: "no position can be solved for these elements at that time",
|
|
507
|
+
},
|
|
508
|
+
};
|
|
509
|
+
}
|
|
453
510
|
/*
|
|
454
511
|
* The encounter says when the patch ends, and it is locked until the save can
|
|
455
512
|
* compute one. The body's own sphere of influence is the same boundary stated
|
|
456
513
|
* as a distance, which every save has.
|
|
457
514
|
*/
|
|
458
515
|
const reach = sphereOfInfluenceRadius(bodies, orbit.referenceBodyIndex);
|
|
459
|
-
if (reach !== undefined &&
|
|
516
|
+
if (reach !== undefined && radius > reach) {
|
|
460
517
|
return {
|
|
461
518
|
declined: {
|
|
462
519
|
reason: "beyond-horizon",
|
|
@@ -467,7 +524,7 @@ export function keplerAdmissibility(
|
|
|
467
524
|
}
|
|
468
525
|
const floor = entryInterfaceRadius(bodies, orbit.referenceBodyIndex);
|
|
469
526
|
if (floor !== undefined) {
|
|
470
|
-
if (
|
|
527
|
+
if (radius <= floor) {
|
|
471
528
|
return {
|
|
472
529
|
declined: {
|
|
473
530
|
reason: "beyond-horizon",
|
|
@@ -497,6 +554,191 @@ export function keplerAdmissibility(
|
|
|
497
554
|
return { ok: true };
|
|
498
555
|
}
|
|
499
556
|
|
|
557
|
+
/** The plain name of each element {@link unsolvableElements} checks, for the note naming one that is absent. */
|
|
558
|
+
const ELEMENT_NAMES = {
|
|
559
|
+
sma: "semi-major axis",
|
|
560
|
+
ecc: "eccentricity",
|
|
561
|
+
inc: "inclination",
|
|
562
|
+
lan: "longitude of the ascending node",
|
|
563
|
+
argPe: "argument of periapsis",
|
|
564
|
+
meanAnomalyAtEpoch: "mean anomaly at epoch",
|
|
565
|
+
epoch: "epoch",
|
|
566
|
+
mu: "gravitational parameter",
|
|
567
|
+
} as const;
|
|
568
|
+
|
|
569
|
+
/** How near zero an inclination (as a sine) or an eccentricity must be for the angle it anchors to be undefined. */
|
|
570
|
+
const UNDEFINED_ANGLE_TOLERANCE = 1e-9;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Whether `field` is an angle the orbit leaves undefined: the ascending node of
|
|
574
|
+
* an orbit with no inclination, the argument of periapsis of one with no
|
|
575
|
+
* eccentricity. Any other field is never undefined.
|
|
576
|
+
*/
|
|
577
|
+
function isUndefinedAngle(field: string, orbit: ConicOrbitInput): boolean {
|
|
578
|
+
if (field === "lan") {
|
|
579
|
+
return (
|
|
580
|
+
Math.abs(Math.sin(degToRad(mag(orbit.inc)))) < UNDEFINED_ANGLE_TOLERANCE
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
if (field === "argPe") {
|
|
584
|
+
return Math.abs(mag(orbit.ecc)) < UNDEFINED_ANGLE_TOLERANCE;
|
|
585
|
+
}
|
|
586
|
+
return false;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Why `orbit`'s elements place the craft nowhere, or `null` when every one is
|
|
591
|
+
* a number and together they describe an orbit. An ascending node or argument
|
|
592
|
+
* of periapsis that is `null` is an undefined one and reads as 0 only where the
|
|
593
|
+
* orbit leaves it undefined (see {@link isUndefinedAngle}); anywhere else, and
|
|
594
|
+
* for one that is present and not a number, it is absent. Parabolic elements pass, so that a burn
|
|
595
|
+
* through an eccentricity of 1 still reaches the coast and powered-flight
|
|
596
|
+
* checks, and are declined where their position is asked for.
|
|
597
|
+
*/
|
|
598
|
+
function unsolvableElements(orbit: ConicOrbitInput): ReckoningDecline | null {
|
|
599
|
+
for (const field of Object.keys(
|
|
600
|
+
ELEMENT_NAMES,
|
|
601
|
+
) as (keyof typeof ELEMENT_NAMES)[]) {
|
|
602
|
+
const raw = orbit[field];
|
|
603
|
+
if (raw == null && isUndefinedAngle(field, orbit)) continue;
|
|
604
|
+
if (!Number.isFinite(mag(raw))) {
|
|
605
|
+
return {
|
|
606
|
+
reason: "input-absent",
|
|
607
|
+
input: `@vessel.orbit#${field}`,
|
|
608
|
+
note: `the orbit's ${ELEMENT_NAMES[field]} is absent, so there is no position to carry forward`,
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
const ecc = mag(orbit.ecc);
|
|
613
|
+
const sma = mag(orbit.sma);
|
|
614
|
+
if (ecc < 0) {
|
|
615
|
+
return {
|
|
616
|
+
reason: "model-inapplicable",
|
|
617
|
+
input: "@vessel.orbit#ecc",
|
|
618
|
+
note: "a negative eccentricity describes no orbit",
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
if (!(mag(orbit.mu) > 0)) {
|
|
622
|
+
return {
|
|
623
|
+
reason: "model-inapplicable",
|
|
624
|
+
input: "@vessel.orbit#mu",
|
|
625
|
+
note: "a gravitational parameter of zero or below describes no orbit",
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
if (sma === 0 || (ecc < 1 && sma < 0)) {
|
|
629
|
+
return {
|
|
630
|
+
reason: "model-inapplicable",
|
|
631
|
+
input: "@vessel.orbit#sma",
|
|
632
|
+
note: "the semi-major axis does not fit the eccentricity, so the elements describe no orbit",
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
return null;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/** The note a decline carries when the view time is past the end of the current patch. */
|
|
639
|
+
const PATCH_END_NOTE = "this patch ends at the SOI transition";
|
|
640
|
+
|
|
641
|
+
/** Slack, in seconds, between a patch's `startUt` and the transition that ends the one before it. */
|
|
642
|
+
const PATCH_JOIN_SLACK = 1;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* The patch the craft is on once the current one has ended at `transitionUt`,
|
|
646
|
+
* as an orbit of its own, or `undefined` when the chain does not carry it.
|
|
647
|
+
* A patch missing its body, its gravitational parameter, its phase or the
|
|
648
|
+
* orientation of its plane is not used, because none of them can be guessed.
|
|
649
|
+
*/
|
|
650
|
+
function successorOrbit(
|
|
651
|
+
orbit: ConicOrbitInput,
|
|
652
|
+
transitionUt: number,
|
|
653
|
+
viewUt: number,
|
|
654
|
+
): ConicOrbitInput | undefined {
|
|
655
|
+
const chain = orbit.patches ?? [];
|
|
656
|
+
const at = chain.findIndex(
|
|
657
|
+
(patch, i) =>
|
|
658
|
+
i > 0 && Math.abs(mag(patch.startUt) - transitionUt) <= PATCH_JOIN_SLACK,
|
|
659
|
+
);
|
|
660
|
+
if (at < 1) return undefined;
|
|
661
|
+
const patch = chain[at];
|
|
662
|
+
const endUt = mag(patch.endUt);
|
|
663
|
+
if (endUt <= viewUt) return undefined;
|
|
664
|
+
const mu = mag(patch.mu);
|
|
665
|
+
const body = patch.referenceBodyIndex;
|
|
666
|
+
if (!(mu > 0) || body == null) return undefined;
|
|
667
|
+
if (!Number.isFinite(mag(patch.meanAnomalyAtEpoch))) return undefined;
|
|
668
|
+
if (!Number.isFinite(mag(patch.lan)) || !Number.isFinite(mag(patch.argPe))) {
|
|
669
|
+
return undefined;
|
|
670
|
+
}
|
|
671
|
+
const followed = chain[at + 1];
|
|
672
|
+
const follows =
|
|
673
|
+
followed !== undefined && Number.isFinite(endUt)
|
|
674
|
+
? { transitionUt: patch.endUt as Quantityish }
|
|
675
|
+
: null;
|
|
676
|
+
return {
|
|
677
|
+
referenceBodyIndex: body,
|
|
678
|
+
sma: patch.sma,
|
|
679
|
+
ecc: patch.ecc,
|
|
680
|
+
inc: patch.inc,
|
|
681
|
+
lan: patch.lan,
|
|
682
|
+
argPe: patch.argPe,
|
|
683
|
+
meanAnomalyAtEpoch: patch.meanAnomalyAtEpoch as Quantityish,
|
|
684
|
+
epoch: patch.epoch,
|
|
685
|
+
mu: patch.mu as Quantityish,
|
|
686
|
+
encounter: follows,
|
|
687
|
+
horizon: orbit.horizon,
|
|
688
|
+
patches: chain.slice(at),
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Returns whether the craft's orbit may be carried forward to `viewUt`, and the
|
|
694
|
+
* orbit it is carried on: the point's own, or the next patch of its chain when
|
|
695
|
+
* `viewUt` is past the sphere-of-influence change that ends the current one.
|
|
696
|
+
* Useful for showing the operator the body the craft is about to be around
|
|
697
|
+
* before the game's next sample arrives. The next patch is a prediction already
|
|
698
|
+
* in the delivered sample, so nothing is shown that the link has not carried.
|
|
699
|
+
* Used by the orbit reckoner.
|
|
700
|
+
*
|
|
701
|
+
* @category Reckoners
|
|
702
|
+
*/
|
|
703
|
+
export function keplerAdmissibilityAcrossPatches(
|
|
704
|
+
orbitPoint: TimelinePoint<ConicOrbitInput> | undefined,
|
|
705
|
+
bodies: ConicBodiesInput | undefined,
|
|
706
|
+
viewUt: number,
|
|
707
|
+
coast?: LoadedCoastEvidence,
|
|
708
|
+
):
|
|
709
|
+
| {
|
|
710
|
+
readonly ok: true;
|
|
711
|
+
readonly orbit: ConicOrbitInput;
|
|
712
|
+
readonly carried: boolean;
|
|
713
|
+
}
|
|
714
|
+
| { readonly declined: ReckoningDecline } {
|
|
715
|
+
const own = keplerAdmissibility(orbitPoint, bodies, viewUt, coast);
|
|
716
|
+
const orbit = orbitPoint?.payload;
|
|
717
|
+
if (orbitPoint === undefined || orbit == null) return own as never;
|
|
718
|
+
if ("ok" in own) return { ok: true, orbit, carried: false };
|
|
719
|
+
const declined = own.declined;
|
|
720
|
+
if (
|
|
721
|
+
declined.reason !== "beyond-horizon" ||
|
|
722
|
+
declined.note !== PATCH_END_NOTE
|
|
723
|
+
) {
|
|
724
|
+
return own;
|
|
725
|
+
}
|
|
726
|
+
const transitionUt = mag(
|
|
727
|
+
(unlessLocked(orbit.encounter ?? null) as { transitionUt: Quantityish })
|
|
728
|
+
.transitionUt,
|
|
729
|
+
);
|
|
730
|
+
const next = successorOrbit(orbit, transitionUt, viewUt);
|
|
731
|
+
if (next === undefined) return own;
|
|
732
|
+
const onward = keplerAdmissibility(
|
|
733
|
+
{ ...orbitPoint, payload: next },
|
|
734
|
+
bodies,
|
|
735
|
+
viewUt,
|
|
736
|
+
coast,
|
|
737
|
+
);
|
|
738
|
+
if ("declined" in onward) return onward;
|
|
739
|
+
return { ok: true, orbit: next, carried: true };
|
|
740
|
+
}
|
|
741
|
+
|
|
500
742
|
/** The radius of a body's sphere of influence, in metres, or `undefined` when `bodies` does not state one for it. */
|
|
501
743
|
function sphereOfInfluenceRadius(
|
|
502
744
|
bodies: ConicBodiesInput | undefined,
|
package/src/spine/kepler.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* rotation (argument of periapsis, then inclination, then longitude of
|
|
8
8
|
* ascending node -- the Vallado/AIAA convention).
|
|
9
9
|
*
|
|
10
|
-
* This is the
|
|
10
|
+
* This is the published-processor foundation for the streaming delay model: the mod
|
|
11
11
|
* transmits sparse orbital
|
|
12
12
|
* elements over the wire, and each consumer -- the mod itself, and this SDK
|
|
13
13
|
* -- derives position on demand rather than streaming dense position
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { JourneyEventKind } from "../__generated__/contract";
|
|
2
|
+
import type { PendingEntry } from "../command-delay";
|
|
3
|
+
import { value } from "../unit-system/value";
|
|
4
|
+
import type { Journey, JourneyEvent } from "./comms-journey";
|
|
5
|
+
import type { PendingUplinkQueueLike } from "./resolve-tracked";
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* The centre's plan can predict that a command will wait at a relay, but the
|
|
9
|
+
* centre learns that it does only when the relay's hold report reaches it,
|
|
10
|
+
* which is no sooner than light carries it home. Until then the command is
|
|
11
|
+
* drawn as one going straight out at the speed of light; from the report on,
|
|
12
|
+
* as waiting where the relay says; from the relay's departure report on, as
|
|
13
|
+
* going on from there. A reply settles it either way.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** The reports about one queue entry, oldest first. */
|
|
17
|
+
function reportsAbout(
|
|
18
|
+
entry: PendingEntry,
|
|
19
|
+
journey: Journey | null,
|
|
20
|
+
): JourneyEvent[] {
|
|
21
|
+
if (!journey) return [];
|
|
22
|
+
return journey.events
|
|
23
|
+
.filter((e) => e.about === entry.id)
|
|
24
|
+
.sort((a, b) => a.atUt.compare(b.atUt));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The entry as the centre knows it, from its own plan and the reports that have reached it. */
|
|
28
|
+
export function entryAsKnown(
|
|
29
|
+
entry: PendingEntry,
|
|
30
|
+
journey: Journey | null,
|
|
31
|
+
): PendingEntry {
|
|
32
|
+
if (entry.predictedHeldAt == null) return entry;
|
|
33
|
+
const reports = reportsAbout(entry, journey);
|
|
34
|
+
const held = reports.find((e) => e.kind === JourneyEventKind.Held);
|
|
35
|
+
const departed = held
|
|
36
|
+
? reports.find(
|
|
37
|
+
(e) =>
|
|
38
|
+
e.kind === JourneyEventKind.Departed && !e.atUt.lessThan(held.atUt),
|
|
39
|
+
)
|
|
40
|
+
: undefined;
|
|
41
|
+
const sent = entry.dispatchedAt;
|
|
42
|
+
const from = entry.predictedHeldFromUt;
|
|
43
|
+
const until = entry.predictedHeldUntilUt;
|
|
44
|
+
const arrival = entry.predictedArrivalUt;
|
|
45
|
+
const reply = entry.predictedReplyUt;
|
|
46
|
+
// The light-time out to the craft and back, from the plan's own hops.
|
|
47
|
+
const out =
|
|
48
|
+
from != null && until != null && arrival != null
|
|
49
|
+
? from.minus(sent).plus(arrival.minus(until))
|
|
50
|
+
: null;
|
|
51
|
+
const back = reply != null && arrival != null ? reply.minus(arrival) : out;
|
|
52
|
+
if (!held) {
|
|
53
|
+
// A command held at the centre itself is known held at once; nothing is on its way to report it.
|
|
54
|
+
if (entry.predictedHeldAt === entry.vantage || out === null) return entry;
|
|
55
|
+
return {
|
|
56
|
+
...entry,
|
|
57
|
+
predictedHeldAt: null,
|
|
58
|
+
predictedHeldFromUt: null,
|
|
59
|
+
predictedHeldUntilUt: null,
|
|
60
|
+
predictedArrivalUt: sent.plus(out),
|
|
61
|
+
predictedReplyUt: sent.plus(out).plus(back ?? out),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const onward =
|
|
65
|
+
departed?.untilUt != null
|
|
66
|
+
? departed.untilUt.minus(departed.atUt)
|
|
67
|
+
: until != null && arrival != null
|
|
68
|
+
? arrival.minus(until)
|
|
69
|
+
: value("s", 0);
|
|
70
|
+
// Until its departure is heard the command is where the relay last said, for as long as it can last there.
|
|
71
|
+
const leaves =
|
|
72
|
+
departed?.atUt ?? entry.expiresAtUt ?? held.untilUt ?? until ?? held.atUt;
|
|
73
|
+
const reaches = leaves.plus(onward);
|
|
74
|
+
return {
|
|
75
|
+
...entry,
|
|
76
|
+
predictedHeldAt: held.at,
|
|
77
|
+
predictedHeldFromUt: held.atUt,
|
|
78
|
+
predictedHeldUntilUt: leaves,
|
|
79
|
+
predictedArrivalUt: reaches,
|
|
80
|
+
predictedReplyUt: reaches.plus(back ?? onward),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** The queue with each entry as the centre knows it. */
|
|
85
|
+
export function queueAsKnown(
|
|
86
|
+
queue: PendingUplinkQueueLike | undefined,
|
|
87
|
+
journey: Journey | null,
|
|
88
|
+
): PendingUplinkQueueLike | undefined {
|
|
89
|
+
if (!queue?.pending.some((e) => e.predictedHeldAt != null)) {
|
|
90
|
+
return queue;
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
...queue,
|
|
94
|
+
pending: queue.pending.map((e) => entryAsKnown(e, journey)),
|
|
95
|
+
};
|
|
96
|
+
}
|
package/src/spine/lagrange.ts
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
* equilibria slightly and are not solved for here; they do enter through the
|
|
42
42
|
* frame, whose angular velocity is summed over the whole catalogue as point
|
|
43
43
|
* masses. A craft is never at a mathematical equilibrium anyway, which is what
|
|
44
|
-
* the
|
|
44
|
+
* the offset below is for.
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
import { PerfBudget } from "../perf/PerfBudget";
|
|
@@ -205,39 +205,13 @@ const LIBRATION_BUDGET = new PerfBudget({
|
|
|
205
205
|
});
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*/
|
|
212
|
-
export const LIBRATION_ON_STATION_UNITS = 0.02;
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* The distance, as a multiple of the pair's separation (0.15), beyond which a
|
|
216
|
-
* vessel is not station-keeping on the point at all. Useful for telling the
|
|
217
|
-
* operator whether a vessel is drifting from a libration point. Used by
|
|
218
|
-
* {@link librationOffsetOf}.
|
|
219
|
-
*/
|
|
220
|
-
export const LIBRATION_DRIFTING_UNITS = 0.15;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* What a vessel's offset from the nearest point means: holding station on it,
|
|
224
|
-
* drifting off it, or not station-keeping on it at all. Useful for showing the
|
|
225
|
-
* operator how well a vessel holds its libration point, with the widget picking
|
|
226
|
-
* the colour. Held in a {@link LibrationOffset}.
|
|
208
|
+
* Where a vessel sits against an answered pair's points: which one it is nearest
|
|
209
|
+
* and how far off it. Useful for showing the operator how far a vessel is from a
|
|
210
|
+
* libration point. Returned by {@link librationOffsetOf}.
|
|
227
211
|
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* @category Frames of reference
|
|
233
|
-
*/
|
|
234
|
-
export type LibrationStationKeeping = "on-station" | "drifting" | "elsewhere";
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Where a vessel sits against an answered pair's points: which one it is nearest,
|
|
238
|
-
* how far off it, and what that distance means. Useful for showing the operator
|
|
239
|
-
* how far a vessel is from a libration point. Returned by
|
|
240
|
-
* {@link librationOffsetOf}.
|
|
212
|
+
* Distance alone does not say whether a vessel is station-keeping on the point:
|
|
213
|
+
* that also needs its velocity relative to the point in the pair's rotating
|
|
214
|
+
* frame, which {@link toFrame} gives.
|
|
241
215
|
*
|
|
242
216
|
* @category Frames of reference
|
|
243
217
|
*/
|
|
@@ -250,8 +224,6 @@ export interface LibrationOffset {
|
|
|
250
224
|
distanceMetres: number;
|
|
251
225
|
/** The same distance as a multiple of the pair's separation. */
|
|
252
226
|
distanceUnits: number;
|
|
253
|
-
/** Whether the craft is holding station at that point. */
|
|
254
|
-
keeping: LibrationStationKeeping;
|
|
255
227
|
}
|
|
256
228
|
|
|
257
229
|
const NO_PAIR_CHOICE = (
|
|
@@ -512,8 +484,8 @@ export function lagrangePointsAt(
|
|
|
512
484
|
}
|
|
513
485
|
|
|
514
486
|
/**
|
|
515
|
-
* Which point a vessel is nearest, how far off it is
|
|
516
|
-
*
|
|
487
|
+
* Which point a vessel is nearest, and how far off it is. Useful for showing
|
|
488
|
+
* the operator how close a vessel is to a libration point.
|
|
517
489
|
*
|
|
518
490
|
* Pass the vessel's root-centred inertial position, in metres, at the answer's
|
|
519
491
|
* own instant. `null` when the answer is a refusal or the position is not
|
|
@@ -547,19 +519,11 @@ export function librationOffsetOf(
|
|
|
547
519
|
}
|
|
548
520
|
if (nearest === null || !Number.isFinite(best)) return null;
|
|
549
521
|
|
|
550
|
-
const distanceUnits = best / unitLength;
|
|
551
|
-
const keeping: LibrationStationKeeping =
|
|
552
|
-
distanceUnits <= LIBRATION_ON_STATION_UNITS
|
|
553
|
-
? "on-station"
|
|
554
|
-
: distanceUnits <= LIBRATION_DRIFTING_UNITS
|
|
555
|
-
? "drifting"
|
|
556
|
-
: "elsewhere";
|
|
557
522
|
return {
|
|
558
523
|
nearest: nearest.name,
|
|
559
524
|
vesselFrame: toFrame(answer.frame, vesselInertial).position,
|
|
560
525
|
distanceMetres: best,
|
|
561
|
-
distanceUnits,
|
|
562
|
-
keeping,
|
|
526
|
+
distanceUnits: best / unitLength,
|
|
563
527
|
};
|
|
564
528
|
}
|
|
565
529
|
|
package/src/spine/lifecycle.ts
CHANGED
|
@@ -120,6 +120,26 @@ export interface CommandFailure extends CommandLoss {
|
|
|
120
120
|
reason: string;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
/**
|
|
124
|
+
* One command the mod accepted with a warning, as a widget renders it: a
|
|
125
|
+
* continuous input the sending centre's plan says will be dropped where it
|
|
126
|
+
* would have to wait at a relay. Useful for telling the operator that an input
|
|
127
|
+
* is likely to be lost while it is still on its way. Listed in the `warnings`
|
|
128
|
+
* that {@link useCommand} returns while the command is in flight.
|
|
129
|
+
*
|
|
130
|
+
* @category Commands
|
|
131
|
+
*/
|
|
132
|
+
export interface CommandWarning {
|
|
133
|
+
/** The dispatch's request id. */
|
|
134
|
+
id: string;
|
|
135
|
+
/** The command id that was dispatched. */
|
|
136
|
+
command: string;
|
|
137
|
+
/** The dispatch's own operator-facing description; `""` when it carried none. */
|
|
138
|
+
label: string;
|
|
139
|
+
/** What the mod said, as a sentence to show. */
|
|
140
|
+
warning: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
123
143
|
/**
|
|
124
144
|
* One command that was reported lost and then replied to after all, as a widget
|
|
125
145
|
* renders it. Useful for telling the operator what a command reported lost
|
|
@@ -212,6 +232,8 @@ export type CommandStatus =
|
|
|
212
232
|
requestId: string;
|
|
213
233
|
/** When the reply is due, in seconds on the clock the client was built with. In the running app that clock counts from the page's start, so this is not a game UT. */
|
|
214
234
|
etaConfirm: number;
|
|
235
|
+
/** The mod has answered the send by accepting it for its flight to the target; absent until it does, and for a command that never waits on a delay, which is answered by its reply alone. */
|
|
236
|
+
accepted?: true;
|
|
215
237
|
/** What the mod said of a command it accepted against the odds, as a sentence to show: a continuous input that its centre's plan says will be dropped on the way. Absent for an ordinary command. */
|
|
216
238
|
warning?: string;
|
|
217
239
|
}
|
package/src/spine/lock-scope.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { createContext, useContext, useLayoutEffect } from "react";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Something a widget uses that the save may not have unlocked: a Topic it reads
|
|
5
|
-
* or a command it
|
|
6
|
-
* yet unlocked what it needs. Taken by the ui-kit
|
|
5
|
+
* or a command it sends. Useful for refusing a widget when the career has not
|
|
6
|
+
* yet unlocked what it needs. Taken by `LockScope` in the ui-kit, which collects
|
|
7
7
|
* the capabilities a section of a widget uses so it can show one lock message.
|
|
8
8
|
*
|
|
9
9
|
* @category Readings
|
package/src/spine/map-topic.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* `isKnownFieldPath` / `resolveValueTopic` say whether a dotted path names a
|
|
5
5
|
* field the contract declares, and which Topic a caller should sample for it.
|
|
6
6
|
* Both read the contract's own generated metadata through
|
|
7
|
-
* `unitsForTopic`/`shapesForTopic`, so a Topic an Uplink or a
|
|
7
|
+
* `unitsForTopic`/`shapesForTopic`, so a Topic an Uplink or a published processor
|
|
8
8
|
* registered at module load resolves alongside a first-party one.
|
|
9
9
|
*
|
|
10
10
|
* `mapTopic` vouches for a key in a dynamic namespace, which no generated
|
|
@@ -108,7 +108,7 @@ function isEmpty(record: Readonly<Record<string, unknown>>): boolean {
|
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Whether the contract declares `topic` as a Topic at all, including a Topic
|
|
111
|
-
* registered at module load such as an Uplink's own or a
|
|
111
|
+
* registered at module load such as an Uplink's own or a published processor.
|
|
112
112
|
* Useful for checking a Topic the operator or a widget names before reading it.
|
|
113
113
|
*
|
|
114
114
|
* It differs from {@link isKnownFieldPath}: reads keyed by a whole Topic (a
|
|
@@ -125,7 +125,7 @@ export function isKnownTopic(topic: string): boolean {
|
|
|
125
125
|
/**
|
|
126
126
|
* Whether `path` names a field the contract declares under one of its Topics,
|
|
127
127
|
* including a Topic registered at module load such as an Uplink's own payload
|
|
128
|
-
* type or a
|
|
128
|
+
* type or a published processor. Useful for checking a field path the
|
|
129
129
|
* operator picked before reading it. Used by the core when it classifies what a
|
|
130
130
|
* widget declares it reads.
|
|
131
131
|
*/
|
|
@@ -171,7 +171,7 @@ export const NEVER_RECKONABLE = [
|
|
|
171
171
|
// why, and making the model cheaper is what moves it back out.
|
|
172
172
|
//
|
|
173
173
|
// Deliberately EMPTY. Provider-supplied compute on the frame path is what this
|
|
174
|
-
// whole pipeline already is (a mapper runs every tick, a
|
|
174
|
+
// whole pipeline already is (a mapper runs every tick, a published processor and a
|
|
175
175
|
// processor every frame), so a reckoning is not special and nothing here has
|
|
176
176
|
// earned an exemption yet. An entry needs evidence of a real per-frame cost,
|
|
177
177
|
// named in its comment.
|
|
@@ -207,10 +207,58 @@ export function patchHolds(patch: PatchSpan, ut: number): boolean {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
|
-
* `samples + 1`
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
210
|
+
* The instants of `samples + 1` points from `from` to `end`, spaced evenly in
|
|
211
|
+
* eccentric anomaly on a closed patch and in hyperbolic anomaly on an open one.
|
|
212
|
+
* Even steps in time leave a high-eccentricity patch a few points across its
|
|
213
|
+
* whole periapsis pass and draw that pass as a corner.
|
|
214
|
+
*/
|
|
215
|
+
function instantsEvenInAnomaly(
|
|
216
|
+
patch: PropagablePatch,
|
|
217
|
+
from: number,
|
|
218
|
+
end: number,
|
|
219
|
+
samples: number,
|
|
220
|
+
): number[] {
|
|
221
|
+
const ecc = patch.ecc.valueOf();
|
|
222
|
+
const open = ecc > 1;
|
|
223
|
+
const rate = patchMeanMotion(patch);
|
|
224
|
+
const rateValue = rate.valueOf();
|
|
225
|
+
const at = (ut: number) => solveConic(patch, rate, value("ut", ut));
|
|
226
|
+
// The mean anomaly of an anomaly, which is how far along the orbit in time it is.
|
|
227
|
+
const meanOf = (anomaly: number) =>
|
|
228
|
+
open
|
|
229
|
+
? ecc * Math.sinh(anomaly) - anomaly
|
|
230
|
+
: anomaly - ecc * Math.sin(anomaly);
|
|
231
|
+
const first = at(from).eccentricAnomaly;
|
|
232
|
+
const meanFrom = meanOf(first);
|
|
233
|
+
/*
|
|
234
|
+
* A closed patch's solve wraps into one turn, so the far end is lifted by the whole turns the window spans.
|
|
235
|
+
* An open patch's anomaly is already continuous.
|
|
236
|
+
*/
|
|
237
|
+
const last = at(end).eccentricAnomaly;
|
|
238
|
+
const turns = open
|
|
239
|
+
? 0
|
|
240
|
+
: Math.round(
|
|
241
|
+
(meanFrom + rateValue * (end - from) - meanOf(last)) / (2 * Math.PI),
|
|
242
|
+
);
|
|
243
|
+
const far = last + 2 * Math.PI * turns;
|
|
244
|
+
const meanSpan = meanOf(far) - meanFrom;
|
|
245
|
+
const instants = [from];
|
|
246
|
+
for (let s = 1; s < samples; s++) {
|
|
247
|
+
const anomaly = first + ((far - first) * s) / samples;
|
|
248
|
+
const share = (meanOf(anomaly) - meanFrom) / meanSpan;
|
|
249
|
+
instants.push(from + (end - from) * share);
|
|
250
|
+
}
|
|
251
|
+
instants.push(end);
|
|
252
|
+
return instants;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* `samples + 1` states across a patch's window, beginning no earlier than
|
|
257
|
+
* `notBeforeUt`, spaced evenly in the patch's own anomaly so a path that swings
|
|
258
|
+
* close to its body is drawn smooth through the swing. Useful for drawing the
|
|
259
|
+
* part of a predicted patch still ahead of the vessel. Used by the system
|
|
260
|
+
* diagram's predicted trajectory. The result is empty when nothing of the
|
|
261
|
+
* window is left.
|
|
214
262
|
*/
|
|
215
263
|
export function patchArc(
|
|
216
264
|
patch: PatchSpan & PropagablePatch,
|
|
@@ -220,12 +268,8 @@ export function patchArc(
|
|
|
220
268
|
const { start, end } = windowOf(patch);
|
|
221
269
|
const from = notBeforeUt === undefined ? start : Math.max(start, notBeforeUt);
|
|
222
270
|
if (!(end > from)) return [];
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
const ut = from + ((end - from) * s) / samples;
|
|
226
|
-
arc.push({ ut, state: patchStateAt(patch, ut) });
|
|
227
|
-
}
|
|
228
|
-
return arc;
|
|
271
|
+
const instants = instantsEvenInAnomaly(patch, from, end, samples);
|
|
272
|
+
return instants.map((ut) => ({ ut, state: patchStateAt(patch, ut) }));
|
|
229
273
|
}
|
|
230
274
|
|
|
231
275
|
/**
|