Add command-line-run programs for satellites.
This commit is contained in:
parent
7488effd5c
commit
d5e3a21e26
24
boot/satellite.ks
Normal file
24
boot/satellite.ks
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
runoncepath("0:/lib/boot").
|
||||||
|
|
||||||
|
parameter debug is false.
|
||||||
|
|
||||||
|
local compiled is list(
|
||||||
|
"/lib/navigation",
|
||||||
|
"/lib/node",
|
||||||
|
"/lib/throttle"
|
||||||
|
).
|
||||||
|
|
||||||
|
local copied is list(
|
||||||
|
"/lib/ui",
|
||||||
|
"/prog/execnode",
|
||||||
|
"/prog/nodestats",
|
||||||
|
"/prog/circ"
|
||||||
|
).
|
||||||
|
|
||||||
|
Bootstrap(
|
||||||
|
"/boot/satellite",
|
||||||
|
"",
|
||||||
|
compiled,
|
||||||
|
copied,
|
||||||
|
debug
|
||||||
|
).
|
|
@ -11,7 +11,7 @@ function ExecNode {
|
||||||
local leadT is BurnTime(NEXTNODE:DELTAV:MAG / 2).
|
local leadT is BurnTime(NEXTNODE:DELTAV:MAG / 2).
|
||||||
local t is BurnTime(NEXTNODE:DELTAV:MAG).
|
local t is BurnTime(NEXTNODE:DELTAV:MAG).
|
||||||
|
|
||||||
if willStage(NEXTNODE:DELTAV:MAG) {
|
if WillStage(NEXTNODE:DELTAV:MAG) {
|
||||||
print "WARNING: kOS will stage during this node execution. Safe cancellation requires reboot.".
|
print "WARNING: kOS will stage during this node execution. Safe cancellation requires reboot.".
|
||||||
when flameOut() then {
|
when flameOut() then {
|
||||||
print "Flameout detected. Staging.".
|
print "Flameout detected. Staging.".
|
||||||
|
@ -39,6 +39,12 @@ function ExecNode {
|
||||||
print "Node execution complete.".
|
print "Node execution complete.".
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function WillStage {
|
||||||
|
parameter dV.
|
||||||
|
if not HASNODE { return false. }
|
||||||
|
return dV > NEXTNODE:DELTAV:MAG.
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate the time required to burn a given dV.
|
// Calculate the time required to burn a given dV.
|
||||||
// Assumes a perfectly spherical Kerbal in a vacuum.
|
// Assumes a perfectly spherical Kerbal in a vacuum.
|
||||||
function BurnTime {
|
function BurnTime {
|
||||||
|
|
15
prog/circ.ks
Normal file
15
prog/circ.ks
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
@lazyglobal off.
|
||||||
|
|
||||||
|
runoncepath("/lib/navigation").
|
||||||
|
|
||||||
|
parameter where is "a".
|
||||||
|
parameter whereStr is "apoapsis".
|
||||||
|
|
||||||
|
local usePeri is false.
|
||||||
|
if where = "p" {
|
||||||
|
set usePeri to true.
|
||||||
|
set whereStr to "periapsis".
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateCircularizationNode(usePeri).
|
||||||
|
print "Circularization node created at " + whereStr.
|
4
prog/execnode.ks
Normal file
4
prog/execnode.ks
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
@lazyglobal off.
|
||||||
|
|
||||||
|
runoncepath("/lib/node").
|
||||||
|
ExecuteNode().
|
15
prog/nodestats.ks
Normal file
15
prog/nodestats.ks
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
@lazyglobal off.
|
||||||
|
|
||||||
|
runoncepath("/lib/node").
|
||||||
|
|
||||||
|
if not HASNODE {
|
||||||
|
print "No node planned.".
|
||||||
|
return.
|
||||||
|
}
|
||||||
|
|
||||||
|
print "Node dV: " + NEXTNODE:DELTAV:MAG.
|
||||||
|
print "Burn time: " + BurnTime(NEXTNODE:DELTAV:MAG).
|
||||||
|
print "Lead time: " + BurnTime(NEXTNODE:DELTAV:MAG / 2).
|
||||||
|
print "Node UT: " + NEXTNODE:TIME.
|
||||||
|
print "Node ETA: " + NEXTNODE:ETA.
|
||||||
|
print "Will stage? " + choose "yes" if WillStage(NEXTNODE:DELTAV:MAG) else "no".
|
Loading…
Reference in New Issue
Block a user