diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index a75723d9..e456251d 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -210,7 +210,7 @@ var canvas_PFD_base = { wow2 = getprop("/gear/gear[2]/wow"); # FMA MAN TOGA MCT FLX THR - if (athr == 1 and (state1 == "TOGA" or state1 == "MCT" or state1 == "MAN THR" or state2 == "TOGA" or state2 == "MCT" or state2 == "MAN THR")) { + if (athr == 1 and (state1 == "TOGA" or state1 == "MCT" or state1 == "MAN THR" or state2 == "TOGA" or state2 == "MCT" or state2 == "MAN THR") and getprop("/systems/thrust/eng-out") != 1) { me["FMA_man"].show(); me["FMA_manmode"].show(); if (state1 == "TOGA" or state2 == "TOGA") { @@ -245,6 +245,30 @@ var canvas_PFD_base = { me["FMA_manmode"].setText("THR"); me["FMA_man_box"].setColor(0.7333,0.3803,0); } + } else if (athr == 1 and (state1 == "TOGA" or (state1 == "MCT" and getprop("/controls/engines/thrust-limit") == "FLX") or (state1 == "MAN THR" and thr1 >= 0.83) or state2 == "TOGA" or (state2 == "MCT" and + getprop("/controls/engines/thrust-limit") == "FLX") or (state2 == "MAN THR" and thr2 >= 0.83)) and getprop("/systems/thrust/eng-out") == 1) { + me["FMA_man"].show(); + me["FMA_manmode"].show(); + if (state1 == "TOGA" or state2 == "TOGA") { + me["FMA_flx_box"].hide(); + me["FMA_flxtemp"].hide(); + me["FMA_man_box"].show(); + me["FMA_manmode"].setText("TOGA"); + me["FMA_man_box"].setColor(0.8078,0.8039,0.8078); + } else if ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) { + me["FMA_flx_box"].hide(); + me["FMA_flxtemp"].hide(); + me["FMA_man_box"].show(); + me["FMA_manmode"].setText("THR"); + me["FMA_man_box"].setColor(0.7333,0.3803,0); + } else if ((state1 == "MCT" or state2 == "MCT") and getprop("/controls/engines/thrust-limit") == "FLX") { + me["FMA_flxtemp"].setText(sprintf("%s", "+" ~ getprop("/FMGC/internal/flex"))); + me["FMA_man_box"].hide(); + me["FMA_flx_box"].show(); + me["FMA_flxtemp"].show(); + me["FMA_manmode"].setText("FLX "); + me["FMA_man_box"].setColor(0.8078,0.8039,0.8078); + } } else { me["FMA_man"].hide(); me["FMA_manmode"].hide(); @@ -253,6 +277,12 @@ var canvas_PFD_base = { me["FMA_flxtemp"].hide(); } + if (getprop("/systems/thrust/eng-out") == 1) { + me["FMA_lvrclb"].setText("LVR MCT"); + } else { + me["FMA_lvrclb"].setText("LVR CLB"); + } + if (athr == 1 and getprop("/systems/thrust/lvrclb") == 1) { me["FMA_lvrclb"].show(); } else { @@ -260,7 +290,15 @@ var canvas_PFD_base = { } # FMA A/THR - if (athr == 1 and ((state1 == "MAN" or state1 == "CL") and (state2 == "MAN" or state2 == "CL"))) { + if (athr == 1 and getprop("/systems/thrust/eng-out") != 1 and (state1 == "MAN" or state1 == "CL") and (state2 == "MAN" or state2 == "CL")) { + me["FMA_thrust"].show(); + if (getprop("/modes/pfd/fma/throttle-mode-box") == 1 and throttle_mode != " ") { + me["FMA_thrust_box"].show(); + } else { + me["FMA_thrust_box"].hide(); + } + } else if (athr == 1 and getprop("/systems/thrust/eng-out") == 1 and (state1 == "MAN" or state1 == "CL" or (state1 == "MAN THR" and thr1 < 0.83) or (state1 == "MCT" and getprop("/controls/engines/thrust-limit") != "FLX")) and + (state2 == "MAN" or state2 == "CL" or (state2 == "MAN THR" and thr2 < 0.83) or (state2 == "MCT" and getprop("/controls/engines/thrust-limit") != "FLX"))) { me["FMA_thrust"].show(); if (getprop("/modes/pfd/fma/throttle-mode-box") == 1 and throttle_mode != " ") { me["FMA_thrust_box"].show(); @@ -390,7 +428,7 @@ var canvas_PFD_base = { me["FMA_fd"].setText(sprintf("%s", getprop("/modes/pfd/fma/fd-mode"))); me["FMA_athr"].setText(sprintf("%s", getprop("/modes/pfd/fma/at-mode"))); - if ((state1 == "MAN" or state1 == "CL") and (state2 == "MAN" or state2 == "CL")) { + if (getprop("/modes/pfd/fma/athr-armed") != 1) { me["FMA_athr"].setColor(0.8078,0.8039,0.8078); } else { me["FMA_athr"].setColor(0.0862,0.5176,0.6470); diff --git a/Nasal/FMGC-c.nas b/Nasal/FMGC-c.nas index 2b1faa02..ba2214e4 100644 --- a/Nasal/FMGC-c.nas +++ b/Nasal/FMGC-c.nas @@ -46,17 +46,23 @@ var loopFMA = maketimer(0.05, func { var state1 = getprop("/systems/thrust/state1"); var state2 = getprop("/systems/thrust/state2"); var newthr = getprop("/modes/pfd/fma/throttle-mode"); + var thr1 = getprop("/controls/engines/engine[0]/throttle-pos"); + var thr2 = getprop("/controls/engines/engine[1]/throttle-pos"); if (state1 == "TOGA" or state2 == "TOGA") { - if (newthr != " ") { - setprop("/modes/pfd/fma/throttle-mode", " "); + if (newthr != " ") { + setprop("/modes/pfd/fma/throttle-mode", " "); } - } else if (state1 == "MCT" or state2 == "MCT") { + } else if ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83)) { + if (newthr != " ") { + setprop("/modes/pfd/fma/throttle-mode", " "); + } + } else if ((state1 == "MCT" or state2 == "MCT") and getprop("/systems/thrust/eng-out") != 1) { if (newthr != " ") { setprop("/modes/pfd/fma/throttle-mode", " "); } - } else if (state1 == "MAN THR" or state2 == "MAN THR") { - if (newthr != " ") { - setprop("/modes/pfd/fma/throttle-mode", " "); + } else if (((state1 == "MAN THR" and thr1 < 0.83) or (state2 == "MAN THR" and thr2 < 0.83)) and getprop("/systems/thrust/eng-out") != 1) { + if (newthr != " ") { + setprop("/modes/pfd/fma/throttle-mode", " "); } } else { if ((getprop("/it-autoflight/output/vert") == 4) or (getprop("/it-autoflight/output/vert") == 6) or (getprop("/it-autoflight/output/vert") == 7) or (getprop("/it-autoflight/output/vert") == 8)) { @@ -71,7 +77,11 @@ var loopFMA = maketimer(0.05, func { setprop("/modes/pfd/fma/throttle-mode", "THR IDLE"); } } else if (thr == 2) { - if (state1 == "CL" or state2 == "CL") { + if (state1 == "MCT" or state2 == "MCT" and getprop("/systems/thrust/eng-out") == 1) { + if (newthr != "THR MCT") { + setprop("/modes/pfd/fma/throttle-mode", "THR MCT"); + } + } else if (state1 == "CL" or state2 == "CL") { if (newthr != "THR CLB") { setprop("/modes/pfd/fma/throttle-mode", "THR CLB"); } @@ -88,7 +98,12 @@ var loopFMA = maketimer(0.05, func { } # A/THR Armed/Active - if (getprop("/it-autoflight/output/athr") == 1 and (state1 == "MAN THR" or state2 == "MAN THR" or state1 == "MCT" or state2 == "MCT" or state1 == "TOGA" or state2 == "TOGA")) { + if (getprop("/it-autoflight/output/athr") == 1 and (state1 == "MAN THR" or state2 == "MAN THR" or state1 == "MCT" or state2 == "MCT" or state1 == "TOGA" or state2 == "TOGA") and getprop("/systems/thrust/eng-out") != 1) { + if (getprop("/modes/pfd/fma/athr-armed") != 1) { + setprop("/modes/pfd/fma/athr-armed", 1); + } + } else if (getprop("/it-autoflight/output/athr") == 1 and ((state1 == "MAN THR" and thr1 >= 0.83) or (state2 == "MAN THR" and thr2 >= 0.83) or (state1 == "MCT" and getprop("/controls/engines/thrust-limit") == "FLX") or + (state2 == "MCT" and getprop("/controls/engines/thrust-limit") == "FLX") or state1 == "TOGA" or state2 == "TOGA") and getprop("/systems/thrust/eng-out") == 1) { if (getprop("/modes/pfd/fma/athr-armed") != 1) { setprop("/modes/pfd/fma/athr-armed", 1); } @@ -612,8 +627,13 @@ setlistener("/modes/pfd/fma/athr-armed", func { setlistener("/modes/pfd/fma/throttle-mode", func { var state1 = getprop("/systems/thrust/state1"); var state2 = getprop("/systems/thrust/state2"); - if (getprop("/it-autoflight/output/athr") == 1 and state1 != "MCT" and state2 != "MCT" and state1 != "MAN THR" and state2 != "MAN THR" and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE") { + if (getprop("/it-autoflight/output/athr") == 1 and state1 != "MCT" and state2 != "MCT" and state1 != "MAN THR" and state2 != "MAN THR" and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and + getprop("/systems/thrust/eng-out") != 1) { setprop("/modes/pfd/fma/throttle-mode-time", getprop("/sim/time/elapsed-sec")); + } else if (getprop("/it-autoflight/output/athr") == 1 and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE" and getprop("/systems/thrust/eng-out") == 1) { + if (getprop("/controls/engines/engine[0]/throttle-pos") < 0.83 and getprop("/controls/engines/engine[1]/throttle-pos") < 0.83) { + setprop("/modes/pfd/fma/throttle-mode-time", getprop("/sim/time/elapsed-sec")); + } } }); diff --git a/Nasal/fadec-common.nas b/Nasal/fadec-common.nas index cbab9e7f..7ceaff98 100644 --- a/Nasal/fadec-common.nas +++ b/Nasal/fadec-common.nas @@ -28,6 +28,7 @@ setprop("/systems/thrust/mct-lim", 0.0); setprop("/systems/thrust/clb-lim", 0.0); setprop("/systems/thrust/lim-flex", 0); setprop("/engines/flex-derate", 0); +setprop("/systems/thrust/eng-out", 0); setlistener("/sim/signals/fdm-initialized", func { var thr1 = getprop("/controls/engines/engine[0]/throttle-pos"); @@ -70,13 +71,15 @@ setlistener("/controls/engines/engine[0]/throttle-pos", func { setprop("/systems/thrust/state1", "MAN THR"); unflex(); } else if (thr1 >= 0.78 and thr1 < 0.83) { - if (getprop("/controls/engines/thrust-limit") == "FLX") { - if (getprop("/gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) { - setprop("/it-autoflight/input/athr", 1); + if (getprop("/systems/thrust/eng-out") != 1) { + if (getprop("/controls/engines/thrust-limit") == "FLX") { + if (getprop("/gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) { + setprop("/it-autoflight/input/athr", 1); + } + setprop("/controls/engines/engine[0]/throttle-fdm", 0.99); + } else { + setprop("/controls/engines/engine[0]/throttle-fdm", 0.95); } - setprop("/controls/engines/engine[0]/throttle-fdm", 0.99); - } else { - setprop("/controls/engines/engine[0]/throttle-fdm", 0.95); } setprop("/systems/thrust/state1", "MCT"); } else if (thr1 >= 0.83 and thr1 < 0.95) { @@ -129,13 +132,15 @@ setlistener("/controls/engines/engine[1]/throttle-pos", func { setprop("/systems/thrust/state2", "MAN THR"); unflex(); } else if (thr2 >= 0.78 and thr2 < 0.83) { - if (getprop("/controls/engines/thrust-limit") == "FLX") { - if (getprop("/gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) { - setprop("/it-autoflight/input/athr", 1); + if (getprop("/systems/thrust/eng-out") != 1) { + if (getprop("/controls/engines/thrust-limit") == "FLX") { + if (getprop("/gear/gear[0]/wow") == 1 and (engstate1 == 3 or engstate2 == 3)) { + setprop("/it-autoflight/input/athr", 1); + } + setprop("/controls/engines/engine[1]/throttle-fdm", 0.99); + } else { + setprop("/controls/engines/engine[1]/throttle-fdm", 0.95); } - setprop("/controls/engines/engine[1]/throttle-fdm", 0.99); - } else { - setprop("/controls/engines/engine[1]/throttle-fdm", 0.95); } setprop("/systems/thrust/state2", "MCT"); } else if (thr2 >= 0.83 and thr2 < 0.95) { @@ -187,14 +192,6 @@ var atoff_request = func { } } -setlistener("/systems/thrust/state1", func { - thrust_lim(); -}); - -setlistener("/systems/thrust/state2", func { - thrust_lim(); -}); - var thrust_lim = func { state1 = getprop("/systems/thrust/state1"); state2 = getprop("/systems/thrust/state2"); @@ -266,7 +263,18 @@ var unflex = func { var thrust_loop = func { state1 = getprop("/systems/thrust/state1"); state2 = getprop("/systems/thrust/state2"); - if ((state1 == "CL") and (state2 == "CL")) { + + thrust_lim(); + + if (getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0 and (getprop("/engines/engine[0]/state") != 3 or getprop("/engines/engine[1]/state") != 3)) { + setprop("/systems/thrust/eng-out", 1); + } else { + setprop("/systems/thrust/eng-out", 0); + } + + if (state1 == "CL" and state2 == "CL" and getprop("/systems/thrust/eng-out") != 1) { + setprop("/systems/thrust/lvrclb", "0"); + } else if (state1 == "MCT" and state2 == "MCT" and getprop("/systems/thrust/lim-flex") != 1 and getprop("/systems/thrust/eng-out") == 1) { setprop("/systems/thrust/lvrclb", "0"); } else { var status = getprop("/systems/thrust/lvrclb"); @@ -286,7 +294,7 @@ var thrust_loop = func { setprop("/systems/thrust/lvrclb", "0"); } } - + # ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt"); # flaps = getprop("/controls/flight/flap-pos"); # alphaProtSpd = getprop("/FMGC/internal/alpha-prot-speed"); diff --git a/Systems/fadec-cfm.xml b/Systems/fadec-cfm.xml index 856ba3ae..79fb501d 100644 --- a/Systems/fadec-cfm.xml +++ b/Systems/fadec-cfm.xml @@ -279,6 +279,20 @@ 0 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state1 + MCT + + /systems/thrust/state1 MAN THR @@ -302,16 +316,60 @@ - - /systems/thrust/state1 - MAN THR - + + + /systems/thrust/eng-out + 0 + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + /it-autoflight/output/athr 0 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state1 + MCT + + + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/state1 + MAN THR + + /systems/thrust/state1 CL @@ -338,6 +396,34 @@ 1 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state1 + MCT + + + + + /systems/thrust/eng-out + 1 + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + /systems/thrust/state1 CL @@ -373,6 +459,20 @@ 0 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state2 + MCT + + /systems/thrust/state2 MAN THR @@ -396,16 +496,60 @@ - - /systems/thrust/state2 - MAN THR - + + + /systems/thrust/eng-out + 0 + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + /it-autoflight/output/athr 0 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state2 + MCT + + + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/state2 + MAN THR + + /systems/thrust/state2 CL @@ -432,6 +576,34 @@ 1 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state2 + MCT + + + + + /systems/thrust/eng-out + 1 + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + /systems/thrust/state2 CL diff --git a/Systems/fadec-iae.xml b/Systems/fadec-iae.xml index b68b0d17..7305caff 100644 --- a/Systems/fadec-iae.xml +++ b/Systems/fadec-iae.xml @@ -618,6 +618,20 @@ 0 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state1 + MCT + + /systems/thrust/state1 MAN THR @@ -641,16 +655,60 @@ - - /systems/thrust/state1 - MAN THR - + + + /systems/thrust/eng-out + 0 + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + /it-autoflight/output/athr 0 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state1 + MCT + + + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/state1 + MAN THR + + /systems/thrust/state1 CL @@ -677,6 +735,34 @@ 1 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state1 + MCT + + + + + /systems/thrust/eng-out + 1 + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + /systems/thrust/state1 CL @@ -712,6 +798,20 @@ 0 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state2 + MCT + + /systems/thrust/state2 MAN THR @@ -735,16 +835,60 @@ - - /systems/thrust/state2 - MAN THR - + + + /systems/thrust/eng-out + 0 + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + /it-autoflight/output/athr 0 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state2 + MCT + + + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/state2 + MAN THR + + /systems/thrust/state2 CL @@ -771,6 +915,34 @@ 1 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + /systems/thrust/state2 + MCT + + + + + /systems/thrust/eng-out + 1 + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + /systems/thrust/state2 CL diff --git a/Systems/fmgc-thrust.xml b/Systems/fmgc-thrust.xml index d0e68f94..d50d6806 100644 --- a/Systems/fmgc-thrust.xml +++ b/Systems/fmgc-thrust.xml @@ -192,6 +192,54 @@ + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + + /systems/thrust/state1 + MCT + + + /systems/thrust/state2 + MCT + + + + + + /systems/thrust/eng-out + 1 + + + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + + + /systems/thrust/state1 MAN @@ -276,6 +324,54 @@ + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + + /systems/thrust/state1 + MCT + + + /systems/thrust/state2 + MCT + + + + + + /systems/thrust/eng-out + 1 + + + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + + + /systems/thrust/state1 MAN @@ -358,6 +454,54 @@ 1 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + + /systems/thrust/state1 + MCT + + + /systems/thrust/state2 + MCT + + + + + + /systems/thrust/eng-out + 1 + + + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + + + /systems/thrust/state1 MAN @@ -430,6 +574,54 @@ 2 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + + /systems/thrust/state1 + MCT + + + /systems/thrust/state2 + MCT + + + + + + /systems/thrust/eng-out + 1 + + + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + + + /systems/thrust/state1 MAN @@ -471,6 +663,54 @@ 0 + + + /systems/thrust/eng-out + 1 + + + /systems/thrust/lim-flex + 0 + + + + /systems/thrust/state1 + MCT + + + /systems/thrust/state2 + MCT + + + + + + /systems/thrust/eng-out + 1 + + + + + /controls/engines/engine[0]/throttle-pos + 0.83 + + + /systems/thrust/state1 + MAN THR + + + + + /controls/engines/engine[1]/throttle-pos + 0.83 + + + /systems/thrust/state2 + MAN THR + + + + /systems/thrust/state1 MAN diff --git a/revision.txt b/revision.txt index fefa68a8..8e0f03b2 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4062 \ No newline at end of file +4063 \ No newline at end of file