Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clearscreen.
- on ag10 {
- aborttest().
- }
- prep().
- fuel().
- preburner().
- detanking().
- function prep {
- print "Welcome to Starhopper Test Software V4!".
- wait 2.
- print "Running hardware, preparings for software...".
- wait 5.
- set teststatus to "Preparations".
- wait until teststatus = "Preparations".
- stage.
- wait 1.
- set goal to "Static fire".
- if goal = "Preburner" {
- set n to 95.
- } else if goal = "Static fire" {
- set n to 1.
- }
- set northPole TO latlng(90,0).
- set head TO mod(360 - northPole:bearing,360).
- lock steering to heading(head,90).
- set lenght to 2.
- set maxthr to ship:maxthrust.
- set needthr to maxthr/n.
- lock diff to needthr - curthr.
- list engines in engList.
- set eng to engList[0].
- lock curthr to eng:thrust.
- if goal = "Preburner" {
- set tthr to 0.05.
- } else if goal = "Static fire" {
- set tthr to 1.
- }
- print "Goal: " + goal.
- print "Lenght: " + lenght + " Seconds".
- print "Need throttle on test: " + needthr + "kn".
- print "Press 9".
- wait 1.
- wait until ag9.
- set now to time:seconds.
- lock testtime to time:seconds - now.
- wait 1.
- toggle ag9.
- set teststatus to "Fueling".
- print "Go for test".
- }
- function fuel {
- wait until teststatus = "Fueling".
- print "Beginning fueling".
- wait 1.
- toggle ag3.
- wait 1.
- toggle ag2.
- wait 3.
- print "Awaiting for fueling end, press 9 to end".
- until ag9 {
- printing().
- }
- set teststatus to goal + " preparing".
- wait 1.
- toggle ag3.
- toggle ag2.
- wait 1.
- toggle ag9.
- print "Fueling finished, press 9".
- wait 1.
- until ag9 {
- printing().
- }
- set teststatus to goal + " go".
- }
- function preburner {
- wait 1.
- lock throttle to 0.05.
- wait 1.
- set n to time:seconds.
- lock t to time:seconds - n.
- lock throttle to min(tthr, t/1).
- print "Test began".
- until t > lenght - 0.01 {
- clearscreen.
- print "Test lenght: " + t + " Seconds".
- print "Need throttle: " + needthr + "kn".
- print "Current throttle: " + curthr + "kn".
- print "Maximum throttle: " + maxthr + "kn".
- print "Difference: " + diff + "kn".
- log t + ";" + diff + ";" + maxthr + ";" to starhoppertest.txt.
- wait 0.1.
- }
- lock throttle to 0.05.
- print "Test completed".
- wait 4.
- lock throttle to 0.
- set teststatus to "Completed".
- }
- function detanking {
- wait until teststatus = "Completed".
- print "Test status: " + teststatus.
- ag2 on.
- ag3 on.
- wait 1.
- toggle ag9.
- print "Detanking".
- wait 100.
- }
- function printing {
- clearscreen.
- print "Time from test beginning: " + testtime + " Seconds".
- print "Test status: " + teststatus.
- print "Goal: " + goal.
- print "Lenght of test: " + lenght + " Seconds".
- print "Time(KSC): " + time:clock.
- wait 0.1.
- }
- function aborttest {
- print "Abort".
- lock throttle to 0.
- unlock steering.
- if ag3 or ag2 or ag1 {
- detanking().
- } else {
- print 3/0.
- }
- }
Add Comment
Please, Sign In to add comment