Tune and improve aircraft code.

This commit is contained in:
Anna Rose 2021-08-24 22:35:49 -04:00
parent 376629354b
commit 27ad3c11d7
2 changed files with 20 additions and 23 deletions

View File

@ -11,9 +11,12 @@ on AG9 {
return true.
}
global takeoffAngle is 15.
global landingAngle is 30.
function landingMode {
print "Setting flaps to landing mode.".
SetFlapAngle(20).
SetFlapAngle(landingAngle).
when SHIP:VELOCITY:SURFACE:MAG < 0.1 then {
takeoffMode().
}
@ -21,7 +24,7 @@ function landingMode {
function takeoffMode {
print "Setting flaps to takeoff mode.".
SetFlapAngle(10).
SetFlapAngle(takeoffAngle).
on GEAR {
if GEAR = true {
return true.
@ -45,26 +48,20 @@ local rows is List(MakeRow(top), MakeRow(top)).
local stk is iface:AddStack().
AddStockButtons(rows[0], "aircraft").
// rows[0]:AddLabel("FLAPS").
// // Todo: make angles configurable...
// set rows[1]:AddButton("Takeoff"):onClick to {
// SetFlapAngle(10).
// }.
// set rows[1]:AddButton("Land"):onClick to {
// SetFlapAngle(20).
// }.
// set rows[2]:AddButton("Extend"):onClick to {
// SetFlaps(true).
// }.
// set rows[2]:AddButton("Retract"):onClick to {
// SetFlaps(true).
// }.
// rows[3]:AddLabel("AUTO").
MakeMenu(
stk,
MakeButton(rows[0], "Config"),
List(
List("Takeoff Flap Angle", "SCALAR", "15"),
List("Landing Flap Angle", "SCALAR", "30")
),
"Apply",
{
parameter options.
set takeoffAngle to options["Takeoff Flap Angle"]:TEXT:ToNumber().
set landingAngle to options["Landing Flap Angle"]:TEXT:ToNumber().
}
).
MakeMenu(
stk,

View File

@ -148,7 +148,7 @@ MakeMenu(
MakeMenu(
stk,
MakeButton(rows[2], "CONF"),
MakeButton(rows[2], "Config"),
List(
List("Torque Epsilon Max", "SCALAR", "0.001"),
List("Max Stopping Time", "SCALAR", "2.0")