From dcfecf58974f8db481e143d20fe10876bd558c6d Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Fri, 28 Dec 2018 13:24:44 -0500 Subject: [PATCH] Control: FADEC THR-LOCK is simulated --- Nasal/ECAM/ECAM-logic.nas | 2 +- Nasal/fadec-common.nas | 11 ++++++- Systems/fadec-cfm.xml | 18 +++++++++++ Systems/fadec-iae.xml | 18 +++++++++++ Systems/fmgc-thrust.xml | 50 +++++++++++++++++++++++++++++ gui/dialogs/a3xx-autoflight-dlg.xml | 12 ++++--- 6 files changed, 104 insertions(+), 7 deletions(-) diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index fbf55675..767cf96a 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -24,7 +24,7 @@ var messages_priority_2 = func { ap_offw.noRepeat = 0; } - if ((getprop("/ECAM/warning-phase") >= 5 and getprop("/ECAM/warning-phase") <= 7) and getprop("/systems/thrust/thr-locked") == 1) { + if (getprop("/ECAM/warning-phase") >= 5 and getprop("/ECAM/warning-phase") <= 7 and getprop("/systems/thrust/thr-locked") == 1) { athr_lock.active = 1; athr_lock_1.active = 1; } else { diff --git a/Nasal/fadec-common.nas b/Nasal/fadec-common.nas index e722b93c..b2557d91 100644 --- a/Nasal/fadec-common.nas +++ b/Nasal/fadec-common.nas @@ -1,5 +1,4 @@ # A3XX FADEC/Throttle Control System -# Joshua Davidson (it0uchpods) # Copyright (c) 2018 Joshua Davidson (it0uchpods) @@ -52,6 +51,9 @@ setprop("/systems/thrust/clb-lim", 0.0); setprop("/systems/thrust/lim-flex", 0); setprop("/engines/flex-derate", 0); setprop("/systems/thrust/eng-out", 0); +setprop("/systems/thrust/thr-locked", 0); +setprop("/systems/thrust/thr-lock-cmd[0]", 0); +setprop("/systems/thrust/thr-lock-cmd[1]", 0); setlistener("/sim/signals/fdm-initialized", func { thrust_loop.start(); @@ -333,3 +335,10 @@ var thrust_flash = maketimer(0.5, func { } } }); + +setlistener("/systems/thrust/thr-locked", func { + if (getprop("/systems/thrust/thr-locked") == 1) { + setprop("/systems/thrust/thr-lock-cmd[0]", getprop("/controls/engines/engine[0]/throttle-output")); + setprop("/systems/thrust/thr-lock-cmd[1]", getprop("/controls/engines/engine[1]/throttle-output")); + } +}, 0, 0); diff --git a/Systems/fadec-cfm.xml b/Systems/fadec-cfm.xml index 178f40c5..b9ae33ad 100644 --- a/Systems/fadec-cfm.xml +++ b/Systems/fadec-cfm.xml @@ -1135,6 +1135,15 @@ /controls/engines/engine[0]/throttle-rev + + + + /systems/thrust/thr-locked + 1 + + + /systems/thrust/thr-lock-cmd[0] + @@ -1183,6 +1192,15 @@ /controls/engines/engine[1]/throttle-rev + + + + /systems/thrust/thr-locked + 1 + + + /systems/thrust/thr-lock-cmd[1] + diff --git a/Systems/fadec-iae.xml b/Systems/fadec-iae.xml index ef83867a..8038cf41 100644 --- a/Systems/fadec-iae.xml +++ b/Systems/fadec-iae.xml @@ -1656,6 +1656,15 @@ /controls/engines/engine[0]/throttle-rev + + + + /systems/thrust/thr-locked + 1 + + + /systems/thrust/thr-lock-cmd[0] + @@ -1704,6 +1713,15 @@ /controls/engines/engine[1]/throttle-rev + + + + /systems/thrust/thr-locked + 1 + + + /systems/thrust/thr-lock-cmd[1] + diff --git a/Systems/fmgc-thrust.xml b/Systems/fmgc-thrust.xml index 6dcf401c..0de1b4bb 100644 --- a/Systems/fmgc-thrust.xml +++ b/Systems/fmgc-thrust.xml @@ -37,6 +37,10 @@ /gear/gear[2]/wow 0 + + /systems/thrust/thr-locked + 1 + 10 @@ -75,6 +79,10 @@ /gear/gear[2]/wow 0 + + /systems/thrust/thr-locked + 1 + 0.1 @@ -111,6 +119,10 @@ /it-autoflight/input/kts-mach 0 + + /systems/thrust/thr-locked + 1 + @@ -230,6 +242,10 @@ /it-autoflight/input/kts-mach 1 + + /systems/thrust/thr-locked + 1 + @@ -353,6 +369,10 @@ /it-autoflight/output/athr 1 + + /systems/thrust/thr-locked + 1 + /it-autoflight/output/fd1 @@ -460,6 +480,10 @@ /it-autoflight/output/athr 1 + + /systems/thrust/thr-locked + 1 + /it-autoflight/output/fd1 @@ -567,6 +591,10 @@ /it-autoflight/output/athr 0 + + /systems/thrust/thr-locked + 1 + @@ -636,6 +664,28 @@ + + + + /systems/thrust/thr-locked + 1 + + + +
+ + /systems/thrust/thr-lock-cmd[0] + /systems/thrust/thr-lock-cmd[1] + + + /environment/temperature-degc + 700.797 + 400.822 + -601.000 +
+
+
+ diff --git a/gui/dialogs/a3xx-autoflight-dlg.xml b/gui/dialogs/a3xx-autoflight-dlg.xml index 30fa6bd1..03be7fcf 100644 --- a/gui/dialogs/a3xx-autoflight-dlg.xml +++ b/gui/dialogs/a3xx-autoflight-dlg.xml @@ -36,13 +36,15 @@