From faf5093366498ea3658324e2198b8724af0b68b3 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Mon, 17 Apr 2017 15:44:59 -0400 Subject: [PATCH] FBW improvements, etc --- Nasal/efis.nas | 4 ++-- Nasal/it-fbw.nas | 4 ++-- Nasal/thrust.nas | 18 ++++++++++++------ Systems/it-fbw-b.xml | 2 +- Systems/it-fbw.xml | 26 ++++++++++++++------------ 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/Nasal/efis.nas b/Nasal/efis.nas index 7afc5372..fe270cfc 100644 --- a/Nasal/efis.nas +++ b/Nasal/efis.nas @@ -1,10 +1,10 @@ -# A320 EFIS controller by Joshua Davidson (it0uchpods/411). +# A3XX EFIS controller by Joshua Davidson (it0uchpods). setlistener("sim/signals/fdm-initialized", func { setprop("instrumentation/efis/mfd/pnl_mode-num", 3); setprop("/controls/lighting/ndl-norm", "1"); setprop("/controls/lighting/ndr-norm", "1"); - print("EFIS ... FINE!"); + print("EFIS ... Done!"); }); # Captain diff --git a/Nasal/it-fbw.nas b/Nasal/it-fbw.nas index 3eb9bcd7..230f3cad 100644 --- a/Nasal/it-fbw.nas +++ b/Nasal/it-fbw.nas @@ -1,4 +1,4 @@ -# Airbus A3XX FBW System by Joshua Davidson (it0uchpods/411) +# Airbus A3XX FBW System by Joshua Davidson (it0uchpods) # V0.9.6 ######################## @@ -87,7 +87,7 @@ setlistener("/sim/signals/fdm-initialized", func { setprop("/it-fbw/law", 2); update_roll.start(); update_pitch.start(); - print("AIRBUS FBW ... OK!"); + print("AIRBUS FBW ... Done!"); }); setlistener("/systems/electrical/bus/ac-ess", func { diff --git a/Nasal/thrust.nas b/Nasal/thrust.nas index 94068c22..00be0d5c 100644 --- a/Nasal/thrust.nas +++ b/Nasal/thrust.nas @@ -1,14 +1,14 @@ -# A320 Throttle Control System by Joshua Davidson (it0uchpods/411) +# A3XX Throttle Control System by Joshua Davidson (it0uchpods) # Set A/THR modes to Custom IT-AUTOTHRUST, and other thrust modes like MCT, TOGA and eventually TO FLEX. # Also handles FADEC -# V1.9 +# V1.9.1 setlistener("/sim/signals/fdm-initialized", func { setprop("/systems/thrust/state1", "IDLE"); setprop("/systems/thrust/state2", "IDLE"); setprop("/systems/thrust/lvrclb", "0"); setprop("/systems/thrust/clbreduc-ft", "1500"); - lvrclb(); + lvrclbt.start(); print("FADEC ... Done!") }); @@ -81,14 +81,20 @@ var lvrclb = func { } else { var status = getprop("/systems/thrust/lvrclb"); if (status == 0) { - if (getprop("/instrumentation/altimeter/indicated-altitude-ft") >= getprop("/systems/thrust/clbreduc-ft")) { + if (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN") { setprop("/systems/thrust/lvrclb", "1"); } else { - setprop("/systems/thrust/lvrclb", "0"); + if (getprop("/instrumentation/altimeter/indicated-altitude-ft") >= getprop("/systems/thrust/clbreduc-ft")) { + setprop("/systems/thrust/lvrclb", "1"); + } else { + setprop("/systems/thrust/lvrclb", "0"); + } } } else if (status == 1) { setprop("/systems/thrust/lvrclb", "0"); } } - settimer(lvrclb, 0.5); } + +# Timers +var lvrclbt = maketimer(0.5, lvrclb); diff --git a/Systems/it-fbw-b.xml b/Systems/it-fbw-b.xml index 3e97bd04..e1e67d73 100644 --- a/Systems/it-fbw-b.xml +++ b/Systems/it-fbw-b.xml @@ -1,6 +1,6 @@ - + diff --git a/Systems/it-fbw.xml b/Systems/it-fbw.xml index 4693d8b7..dcc956ae 100644 --- a/Systems/it-fbw.xml +++ b/Systems/it-fbw.xml @@ -1,3 +1,5 @@ + + /it-fbw/law /it-fbw/roll-deg @@ -40,19 +42,19 @@ /controls/flight/aileron - -1.0 -0.2 - -0.7 -0.1 - -0.5 -0.05 - -0.3 -0.01 - -0.15 -0.005 - -0.05 -0.001 + -1.0 -0.3 + -0.7 -0.2 + -0.5 -0.1 + -0.3 -0.05 + -0.15 -0.01 + -0.05 -0.005 0.00 0.00 - 0.05 0.001 - 0.15 0.005 - 0.3 0.01 - 0.5 0.05 - 0.7 0.1 - 1.0 0.2 + 0.05 0.005 + 0.15 0.01 + 0.3 0.05 + 0.5 0.1 + 0.7 0.2 + 1.0 0.3