From 2f74c03317e34b95b671b308c78683dba12542b9 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Wed, 28 Jun 2017 14:50:39 -0400 Subject: [PATCH] A3XX: Major Update: Update AP, FBW, Autotrim, FCU, add Preselect --- A320-main.xml | 28 +-- Models/FlightDeck/a320.flightdeck.xml | 220 +++++++++++---------- Nasal/FMGC-b.nas | 10 +- Nasal/FMGC.nas | 16 +- Nasal/libraries.nas | 37 ++++ Systems/fmgc-pitch.xml | 202 +------------------ Systems/fmgc-roll-yaw.xml | 71 +------ Systems/it-fbw.xml | 273 ++++++-------------------- 8 files changed, 255 insertions(+), 602 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index c903a9a0..efafe0ae 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -333,19 +333,19 @@ 0 - -0.45 - 0.45 - 0.045 - 0.07 - 10.0 - 0.00001 + -0.4 + 0.4 + 0.08 + 0.09 + 5.0 + 0.001 - -0.20 - 0.20 - -0.06 - 10.0 - 0.00001 + -0.3 + 0.3 + -0.1 + 5.0 + 0.001 -0.9 @@ -363,8 +363,12 @@ 0 - 0 + 0 0 + 0 + 0 + 0 + 0 diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 6c11623a..d21c9aef 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -512,10 +512,16 @@ select lat.dash - - /it-autoflight/output/lat - 0 - + + + /it-autoflight/output/lat + 0 + + + /it-autoflight/custom/show-hdg + 0 + + @@ -533,27 +539,6 @@ select vs.ind - - - /it-autoflight/output/vert - 1 - - - - - - select - fpa.ind - - - /it-autoflight/output/vert - 5 - - - - - - select vs.ind.001 @@ -565,6 +550,7 @@ select + fpa.ind fpa.ind.001 @@ -659,6 +645,14 @@ 0.50 0.95 + + property-adjust + /it-autoflight/custom/spd-knb + 1 + 0 + 10000 + true + @@ -701,6 +695,14 @@ 0.50 0.95 + + property-adjust + /it-autoflight/custom/spd-knb + -1 + 0 + 10000 + true + @@ -711,9 +713,8 @@ false - property-assign - /it-autoflight/input/lat - 1 + nasal + nasal @@ -724,9 +725,8 @@ false - property-assign - /it-autoflight/input/lat - 3 + nasal + nasal @@ -738,9 +738,19 @@ true - + /it-autoflight/output/lat 0 + + + nasal + + + + + + /it-autoflight/custom/show-hdg + 1 property-adjust @@ -750,15 +760,33 @@ 361 true + + property-adjust + /it-autoflight/custom/hdg-knb + 1 + 0 + 10000 + true + true - + /it-autoflight/output/lat 0 + + + nasal + + + + + + /it-autoflight/custom/show-hdg + 1 property-adjust @@ -768,6 +796,14 @@ 361 true + + property-adjust + /it-autoflight/custom/hdg-knb + -1 + 0 + 10000 + true + @@ -829,6 +865,14 @@ 0 50000 + + property-adjust + /it-autoflight/custom/alt-knb + 1 + 0 + 10000 + true + @@ -859,6 +903,14 @@ 0 50000 + + property-adjust + /it-autoflight/custom/alt-knb + -1 + 0 + 10000 + true + @@ -972,6 +1024,14 @@ 0.1 20.9 + + property-adjust + /it-autoflight/custom/vs-knb + 1 + 0 + 10000 + true + @@ -1010,9 +1070,16 @@ -0.1 -20.9 + + property-adjust + /it-autoflight/custom/vs-knb + -1 + 0 + 10000 + true + - @@ -1282,50 +1349,6 @@ select hdg.ind - - - - /it-autoflight/output/lat - 0 - - - /it-autoflight/custom/trk-fpa - 0 - - - - - - - select - trk.ind - - - - /it-autoflight/output/lat - 0 - - - /it-autoflight/custom/trk-fpa - 1 - - - - - - - select - hdg-text - - - /it-autoflight/output/lat - 0 - - - - - - select hdg2.ind @@ -1337,6 +1360,7 @@ select + trk.ind trk2.ind @@ -1346,6 +1370,17 @@ + + select + hdg-text + + + /it-autoflight/custom/show-hdg + 1 + + + + select vs.dash @@ -1701,7 +1736,7 @@ rotate hdg-sel - /it-autoflight/input/hdg-sel + /it-autoflight/custom/hdg-knb 11.25 -0.4608 @@ -1716,7 +1751,7 @@ rotate spd-sel - /it-autoflight/input/spd-kts + /it-autoflight/custom/spd-knb 11.25 -0.4608 @@ -1728,25 +1763,10 @@ - - rotate - spd-sel - /it-autoflight/input/spd-mach - 0.01 - - -0.4608 - -0.0874 - 0.1526 - -0.4807 - -0.0874 - 0.1478 - - - rotate alt-sel - /it-autoflight/input/alt + /it-autoflight/custom/alt-knb 11.25 -0.4738 @@ -1761,14 +1781,8 @@ rotate vs-sel - /it-autoflight/input/vs + /it-autoflight/custom/vs-knb 11.25 - - - /it-autoflight/output/vert - 1 - - -0.4608 0.0924 diff --git a/Nasal/FMGC-b.nas b/Nasal/FMGC-b.nas index e8fdfa58..2b1cc84f 100644 --- a/Nasal/FMGC-b.nas +++ b/Nasal/FMGC-b.nas @@ -55,6 +55,7 @@ var APinit = func { setprop("/it-autoflight/mode/vert", "T/O CLB"); setprop("/it-autoflight/input/spd-kts", 100); setprop("/it-autoflight/input/spd-mach", 0.50); + setprop("/it-autoflight/custom/show-hdg", 0); update_armst.start(); thrustmode(); } @@ -185,6 +186,7 @@ var lateral = func { setprop("/it-autoflight/output/lat", 1); setprop("/it-autoflight/mode/lat", "LNAV"); setprop("/it-autoflight/mode/arm", " "); + setprop("/it-autoflight/custom/show-hdg", 0); } else { gui.popupTip("Please make sure you have a route set, and that it is Activated!"); } @@ -212,9 +214,11 @@ var lateral = func { lnavwptt.stop(); setprop("/it-autoflight/output/lat", 4); setprop("/it-autoflight/mode/lat", "ALGN"); + setprop("/it-autoflight/custom/show-hdg", 0); } else if (latset == 5) { lnavwptt.stop(); setprop("/it-autoflight/output/lat", 5); + setprop("/it-autoflight/custom/show-hdg", 0); } } @@ -222,11 +226,12 @@ var lat_arm = func { var latset = getprop("/it-autoflight/input/lat"); if (latset == 0) { setprop("/it-autoflight/input/lat-arm", 0); - setprop("/it-autoflight/mode/arm", "HDG"); + setprop("/it-autoflight/custom/show-hdg", 1); } else if (latset == 1) { if (getprop("/autopilot/route-manager/route/num") > 0 and getprop("/autopilot/route-manager/active") == 1) { setprop("/it-autoflight/input/lat-arm", 1); setprop("/it-autoflight/mode/arm", "LNV"); + setprop("/it-autoflight/custom/show-hdg", 0); } else { gui.popupTip("Please make sure you have a route set, and that it is Activated!"); } @@ -234,7 +239,7 @@ var lat_arm = func { var hdgnow = int(getprop("/orientation/heading-magnetic-deg")+0.5); setprop("/it-autoflight/input/hdg", hdgnow); setprop("/it-autoflight/input/lat-arm", 0); - setprop("/it-autoflight/mode/arm", "HDG"); + setprop("/it-autoflight/custom/show-hdg", 1); } } @@ -700,6 +705,7 @@ var make_loc_active = func { setprop("/it-autoflight/output/loc-armed", 0); setprop("/it-autoflight/output/lat", 2); setprop("/it-autoflight/mode/lat", "LOC"); + setprop("/it-autoflight/custom/show-hdg", 0); if (getprop("/it-autoflight/output/appr-armed") == 1) { # Do nothing because G/S is armed } else { diff --git a/Nasal/FMGC.nas b/Nasal/FMGC.nas index 029b88e2..08e89d75 100644 --- a/Nasal/FMGC.nas +++ b/Nasal/FMGC.nas @@ -35,6 +35,7 @@ var FMGCinit = func { setprop("/FMGC/internal/loc-source", "NAV0"); phasecheck.start(); various.start(); + various2.start(); } ############# @@ -84,9 +85,9 @@ setlistener("/FMGC/internal/cruise-ft", func { setprop("/autopilot/route-manager/cruise/altitude-ft", getprop("/FMGC/internal/cruise-ft")); }); -################ -# Flight Phase # -################ +############################ +# Flight Phase and Various # +############################ var phasecheck = maketimer(0.2, func { var n1_left = getprop("/engines/engine[0]/n1"); @@ -204,7 +205,7 @@ var phasecheck = maketimer(0.2, func { setprop("/FMGC/internal/minspeed", 147); } else if (flap == 5) { setprop("/FMGC/internal/overspeed", 163); - setprop("/FMGC/internal/minspeed", 135); + setprop("/FMGC/internal/minspeed", 134); } }); @@ -216,8 +217,15 @@ var various = maketimer(1, func { } else { setprop("/it-autoflight/settings/reduc-agl-ft", getprop("/FMGC/internal/reduc-agl-ft")); } +}); + +var various2 = maketimer(0.5, func { nav0(); nav1(); + var latmode = getprop("/it-autoflight/output/lat"); + if (latmode == 0) { + setprop("/it-autoflight/custom/show-hdg", 1); + } }); var nav0 = func { diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index 6f04e105..3146d5d8 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -222,6 +222,10 @@ var librariesLoop = maketimer(0.1, func { } else { setprop("/it-autoflight/internal/bank-limit", 25); } + + if (getprop("/it-autoflight/custom/show-hdg") == 0) { + setprop("/it-autoflight/input/hdg", getprop("/orientation/heading-magentic-deg")); + } }); var variousReset = func { @@ -276,6 +280,39 @@ var mcpSPDKnbPush = func { } } +var mcpHDGKnbPull = func { + var latmode = getprop("/it-autoflight/output/lat"); + var showhdg = getprop("/it-autoflight/custom/show-hdg"); + if (latmode == 0 or showhdg == 0) { + setprop("/it-autoflight/input/lat", 3); + setprop("/it-autoflight/custom/show-hdg", 1); + } else { + setprop("/it-autoflight/input/lat", 0); + setprop("/it-autoflight/custom/show-hdg", 1); + } +} + +var mcpHDGKnbPush = func { + setprop("/it-autoflight/input/lat", 1); +} + +var hdgInput = func { + var latmode = getprop("/it-autoflight/output/lat"); + if (latmode != 0) { + setprop("/it-autoflight/custom/show-hdg", 1); + var hdgnow = getprop("/it-autoflight/input/hdg"); + settimer(func { + var hdgnew = getprop("/it-autoflight/input/hdg"); + var showhdg = getprop("/it-autoflight/custom/show-hdg"); + if (hdgnow == hdgnew and latmode != 5 and showhdg == 1) { + settimer(func { + setprop("/it-autoflight/custom/show-hdg", 0); + }, 10); + } + }, 2); + } +} + # In air, flaps 1 is slats only. On ground, it is slats and flaps. setprop("/controls/flight/flap-lever", 0); diff --git a/Systems/fmgc-pitch.xml b/Systems/fmgc-pitch.xml index 3454f587..50e1ed95 100644 --- a/Systems/fmgc-pitch.xml +++ b/Systems/fmgc-pitch.xml @@ -643,7 +643,7 @@ /it-autoflight/internal/target-pitch-deg - /it-autoflight/internal/elevator-cmd + /it-autoflight/internal/elevator-cmd @@ -666,205 +666,5 @@ - - - IT-CONTROLLER: PITCH CMD - false - true - output - - - - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - - - - /controls/flight/elevator-fbw - - - - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - - - /it-autoflight/internal/elevator-cmd - - /controls/flight/elevator-fmgc - noise-spike - - - - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - - - - 10 - - - - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - - - 0.35 - - - - - - - - - AP PITCH HELPER PLUS - false - - - - - /it-autoflight/internal/elevator-cmd - 0.01 - - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - - - - - - 0 - - - 1 - - - /it-autoflight/internal/elevator-trim-cmd - - - 0.08 - 1.0 - 0.1 - 0.0 - 10 - 0.00001 - -1.00 - 1.00 - - - - - AP PITCH HELPER MINUS - false - - - - - /it-autoflight/internal/elevator-cmd - -0.01 - - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - - - - - - 0 - - - 1 - - - /it-autoflight/internal/elevator-trim-cmd - - - -0.08 - 1.0 - 0.1 - 0.0 - 10 - 0.00001 - -1.00 - 1.00 - - - - - IT-CONTROLLER: PITCH TRIM CMD - false - true - output - - - - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - - - - /it-autoflight/internal/elevator-cmd - 0.01 - - - /it-autoflight/internal/elevator-cmd - -0.01 - - - - - - - /it-autoflight/internal/elevator-trim-cmd - - /controls/flight/elevator-trim - noise-spike - 0.01 - diff --git a/Systems/fmgc-roll-yaw.xml b/Systems/fmgc-roll-yaw.xml index bf4a7048..0432ccc7 100644 --- a/Systems/fmgc-roll-yaw.xml +++ b/Systems/fmgc-roll-yaw.xml @@ -244,7 +244,7 @@ 0 - /it-autoflight/internal/aileron-cmd + /it-autoflight/internal/aileron-cmd @@ -283,75 +283,6 @@ - - IT-CONTROLLER: ROLL CMD - false - true - output - - - - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - - - - /controls/flight/aileron-fbw - - - - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - - - /it-autoflight/internal/aileron-cmd - - /controls/flight/aileron-fmgc - noise-spike - - - - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - - - - 10 - - - - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - - - 0.5 - - - diff --git a/Systems/it-fbw.xml b/Systems/it-fbw.xml index 419f115d..a1fd9533 100644 --- a/Systems/it-fbw.xml +++ b/Systems/it-fbw.xml @@ -26,10 +26,24 @@ 5 - false noise-spike + + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + /it-autoflight/internal/aileron-cmd + /controls/flight/aileron /controls/flight/aileron-input 2.0 @@ -83,8 +97,21 @@ - /controls/flight/elevator + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + /it-autoflight/internal/elevator-cmd + /controls/flight/elevator /controls/flight/elevator-input 2.0 @@ -226,14 +253,6 @@ - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /gear/gear[1]/wow 0 @@ -280,14 +299,6 @@ - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /gear/gear[1]/wow 0 @@ -304,53 +315,28 @@ /controls/flight/aileron-fbw-cmd - - - - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - - - - /gear/gear[1]/wow - 1 - - - /gear/gear[2]/wow - 1 - - - /it-fbw/law - 1 - - - /it-fbw/law - 2 - - - - - /controls/flight/aileron-input - - /it-autoflight/output/ap1 + /gear/gear[1]/wow 1 - /it-autoflight/output/ap2 + /gear/gear[2]/wow 1 + + /it-fbw/law + 1 + + + /it-fbw/law + 2 + - /controls/flight/aileron-fmgc + /controls/flight/aileron-input @@ -378,20 +364,10 @@ 1 - - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - - - /it-fbw/roll-back - 0 - - + + /it-fbw/roll-back + 0 + @@ -406,44 +382,10 @@ - - - /it-autoflight/output/ap1 - 1 - - - /it-autoflight/output/ap2 - 1 - - - - - - /controls/flight/aileron-fmgc - - /instrumentation/airspeed-indicator/indicated-mach - 0.21.00 - 0.90.25 -
-
-
- - - - - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - - - /it-fbw/roll-back - 1 - - + + /it-fbw/roll-back + 1 + 0 @@ -611,14 +553,6 @@ - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /gear/gear[1]/wow 0 @@ -679,14 +613,6 @@ - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /gear/gear[1]/wow 0 @@ -731,14 +657,6 @@ - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /gear/gear[1]/wow 0 @@ -799,14 +717,6 @@ - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /gear/gear[1]/wow 0 @@ -871,14 +781,6 @@ - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /gear/gear[1]/wow 0 @@ -909,57 +811,32 @@ /controls/flight/elevator-fbw-cmd - - - - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - - - - /gear/gear[1]/wow - 1 - - - /gear/gear[2]/wow - 1 - - - /it-fbw/law - 2 - - - /orientation/roll-deg - 40 - - - /orientation/roll-deg - -40 - - - - - /controls/flight/elevator-input - - /it-autoflight/output/ap1 + /gear/gear[1]/wow 1 - /it-autoflight/output/ap2 + /gear/gear[2]/wow 1 + + /it-fbw/law + 2 + + + /orientation/roll-deg + 40 + + + /orientation/roll-deg + -40 + - /controls/flight/elevator-fmgc + /controls/flight/elevator-input @@ -983,14 +860,6 @@ /controls/flight/elevator-fbw 0.01 - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /orientation/roll-deg 40 @@ -1047,14 +916,6 @@ /controls/flight/elevator-fbw -0.01 - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /orientation/roll-deg 40 @@ -1110,14 +971,6 @@ - - /it-autoflight/output/ap1 - 0 - - - /it-autoflight/output/ap2 - 0 - /it-fbw/law