2021-07-18 23:32:45 +00:00
|
|
|
function launchButtonPressed {
|
2021-07-19 07:43:07 +00:00
|
|
|
run "launch"(
|
|
|
|
targetApo:TEXT:ToNumber(),
|
|
|
|
gravTurnStart:TEXT:ToNumber(),
|
2021-07-19 08:46:05 +00:00
|
|
|
gravPitch:TEXT:ToNumber(),
|
|
|
|
initialPitch:TEXT:ToNumber(),
|
|
|
|
minimumPitch:TEXT:ToNumber()
|
2021-07-19 04:54:32 +00:00
|
|
|
).
|
2021-07-18 23:32:45 +00:00
|
|
|
}
|
|
|
|
|
2021-07-19 07:43:07 +00:00
|
|
|
function nodeButtonPressed {
|
2021-07-19 08:46:05 +00:00
|
|
|
run "execnode".
|
2021-07-19 07:43:07 +00:00
|
|
|
}
|
|
|
|
|
2021-07-20 01:36:04 +00:00
|
|
|
local termOn is false.
|
|
|
|
function terminalButtonPressed {
|
|
|
|
if termOn {
|
|
|
|
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal").
|
|
|
|
set termOn to false.
|
|
|
|
} else {
|
|
|
|
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Open Terminal").
|
|
|
|
set termOn to true.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-19 08:46:05 +00:00
|
|
|
// Main UI.
|
2021-07-18 23:32:45 +00:00
|
|
|
local interface is gui(200).
|
2021-07-19 07:43:07 +00:00
|
|
|
set interface:X to 200.
|
2021-07-19 08:46:05 +00:00
|
|
|
set interface:Y to 800.
|
2021-07-18 23:32:45 +00:00
|
|
|
|
|
|
|
// Launch button
|
2021-07-19 04:54:32 +00:00
|
|
|
local hBox is interface:AddHBox().
|
|
|
|
hBox:AddLabel("Initial Pitch").
|
|
|
|
local initialPitch is hBox:AddTextField("85").
|
|
|
|
|
2021-07-19 08:46:05 +00:00
|
|
|
local hBox is interface:AddHBox().
|
|
|
|
hBox:AddLabel("Minimum Pitch").
|
2021-07-20 01:29:27 +00:00
|
|
|
local minimumPitch is hBox:AddTextField("5").
|
2021-07-19 08:46:05 +00:00
|
|
|
|
2021-07-19 04:54:32 +00:00
|
|
|
local hBox is interface:AddHBox().
|
|
|
|
hBox:AddLabel("Gravity Turn @").
|
|
|
|
local gravTurnStart is hBox:AddTextField("8000").
|
|
|
|
|
|
|
|
local hBox is interface:AddHBox().
|
|
|
|
hBox:AddLabel("Gravity Pitch").
|
|
|
|
local gravPitch is hBox:AddTextField("75").
|
|
|
|
|
|
|
|
local hBox is interface:AddHBox().
|
|
|
|
hBox:AddLabel("Target Apoapsis").
|
|
|
|
local targetApo is hBox:AddTextField("80000").
|
|
|
|
|
|
|
|
local launchButton is interface:AddButton("Launch").
|
2021-07-18 23:32:45 +00:00
|
|
|
set launchButton:onClick to launchButtonPressed@.
|
2021-07-19 04:54:32 +00:00
|
|
|
|
2021-07-19 07:43:07 +00:00
|
|
|
local nodeButton is interface:AddButton("Execute Node").
|
2021-07-19 08:46:05 +00:00
|
|
|
set nodeButton:onClick to nodeButtonPressed@.
|
2021-07-19 07:43:07 +00:00
|
|
|
|
2021-07-20 01:36:04 +00:00
|
|
|
local termButton is interface:AddButton("Terminal").
|
|
|
|
set termButton:onClick to terminalButtonPressed@.
|
|
|
|
|
2021-07-18 23:32:45 +00:00
|
|
|
interface:show().
|
|
|
|
|
|
|
|
wait until false.
|