From f3c8395b3547025e4788b076b1be2133bad8104e Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Fri, 22 Sep 2017 23:53:01 -0400 Subject: [PATCH] A3XX: Further fuel system bugfixes --- A320-main.xml | 9 ++---- Nasal/fuel.nas | 71 ++++++++++++++++-------------------------------- Systems/fuel.xml | 24 ++++++++-------- 3 files changed, 38 insertions(+), 66 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 8fedc847..166020f1 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -687,16 +687,13 @@ 0 - 0 - 0 + 0 - 0 - 0 + 0 - 0 - 0 + 0 0 diff --git a/Nasal/fuel.nas b/Nasal/fuel.nas index e2790c3e..d486cc33 100644 --- a/Nasal/fuel.nas +++ b/Nasal/fuel.nas @@ -26,12 +26,9 @@ setlistener("/sim/signals/fdm-initialized", func { var gload = getprop("/accelerations/pilot-gdamped"); var gravityfeedL_output = getprop("/systems/fuel/gravityfeedL-output"); var gravityfeedR_output = getprop("/systems/fuel/gravityfeedR-output"); - var tank0feed0 = getprop("/systems/fuel/tank[0]/feed0"); - var tank0feed1 = getprop("/systems/fuel/tank[0]/feed1"); - var tank1feed0 = getprop("/systems/fuel/tank[1]/feed0"); - var tank1feed1 = getprop("/systems/fuel/tank[1]/feed1"); - var tank2feed0 = getprop("/systems/fuel/tank[2]/feed0"); - var tank2feed1 = getprop("/systems/fuel/tank[2]/feed1"); + var tank0 = getprop("/systems/fuel/tank[0]/feed"); + var tank1 = getprop("/systems/fuel/tank[1]/feed"); + var tank2 = getprop("/systems/fuel/tank[2]/feed"); var gravityfeedL = getprop("/systems/fuel/gravityfeedL"); var gravityfeedR = getprop("/systems/fuel/gravityfeedR"); var tank0pump1_fail = getprop("/systems/failures/tank0pump1"); @@ -56,12 +53,9 @@ var fuel_init = func { setprop("/controls/fuel/tank2pump2", 0); setprop("/controls/fuel/mode", 1); setprop("/systems/fuel/x-feed", 0); - setprop("/systems/fuel/tank[0]/feed0", 0); - setprop("/systems/fuel/tank[0]/feed1", 0); - setprop("/systems/fuel/tank[1]/feed0", 0); - setprop("/systems/fuel/tank[1]/feed1", 0); - setprop("/systems/fuel/tank[2]/feed0", 0); - setprop("/systems/fuel/tank[2]/feed1", 0); + setprop("/systems/fuel/tank[0]/feed", 0); + setprop("/systems/fuel/tank[1]/feed", 0); + setprop("/systems/fuel/tank[2]/feed", 0); setprop("/systems/fuel/only-use-ctr-tank", 0); setprop("/systems/fuel/tank0pump1-fault", 0); setprop("/systems/fuel/tank0pump2-fault", 0); @@ -114,47 +108,31 @@ var master_fuel = func { gravityfeedR_output = getprop("/systems/fuel/gravityfeedR-output"); if ((ac1 >= 110 or ac2 >= 110) and tank0pump1_sw and !tank0pump1_fail) { - setprop("/systems/fuel/tank[0]/feed0", 1); + setprop("/systems/fuel/tank[0]/feed", 1); + } else if ((ac1 >= 110 or ac2 >= 110) and tank0pump2_sw and !tank0pump2_fail) { + setprop("/systems/fuel/tank[0]/feed", 1); } else if (gravityfeedL_output) { - setprop("/systems/fuel/tank[0]/feed0", 1); + setprop("/systems/fuel/tank[0]/feed", 1); } else { - setprop("/systems/fuel/tank[0]/feed0", 0); - } - - if ((ac1 >= 110 or ac2 >= 110) and tank0pump2_sw and !tank0pump2_fail) { - setprop("/systems/fuel/tank[0]/feed1", 1); - } else if (gravityfeedL_output) { - setprop("/systems/fuel/tank[0]/feed1", 1); - } else { - setprop("/systems/fuel/tank[0]/feed1", 0); + setprop("/systems/fuel/tank[0]/feed", 0); } if ((ac1 >= 110 or ac2 >= 110) and tank1pump1_sw and !tank1pump1_fail) { - setprop("/systems/fuel/tank[1]/feed0", 1); + setprop("/systems/fuel/tank[1]/feed", 1); + } else if ((ac1 >= 110 or ac2 >= 110) and tank1pump2_sw and !tank1pump2_fail) { + setprop("/systems/fuel/tank[1]/feed", 1); } else { - setprop("/systems/fuel/tank[1]/feed0", 0); - } - - if ((ac1 >= 110 or ac2 >= 110) and tank1pump2_sw and !tank1pump2_fail) { - setprop("/systems/fuel/tank[1]/feed1", 1); - } else { - setprop("/systems/fuel/tank[1]/feed1", 0); + setprop("/systems/fuel/tank[1]/feed", 0); } if ((ac1 >= 110 or ac2 >= 110) and tank2pump1_sw and !tank2pump1_fail) { - setprop("/systems/fuel/tank[2]/feed0", 1); + setprop("/systems/fuel/tank[2]/feed", 1); + } else if ((ac1 >= 110 or ac2 >= 110) and tank2pump2_sw and !tank2pump2_fail) { + setprop("/systems/fuel/tank[2]/feed", 1); } else if (gravityfeedR_output) { - setprop("/systems/fuel/tank[2]/feed0", 1); + setprop("/systems/fuel/tank[2]/feed", 1); } else { - setprop("/systems/fuel/tank[2]/feed0", 0); - } - - if ((ac1 >= 110 or ac2 >= 110) and tank2pump2_sw and !tank2pump2_fail) { - setprop("/systems/fuel/tank[2]/feed1", 1); - } else if (gravityfeedR_output) { - setprop("/systems/fuel/tank[2]/feed1", 1); - } else { - setprop("/systems/fuel/tank[2]/feed1", 0); + setprop("/systems/fuel/tank[2]/feed", 0); } if ((ac1 >= 110 or ac2 >= 110) and xfeed_sw) { @@ -163,12 +141,9 @@ var master_fuel = func { setprop("/systems/fuel/x-feed", 0); } - tank0feed0 = getprop("/systems/fuel/tank[0]/feed0"); - tank0feed1 = getprop("/systems/fuel/tank[0]/feed1"); - tank1feed0 = getprop("/systems/fuel/tank[1]/feed0"); - tank1feed1 = getprop("/systems/fuel/tank[1]/feed1"); - tank2feed0 = getprop("/systems/fuel/tank[2]/feed0"); - tank2feed1 = getprop("/systems/fuel/tank[2]/feed1"); + tank0 = getprop("/systems/fuel/tank[0]/feed"); + tank1 = getprop("/systems/fuel/tank[1]/feed"); + tank2 = getprop("/systems/fuel/tank[2]/feed"); if (((ac1 >= 110 or ac2 >= 110) and tank0pump1_sw and tank0pump1_sw)) { setprop("/systems/fuel/gravityfeedL", 0); diff --git a/Systems/fuel.xml b/Systems/fuel.xml index 46372601..5b401740 100644 --- a/Systems/fuel.xml +++ b/Systems/fuel.xml @@ -16,18 +16,18 @@ /systems/fuel/only-use-ctr-tank == 0 - /systems/fuel/tank[0]/feed0 == 1 + /systems/fuel/tank[0]/feed == 1 propulsion/tank[0]/contents-lbs GT 0 - /consumables/fuel/tank[3]/level-lbs LT 0.9 + propulsion/tank[3]/contents-lbs LT 0.9 - /systems/fuel/tank[1]/feed0 == 1 + /systems/fuel/tank[1]/feed == 1 propulsion/tank[1]/contents-lbs GT 0 - /consumables/fuel/tank[3]/level-lbs LT 0.9 + propulsion/tank[3]/contents-lbs LT 0.9 @@ -36,9 +36,9 @@ /systems/fuel/x-feed == 1 /systems/fuel/only-use-ctr-tank == 0 - /systems/fuel/tank[2]/feed0 == 1 + /systems/fuel/tank[2]/feed == 1 propulsion/tank[2]/contents-lbs GT 0 - /consumables/fuel/tank[3]/level-lbs LT 0.9 + propulsion/tank[3]/contents-lbs LT 0.9 @@ -48,18 +48,18 @@ /systems/fuel/only-use-ctr-tank == 0 - /systems/fuel/tank[2]/feed0 == 1 + /systems/fuel/tank[2]/feed == 1 propulsion/tank[2]/contents-lbs GT 0 - /consumables/fuel/tank[4]/level-lbs LT 0.9 + propulsion/tank[4]/contents-lbs LT 0.9 - /systems/fuel/tank[1]/feed0 == 1 + /systems/fuel/tank[1]/feed == 1 propulsion/tank[1]/contents-lbs GT 0 - /consumables/fuel/tank[4]/level-lbs LT 0.9 + propulsion/tank[4]/contents-lbs LT 0.9 @@ -68,9 +68,9 @@ /systems/fuel/x-feed == 1 /systems/fuel/only-use-ctr-tank == 0 - /systems/fuel/tank[0]/feed0 == 1 + /systems/fuel/tank[0]/feed == 1 propulsion/tank[0]/contents-lbs GT 0 - /consumables/fuel/tank[4]/level-lbs LT 0.9 + propulsion/tank[4]/contents-lbs LT 0.9