Tune and improve aircraft code.
This commit is contained in:
parent
376629354b
commit
27ad3c11d7
|
@ -11,9 +11,12 @@ on AG9 {
|
||||||
return true.
|
return true.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global takeoffAngle is 15.
|
||||||
|
global landingAngle is 30.
|
||||||
|
|
||||||
function landingMode {
|
function landingMode {
|
||||||
print "Setting flaps to landing mode.".
|
print "Setting flaps to landing mode.".
|
||||||
SetFlapAngle(20).
|
SetFlapAngle(landingAngle).
|
||||||
when SHIP:VELOCITY:SURFACE:MAG < 0.1 then {
|
when SHIP:VELOCITY:SURFACE:MAG < 0.1 then {
|
||||||
takeoffMode().
|
takeoffMode().
|
||||||
}
|
}
|
||||||
|
@ -21,7 +24,7 @@ function landingMode {
|
||||||
|
|
||||||
function takeoffMode {
|
function takeoffMode {
|
||||||
print "Setting flaps to takeoff mode.".
|
print "Setting flaps to takeoff mode.".
|
||||||
SetFlapAngle(10).
|
SetFlapAngle(takeoffAngle).
|
||||||
on GEAR {
|
on GEAR {
|
||||||
if GEAR = true {
|
if GEAR = true {
|
||||||
return true.
|
return true.
|
||||||
|
@ -45,26 +48,20 @@ local rows is List(MakeRow(top), MakeRow(top)).
|
||||||
local stk is iface:AddStack().
|
local stk is iface:AddStack().
|
||||||
|
|
||||||
AddStockButtons(rows[0], "aircraft").
|
AddStockButtons(rows[0], "aircraft").
|
||||||
|
MakeMenu(
|
||||||
// rows[0]:AddLabel("FLAPS").
|
stk,
|
||||||
// // Todo: make angles configurable...
|
MakeButton(rows[0], "Config"),
|
||||||
// set rows[1]:AddButton("Takeoff"):onClick to {
|
List(
|
||||||
// SetFlapAngle(10).
|
List("Takeoff Flap Angle", "SCALAR", "15"),
|
||||||
// }.
|
List("Landing Flap Angle", "SCALAR", "30")
|
||||||
|
),
|
||||||
// set rows[1]:AddButton("Land"):onClick to {
|
"Apply",
|
||||||
// SetFlapAngle(20).
|
{
|
||||||
// }.
|
parameter options.
|
||||||
|
set takeoffAngle to options["Takeoff Flap Angle"]:TEXT:ToNumber().
|
||||||
// set rows[2]:AddButton("Extend"):onClick to {
|
set landingAngle to options["Landing Flap Angle"]:TEXT:ToNumber().
|
||||||
// SetFlaps(true).
|
}
|
||||||
// }.
|
).
|
||||||
|
|
||||||
// set rows[2]:AddButton("Retract"):onClick to {
|
|
||||||
// SetFlaps(true).
|
|
||||||
// }.
|
|
||||||
|
|
||||||
// rows[3]:AddLabel("AUTO").
|
|
||||||
|
|
||||||
MakeMenu(
|
MakeMenu(
|
||||||
stk,
|
stk,
|
||||||
|
|
|
@ -148,7 +148,7 @@ MakeMenu(
|
||||||
|
|
||||||
MakeMenu(
|
MakeMenu(
|
||||||
stk,
|
stk,
|
||||||
MakeButton(rows[2], "CONF"),
|
MakeButton(rows[2], "Config"),
|
||||||
List(
|
List(
|
||||||
List("Torque Epsilon Max", "SCALAR", "0.001"),
|
List("Torque Epsilon Max", "SCALAR", "0.001"),
|
||||||
List("Max Stopping Time", "SCALAR", "2.0")
|
List("Max Stopping Time", "SCALAR", "2.0")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user