From 99b3e5a78ce8d4e5002d5f526b4e399f26a55d7e Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Sat, 21 Oct 2017 23:33:01 -0400 Subject: [PATCH] A3XX: Brake system improved, autobrake disconnect logic fixed --- A320-main.xml | 2 +- Nasal/{autobrake.nas => brakes.nas} | 10 ++++++---- revision.txt | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) rename Nasal/{autobrake.nas => brakes.nas} (91%) diff --git a/A320-main.xml b/A320-main.xml index b878facb..404b4003 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -1210,7 +1210,7 @@ Aircraft/IDG-A32X/Nasal/engines.nas Aircraft/IDG-A32X/Nasal/ADIRS.nas Aircraft/IDG-A32X/Nasal/fire.nas - Aircraft/IDG-A32X/Nasal/autobrake.nas + Aircraft/IDG-A32X/Nasal/brakes.nas Aircraft/IDG-A32X/Nasal/fadec-common.nas diff --git a/Nasal/autobrake.nas b/Nasal/brakes.nas similarity index 91% rename from Nasal/autobrake.nas rename to Nasal/brakes.nas index 372f3bde..3fc2e47c 100644 --- a/Nasal/autobrake.nas +++ b/Nasal/brakes.nas @@ -28,7 +28,7 @@ controls.applyBrakes = func(v, which = 0) { if (getprop("/systems/acconfig/autoconfig-running") != 1) { wow1 = getprop("/gear/gear[1]/wow"); wow2 = getprop("/gear/gear[2]/wow"); - if (getprop("/controls/autobrake/mode") != 0 and (wow1 or wow2)) { + if (getprop("/controls/autobrake/mode") != 0 and (wow1 or wow2) and getprop("/controls/autobrake/active") == 1) { arm_autobrake(0); } if (which <= 0) { @@ -42,6 +42,8 @@ controls.applyBrakes = func(v, which = 0) { # Set autobrake mode var arm_autobrake = func(mode) { + wow1 = getprop("/gear/gear[1]/wow"); + wow2 = getprop("/gear/gear[2]/wow"); if (mode == 0) { # OFF absChk.stop(); if (getprop("/controls/autobrake/active") == 1) { @@ -50,13 +52,13 @@ var arm_autobrake = func(mode) { setprop("/controls/gear/brake-right", 0); } setprop("/controls/autobrake/mode", 0); - } else if (mode == 1) { # LO + } else if (mode == 1 and !wow1 and !wow2) { # LO setprop("/controls/autobrake/mode", 1); absChk.start(); - } else if (mode == 2) { # MED + } else if (mode == 2 and !wow1 and !wow2) { # MED setprop("/controls/autobrake/mode", 2); absChk.start(); - } else if (mode == 3) { # MAX + } else if (mode == 3 and (wow1 or wow2)) { # MAX setprop("/controls/autobrake/mode", 3); absChk.start(); } diff --git a/revision.txt b/revision.txt index 9e5b92ad..a2cb5787 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -2162 \ No newline at end of file +2170 \ No newline at end of file