Improvements and gui to ascent script

This commit is contained in:
2026-05-21 01:32:58 -07:00
parent 6822923238
commit a314cdaa62
15 changed files with 405 additions and 226 deletions
+51
View File
@@ -0,0 +1,51 @@
// ═══════════════════════════════════════════════════════════
// staging.ks
// Utility functions related to staging and the effects of changing stages
//
// Usage:
// basicStaging()
// calcBurnTime(dvNeeded: scalar)
// ═══════════════════════════════════════════════════════════
function calcBurnTime {
parameter dvNeeded.
local totalTime to 0.
local dvRemaining to dvNeeded.
local stageNum to ship:stagenum.
until dvRemaining <= 0 or stageNum < 0 {
local stageDv to ship:stagedeltav(stageNum):current.
local stageTime to ship:stagedeltav(stageNum):duration.
print "Stage: " + stageNum.
if stageDv <= 0 {
set stageNum to stageNum - 1.
} else if stageDv >= dvRemaining {
set totalTime to totalTime + stageTime * (dvRemaining / stageDv).
set dvRemaining to 0.
} else {
set totalTime to totalTime + stageTime.
set dvRemaining to dvRemaining - stageDv.
set stageNum to stageNum - 1.
}
print " - time: " + totalTime.
print " - dv : " + dvRemaining.
}
if dvRemaining > 0 {
print "WARNING: Insufficient dV. Short by " + round(dvRemaining, 1) + " m/s.".
}
return totalTime.
}
function deployables {
ag1 on.
wait 0.5.
panels on.
radiators on.
ag2 on.
}