diff --git a/A320-main.xml b/A320-main.xml index a32a56b6..3494da34 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -55,11 +55,9 @@ - - Aircraft/A320Family/Systems/hydraulics.xml @@ -67,16 +65,18 @@ Aircraft/A320Family/Systems/it-fbw-b.xml - Aircraft/A320Family/Systems/fmgc-autofight.xml + Aircraft/A320Family/Systems/fmgc-b.xml Aircraft/A320Family/Systems/custom-autothrust.xml - Custom engine values system Aircraft/A320Family/Systems/engine-timing.xml - + + Aircraft/A320Family/Systems/fmgc-c.xml + + Systems/fl2070_sound.xml @@ -310,15 +310,6 @@ -0.25 - - 1 - 0.645 - 40 - 0 - 157 - 20 - 3000 - 0 0 diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 76d80ee4..bbde178d 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -395,12 +395,12 @@ - /flight-management/control/spd-ctrl - man-set + /it-autoflight/input/kts-mach + 0 - /flight-management/control/spd-mode - ias + /it-autoflight/input/spd-managed + 0 @@ -412,29 +412,12 @@ - /flight-management/control/spd-ctrl - man-set + /it-autoflight/input/kts-mach + 1 - /flight-management/control/spd-mode - mach - - - - - - - select - spd.ind - - - - /flight-management/control/spd-ctrl - man-set - - - /flight-management/control/spd-mode - ias + /it-autoflight/input/spd-managed + 0 @@ -444,10 +427,10 @@ select spd.fmgc - - /flight-management/control/spd-ctrl - fmgc - + + /it-autoflight/input/spd-managed + 1 + @@ -456,8 +439,8 @@ spd.dash - /it-autoflight/unused - 999 + /it-autoflight/input/spd-managed + 1 @@ -534,6 +517,20 @@ pick spd-sel + + + true + + nasal + + + + nasal + + + true @@ -553,10 +550,16 @@ true - - /it-autoflight/input/kts-mach - 0 - + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust /it-autoflight/input/spd-kts @@ -566,14 +569,20 @@ - - /it-autoflight/input/kts-mach - 1 - + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust /it-autoflight/input/spd-mach - 0.01 + 0.001 0.50 0.95 @@ -583,10 +592,16 @@ true - - /it-autoflight/input/kts-mach - 0 - + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust /it-autoflight/input/spd-kts @@ -596,14 +611,20 @@ - - /it-autoflight/input/kts-mach - 1 - + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust /it-autoflight/input/spd-mach - -0.01 + -0.001 0.50 0.95 @@ -1130,10 +1151,16 @@ select spd-text - - /it-autoflight/input/kts-mach - 0 - + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 0 + + @@ -1141,10 +1168,16 @@ select mach-text - - /it-autoflight/input/kts-mach - 1 - + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 0 + + diff --git a/Models/FlightDeck/res/horizon.png b/Models/FlightDeck/res/horizon.png index 2928bd8c..2a214424 100644 Binary files a/Models/FlightDeck/res/horizon.png and b/Models/FlightDeck/res/horizon.png differ diff --git a/Models/Instruments/PFD/PFD1.xml b/Models/Instruments/PFD/PFD1.xml index ffea16cc..3c74e935 100644 --- a/Models/Instruments/PFD/PFD1.xml +++ b/Models/Instruments/PFD/PFD1.xml @@ -1015,6 +1015,54 @@ 32 + + + mng-spd + + 0.0010 + -0.042 + 0.0462 + + right-center + yz-plane + number-value + %3.0f + /it-autoflight/input/spd-kts + false + helvetica_bold.txf + true + false + false + 0.006 + + 32 + 32 + + + + + mng-spd-lower + + 0.0010 + -0.042 + -0.0462 + + right-center + yz-plane + number-value + %5.0f + /it-autoflight/input/spd-kts + false + helvetica_bold.txf + true + false + false + 0.006 + + 32 + 32 + + man-mach @@ -1064,12 +1112,61 @@ + + mng-mach + + 0.0010 + -0.042 + 0.0462 + + right-center + yz-plane + number-value + %1.2f + /it-autoflight/input/spd-mach + false + helvetica_bold.txf + true + false + false + 0.006 + + 32 + 32 + + + + + mng-mach-lower + + 0.0010 + -0.042 + -0.0462 + + right-center + yz-plane + number-value + %1.2f + /it-autoflight/input/spd-mach + false + helvetica_bold.txf + true + false + false + 0.006 + + 32 + 32 + + + texmultiple trgt-spd-man + trgt-spd-mng textranslate - /it-autoflight/input/spd-kts + /FMGC/internal/target-ias-pfd 0.002001953 -1 @@ -1089,6 +1186,28 @@ + + select + trgt-spd-man + + + /it-autoflight/input/spd-managed + 0 + + + + + + select + trgt-spd-mng + + + /it-autoflight/input/spd-managed + 1 + + + + select man-spd @@ -1107,6 +1226,36 @@ /it-autoflight/input/kts-mach 0 + + /it-autoflight/input/spd-managed + 0 + + + + + + + select + mng-spd + + + + + + /it-autoflight/input/spd-kts + /instrumentation/airspeed-indicator/indicated-speed-kt + + + 70 + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 1 + @@ -1129,6 +1278,36 @@ /it-autoflight/input/kts-mach 0 + + /it-autoflight/input/spd-managed + 0 + + + + + + + select + mng-spd-lower + + + + + + /it-autoflight/input/spd-kts + /instrumentation/airspeed-indicator/indicated-speed-kt + + + -70 + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 1 + @@ -1151,6 +1330,36 @@ /it-autoflight/input/kts-mach 1 + + /it-autoflight/input/spd-managed + 0 + + + + + + + select + mng-mach + + + + + + /it-autoflight/input/spd-kts + /instrumentation/airspeed-indicator/indicated-speed-kt + + + 70 + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 1 + @@ -1173,6 +1382,36 @@ /it-autoflight/input/kts-mach 1 + + /it-autoflight/input/spd-managed + 0 + + + + + + + select + mng-mach-lower + + + + + + /it-autoflight/input/spd-kts + /instrumentation/airspeed-indicator/indicated-speed-kt + + + -70 + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 1 + @@ -2436,6 +2675,7 @@ + material qnh-indicator @@ -2474,6 +2714,7 @@ + material osgtext-cyan @@ -2505,6 +2746,7 @@ + material osgtext-green @@ -2535,6 +2777,7 @@ + material radio-alt @@ -2560,6 +2803,7 @@ + material man-alt @@ -2590,6 +2834,7 @@ + material decision-height @@ -2616,6 +2861,7 @@ + material radio-alt-land @@ -2641,6 +2887,7 @@ + material athr-afloor-fma @@ -2667,6 +2914,7 @@ + material athr-box-b-fma @@ -2692,4 +2940,33 @@ + + + material + mng-spd + mng-spd-lower + mng-mach + mng-mach-lower + + 1 + 0 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 1 + 0 + 1 + + + diff --git a/Models/Instruments/PFD/PFD2.xml b/Models/Instruments/PFD/PFD2.xml index 7b52b387..05198044 100644 --- a/Models/Instruments/PFD/PFD2.xml +++ b/Models/Instruments/PFD/PFD2.xml @@ -1015,6 +1015,54 @@ 32 + + + mng-spd + + 0.0010 + -0.042 + 0.0462 + + right-center + yz-plane + number-value + %3.0f + /it-autoflight/input/spd-kts + false + helvetica_bold.txf + true + false + false + 0.006 + + 32 + 32 + + + + + mng-spd-lower + + 0.0010 + -0.042 + -0.0462 + + right-center + yz-plane + number-value + %5.0f + /it-autoflight/input/spd-kts + false + helvetica_bold.txf + true + false + false + 0.006 + + 32 + 32 + + man-mach @@ -1064,12 +1112,61 @@ + + mng-mach + + 0.0010 + -0.042 + 0.0462 + + right-center + yz-plane + number-value + %1.2f + /it-autoflight/input/spd-mach + false + helvetica_bold.txf + true + false + false + 0.006 + + 32 + 32 + + + + + mng-mach-lower + + 0.0010 + -0.042 + -0.0462 + + right-center + yz-plane + number-value + %1.2f + /it-autoflight/input/spd-mach + false + helvetica_bold.txf + true + false + false + 0.006 + + 32 + 32 + + + texmultiple trgt-spd-man + trgt-spd-mng textranslate - /it-autoflight/input/spd-kts + /FMGC/internal/target-ias-pfd 0.002001953 -1 @@ -1089,6 +1186,28 @@ + + select + trgt-spd-man + + + /it-autoflight/input/spd-managed + 0 + + + + + + select + trgt-spd-mng + + + /it-autoflight/input/spd-managed + 1 + + + + select man-spd @@ -1107,6 +1226,36 @@ /it-autoflight/input/kts-mach 0 + + /it-autoflight/input/spd-managed + 0 + + + + + + + select + mng-spd + + + + + + /it-autoflight/input/spd-kts + /instrumentation/airspeed-indicator/indicated-speed-kt + + + 70 + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 1 + @@ -1129,6 +1278,36 @@ /it-autoflight/input/kts-mach 0 + + /it-autoflight/input/spd-managed + 0 + + + + + + + select + mng-spd-lower + + + + + + /it-autoflight/input/spd-kts + /instrumentation/airspeed-indicator/indicated-speed-kt + + + -70 + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 1 + @@ -1151,6 +1330,36 @@ /it-autoflight/input/kts-mach 1 + + /it-autoflight/input/spd-managed + 0 + + + + + + + select + mng-mach + + + + + + /it-autoflight/input/spd-kts + /instrumentation/airspeed-indicator/indicated-speed-kt + + + 70 + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 1 + @@ -1173,6 +1382,36 @@ /it-autoflight/input/kts-mach 1 + + /it-autoflight/input/spd-managed + 0 + + + + + + + select + mng-mach-lower + + + + + + /it-autoflight/input/spd-kts + /instrumentation/airspeed-indicator/indicated-speed-kt + + + -70 + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 1 + @@ -2436,6 +2675,7 @@ + material qnh-indicator @@ -2474,6 +2714,7 @@ + material osgtext-cyan @@ -2505,6 +2746,7 @@ + material osgtext-green @@ -2535,6 +2777,7 @@ + material radio-alt @@ -2560,6 +2803,7 @@ + material man-alt @@ -2590,6 +2834,7 @@ + material decision-height @@ -2616,6 +2861,7 @@ + material radio-alt-land @@ -2641,6 +2887,7 @@ + material athr-afloor-fma @@ -2667,6 +2914,7 @@ + material athr-box-b-fma @@ -2692,4 +2940,33 @@ + + + material + mng-spd + mng-spd-lower + mng-mach + mng-mach-lower + + 1 + 0 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 1 + 0 + 1 + + + diff --git a/Models/Instruments/PFD/res/horizon.png b/Models/Instruments/PFD/res/horizon.png index 3f568ac9..dea8ff8c 100644 Binary files a/Models/Instruments/PFD/res/horizon.png and b/Models/Instruments/PFD/res/horizon.png differ diff --git a/Models/Instruments/PFD/res/pfd-3d.ac b/Models/Instruments/PFD/res/pfd-3d.ac index 3250357a..5d36f0b1 100644 --- a/Models/Instruments/PFD/res/pfd-3d.ac +++ b/Models/Instruments/PFD/res/pfd-3d.ac @@ -1,7 +1,26 @@ AC3Db MATERIAL "ac3dmat1" rgb 1 1 1 amb 0 0 0 emis 0.658824 0.670588 0.67451 spec 0 0 0 shi 128 trans 0 OBJECT world -kids 34 +kids 35 +OBJECT poly +name "trgt-spd-mng" +loc 0.00121828 0.000747255 0.0473924 +texture "trgt-spd-mng.png" +crease 45.000000 +numvert 4 +0 -0.0424935 -0.00258292 +0 -0.0424935 0.00258288 +0 0.0424935 0.00258288 +0 0.0424935 -0.00258292 +numsurf 1 +SURF 0x30 +mat 0 +refs 4 +3 0.998074 0.321737 +2 0.800781 0.321737 +1 0.800781 0.0447528 +0 0.998074 0.0447528 +kids 0 OBJECT poly name "ground" loc -0.000632844 0.000620101 0.00496066 diff --git a/Models/Instruments/PFD/res/sky.png b/Models/Instruments/PFD/res/sky.png index 4a7c99eb..2ecff69c 100644 Binary files a/Models/Instruments/PFD/res/sky.png and b/Models/Instruments/PFD/res/sky.png differ diff --git a/Nasal/FMGC.nas b/Nasal/FMGC.nas index 217739c4..5e109d6c 100644 --- a/Nasal/FMGC.nas +++ b/Nasal/FMGC.nas @@ -5,13 +5,25 @@ # Init Functions # ################## +setprop("/FMGC/internal/overspeed", 338); setprop("/position/gear-agl-ft", 0); +setprop("/FMGC/internal/mng-spd", 157); +setprop("/FMGC/internal/mng-spd-cmd", 157); +setprop("/FMGC/internal/mng-kts-mach", 0); +setprop("/FMGC/internal/mach-switchover", 0); +setprop("/it-autoflight/settings/reduc-agl-ft", 3000); setprop("/it-autoflight/internal/vert-speed-fpm", 0); var FMGCinit = func { setprop("/FMGC/status/to-state", 0); setprop("/FMGC/status/phase", "0"); # 0 is preflight 1 takeoff 2 climb 3 cruise 4 descent 5 approach 6 go around 7 done setprop("/FMGC/internal/tropo", 36090); + setprop("/FMGC/internal/overspeed", 338); + setprop("/FMGC/internal/mng-spd", 157); + setprop("/FMGC/internal/mng-spd-cmd", 157); + setprop("/FMGC/internal/mng-kts-mach", 0); + setprop("/FMGC/internal/mach-switchover", 0); + setprop("/it-autoflight/settings/reduc-agl-ft", 3000); phasecheck.start(); various.start(); } @@ -71,7 +83,9 @@ var phasecheck = maketimer(0.2, func { var mode = getprop("/modes/pfd/fma/pitch-mode"); var gs = getprop("/velocities/groundspeed-kt"); var alt = getprop("/instrumentation/altimeter/indicated-altitude-ft"); - var cruisefl = getprop("/FMGC/internal/cruise-ft"); + var aglalt = getprop("/position/gear-agl-ft"); + var cruiseft = getprop("/FMGC/internal/cruise-ft"); + var cruiseft_b = getprop("/FMGC/internal/cruise-ft") - 50; var newcruise = getprop("/it-autoflight/internal/alt"); var phase = getprop("/FMGC/status/phase"); var state1 = getprop("/systems/thrust/state1"); @@ -82,21 +96,21 @@ var phasecheck = maketimer(0.2, func { var targetvs = getprop("/it-autoflight/input/vs"); var targetfpa = getprop("/it-autoflight/input/fpa"); var vertmode = getprop("/modes/pfd/fma/pitch-mode"); + var reduc_agl_ft = getprop("/it-autoflight/settings/reduc-agl-ft"); if ((((n1_left >= 85) and (n1_right >= 85)) or (gs > 90 )) and flaps < 4 and (mode == "SRS")) { setprop("/FMGC/status/phase", "1"); setprop("/systems/pressurization/mode", "TO"); } - if ((alt >= 3000) and (alt <= cruisefl) and (phase == "1") and (phase != "4") and (mode != "SRS")) { + if ((aglalt >= reduc_agl_ft) and (alt <= cruiseft) and (phase == "1") and (phase != "4") and (mode != "SRS")) { setprop("/FMGC/status/phase", "2"); } - if ((alt >= cruisefl) and (phase == "2") and (mode != "SRS")) { + if (alt >= cruiseft_b and phase == "2" and (mode == "ALT" or mode == "ALT CRZ")) { setprop("/FMGC/status/phase", "3"); setprop("/systems/pressurization/mode", "CR"); } - if ((alt <= cruisefl) and (phase == "3")) { # for now it will have to be when we begin descent. + if (alt <= cruiseft and (mode == "DES" or mode == "OP DES") and phase == "3") { setprop("/FMGC/status/phase", "4"); setprop("/systems/pressurization/mode", "DE"); - } if (getprop("/FMGC/status/to-state") == 0 and flaps >= 4 and ((phase == "4") or (phase == "2"))) { # add man activation of approach phase in MCDU or DECEL when those things are simulated setprop("/FMGC/status/phase", "5"); @@ -131,6 +145,115 @@ var various = maketimer(1, func { } else { setprop("/it-autoflight/settings/reduc-agl-ft", getprop("/FMGC/internal/reduc-agl-ft")); } + + var flap = getprop("/controls/flight/flap-pos"); + if (flap == 0) { + setprop("/FMGC/internal/overspeed", 338); + } else if (flap == 1) { + setprop("/FMGC/internal/overspeed", 216); + } else if (flap == 2) { + setprop("/FMGC/internal/overspeed", 207); + } else if (flap == 3) { + setprop("/FMGC/internal/overspeed", 189); + } else if (flap == 4) { + setprop("/FMGC/internal/overspeed", 174); + } else if (flap == 5) { + setprop("/FMGC/internal/overspeed", 163); + } +}); + +################# +# Managed Speed # +################# + +var ManagedSPD = maketimer(0.25, func { + if (getprop("/FMGC/internal/cruise-lvl-set") == 1 and getprop("/FMGC/internal/cost-index-set") == 1) { + if (getprop("/it-autoflight/input/spd-managed") == 1) { + var alt = getprop("/instrumentation/altimeter/indicated-altitude-ft"); + var mode = getprop("/modes/pfd/fma/pitch-mode"); + var mach = getprop("/instrumentation/airspeed-indicator/indicated-mach"); + var ktsmach = getprop("/it-autoflight/input/kts-mach"); + var mngktsmach = getprop("/FMGC/internal/mng-kts-mach"); + var mng_spd = getprop("/FMGC/internal/mng-spd"); + var mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd"); + var kts_sel = getprop("/it-autoflight/input/spd-kts"); + var mach_sel = getprop("/it-autoflight/input/spd-mach"); + var srsSPD = getprop("/it-autoflight/settings/togaspd"); + var phase = getprop("/FMGC/status/phase"); # 0 is preflight 1 takeoff 2 climb 3 cruise 4 descent 5 approach 6 go around 7 done + var flap = getprop("/controls/flight/flap-pos"); + var overspeed = getprop("/FMGC/internal/overspeed"); + var mach_switchover = getprop("/FMGC/internal/mach-switchover"); + + var mng_alt_spd_cmd = getprop("/FMGC/internal/mng-alt-spd"); + var mng_alt_spd = math.round(mng_alt_spd_cmd, 1); + + var mng_alt_mach_cmd = getprop("/FMGC/internal/mng-alt-mach"); + var mng_alt_mach = math.round(mng_alt_mach_cmd, 0.001); + + if (mode == "SRS" and phase == 0 or phase == 1) { + if (mngktsmach) { + setprop("/FMGC/internal/mng-kts-mach", 0); + } + if (mng_spd_cmd != srsSPD) { + setprop("/FMGC/internal/mng-spd-cmd", srsSPD); + } + } else if (phase == 2 and alt <= 10050) { + if (mngktsmach) { + setprop("/FMGC/internal/mng-kts-mach", 0); + } + if (mng_spd_cmd != 250) { + setprop("/FMGC/internal/mng-spd-cmd", 250); + } + } else if ((phase == 2 or phase == 3) and alt > 10100 and !mach_switchover) { + if (mngktsmach) { + setprop("/FMGC/internal/mng-kts-mach", 0); + } + if (mng_spd_cmd != mng_alt_spd) { + setprop("/FMGC/internal/mng-spd-cmd", mng_alt_spd); + } + } else if ((phase == 2 or phase == 3) and alt > 10100 and mach_switchover) { + if (!mngktsmach) { + setprop("/FMGC/internal/mng-kts-mach", 1); + } + if (mng_spd_cmd != mng_alt_mach) { + setprop("/FMGC/internal/mng-spd-cmd", mng_alt_mach); + } + } else if (phase == 4 or phase == 5 or phase == 6 or phase == 7) { + libraries.mcpSPDKnbPull(); + } + + var mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd"); + + if (mng_spd_cmd > overspeed) { + setprop("/FMGC/internal/mng-spd", overspeed); + } else { + setprop("/FMGC/internal/mng-spd", mng_spd_cmd); + } + + if (ktsmach and !mngktsmach) { + setprop("/it-autoflight/input/kts-mach", 0); + } else if (!ktsmach and mngktsmach) { + setprop("/it-autoflight/input/kts-mach", 1); + } + + var mng_spd = getprop("/FMGC/internal/mng-spd"); + + if (kts_sel != mng_spd and !ktsmach) { + setprop("/it-autoflight/input/spd-kts", mng_spd); + } else if (mach_sel != mng_spd and ktsmach) { + setprop("/it-autoflight/input/spd-mach", mng_spd); + } + + if (mach >= mng_alt_mach and phase == 2) { + setprop("/FMGC/internal/mach-switchover", 1); + } + } else { + ManagedSPD.stop(); + } + } else { + ManagedSPD.stop(); + libraries.mcpSPDKnbPull(); + } }); ################################# @@ -154,6 +277,7 @@ var APinit = func { setprop("/it-autoflight/input/bank-limit", 25); setprop("/it-autoflight/input/trk", 0); setprop("/it-autoflight/input/toga", 0); + setprop("/it-autoflight/input/spd-managed", 0); setprop("/it-autoflight/output/ap1", 0); setprop("/it-autoflight/output/ap2", 0); setprop("/it-autoflight/output/athr", 0); @@ -162,7 +286,6 @@ var APinit = func { setprop("/it-autoflight/output/loc-armed", 0); setprop("/it-autoflight/output/appr-armed", 0); setprop("/it-autoflight/output/thr-mode", 2); - setprop("/it-autoflight/output/retard", 0); setprop("/it-autoflight/output/lat", 5); setprop("/it-autoflight/output/vert", 7); setprop("/it-autoflight/settings/use-nav2-radio", 0); @@ -177,8 +300,8 @@ var APinit = func { setprop("/it-autoflight/mode/arm", "HDG"); setprop("/it-autoflight/mode/lat", "T/O"); setprop("/it-autoflight/mode/vert", "T/O CLB"); - setprop("/it-autoflight/input/spd-kts", 250); - setprop("/it-autoflight/input/spd-mach", 0.68); + setprop("/it-autoflight/input/spd-kts", 100); + setprop("/it-autoflight/input/spd-mach", 0.50); update_armst.start(); thrustmode(); } @@ -225,7 +348,6 @@ setlistener("/it-autoflight/input/athr", func { if (atmas == 0) { setprop("/it-autoflight/output/athr", 0); } else if (atmas == 1) { - setprop("/it-autoflight/output/retard", 0); thrustmode(); setprop("/it-autoflight/output/athr", 1); } @@ -534,8 +656,10 @@ setlistener("/it-autoflight/input/kts-mach", func { # Takeoff Modes # Lat Active var latarms = func { - if (getprop("/position/gear-agl-ft") >= getprop("/it-autoflight/settings/lat-agl-ft")) { - setprop("/it-autoflight/input/lat", getprop("/it-autoflight/input/lat-arm")); + if (getprop("/position/gear-agl-ft") >= 20) { + if (getprop("/it-autoflight/input/lat-arm") == 1) { + setprop("/it-autoflight/input/lat", getprop("/it-autoflight/input/lat-arm")); + } } } @@ -705,52 +829,6 @@ var thrustmode = func { } # ILS and Autoland -# Retard -setlistener("/controls/flight/flaps", func { - var flapc = getprop("/controls/flight/flaps"); - var flapl = getprop("/it-autoflight/settings/land-flap"); - if (flapc >= flapl) { - retardt.start(); - } else { - retardt.stop(); - } -}); - -var retardchk = func { - if (getprop("/it-autoflight/settings/retard-enable") == 1) { - var altpos = getprop("/position/gear-agl-ft"); - var retardalt = getprop("/it-autoflight/settings/retard-ft"); - var aton = getprop("/it-autoflight/output/athr"); - if (altpos < retardalt) { - if (aton == 1) { - setprop("/it-autoflight/output/retard", 1); - setprop("/it-autoflight/mode/thr", "RETARD"); - atofft.start(); - } else { - setprop("/it-autoflight/output/retard", 0); - thrustmode(); - } - } - } -} - -var atoffchk = func{ - var gear1 = getprop("/gear/gear[1]/wow"); - var gear2 = getprop("/gear/gear[2]/wow"); - if (gear1 == 1 or gear2 == 1) { - setprop("/it-autoflight/input/athr", 0); - setprop("/controls/engines/engine[0]/throttle", 0); - setprop("/controls/engines/engine[1]/throttle", 0); - setprop("/controls/engines/engine[2]/throttle", 0); - setprop("/controls/engines/engine[3]/throttle", 0); - setprop("/controls/engines/engine[4]/throttle", 0); - setprop("/controls/engines/engine[5]/throttle", 0); - setprop("/controls/engines/engine[6]/throttle", 0); - setprop("/controls/engines/engine[7]/throttle", 0); - atofft.stop(); - } -} - # LOC and G/S arming var update_arms = func { update_locarmelec(); @@ -815,9 +893,7 @@ var make_appr_active = func { setprop("/it-autoflight/output/vert", 2); setprop("/it-autoflight/mode/vert", "G/S"); setprop("/it-autoflight/mode/arm", " "); - if (getprop("/it-autoflight/settings/land-enable") == 1){ - alandt.start(); - } + alandt.start(); thrustmode(); } @@ -864,8 +940,6 @@ var update_armst = maketimer(0.5, update_arms); var altcaptt = maketimer(0.5, altcapt); var thrustmodet = maketimer(0.5, thrustmode); var minmaxtimer = maketimer(0.5, minmax); -var retardt = maketimer(0.5, retardchk); -var atofft = maketimer(0.5, atoffchk); var alandt = maketimer(0.5, aland); var alandt1 = maketimer(0.5, aland1); var reduct = maketimer(0.5, toga_reduc); diff --git a/Nasal/MCDU/MCDU1.nas b/Nasal/MCDU/MCDU1.nas index 9460c366..3769b281 100644 --- a/Nasal/MCDU/MCDU1.nas +++ b/Nasal/MCDU/MCDU1.nas @@ -314,7 +314,7 @@ var PerfTOInput = func(key) { if (scratchpad >= 100 and scratchpad <= 200) { setprop("/FMGC/internal/v2", scratchpad); setprop("/FMGC/internal/v2-set", 1); - setprop("/it-autoflight/settings/togaspd", scratchpad + 15); + setprop("/it-autoflight/settings/togaspd", scratchpad + 10); setprop("/MCDU[0]/scratchpad", ""); } else { setprop("/MCDU[0]/scratchpad-msg", "1"); diff --git a/Nasal/MCDU/MCDU2.nas b/Nasal/MCDU/MCDU2.nas index 6735fdee..f4cb61b6 100644 --- a/Nasal/MCDU/MCDU2.nas +++ b/Nasal/MCDU/MCDU2.nas @@ -314,7 +314,7 @@ var PerfTOInput = func(key) { if (scratchpad >= 100 and scratchpad <= 200) { setprop("/FMGC/internal/v2", scratchpad); setprop("/FMGC/internal/v2-set", 1); - setprop("/it-autoflight/settings/togaspd", scratchpad + 15); + setprop("/it-autoflight/settings/togaspd", scratchpad + 10); setprop("/MCDU[1]/scratchpad", ""); } else { setprop("/MCDU[1]/scratchpad-msg", "1"); diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index c5f172c1..9a0b34e2 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -194,6 +194,8 @@ var externalconnections = maketimer(0.1, func { }); var mcpSPDKnbPull = func { + setprop("/it-autoflight/input/spd-managed", 0); + fmgc.ManagedSPD.stop(); var ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt"); var mach = getprop("/instrumentation/airspeed-indicator/indicated-mach"); if (getprop("/it-autoflight/input/kts-mach") == 0) { @@ -215,6 +217,15 @@ var mcpSPDKnbPull = func { } } +var mcpSPDKnbPush = func { + if (getprop("/FMGC/internal/cruise-lvl-set") == 1 and getprop("/FMGC/internal/cost-index-set") == 1) { + setprop("/it-autoflight/input/spd-managed", 1); + fmgc.ManagedSPD.start(); + } else { + gui.popupTip("Please make sure you have set a cruise altitude and cost index in the MCDU."); + } +} + # In air, flaps 1 is slats only. On ground, it is slats and flaps. setprop("/controls/flight/flap-lever", 0); diff --git a/Systems/autopilot-dlg.xml b/Systems/autopilot-dlg.xml index aeaa5f94..3fbbbf86 100644 --- a/Systems/autopilot-dlg.xml +++ b/Systems/autopilot-dlg.xml @@ -174,13 +174,11 @@ @@ -223,10 +221,16 @@ 25 << - - /it-autoflight/input/kts-mach - 0 - + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust @@ -244,10 +248,16 @@ 25 < - - /it-autoflight/input/kts-mach - 0 - + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust @@ -266,10 +276,16 @@ /it-autoflight/input/spd-kts true - - /it-autoflight/input/kts-mach - 0 - + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 0 + + dialog-apply @@ -283,10 +299,16 @@ 25 > - - /it-autoflight/input/kts-mach - 0 - + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust @@ -305,10 +327,16 @@ 25 >> - - /it-autoflight/input/kts-mach - 0 - + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust @@ -338,10 +366,16 @@ 25 << - - /it-autoflight/input/kts-mach - 1 - + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust @@ -359,10 +393,16 @@ 25 < - - /it-autoflight/input/kts-mach - 1 - + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust @@ -381,10 +421,16 @@ /it-autoflight/input/spd-mach true - - /it-autoflight/input/kts-mach - 1 - + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 0 + + dialog-apply @@ -398,10 +444,16 @@ 25 > - - /it-autoflight/input/kts-mach - 1 - + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust @@ -420,10 +472,16 @@ 25 >> - - /it-autoflight/input/kts-mach - 1 - + + + /it-autoflight/input/kts-mach + 1 + + + /it-autoflight/input/spd-managed + 0 + + property-adjust diff --git a/Systems/custom-autothrust.xml b/Systems/custom-autothrust.xml index 98720c44..4238b848 100644 --- a/Systems/custom-autothrust.xml +++ b/Systems/custom-autothrust.xml @@ -145,10 +145,6 @@ 0 - - /it-autoflight/output/retard - 0 - @@ -211,10 +207,6 @@ 0 - - /it-autoflight/output/retard - 0 - @@ -272,10 +264,6 @@ /it-autoflight/output/thr-mode 1 - - /it-autoflight/output/retard - 0 - @@ -331,10 +319,6 @@ /it-autoflight/output/thr-mode 2 - - /it-autoflight/output/retard - 0 - @@ -418,10 +402,6 @@ 0 - - /it-autoflight/output/retard - 0 - @@ -484,10 +464,6 @@ 0 - - /it-autoflight/output/retard - 0 - @@ -545,10 +521,6 @@ /it-autoflight/output/thr-mode 1 - - /it-autoflight/output/retard - 0 - @@ -604,10 +576,6 @@ /it-autoflight/output/thr-mode 2 - - /it-autoflight/output/retard - 0 - diff --git a/Systems/fadec-cfm.xml b/Systems/fadec-cfm.xml index a3e7e496..1029768e 100644 --- a/Systems/fadec-cfm.xml +++ b/Systems/fadec-cfm.xml @@ -203,10 +203,6 @@ /it-autoflight/output/thr-mode 0 - - /it-autoflight/output/retard - 0 - 0.40 @@ -232,10 +228,6 @@ /it-autoflight/output/thr-mode 0 - - /it-autoflight/output/retard - 0 - 0.2 @@ -374,10 +366,6 @@ /it-autoflight/output/thr-mode 0 - - /it-autoflight/output/retard - 0 - 0.40 @@ -403,10 +391,6 @@ /it-autoflight/output/thr-mode 0 - - /it-autoflight/output/retard - 0 - 0.2 diff --git a/Systems/fadec-iae.xml b/Systems/fadec-iae.xml index fa306ebe..26cbdcc0 100644 --- a/Systems/fadec-iae.xml +++ b/Systems/fadec-iae.xml @@ -346,10 +346,6 @@ /it-autoflight/output/thr-mode 0 - - /it-autoflight/output/retard - 0 - 0.40 @@ -375,10 +371,6 @@ /it-autoflight/output/thr-mode 0 - - /it-autoflight/output/retard - 0 - 0.2 @@ -517,10 +509,6 @@ /it-autoflight/output/thr-mode 0 - - /it-autoflight/output/retard - 0 - 0.40 @@ -546,10 +534,6 @@ /it-autoflight/output/thr-mode 0 - - /it-autoflight/output/retard - 0 - 0.2 diff --git a/Systems/fmgc-autofight.xml b/Systems/fmgc-b.xml similarity index 99% rename from Systems/fmgc-autofight.xml rename to Systems/fmgc-b.xml index 810ccb8f..2896aab8 100644 --- a/Systems/fmgc-autofight.xml +++ b/Systems/fmgc-b.xml @@ -1117,7 +1117,7 @@ /it-autoflight/internal/target-pitch noise-spike - 3 + 3.5 @@ -1192,7 +1192,7 @@ /controls/flight/elevator noise-spike - 0.2 + 0.3 diff --git a/Systems/fmgc-c.xml b/Systems/fmgc-c.xml new file mode 100644 index 00000000..dadd4c54 --- /dev/null +++ b/Systems/fmgc-c.xml @@ -0,0 +1,89 @@ + + + + + + FMGC MNG SPD + gain + 1 + 0.05 + + + + + /instrumentation/altimeter/indicated-altitude-ft + 10000286 + 42000249 +
+ + /FMGC/internal/cost-index + 01.0 + 1201.1 +
+
+
+ + /FMGC/internal/mng-alt-spd +
+ + + FMGC MNG MACH + gain + 1 + 0.05 + + + + + /instrumentation/altimeter/indicated-altitude-ft + 260000.705 + 420000.815 +
+ + /FMGC/internal/cost-index + 00.97 + 1201.03 +
+
+
+ + /FMGC/internal/mng-alt-mach +
+ + + FMGC Target IAS PFD + gain + 1 + 0.1 + + + + /it-autoflight/input/kts-mach + 0 + + + /it-autoflight/input/spd-kts + + + + + /it-autoflight/input/kts-mach + 1 + + + + + +
+ /instrumentation/airspeed-indicator/indicated-speed-kt + /instrumentation/airspeed-indicator/indicated-mach +
+ /it-autoflight/input/spd-mach +
+
+
+ + /FMGC/internal/target-ias-pfd +
+ +
diff --git a/Systems/pfd.xml b/Systems/pfd.xml index e407ef44..eab139c3 100644 --- a/Systems/pfd.xml +++ b/Systems/pfd.xml @@ -15,84 +15,6 @@ instrumentation/pfd/ground-level-diff - - Target alt diff (selected) gain @@ -105,46 +27,8 @@ instrumentation/altimeter/indicated-altitude-ft instrumentation/pfd/sel-alt-diff - - - Heading Deg gain @@ -333,7 +217,7 @@ velocities/airspeed-kt instrumentation/pfd/speed-lookahead 10.0 - 0.05 + 0.01