From f0f63c2f8f79604bc1daee6c95ab2bacbc314d38 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Mon, 19 Jun 2017 15:44:00 -0400 Subject: [PATCH] A3XX: Automatic Bank Limits --- Models/Instruments/ND/canvas/style.nas | 2 +- Nasal/FMGC-b.nas | 1 - Nasal/libraries.nas | 9 +++++ Systems/fmgc-roll-yaw.xml | 52 ++++++++------------------ 4 files changed, 26 insertions(+), 38 deletions(-) diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index 027027e0..857a90b7 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -700,7 +700,7 @@ canvas.NDStyles["Airbus"] = { init: func(nd,symbol), predicate: func(nd) nd.aircraft_source.get_spd() > 100, is_true: func(nd) { - nd.symbols.tas.setText(sprintf("%3.0f",getprop("/fdm/jsbsim/velocities/vtrue-kts") )); + nd.symbols.tas.setText(sprintf("%3.0f",getprop("/instrumentation/airspeed-indicator/true-speed-kt") )); nd.symbols.tas.show(); }, is_false: func(nd) nd.symbols.tas.hide(), diff --git a/Nasal/FMGC-b.nas b/Nasal/FMGC-b.nas index 27c38507..43a8f82d 100644 --- a/Nasal/FMGC-b.nas +++ b/Nasal/FMGC-b.nas @@ -20,7 +20,6 @@ var APinit = func { setprop("/it-autoflight/input/lat", 5); setprop("/it-autoflight/input/lat-arm", 0); setprop("/it-autoflight/input/vert", 7); - 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); diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index e3a93f77..1aaaa344 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -211,6 +211,15 @@ var librariesLoop = maketimer(0.1, func { } else { setprop("/systems/shake/effect", 0); } + + var trueSpeedKts = getprop("/instrumentation/airspeed-indicator/true-speed-kt"); + if(trueSpeedKts > 370) { + setprop("/it-autoflight/internal/bank-limit", 15); + } else if(trueSpeedKts > 300) { + setprop("/it-autoflight/internal/bank-limit", 20); + } else { + setprop("/it-autoflight/internal/bank-limit", 25); + } }); var variousReset = func { diff --git a/Systems/fmgc-roll-yaw.xml b/Systems/fmgc-roll-yaw.xml index e223aafb..50545188 100644 --- a/Systems/fmgc-roll-yaw.xml +++ b/Systems/fmgc-roll-yaw.xml @@ -63,41 +63,11 @@ 0.0 - - - /it-autoflight/output/lat - 1 - - - /it-autoflight/input/bank-limit + /it-autoflight/internal/bank-limit -1 - - - - /it-autoflight/output/lat - 1 - - - -25 - - - - /it-autoflight/output/lat - 1 - - - /it-autoflight/input/bank-limit - - - - - /it-autoflight/output/lat - 1 - - - 25 + /it-autoflight/internal/bank-limit @@ -166,8 +136,13 @@ 0.0 10.0 0.00001 - -25 - 25 + + /it-autoflight/internal/bank-limit + -1 + + + /it-autoflight/internal/bank-limit + @@ -200,8 +175,13 @@ /orientation/roll-deg /it-autoflight/internal/target-roll-deg - -25 - 25 + + /it-autoflight/internal/bank-limit + -1 + + + /it-autoflight/internal/bank-limit +