HvrdlS

booster static fire

Jun 7th, 2023
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. clearscreen.
  2. on ag10 {
  3. aborttest().
  4. }
  5.  
  6. prep().
  7. fuel().
  8. preburner().
  9. detanking().
  10.  
  11.  
  12. function prep {
  13. print "Welcome to Starship Test Software V2!".
  14. print "Running hardware, preparings for software...".
  15. wait 1.
  16. set teststatus to "Preparations".
  17. wait until teststatus = "Preparations".
  18. wait 1.
  19. set goal to "Static fire".
  20. if goal = "Preburner" {
  21. set n to 95.
  22. } else if goal = "Static fire" {
  23. set n to 0.9.
  24. }
  25.  
  26. set northPole TO latlng(90,0).
  27. set head TO mod(360 - northPole:bearing,360).
  28. lock steering to heading(head, 90).
  29. set lenght to 13.
  30. set engList to list().
  31. set i to -1.
  32. until i >= 32 {
  33. set i to i + 1.
  34. engList:add(ship:partstagged("Vector" + i)[0]).
  35. }
  36.  
  37. if goal = "Preburner" {
  38. set tthr to 0.05.
  39. } else if goal = "Static fire" {
  40. set tthr to 0.9.
  41. }
  42.  
  43. for eng in engList { eng:shutdown. }
  44. print "Goal: " + goal.
  45. print "Lenght: " + lenght + " Seconds".
  46. print "Press 9".
  47. wait 1.
  48. wait until ag9.
  49. set now to time:seconds.
  50. lock testtime to time:seconds - now.
  51. wait 1.
  52. toggle ag9.
  53. set teststatus to "Fueling".
  54. print "Go for test".
  55. }
  56.  
  57. function fuel {
  58. print "Beginning fueling".
  59. wait 1.
  60. print "Awaiting for fueling end, press 9 to end".
  61. wait 1.
  62. until ag9 {
  63. printing().
  64. }
  65.  
  66. set teststatus to goal + " preparing".
  67. wait 1.
  68. toggle ag1.
  69. toggle ag2.
  70. toggle ag9.
  71. print "Fueling finished, press 9".
  72. wait 1.
  73. until ag9 {
  74. printing().
  75. }
  76.  
  77. toggle ag1.
  78. toggle ag2.
  79. wait 6.
  80. set teststatus to goal + " go".
  81. }
  82.  
  83. function preburner {
  84. lock throttle to 0.05.
  85. set now to time:seconds.
  86. lock t to time:seconds-now.
  87. ship:partstagged("Vector0")[0]:activate.
  88. ship:partstagged("Vector1")[0]:activate.
  89. ship:partstagged("Vector2")[0]:activate.
  90. ship:partstagged("Vector20")[0]:activate.
  91. ship:partstagged("Vector18")[0]:activate.
  92. ship:partstagged("Vector28")[0]:activate.
  93. ship:partstagged("Vector30")[0]:activate.
  94. lock throttle to min(tthr, t/0.3).
  95. wait 0.5.
  96. lock throttle to tthr.
  97. ship:partstagged("Vector29")[0]:activate.
  98. ship:partstagged("Vector19")[0]:activate.
  99. ship:partstagged("Vector10")[0]:activate.
  100. ship:partstagged("Vector12")[0]:activate.
  101. ship:partstagged("Vector4")[0]:activate.
  102. ship:partstagged("Vector6")[0]:activate.
  103. wait 0.2.
  104. ship:partstagged("Vector16")[0]:activate.
  105. set n to time:seconds.
  106. lock t to time:seconds - n.
  107. print "Test began".
  108. until t > lenght - 0.0000001 {
  109. clearscreen.
  110. print "Test lenght: " + t + " Seconds".
  111. wait 0.01.
  112. }
  113.  
  114. set n to time:seconds.
  115. lock t to time:seconds - n.
  116. toggle ag1.
  117. toggle ag2.
  118. lock throttle to max(0.05, 1-(t/0.3)).
  119. wait 0.5.
  120. print "Test completed".
  121. lock throttle to 0.
  122. set teststatus to "Completed, detanking".
  123. }
  124.  
  125. function detanking {
  126. print "Test status: " + teststatus.
  127. toggle ag1.
  128. toggle ag2.
  129. for eng in engList { eng:shutdown. }
  130. wait 1.
  131. toggle ag9.
  132. wait 400.
  133. toggle ag1.
  134. toggle ag2.
  135. }
  136.  
  137. function printing {
  138. clearscreen.
  139. print "Time from test beginning: " + testtime + " Seconds".
  140. print "Test status: " + teststatus.
  141. print "Goal: " + goal.
  142. print "Lenght of test: " + lenght + " Seconds".
  143. print "Time(KSC): " + time:clock.
  144. wait 0.1.
  145. }
  146.  
  147. function aborttest {
  148. print "Abort".
  149. for eng in engList { eng:shutdown. }
  150. lock throttle to 0.
  151. unlock steering.
  152. wait 1.
  153. unlock throttle.
  154. set teststatus to "Detanking".
  155. detanking().
  156. }
Advertisement
Add Comment
Please, Sign In to add comment