From f1e1dc5b56e3dce7df4a8a543501f472df92df25 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 8 Nov 2019 20:33:21 +0000 Subject: [PATCH 1/3] Fuel capacities and refuelling system (no gui yet) added --- A320-100-CFM.xml | 38 +++++++------- A320-200-CFM.xml | 38 +++++++------- A320-200-IAE.xml | 38 +++++++------- A320-main.xml | 3 ++ A320neo-CFM.xml | 38 +++++++------- A320neo-PW.xml | 38 +++++++------- Systems/a320-fuel.xml | 116 ++++++++++++++++++++++++++++++++++++------ 7 files changed, 198 insertions(+), 111 deletions(-) diff --git a/A320-100-CFM.xml b/A320-100-CFM.xml index 89c4181e..fd9ed0d9 100644 --- a/A320-100-CFM.xml +++ b/A320-100-CFM.xml @@ -76,11 +76,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -89,11 +89,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 12212.50 + 12272.90 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -103,11 +103,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 0 -0.61182 - 14550.50 - 40.88 + 14623.00 + 42 23.20 1 - 6.67 + 6.71 50 @@ -116,11 +116,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 12212.50 + 12272.90 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -129,11 +129,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -145,7 +145,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 @@ -156,7 +156,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 diff --git a/A320-200-CFM.xml b/A320-200-CFM.xml index 050dd7c9..f9863082 100644 --- a/A320-200-CFM.xml +++ b/A320-200-CFM.xml @@ -76,11 +76,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -89,11 +89,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 12520.50 + 12591.95 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -102,11 +102,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 0 -0.61182 - 14550.50 - 40.88 + 14623.00 + 42 23.20 1 - 6.67 + 6.71 50 @@ -115,11 +115,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 12520.50 + 12591.95 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -128,11 +128,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -144,7 +144,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 @@ -155,7 +155,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 diff --git a/A320-200-IAE.xml b/A320-200-IAE.xml index 71893993..b5a62d2b 100644 --- a/A320-200-IAE.xml +++ b/A320-200-IAE.xml @@ -76,11 +76,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -89,11 +89,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 12212.50 + 12272.90 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -102,11 +102,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 0 -0.61182 - 14550.50 - 40.88 + 14623.00 + 42 23.20 1 - 6.67 + 6.71 50 @@ -115,11 +115,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 12212.50 + 12272.90 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -128,11 +128,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -144,7 +144,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 @@ -155,7 +155,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 diff --git a/A320-main.xml b/A320-main.xml index bdb38a2c..36ed24fd 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -935,6 +935,9 @@ 0 + 0 + 0 + 0 0 0 diff --git a/A320neo-CFM.xml b/A320neo-CFM.xml index 8e5541a9..cab61254 100644 --- a/A320neo-CFM.xml +++ b/A320neo-CFM.xml @@ -76,11 +76,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -89,11 +89,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 12147.00 + 12155.90 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -102,11 +102,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 0 -0.61182 - 14601.44 - 40.88 + 14620.00 + 42 23.20 1 - 6.67 + 6.71 50 @@ -115,11 +115,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 12147.00 + 12155.90 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -128,11 +128,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -144,7 +144,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 @@ -155,7 +155,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 diff --git a/A320neo-PW.xml b/A320neo-PW.xml index 6bfe1af2..6b52fbb7 100644 --- a/A320neo-PW.xml +++ b/A320neo-PW.xml @@ -76,11 +76,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -89,11 +89,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> -5.1104 -0.61182 - 12147.00 + 12155.90 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -102,11 +102,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 0 -0.61182 - 14601.44 - 40.88 + 14620.00 + 42 23.20 1 - 6.67 + 6.71 50 @@ -115,11 +115,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 12147.00 + 12155.90 6000.00 - 11.70 + 28.0 1 - 6.67 + 6.71 50 @@ -128,11 +128,11 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 5.1104 -0.61182 - 1552.00 - 1552.00 - 17.75 + 1523.00 + 1523.00 + 4.0 1 - 6.67 + 6.71 50 @@ -144,7 +144,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 @@ -155,7 +155,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 10 0 1 - 6.67 + 6.71 diff --git a/Systems/a320-fuel.xml b/Systems/a320-fuel.xml index fc318185..3e6f51a3 100644 --- a/Systems/a320-fuel.xml +++ b/Systems/a320-fuel.xml @@ -66,11 +66,11 @@ /systems/fuel/left-inner-full eq 1 - propulsion/tank[1]/contents-lbs lt 11420 + propulsion/tank[1]/contents-lbs lt 12270 propulsion/tank[1]/contents-lbs ge 10300 - propulsion/tank[1]/contents-lbs eq 11420 + propulsion/tank[1]/contents-lbs eq 12270 @@ -78,11 +78,11 @@ /systems/fuel/right-inner-full eq 1 - propulsion/tank[3]/contents-lbs lt 11420 + propulsion/tank[3]/contents-lbs lt 12270 propulsion/tank[3]/contents-lbs ge 10300 - propulsion/tank[3]/contents-lbs eq 11420 + propulsion/tank[3]/contents-lbs eq 12270 @@ -172,9 +172,12 @@ /systems/fuel/valves/outer-inner-transfer-valve-1-cmd eq 1 /systems/fuel/refuel/refuelling eq 0 - - /systems/fuel/quantity/left-wing-inner-low eq 1 - /systems/fuel/quantity/right-wing-inner-low eq 1 + + + /systems/fuel/quantity/left-wing-inner-low eq 1 + /systems/fuel/quantity/right-wing-inner-low eq 1 + + /systems/fuel/refuel/refuelling eq 0 @@ -196,9 +199,12 @@ /systems/fuel/valves/outer-inner-transfer-valve-2-cmd eq 1 /systems/fuel/refuel/refuelling eq 0 - - /systems/fuel/quantity/left-wing-inner-low eq 1 - /systems/fuel/quantity/right-wing-inner-low eq 1 + + + /systems/fuel/quantity/left-wing-inner-low eq 1 + /systems/fuel/quantity/right-wing-inner-low eq 1 + + /systems/fuel/refuel/refuelling eq 0 @@ -425,11 +431,84 @@ /systems/fuel/feed-center-1 eq 0 /systems/fuel/feed-left-inner eq 1 - propulsion/tank[1]/contents-lbs gt 31.24 + propulsion/tank[1]/contents-lbs gt 22.68 propulsion/tank[5]/contents-lbs lt 9 + + + + /systems/fuel/refuel/refuelling eq 1 + /systems/fuel/refuel/left-valve eq 1 + /systems/fuel/refuel/center-valve eq 0 + + + /systems/fuel/refuel/refuelling eq 1 + /systems/fuel/refuel/left-valve eq 1 + /systems/fuel/refuel/center-valve eq 1 + + + + + + + /systems/fuel/refuel/refuelling eq 1 + propulsion/tank[0]/contents-lbs ge 1523 + + + + + + + /systems/fuel/refuel/refuelling eq 1 + /systems/fuel/refuel/right-valve eq 0 + /systems/fuel/refuel/center-valve eq 1 + + + /systems/fuel/refuel/refuelling eq 1 + + + /systems/fuel/refuel/left-valve eq 1 + /systems/fuel/refuel/right-valve eq 0 + + + /systems/fuel/refuel/left-valve eq 0 + /systems/fuel/refuel/right-valve eq 1 + + + /systems/fuel/refuel/center-valve eq 1 + + + /systems/fuel/refuel/refuelling eq 1 + /systems/fuel/refuel/left-valve eq 1 + /systems/fuel/refuel/right-valve eq 1 + /systems/fuel/refuel/center-valve eq 1 + + + + + + + /systems/fuel/refuel/refuelling eq 1 + /systems/fuel/refuel/right-valve eq 1 + /systems/fuel/refuel/center-valve eq 0 + + + /systems/fuel/refuel/refuelling eq 1 + /systems/fuel/refuel/right-valve eq 1 + /systems/fuel/refuel/center-valve eq 1 + + + + + + + /systems/fuel/refuel/refuelling eq 1 + propulsion/tank[4]/contents-lbs ge 1523 + + + @@ -440,7 +519,7 @@ /systems/fuel/valves/crossfeed-valve eq 1 - propulsion/tank[3]/contents-lbs gt 31.24 + propulsion/tank[3]/contents-lbs gt 22.68 propulsion/tank[5]/contents-lbs lt 9 @@ -454,7 +533,7 @@ /systems/fuel/feed-center-2 eq 0 /systems/fuel/valves/crossfeed-valve eq 1 - propulsion/tank[3]/contents-lbs gt 31.24 + propulsion/tank[3]/contents-lbs gt 22.68 propulsion/tank[5]/contents-lbs lt 9 @@ -468,7 +547,7 @@ /systems/fuel/feed-center-1 eq 0 /systems/fuel/feed-left-inner eq 1 - propulsion/tank[1]/contents-lbs gt 31.24 + propulsion/tank[1]/contents-lbs gt 22.68 propulsion/tank[6]/contents-lbs lt 9 @@ -483,7 +562,7 @@ /systems/fuel/valves/crossfeed-valve eq 1 - propulsion/tank[3]/contents-lbs gt 31.24 + propulsion/tank[3]/contents-lbs gt 22.68 propulsion/tank[6]/contents-lbs lt 9 @@ -496,7 +575,7 @@ /systems/fuel/feed-center-2 eq 0 /systems/fuel/feed-right-inner eq 1 - propulsion/tank[3]/contents-lbs gt 31.24 + propulsion/tank[3]/contents-lbs gt 22.68 propulsion/tank[6]/contents-lbs lt 9 @@ -518,18 +597,21 @@ + /systems/fuel/internal/left-outer-wing-tank-refuel -/systems/fuel/internal/left-wing-outer-to-inner-tank propulsion/tank[0]/external-flow-rate-pps /systems/fuel/internal/left-wing-outer-to-inner-tank + /systems/fuel/internal/left-inner-wing-tank-refuel -/systems/fuel/internal/left-wing-tank-eng-1 -/systems/fuel/internal/left-wing-tank-eng-2 propulsion/tank[1]/external-flow-rate-pps + /systems/fuel/internal/center-tank-refuel -/systems/fuel/internal/center-tank-eng-1 -/systems/fuel/internal/center-tank-eng-2 propulsion/tank[2]/external-flow-rate-pps @@ -537,12 +619,14 @@ /systems/fuel/internal/right-wing-outer-to-inner-tank + /systems/fuel/internal/right-inner-wing-tank-refuel -/systems/fuel/internal/right-wing-tank-eng-1 -/systems/fuel/internal/right-wing-tank-eng-2 propulsion/tank[3]/external-flow-rate-pps + /systems/fuel/internal/right-outer-wing-tank-refuel -/systems/fuel/internal/right-wing-outer-to-inner-tank propulsion/tank[4]/external-flow-rate-pps From 62d7447b1fbdc65df6b08d683cd4c8ac867b0002 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 9 Nov 2019 15:20:53 +0000 Subject: [PATCH 2/3] Fix bugs in the fuel system, and add refuelling dialog to the ground services menu --- A320-100-CFM.xml | 1 - A320-200-CFM.xml | 11 +- A320-200-IAE.xml | 1 - A320-main.xml | 8 + A320neo-CFM.xml | 1 - A320neo-PW.xml | 1 - AircraftConfig/acconfig.nas | 1 + AircraftConfig/fuel.xml | 160 +++++++++++++++++++ AircraftConfig/groundservices.xml | 34 ++-- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 6 +- Nasal/fuel.nas | 9 ++ Nasal/libraries.nas | 4 +- Nasal/payload.nas | 87 ++++++++++ Nasal/property-tree-setup.nas | 7 + Systems/a320-fuel.xml | 101 +++++++----- Systems/fuel.xml | 113 ------------- revision.txt | 2 +- 17 files changed, 359 insertions(+), 188 deletions(-) create mode 100644 AircraftConfig/fuel.xml create mode 100644 Nasal/payload.nas delete mode 100644 Systems/fuel.xml diff --git a/A320-100-CFM.xml b/A320-100-CFM.xml index fd9ed0d9..68189533 100644 --- a/A320-100-CFM.xml +++ b/A320-100-CFM.xml @@ -160,7 +160,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/A320-200-CFM.xml b/A320-200-CFM.xml index f9863082..7aa13e60 100644 --- a/A320-200-CFM.xml +++ b/A320-200-CFM.xml @@ -79,7 +79,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 1523.00 1523.00 4.0 - 1 + 0 6.71 50 @@ -92,7 +92,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 12591.95 6000.00 28.0 - 1 + 0 6.71 50 @@ -105,7 +105,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 14623.00 42 23.20 - 1 + 0 6.71 50 @@ -118,7 +118,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 12591.95 6000.00 28.0 - 1 + 0 6.71 50 @@ -131,7 +131,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> 1523.00 1523.00 4.0 - 1 + 0 6.71 50 @@ -159,7 +159,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/A320-200-IAE.xml b/A320-200-IAE.xml index b5a62d2b..dfcbc9f4 100644 --- a/A320-200-IAE.xml +++ b/A320-200-IAE.xml @@ -159,7 +159,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/A320-main.xml b/A320-main.xml index 36ed24fd..66a428de 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -802,6 +802,13 @@ 0 0 + + 0 + 0 + 0 + 0 + 0 + @@ -1634,6 +1641,7 @@ Aircraft/A320-family/Nasal/fire.nas Aircraft/A320-family/Nasal/brakes.nas Aircraft/A320-family/Nasal/ground_services.nas + Aircraft/A320-family/Nasal/payload.nas Aircraft/A320-family/Nasal/effects.nas diff --git a/A320neo-CFM.xml b/A320neo-CFM.xml index cab61254..618a4d46 100644 --- a/A320neo-CFM.xml +++ b/A320neo-CFM.xml @@ -159,7 +159,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/A320neo-PW.xml b/A320neo-PW.xml index 6b52fbb7..2cde3fd4 100644 --- a/A320neo-PW.xml +++ b/A320neo-PW.xml @@ -159,7 +159,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 45ebd411..555f603f 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -113,6 +113,7 @@ var about_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/about/dialog", "Aircraf var update_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/update/dialog", "Aircraft/A320-family/AircraftConfig/update.xml"); var updated_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/updated/dialog", "Aircraft/A320-family/AircraftConfig/updated.xml"); var error_mismatch = gui.Dialog.new("sim/gui/dialogs/acconfig/error/mismatch/dialog", "Aircraft/A320-family/AircraftConfig/error-mismatch.xml"); +var fuel_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/fuel/dialog", "Aircraft/A320-family/AircraftConfig/fuel.xml"); var groundservices_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/groundsrvc/dialog", "Aircraft/A320-family/AircraftConfig/groundservices.xml"); var du_quality = gui.Dialog.new("sim/gui/dialogs/acconfig/du-quality/dialog", "Aircraft/A320-family/AircraftConfig/du-quality.xml"); var rendering_dlg = gui.Dialog.new("sim/gui/dialogs/rendering/dialog", "Aircraft/A320-family/AircraftConfig/rendering.xml"); diff --git a/AircraftConfig/fuel.xml b/AircraftConfig/fuel.xml new file mode 100644 index 00000000..ce0c1eb6 --- /dev/null +++ b/AircraftConfig/fuel.xml @@ -0,0 +1,160 @@ + + + + + + + + + fuel-dlg + vbox + + + hbox + + left + + + + + + + + + vbox + + + + left + + /services/fuel-truck/connect + + /services/fuel-truck/enable + + dialog-apply + + true + + + + + left + + /services/fuel-truck/enable + + /services/fuel-truck/connect + + dialog-apply + + true + + + + + + table + + + right + 2 + 0 + 0 + + + + + right + 2 + 1 + 0 + + + + + right + 2 + 2 + 0 + + + + 0 + 1 + left + 2 + /consumables/fuel/total-fuel-lbs + true + %.1f + + + + 1 + 1 + left + 1 + /services/fuel-truck/request-lbs + true + + dialog-apply + + + + + 2 + 1 + left + 2 + /services/fuel-truck/request-total-lbs + true + %.1f + + + + + + + hbox + + + + + + + + diff --git a/AircraftConfig/groundservices.xml b/AircraftConfig/groundservices.xml index e27d0bfc..169d823e 100644 --- a/AircraftConfig/groundservices.xml +++ b/AircraftConfig/groundservices.xml @@ -56,31 +56,21 @@ - - - left - - /services/fuel-truck/connect - - /services/fuel-truck/enable - - dialog-apply - - true - + - - - left - - /services/fuel-truck/enable - - /services/fuel-truck/connect + + + diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 63b03d7a..7005a83e 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -222,9 +222,9 @@ var fadec2 = props.globals.getNode("/systems/fadec/powered2", 1); var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1); var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1); var fuel_left_outer_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1); -var fuel_left_inner_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1); -var fuel_right_outer_temp = props.globals.getNode("/consumables/fuel/tank[1]/temperature_degC", 1); -var fuel_right_inner_temp = props.globals.getNode("/consumables/fuel/tank[1]/temperature_degC", 1); +var fuel_left_inner_temp = props.globals.getNode("/consumables/fuel/tank[1]/temperature_degC", 1); +var fuel_right_outer_temp = props.globals.getNode("/consumables/fuel/tank[3]/temperature_degC", 1); +var fuel_right_inner_temp = props.globals.getNode("/consumables/fuel/tank[4]/temperature_degC", 1); var cutoff_switch1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1); var cutoff_switch2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1); var fuel_xfeed = props.globals.getNode("/controls/fuel/x-feed", 1); diff --git a/Nasal/fuel.nas b/Nasal/fuel.nas index 79f6765e..918f6d7e 100644 --- a/Nasal/fuel.nas +++ b/Nasal/fuel.nas @@ -8,6 +8,7 @@ var FUEL = { offset2: 0, timeEngStart: 0, cmdCtrOn: props.globals.getNode("/systems/fuel/ctr-pump-cmd-on-eng-start"), + refuelling: props.globals.getNode("/systems/fuel/refuel/refuelling"), Fail: { }, @@ -27,13 +28,21 @@ var FUEL = { lpValve2: props.globals.getNode("/systems/fuel/valves/engine-2-lp-valve"), transfer1: props.globals.getNode("/systems/fuel/valves/outer-inner-transfer-valve-1"), transfer2: props.globals.getNode("/systems/fuel/valves/outer-inner-transfer-valve-2"), + refuelLeft: props.globals.getNode("/systems/fuel/refuel/left-valve"), + refuelCenter: props.globals.getNode("/systems/fuel/refuel/center-valve"), + refuelRight: props.globals.getNode("/systems/fuel/refuel/right-valve"), }, Quantity: { leftOuter: props.globals.getNode("/consumables/fuel/tank[0]/level-lbs"), + leftOuterPct: props.globals.getNode("/consumables/fuel/tank[0]/level-norm"), leftInner: props.globals.getNode("/consumables/fuel/tank[1]/level-lbs"), + leftInnerPct: props.globals.getNode("/consumables/fuel/tank[1]/level-norm"), center: props.globals.getNode("/consumables/fuel/tank[2]/level-lbs"), + centerPct: props.globals.getNode("/consumables/fuel/tank[2]/level-norm"), rightInner: props.globals.getNode("/consumables/fuel/tank[3]/level-lbs"), + rightInnerPct: props.globals.getNode("/consumables/fuel/tank[3]/level-norm"), rightOuter: props.globals.getNode("/consumables/fuel/tank[4]/level-lbs"), + rightOuterPct: props.globals.getNode("/consumables/fuel/tank[4]/level-norm"), usedLeft: props.globals.getNode("/systems/fuel/fuel-used-1"), usedRight: props.globals.getNode("/systems/fuel/fuel-used-2"), }, diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index 7e82224e..71c45e84 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -266,10 +266,10 @@ var systemsLoop = maketimer(0.1, func { setprop("/engines/ready", 0); } - if ((getprop("/engines/engine[0]/state") == 2 or getprop("/engines/engine[0]/state") == 3) and getprop("/fdm/jsbsim/propulsion/tank[3]/contents-lbs") < 1) { + if ((getprop("/engines/engine[0]/state") == 2 or getprop("/engines/engine[0]/state") == 3) and getprop("/fdm/jsbsim/propulsion/tank[5]/contents-lbs") < 1) { systems.cutoff_one(); } - if ((getprop("/engines/engine[1]/state") == 2 or getprop("/engines/engine[1]/state") == 3) and getprop("/fdm/jsbsim/propulsion/tank[4]/contents-lbs") < 1) { + if ((getprop("/engines/engine[1]/state") == 2 or getprop("/engines/engine[1]/state") == 3) and getprop("/fdm/jsbsim/propulsion/tank[6]/contents-lbs") < 1) { systems.cutoff_two(); } diff --git a/Nasal/payload.nas b/Nasal/payload.nas new file mode 100644 index 00000000..5572dd2f --- /dev/null +++ b/Nasal/payload.nas @@ -0,0 +1,87 @@ +# A32X Fuelling and Loading +# Jonathan Redpath + +var fuelSvc = { + enable: props.globals.getNode("/services/fuel-truck/enable"), + connect: props.globals.getNode("/services/fuel-truck/connect"), + operate: props.globals.getNode("/services/fuel-truck/operate"), + Nodes: { + requestLbs: props.globals.getNode("/services/fuel-truck/request-lbs"), + requestTotalLbs: props.globals.getNode("/services/fuel-truck/request-total-lbs"), + }, + + newRequest: func() { + if (pts.Sim.aero.getValue() == "A320-200-CFM") { + me.Nodes.requestTotalLbs.setValue(math.min(pts.Consumables.Fuel.totalFuelLbs.getValue() + me.Nodes.requestLbs.getValue(), 42872)); + } elsif (pts.Sim.aero.getValue() == "A320-200-IAE" or pts.Sim.aero.getValue() == "A320-100-CFM") { + me.Nodes.requestTotalLbs.setValue(math.min(pts.Consumables.Fuel.totalFuelLbs.getValue() + me.Nodes.requestLbs.getValue(), 42214)); + } elsif (pts.Sim.aero.getValue() == "A320neo-CFM" or pts.Sim.aero.getValue() == "A320neo-PW") { + me.Nodes.requestTotalLbs.setValue(math.min(pts.Consumables.Fuel.totalFuelLbs.getValue() + me.Nodes.requestLbs.getValue(), 41977)); + } + }, + + refuel: func() { + if (me.operate.getBoolValue()) { return; } + + if (me.enable.getValue() and me.connect.getValue()) { + me.operate.setBoolValue(1); + } + + fuelTimer.start(); + systems.FUEL.refuelling.setBoolValue(1); + + systems.FUEL.Valves.refuelLeft.setBoolValue(1); + systems.FUEL.Valves.refuelRight.setBoolValue(1); + + if (pts.Sim.aero.getValue() == "A320-200-CFM" and me.Nodes.requestTotalLbs.getValue() > 28229.9) { + systems.FUEL.Valves.refuelCenter.setBoolValue(1); + } elsif ((pts.Sim.aero.getValue() == "A320-200-IAE" or pts.Sim.aero.getValue() == "A320-100-CFM") and me.Nodes.requestTotalLbs.getValue() > 27591.8) { + systems.FUEL.Valves.refuelCenter.setBoolValue(1); + } elsif ((pts.Sim.aero.getValue() == "A320neo-CFM" or pts.Sim.aero.getValue() == "A320neo-PW") and me.Nodes.requestTotalLbs.getValue() > 27357.8) { + systems.FUEL.Valves.refuelCenter.setBoolValue(1); + } + }, + + stop: func() { + systems.FUEL.refuelling.setBoolValue(0); + systems.FUEL.Valves.refuelLeft.setBoolValue(0); + systems.FUEL.Valves.refuelCenter.setBoolValue(0); + systems.FUEL.Valves.refuelRight.setBoolValue(0); + me.operate.setBoolValue(0); + }, +}; + +setlistener("/services/fuel-truck/request-lbs", func() { + fuelSvc.newRequest(); +}, 0, 0); + +setlistener("/services/fuel-truck/enable", func() { + if (!fuelSvc.enable.getBoolValue()) { + fuelSvc.stop(); + } +}, 0, 0); + +setlistener("/services/fuel-truck/connect", func() { + if (!fuelSvc.connect.getBoolValue()) { + fuelSvc.stop(); + } +}, 0, 0); + +var fuelTimer = maketimer(0.25, func() { + if (systems.FUEL.Quantity.leftInnerPct.getValue() >= 0.999) { + systems.FUEL.Valves.refuelLeft.setBoolValue(0); + } + + if (systems.FUEL.Quantity.centerPct.getValue() >= 0.999) { + systems.FUEL.Valves.refuelCenter.setBoolValue(0); + } + + if (systems.FUEL.Quantity.rightInnerPct.getValue() >= 0.999) { + systems.FUEL.Valves.refuelRight.setBoolValue(0); + } + + if (abs(pts.Consumables.Fuel.totalFuelLbs.getValue() - fuelSvc.Nodes.requestTotalLbs.getValue()) < 5) { + fuelSvc.stop(); + fuelTimer.stop(); + } +}); \ No newline at end of file diff --git a/Nasal/property-tree-setup.nas b/Nasal/property-tree-setup.nas index 459e98b6..008c472d 100644 --- a/Nasal/property-tree-setup.nas +++ b/Nasal/property-tree-setup.nas @@ -5,6 +5,12 @@ # Anything that says Temp is set by another file to avoid multiple getValue calls # Usage Example: pts.Class.SubClass.node.getValue() +var Consumables = { + Fuel: { + totalFuelLbs: props.globals.getNode("/consumables/fuel/total-fuel-lbs"), + }, +}; + var Controls = { Engines: { Engine1: { @@ -69,6 +75,7 @@ var Position = { }; var Sim = { + aero: props.globals.getNode("/sim/aero"), Replay: { replayActive: props.globals.getNode("/sim/replay/replay-state"), }, diff --git a/Systems/a320-fuel.xml b/Systems/a320-fuel.xml index 3e6f51a3..ae1e934c 100644 --- a/Systems/a320-fuel.xml +++ b/Systems/a320-fuel.xml @@ -61,16 +61,34 @@ /systems/electrical/bus/ac-2 ge 110 + + + + + /consumables/fuel/tank[1]/capacity-gal_us + 106.197 + + + + + + + + /consumables/fuel/tank[3]/capacity-gal_us + 106.197 + + + /systems/fuel/left-inner-full eq 1 - propulsion/tank[1]/contents-lbs lt 12270 - propulsion/tank[1]/contents-lbs ge 10300 + /consumables/fuel/tank[1]/level-norm lt 0.999 + /consumables/fuel/tank[1]/level-gal_us ge /systems/fuel/internal/left-inner-tank-underfull-level - propulsion/tank[1]/contents-lbs eq 12270 + /consumables/fuel/tank[1]/level-norm gt 0.999 @@ -78,11 +96,11 @@ /systems/fuel/right-inner-full eq 1 - propulsion/tank[3]/contents-lbs lt 12270 - propulsion/tank[3]/contents-lbs ge 10300 + /consumables/fuel/tank[3]/level-norm lt 0.999 + /consumables/fuel/tank[3]/level-gal_us ge /systems/fuel/internal/right-inner-tank-underfull-level - propulsion/tank[3]/contents-lbs eq 12270 + /consumables/fuel/tank[3]/level-norm gt 0.999 @@ -92,12 +110,14 @@ /controls/fuel/switches/pump-center-1 eq 1 /controls/fuel/switches/center-mode eq 0 - + /systems/fuel/pumps/center-control-low-level ne 1 - /systems/fuel/ctr-pump-cmd-on-eng-start eq 1 - - fcs/slat-pos-deg lt 16 - /systems/fuel/left-inner-full ne 1 + + /systems/fuel/ctr-pump-cmd-on-eng-start eq 1 + + fcs/slat-pos-deg lt 16 + /systems/fuel/left-inner-full ne 1 + @@ -111,13 +131,14 @@ /controls/fuel/switches/pump-center-2 eq 1 /controls/fuel/switches/center-mode eq 0 - + /systems/fuel/pumps/center-control-low-level ne 1 - /systems/fuel/ctr-pump-cmd-on-eng-start eq 1 - - fcs/slat-pos-deg lt 16 - /systems/fuel/pumps/center-control-low-level ne 1 - /systems/fuel/right-inner-full ne 1 + + /systems/fuel/ctr-pump-cmd-on-eng-start eq 1 + + fcs/slat-pos-deg lt 16 + /systems/fuel/left-inner-full ne 1 + @@ -423,19 +444,7 @@ - - - - - /systems/fuel/quantity/center-low eq 1 - /systems/fuel/feed-center-1 eq 0 - - /systems/fuel/feed-left-inner eq 1 - propulsion/tank[1]/contents-lbs gt 22.68 - propulsion/tank[5]/contents-lbs lt 9 - - - + @@ -454,7 +463,7 @@ /systems/fuel/refuel/refuelling eq 1 - propulsion/tank[0]/contents-lbs ge 1523 + propulsion/tank[0]/pct-full ge 99.9 @@ -505,7 +514,21 @@ /systems/fuel/refuel/refuelling eq 1 - propulsion/tank[4]/contents-lbs ge 1523 + propulsion/tank[4]/pct-full ge 99.9 + + + + + + + + + /systems/fuel/quantity/center-low eq 1 + /systems/fuel/feed-center-1 eq 0 + + /systems/fuel/feed-left-inner eq 1 + /consumables/fuel/tank[1]/level-gal_us gt /consumables/fuel/tank[1]/unusable-gal_us + propulsion/tank[5]/contents-lbs lt 9 @@ -519,7 +542,7 @@ /systems/fuel/valves/crossfeed-valve eq 1 - propulsion/tank[3]/contents-lbs gt 22.68 + /consumables/fuel/tank[2]/level-gal_us gt /consumables/fuel/tank[2]/unusable-gal_us propulsion/tank[5]/contents-lbs lt 9 @@ -533,7 +556,7 @@ /systems/fuel/feed-center-2 eq 0 /systems/fuel/valves/crossfeed-valve eq 1 - propulsion/tank[3]/contents-lbs gt 22.68 + /consumables/fuel/tank[3]/level-gal_us gt /consumables/fuel/tank[3]/unusable-gal_us propulsion/tank[5]/contents-lbs lt 9 @@ -547,7 +570,7 @@ /systems/fuel/feed-center-1 eq 0 /systems/fuel/feed-left-inner eq 1 - propulsion/tank[1]/contents-lbs gt 22.68 + /consumables/fuel/tank[1]/level-gal_us gt /consumables/fuel/tank[1]/unusable-gal_us propulsion/tank[6]/contents-lbs lt 9 @@ -562,7 +585,7 @@ /systems/fuel/valves/crossfeed-valve eq 1 - propulsion/tank[3]/contents-lbs gt 22.68 + /consumables/fuel/tank[2]/level-gal_us gt /consumables/fuel/tank[2]/unusable-gal_us propulsion/tank[6]/contents-lbs lt 9 @@ -575,7 +598,7 @@ /systems/fuel/feed-center-2 eq 0 /systems/fuel/feed-right-inner eq 1 - propulsion/tank[3]/contents-lbs gt 22.68 + /consumables/fuel/tank[3]/level-gal_us gt /consumables/fuel/tank[3]/unusable-gal_us propulsion/tank[6]/contents-lbs lt 9 @@ -585,6 +608,8 @@ /systems/fuel/valves/outer-inner-transfer-valve-1 eq 1 /accelerations/pilot-gdamped ge 0.5 + /consumables/fuel/tank[0]/level-gal_us gt /consumables/fuel/tank[0]/unusable-gal_us + /consumables/fuel/tank[1]/level-norm lt 0.999 @@ -593,6 +618,8 @@ /systems/fuel/valves/outer-inner-transfer-valve-2 eq 1 /accelerations/pilot-gdamped ge 0.5 + /consumables/fuel/tank[4]/level-gal_us gt /consumables/fuel/tank[4]/unusable-gal_us + /consumables/fuel/tank[3]/level-norm lt 0.999 diff --git a/Systems/fuel.xml b/Systems/fuel.xml deleted file mode 100644 index 355007f6..00000000 --- a/Systems/fuel.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - /systems/fuel/only-use-ctr-tank == 0 - /systems/fuel/tank[0]/feed == 1 - propulsion/tank[0]/contents-lbs gt 0 - propulsion/tank[3]/contents-lbs lt 9 - - - - - - - /systems/fuel/tank[1]/feed == 1 - propulsion/tank[1]/contents-lbs gt 0 - propulsion/tank[3]/contents-lbs lt 9 - - - - - - - /systems/fuel/valves/crossfeed-valve == 1 - /systems/fuel/only-use-ctr-tank == 0 - /systems/fuel/tank[2]/feed == 1 - propulsion/tank[0]/contents-lbs eq 0 - propulsion/tank[2]/contents-lbs gt 0 - propulsion/tank[3]/contents-lbs lt 9 - - - - - - - - - /systems/fuel/only-use-ctr-tank == 0 - /systems/fuel/tank[2]/feed == 1 - propulsion/tank[2]/contents-lbs gt 0 - propulsion/tank[4]/contents-lbs lt 9 - - - - - - - /systems/fuel/tank[1]/feed == 1 - propulsion/tank[1]/contents-lbs gt 0 - propulsion/tank[4]/contents-lbs lt 9 - - - - - - - /systems/fuel/valves/crossfeed-valve == 1 - /systems/fuel/only-use-ctr-tank == 0 - /systems/fuel/tank[0]/feed == 1 - propulsion/tank[2]/contents-lbs eq 0 - propulsion/tank[0]/contents-lbs gt 0 - propulsion/tank[4]/contents-lbs lt 9 - - - - - - - fuel/from-tank0-to-tank3 - fuel/from-tank1-to-tank3 - fuel/from-tank2-to-tank3 - propulsion/tank[3]/external-flow-rate-pps - - - - - - fuel/from-tank2-to-tank4 - fuel/from-tank1-to-tank4 - fuel/from-tank0-to-tank4 - propulsion/tank[4]/external-flow-rate-pps - - - - - - -fuel/from-tank0-to-tank3 - -fuel/from-tank0-to-tank4 - propulsion/tank[0]/external-flow-rate-pps - - - - -fuel/from-tank1-to-tank3 - -fuel/from-tank1-to-tank4 - propulsion/tank[1]/external-flow-rate-pps - - - - -fuel/from-tank2-to-tank4 - -fuel/from-tank2-to-tank3 - propulsion/tank[2]/external-flow-rate-pps - - - - diff --git a/revision.txt b/revision.txt index 301160a9..f11c82a4 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -8 \ No newline at end of file +9 \ No newline at end of file From eaec1d80192f01a54793d92638b6a8496c2e26f5 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 9 Nov 2019 15:59:19 +0000 Subject: [PATCH 3/3] Gravity feeding only works if no pressure in fuel line so make the suction depend on crossfeed valve and off-side pumps --- Nasal/payload.nas | 6 +++--- Systems/a320-fuel.xml | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Nasal/payload.nas b/Nasal/payload.nas index 5572dd2f..a392164b 100644 --- a/Nasal/payload.nas +++ b/Nasal/payload.nas @@ -12,11 +12,11 @@ var fuelSvc = { newRequest: func() { if (pts.Sim.aero.getValue() == "A320-200-CFM") { - me.Nodes.requestTotalLbs.setValue(math.min(pts.Consumables.Fuel.totalFuelLbs.getValue() + me.Nodes.requestLbs.getValue(), 42872)); + me.Nodes.requestTotalLbs.setValue(math.max(math.min(pts.Consumables.Fuel.totalFuelLbs.getValue() + me.Nodes.requestLbs.getValue(), 42872), 0)); } elsif (pts.Sim.aero.getValue() == "A320-200-IAE" or pts.Sim.aero.getValue() == "A320-100-CFM") { - me.Nodes.requestTotalLbs.setValue(math.min(pts.Consumables.Fuel.totalFuelLbs.getValue() + me.Nodes.requestLbs.getValue(), 42214)); + me.Nodes.requestTotalLbs.setValue(math.max(math.min(pts.Consumables.Fuel.totalFuelLbs.getValue() + me.Nodes.requestLbs.getValue(), 42214), 0)); } elsif (pts.Sim.aero.getValue() == "A320neo-CFM" or pts.Sim.aero.getValue() == "A320neo-PW") { - me.Nodes.requestTotalLbs.setValue(math.min(pts.Consumables.Fuel.totalFuelLbs.getValue() + me.Nodes.requestLbs.getValue(), 41977)); + me.Nodes.requestTotalLbs.setValue(math.max(math.min(pts.Consumables.Fuel.totalFuelLbs.getValue() + me.Nodes.requestLbs.getValue(), 41977), 0)); } }, diff --git a/Systems/a320-fuel.xml b/Systems/a320-fuel.xml index ae1e934c..5af3f62b 100644 --- a/Systems/a320-fuel.xml +++ b/Systems/a320-fuel.xml @@ -414,6 +414,13 @@ /systems/fuel/pumps/wing-pump-left-1-operate eq 1 /systems/fuel/pumps/wing-pump-left-2-operate eq 1 + + /systems/fuel/valves/crossfeed-valve eq 1 + + /systems/fuel/pumps/wing-pump-right-1-operate eq 1 + /systems/fuel/pumps/wing-pump-right-2-operate eq 1 + + /accelerations/pilot-gdamped ge 0.5 @@ -425,6 +432,13 @@ /systems/fuel/pumps/wing-pump-right-1-operate eq 1 /systems/fuel/pumps/wing-pump-right-2-operate eq 1 + + /systems/fuel/valves/crossfeed-valve eq 1 + + /systems/fuel/pumps/wing-pump-left-1-operate eq 1 + /systems/fuel/pumps/wing-pump-left-2-operate eq 1 + + /accelerations/pilot-gdamped ge 0.5