From 361795c89f2d190135b76d250406726dafbdfa95 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Sun, 2 Jan 2022 18:46:45 +0000 Subject: [PATCH 1/6] OXygen: fix power supply --- Systems/a320-oxygen.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Systems/a320-oxygen.xml b/Systems/a320-oxygen.xml index 1fb49433..40979221 100644 --- a/Systems/a320-oxygen.xml +++ b/Systems/a320-oxygen.xml @@ -316,11 +316,11 @@ /controls/oxygen/passenger-mask-reset eq 1 - /systems/electrical/bus/dc-ess lt 25 + /systems/electrical/bus/dc-ess-shed lt 25 /systems/oxygen/passenger-oxygen/masks-deploy-cmd eq 1 - /systems/electrical/bus/dc-ess ge 25 + /systems/electrical/bus/dc-ess-shed ge 25 /systems/oxygen/passenger-oxygen/sys-on-light From 14a02470a03a89e7d3d3a11c1f5d3c921fbfeb40 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Mon, 3 Jan 2022 17:58:26 +0000 Subject: [PATCH 2/6] Remove redundant --- Models/Instruments/OHpanel/OHpanel.xml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index 8b419635..9f0fba46 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -261,22 +261,6 @@ - - material - Battery-volt - Battery-volt-test - - 1 - 1 - 1 - - - 1 - 1 - 1 - - - select From 11edf58d90ea5d2577977d942c0522af26de31bc Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Mon, 3 Jan 2022 20:46:42 +0000 Subject: [PATCH 3/6] Hydraulics: add new logic for fault lights. Add correct power sourcing for transducers and quantity indications. --- A320-main.xml | 9 +- .../Instruments/Lower-ECAM/Lower-ECAM-hyd.nas | 154 +++++++----- Models/Instruments/OHpanel/OHpanel.xml | 160 ++---------- Nasal/ECAM/ECAM-phases.nas | 4 +- Nasal/Systems/hydraulics.nas | 16 ++ Systems/a320-hydraulic.xml | 233 ++++++++++++++---- 6 files changed, 324 insertions(+), 252 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 5b812a29..2f24d876 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -1336,15 +1336,22 @@ 0 - 0 0 + 0 0 + 0 + 0 0 0 + 0 + 0 0 0 0 + 0 0 + 0 + 0 0 diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas index 170cd993..93d1fb75 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas @@ -1,15 +1,6 @@ # A3XX Lower ECAM Canvas # Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath -var elec_pump_y_ovht = props.globals.initNode("/systems/hydraulic/elec-pump-yellow-ovht", 0, "BOOL"); -var elec_pump_b_ovht = props.globals.initNode("/systems/hydraulic/elec-pump-blue-ovht", 0, "BOOL"); -var y_resv_ovht = props.globals.initNode("/systems/hydraulic/yellow-resv-ovht", 0, "BOOL"); -var b_resv_ovht = props.globals.initNode("/systems/hydraulic/blue-resv-ovht", 0, "BOOL"); -var g_resv_ovht = props.globals.initNode("/systems/hydraulic/green-resv-ovht", 0, "BOOL"); -var y_resv_lo_press = props.globals.initNode("/systems/hydraulic/yellow-resv-lo-air-press", 0, "BOOL"); -var b_resv_lo_press = props.globals.initNode("/systems/hydraulic/blue-resv-lo-air-press", 0, "BOOL"); -var g_resv_lo_press = props.globals.initNode("/systems/hydraulic/green-resv-lo-air-press", 0, "BOOL"); - var canvas_lowerECAMPageHyd = { new: func(svg,name) { @@ -46,22 +37,33 @@ var canvas_lowerECAMPageHyd = # init obj.update_items = [ - props.UpdateManager.FromHashValue("blue", 25, func(val) { - if (val >= 100) { - obj["Press-Blue"].setText(sprintf("%s", math.round(val, 50))); - } else { - obj["Press-Blue"].setText(sprintf("%s", 0)); - } - - if (val > 1450) { - obj["Blue-Line"].setColor(0.0509,0.7529,0.2941); - obj["Blue-Line"].setColorFill(0.0509,0.7529,0.2941); - obj["Blue-Line-Top"].setColorFill(0.0509,0.7529,0.2941); - obj["Blue-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941); - obj["Blue-Indicator"].setColor(0.0509,0.7529,0.2941); - obj["Press-Blue"].setColor(0.0509,0.7529,0.2941); - obj["Blue-label"].setColor(0.8078,0.8039,0.8078); + props.UpdateManager.FromHashList(["blue", "dcEssShed"], 25, func(val) { + if (val.dcEssShed >= 25) { + if (val.blue >= 100) { + obj["Press-Blue"].setText(sprintf("%s", math.round(val.blue, 50))); + } else { + obj["Press-Blue"].setText(sprintf("%s", 0)); + } + + if (val.blue > 1450) { + obj["Blue-Line"].setColor(0.0509,0.7529,0.2941); + obj["Blue-Line"].setColorFill(0.0509,0.7529,0.2941); + obj["Blue-Line-Top"].setColorFill(0.0509,0.7529,0.2941); + obj["Blue-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941); + obj["Blue-Indicator"].setColor(0.0509,0.7529,0.2941); + obj["Press-Blue"].setColor(0.0509,0.7529,0.2941); + obj["Blue-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["Blue-Line"].setColor(0.7333,0.3803,0); + obj["Blue-Line"].setColorFill(0.7333,0.3803,0); + obj["Blue-Line-Top"].setColorFill(0.7333,0.3803,0); + obj["Blue-Line-Bottom"].setColorFill(0.7333,0.3803,0); + obj["Blue-Indicator"].setColor(0.7333,0.3803,0); + obj["Press-Blue"].setColor(0.7333,0.3803,0); + obj["Blue-label"].setColor(0.7333,0.3803,0); + } } else { + obj["Press-Blue"].setText(sprintf("%s", "XX")); obj["Blue-Line"].setColor(0.7333,0.3803,0); obj["Blue-Line"].setColorFill(0.7333,0.3803,0); obj["Blue-Line-Top"].setColorFill(0.7333,0.3803,0); @@ -71,23 +73,35 @@ var canvas_lowerECAMPageHyd = obj["Blue-label"].setColor(0.7333,0.3803,0); } }), - props.UpdateManager.FromHashValue("yellow", 25, func(val) { - if (val >= 100) { - obj["Press-Yellow"].setText(sprintf("%s", math.round(val, 50))); - } else { - obj["Press-Yellow"].setText(sprintf("%s", 0)); - } - - if (val > 1450) { - obj["Yellow-Line"].setColor(0.0509,0.7529,0.2941); - obj["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941); - obj["Yellow-Line-Top"].setColorFill(0.0509,0.7529,0.2941); - obj["Yellow-Line-Middle"].setColorFill(0.0509,0.7529,0.2941); - obj["Yellow-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941); - obj["Yellow-Indicator"].setColor(0.0509,0.7529,0.2941); - obj["Press-Yellow"].setColor(0.0509,0.7529,0.2941); - obj["Yellow-label"].setColor(0.8078,0.8039,0.8078); + props.UpdateManager.FromHashList(["yellow", "dcEssShed"], 25, func(val) { + if (val.dcEssShed >= 25) { + if (val.yellow >= 100) { + obj["Press-Yellow"].setText(sprintf("%s", math.round(val.yellow, 50))); + } else { + obj["Press-Yellow"].setText(sprintf("%s", 0)); + } + + if (val.yellow > 1450) { + obj["Yellow-Line"].setColor(0.0509,0.7529,0.2941); + obj["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941); + obj["Yellow-Line-Top"].setColorFill(0.0509,0.7529,0.2941); + obj["Yellow-Line-Middle"].setColorFill(0.0509,0.7529,0.2941); + obj["Yellow-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941); + obj["Yellow-Indicator"].setColor(0.0509,0.7529,0.2941); + obj["Press-Yellow"].setColor(0.0509,0.7529,0.2941); + obj["Yellow-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["Yellow-Line"].setColor(0.7333,0.3803,0); + obj["Yellow-Line"].setColorFill(0.7333,0.3803,0); + obj["Yellow-Line-Top"].setColorFill(0.7333,0.3803,0); + obj["Yellow-Line-Middle"].setColorFill(0.7333,0.3803,0); + obj["Yellow-Line-Bottom"].setColorFill(0.7333,0.3803,0); + obj["Yellow-Indicator"].setColor(0.7333,0.3803,0); + obj["Press-Yellow"].setColor(0.7333,0.3803,0); + obj["Yellow-label"].setColor(0.7333,0.3803,0); + } } else { + obj["Press-Yellow"].setText(sprintf("%s", "XX")); obj["Yellow-Line"].setColor(0.7333,0.3803,0); obj["Yellow-Line"].setColorFill(0.7333,0.3803,0); obj["Yellow-Line-Top"].setColorFill(0.7333,0.3803,0); @@ -98,23 +112,35 @@ var canvas_lowerECAMPageHyd = obj["Yellow-label"].setColor(0.7333,0.3803,0); } }), - props.UpdateManager.FromHashValue("green", 25, func(val) { - if (val >= 100) { - obj["Press-Green"].setText(sprintf("%s", math.round(val, 50))); - } else { - obj["Press-Green"].setText(sprintf("%s", 0)); - } - - if (val > 1450) { - obj["Green-Line"].setColor(0.0509,0.7529,0.2941); - obj["Green-Line"].setColorFill(0.0509,0.7529,0.2941); - obj["Green-Line-Top"].setColorFill(0.0509,0.7529,0.2941); - obj["Green-Line-Middle"].setColorFill(0.0509,0.7529,0.2941); - obj["Green-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941); - obj["Green-Indicator"].setColor(0.0509,0.7529,0.2941); - obj["Press-Green"].setColor(0.0509,0.7529,0.2941); - obj["Green-label"].setColor(0.8078,0.8039,0.8078); + props.UpdateManager.FromHashList(["green", "dcEssShed"], 25, func(val) { + if (val.dcEssShed) { + if (val.green >= 100) { + obj["Press-Green"].setText(sprintf("%s", math.round(val.green, 50))); + } else { + obj["Press-Green"].setText(sprintf("%s", 0)); + } + + if (val.green > 1450) { + obj["Green-Line"].setColor(0.0509,0.7529,0.2941); + obj["Green-Line"].setColorFill(0.0509,0.7529,0.2941); + obj["Green-Line-Top"].setColorFill(0.0509,0.7529,0.2941); + obj["Green-Line-Middle"].setColorFill(0.0509,0.7529,0.2941); + obj["Green-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941); + obj["Green-Indicator"].setColor(0.0509,0.7529,0.2941); + obj["Press-Green"].setColor(0.0509,0.7529,0.2941); + obj["Green-label"].setColor(0.8078,0.8039,0.8078); + } else { + obj["Green-Line"].setColor(0.7333,0.3803,0); + obj["Green-Line"].setColorFill(0.7333,0.3803,0); + obj["Green-Line-Top"].setColorFill(0.7333,0.3803,0); + obj["Green-Line-Middle"].setColorFill(0.7333,0.3803,0); + obj["Green-Line-Bottom"].setColorFill(0.7333,0.3803,0); + obj["Green-Indicator"].setColor(0.7333,0.3803,0); + obj["Press-Green"].setColor(0.7333,0.3803,0); + obj["Green-label"].setColor(0.7333,0.3803,0); + } } else { + obj["Press-Green"].setText(sprintf("%s", "XX")); obj["Green-Line"].setColor(0.7333,0.3803,0); obj["Green-Line"].setColorFill(0.7333,0.3803,0); obj["Green-Line-Top"].setColorFill(0.7333,0.3803,0); @@ -514,14 +540,14 @@ var canvas_lowerECAMPageHyd = }; var input = { - hydBlueResvOvht: "/systems/hydraulic/blue-resv-ovht", - hydGreenResvOvht: "/systems/hydraulic/green-resv-ovht", - hydYellowResvOvht: "/systems/hydraulic/yellow-resv-ovht", - hydBlueResvLoPrs: "/systems/hydraulic/blue-resv-lo-air-press", - hydGreenResvLoPrs: "/systems/hydraulic/green-resv-lo-air-press", - hydYellowResvLoPrs: "/systems/hydraulic/yellow-resv-lo-air-press", - hydYellowElecPumpOvht: "/systems/hydraulic/elec-pump-yellow-ovht", - hydBlueElecPumpOvht: "/systems/hydraulic/elec-pump-blue-ovht", + hydBlueResvOvht: "/systems/hydraulic/relays/blue-reservoir-overheat", + hydGreenResvOvht: "/systems/hydraulic/relays/green-reservoir-overheat", + hydYellowResvOvht: "/systems/hydraulic/relays/yellow-reservoir-overheat", + hydBlueResvLoPrs: "/systems/failures/hydraulic/blue-reservoir-air-press-lo", + hydGreenResvLoPrs: "/systems/failures/hydraulic/green-reservoir-air-press-lo", + hydYellowResvLoPrs: "/systems/failures/hydraulic/yellow-reservoir-air-press-lo", + hydBlueElecPumpOvht: "/systems/failures/hydraulic/blue-elec-ovht", + hydYellowElecPumpOvht: "/systems/failures/hydraulic/yellow-elec-ovht", hydRATPosition: "/systems/hydraulic/sources/rat/position", hydGreenFireValve: "/systems/hydraulic/sources/green-edp/fire-valve", hydYellowFireValve: "/systems/hydraulic/sources/yellow-edp/fire-valve", diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index 9f0fba46..7a241247 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -2009,12 +2009,6 @@ false - - - systems/electrical/bus/dc-ess - 25 - - property-toggle controls/hydraulic/switches/green-edp @@ -2030,20 +2024,8 @@ GreenEngPump1F - - - systems/hydraulic/lights/green-edp-fault - 1 - - - controls/hydraulic/switches/green-edp - 1 - - - - controls/switches/annun-test - 1 - + systems/hydraulic/lights/green-edp-fault + controls/switches/annun-test @@ -2053,14 +2035,10 @@ GreenEngPump2O - + controls/hydraulic/switches/green-edp - 0 - - - controls/switches/annun-test - 1 - + + controls/switches/annun-test @@ -2177,12 +2155,6 @@ false - - - systems/electrical/bus/dc-ess - 25 - - property-toggle controls/hydraulic/switches/blue-elec @@ -2198,20 +2170,8 @@ BlueElecPump1F - - - systems/hydraulic/lights/blue-elec-fault - 1 - - - controls/hydraulic/switches/blue-elec - 1 - - - - controls/switches/annun-test - 1 - + systems/hydraulic/lights/blue-elec-fault + controls/switches/annun-test @@ -2221,14 +2181,10 @@ BlueElecPump2O - + controls/hydraulic/switches/blue-elec - 0 - - - controls/switches/annun-test - 1 - + + controls/switches/annun-test @@ -2244,12 +2200,6 @@ false - - - systems/electrical/bus/dc-ess - 25 - - property-toggle controls/hydraulic/switches/ptu @@ -2265,20 +2215,8 @@ PTU1F - - - systems/hydraulic/lights/ptu-fault - 1 - - - controls/hydraulic/switches/ptu - 1 - - - - controls/switches/annun-test - 1 - + systems/hydraulic/lights/ptu-fault + controls/switches/annun-test @@ -2288,14 +2226,10 @@ PTU2O - + controls/hydraulic/switches/ptu - 0 - - - controls/switches/annun-test - 1 - + + controls/switches/annun-test @@ -2311,12 +2245,6 @@ false - - - systems/electrical/bus/dc-ess - 25 - - property-toggle controls/hydraulic/switches/yellow-edp @@ -2332,20 +2260,8 @@ YellowEngPump1F - - - systems/hydraulic/lights/yellow-edp-fault - 1 - - - controls/hydraulic/switches/yellow-edp - 1 - - - - controls/switches/annun-test - 1 - + systems/hydraulic/lights/yellow-edp-fault + controls/switches/annun-test @@ -2355,14 +2271,10 @@ YellowEngPump2O - + controls/hydraulic/switches/yellow-edp - 0 - - - controls/switches/annun-test - 1 - + + controls/switches/annun-test @@ -2378,12 +2290,6 @@ false - - - systems/electrical/bus/dc-ess - 25 - - property-toggle controls/hydraulic/switches/yellow-elec @@ -2399,20 +2305,8 @@ YellowElecPump1F - - - systems/hydraulic/lights/yellow-elec-fault - 1 - - - controls/hydraulic/switches/yellow-elec - 1 - - - - controls/switches/annun-test - 1 - + systems/hydraulic/lights/yellow-elec-fault + controls/switches/annun-test @@ -2422,14 +2316,8 @@ YellowElecPump2O - - controls/hydraulic/switches/yellow-elec - 1 - - - controls/switches/annun-test - 1 - + controls/hydraulic/switches/yellow-elec + controls/switches/annun-test diff --git a/Nasal/ECAM/ECAM-phases.nas b/Nasal/ECAM/ECAM-phases.nas index 6b959355..5d15918b 100644 --- a/Nasal/ECAM/ECAM-phases.nas +++ b/Nasal/ECAM/ECAM-phases.nas @@ -96,6 +96,6 @@ var setPhase = func(newPhase) { } } -setlistener("/ECAM/buttons/recall-btn", func() { - FWC.Flipflop.recallSet.setValue(FWC.Btn.recall.getBoolValue()); +setlistener("/ECAM/buttons/recall-btn", func(val) { + FWC.Flipflop.recallSet.setValue(val.getBoolValue()); }, 0, 0); diff --git a/Nasal/Systems/hydraulics.nas b/Nasal/Systems/hydraulics.nas index fc698241..b0d1ff60 100644 --- a/Nasal/Systems/hydraulics.nas +++ b/Nasal/Systems/hydraulics.nas @@ -17,13 +17,21 @@ var HYD = { }, Fail: { blueElec: props.globals.getNode("/systems/failures/hydraulic/blue-elec"), + blueElecOvht: props.globals.getNode("/systems/failures/hydraulic/blue-elec-ovht"), blueLeak: props.globals.getNode("/systems/failures/hydraulic/blue-leak"), + blueReservoirAirPressLow: props.globals.getNode("/systems/failures/hydraulic/blue-reservoir-air-press-lo"), + blueReservoirOvht: props.globals.getNode("/systems/failures/hydraulic/blue-reservoir-ovht"), greenEng: props.globals.getNode("/systems/failures/hydraulic/green-edp"), greenLeak: props.globals.getNode("/systems/failures/hydraulic/green-leak"), + greenReservoirAirPressLow: props.globals.getNode("/systems/failures/hydraulic/green-reservoir-air-press-lo"), + greenReservoirOvht: props.globals.getNode("/systems/failures/hydraulic/green-reservoir-ovht"), ptuFault: props.globals.getNode("/systems/failures/hydraulic/ptu"), yellowEng: props.globals.getNode("/systems/failures/hydraulic/yellow-edp"), yellowElec: props.globals.getNode("/systems/failures/hydraulic/yellow-elec"), + yellowElecOvht: props.globals.getNode("/systems/failures/hydraulic/yellow-elec-ovht"), yellowLeak: props.globals.getNode("/systems/failures/hydraulic/yellow-leak"), + yellowReservoirAirPressLow: props.globals.getNode("/systems/failures/hydraulic/yellow-reservoir-air-press-lo"), + yellowReservoirOvht: props.globals.getNode("/systems/failures/hydraulic/yellow-reservoir-ovht"), }, Psi: { blue: props.globals.getNode("/systems/hydraulic/blue-psi"), @@ -83,13 +91,21 @@ var HYD = { }, resetFail: func() { me.Fail.blueElec.setBoolValue(0); + me.Fail.blueElecOvht.setBoolValue(0); me.Fail.blueLeak.setBoolValue(0); + me.Fail.blueReservoirAirPressLow.setBoolValue(0); + me.Fail.blueReservoirOvht.setBoolValue(0); me.Fail.greenEng.setBoolValue(0); me.Fail.greenLeak.setBoolValue(0); + me.Fail.greenReservoirAirPressLow.setBoolValue(0); + me.Fail.greenReservoirOvht.setBoolValue(0); me.Fail.ptuFault.setBoolValue(0); me.Fail.yellowEng.setBoolValue(0); me.Fail.yellowElec.setBoolValue(0); + me.Fail.yellowElecOvht.setBoolValue(0); me.Fail.yellowLeak.setBoolValue(0); + me.Fail.yellowReservoirAirPressLow.setBoolValue(0); + me.Fail.yellowReservoirOvht.setBoolValue(0); }, loop: func(notification) { # Decrease accumPressPsi when green and yellow hydraulics aren't pressurized diff --git a/Systems/a320-hydraulic.xml b/Systems/a320-hydraulic.xml index 30def2b9..bd034982 100644 --- a/Systems/a320-hydraulic.xml +++ b/Systems/a320-hydraulic.xml @@ -5,7 +5,8 @@ /systems/hydraulic/sys-incr-rate - + + @@ -84,7 +85,7 @@ - + @@ -301,6 +302,10 @@ + + + + @@ -437,6 +442,9 @@ /systems/hydraulic/sys-decr-rate + + + @@ -553,11 +561,18 @@ - + /systems/hydraulic/yellow-accumulator-psi 9 + + + + /systems/electrical/bus/dc-ess lt 25 + + + @@ -572,85 +587,105 @@ - + /systems/hydraulic/brakes/pressure-left-psi-input 9 - + + + + /systems/electrical/bus/dc-ess lt 25 + + + + /systems/hydraulic/brakes/pressure-right-psi-input 9 + + + + /systems/electrical/bus/dc-ess lt 25 + + + - + - + - - - /systems/hydraulic/sources/blue-elec/output-psi le 1450 - - /engines/engine[0]/state eq 3 - /engines/engine[1]/state eq 3 - - - /systems/hydraulic/blue-qty lt 2.4 + + /systems/electrical/bus/dc-1 ge 25 + /systems/hydraulic/blue-qty lt 2.2 - + - - - /systems/hydraulic/sources/green-edp/output-psi le 1750 - /engines/engine[0]/state eq 3 - - - /systems/hydraulic/green-qty lt 3.5 + + /systems/electrical/bus/dc-1 ge 25 + /systems/hydraulic/green-qty lt 3.0 + + + + + + + /systems/electrical/bus/dc-1 ge 25 + /systems/hydraulic/yellow-qty lt 3.0 + + + + + + + /systems/electrical/bus/dc-1 ge 25 + + /systems/hydraulic/relays/green-reservoir-low-qty-switch eq 1 + /systems/failures/hydraulic/green-reservoir-air-press-lo eq 1 - + - - - /systems/hydraulic/sources/yellow-edp/output-psi le 1750 - /engines/engine[1]/state eq 3 - - - /systems/hydraulic/yellow-qty lt 3.5 + + /systems/electrical/bus/dc-2 ge 25 + + /systems/hydraulic/relays/yellow-reservoir-low-qty-switch eq 1 + /systems/failures/hydraulic/yellow-reservoir-air-press-lo eq 1 - + - - - /systems/hydraulic/sources/yellow-elec/output-psi le 1450 - /systems/hydraulic/sources/yellow-edp/output-psi le 1750 - - /systems/hydraulic/sources/ptu/green-yellow le 1750 - /systems/hydraulic/sources/ptu/yellow-green le 1750 - - - - /systems/hydraulic/yellow-qty lt 3.5 - + + /systems/electrical/bus/dc-ess ge 25 + /systems/failures/hydraulic/blue-reservoir-ovht eq 1 - + - - /systems/hydraulic/yellow-qty lt 3.5 - /systems/hydraulic/green-qty lt 3.5 + + /systems/electrical/bus/dc-1 ge 25 + /systems/failures/hydraulic/green-reservoir-ovht eq 1 + + + + /systems/electrical/bus/dc-2 ge 25 + /systems/failures/hydraulic/yellow-reservoir-ovht eq 1 + + + + @@ -686,4 +721,104 @@ + + + + + + /systems/electrical/bus/dc-2 ge 25 + + /systems/hydraulic/relays/yellow-reservoir-overheat eq 1 + /systems/hydraulic/relays/green-reservoir-overheat eq 1 + + + /systems/hydraulic/relays/green-reservoir-low-qty-air-press-fault eq 1 + /systems/hydraulic/relays/yellow-reservoir-low-qty-air-press-fault eq 1 + + /controls/hydraulic/switches/ptu eq 1 + + + + + + + + + /systems/electrical/bus/dc-1 ge 25 + + /systems/hydraulic/relays/green-reservoir-overheat eq 1 + + + + /systems/hydraulic/sources/green-edp/output-psi le 1750 + /engines/engine[0]/state eq 3 + + /systems/hydraulic/relays/green-reservoir-low-qty-air-press-fault eq 1 + + /controls/hydraulic/switches/green-edp eq 1 + + + + + + + + + /systems/electrical/bus/dc-2 ge 25 + + /systems/hydraulic/relays/yellow-reservoir-overheat eq 1 + + + + /systems/hydraulic/sources/yellow-edp/output-psi le 1750 + /engines/engine[1]/state eq 3 + + /systems/hydraulic/relays/yellow-reservoir-low-qty-air-press-fault eq 1 + + /controls/hydraulic/switches/yellow-edp eq 1 + + + + + + + + + /systems/hydraulic/relays/blue-reservoir-overheat eq 1 + /systems/failures/hydraulic/blue-elec-ovht eq 1 + + + /systems/hydraulic/relays/blue-reservoir-low-qty-switch eq 1 + /systems/failures/hydraulic/blue-reservoir-air-press-lo eq 1 + + /systems/hydraulic/sources/blue-elec/output-psi le 1450 + + /engines/engine[0]/state eq 3 + /engines/engine[1]/state eq 3 + /controls/hydraulic/switches/blue-elec-ovrd eq 1 + + + + /controls/hydraulic/switches/blue-elec eq 1 + + + + + + + /systems/hydraulic/relays/yellow-reservoir-overheat eq 1 + /systems/failures/hydraulic/yellow-elec-ovht eq 1 + + + /systems/hydraulic/relays/yellow-reservoir-low-qty-switch eq 1 + /systems/failures/hydraulic/yellow-reservoir-air-press-lo eq 1 + /systems/hydraulic/sources/yellow-elec/output-psi le 1450 + + /controls/hydraulic/switches/yellow-elec eq 1 + + + + + + From 489411e8c43bc4bd3878f9c97aba89b59ad33053 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Mon, 3 Jan 2022 21:43:55 +0000 Subject: [PATCH 4/6] HYD: improve fire valve code; add 1500 feet inhibition for PTU --- A320-main.xml | 4 +- Systems/a320-hydraulic.xml | 128 +++++++++++++++++++++++++------------ 2 files changed, 88 insertions(+), 44 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 2f24d876..823c5cf0 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -1340,7 +1340,7 @@ 0 0 0 - 0 + 0 0 0 0 @@ -1348,7 +1348,7 @@ 0 0 0 - 0 + 0 0 0 0 diff --git a/Systems/a320-hydraulic.xml b/Systems/a320-hydraulic.xml index bd034982..13afd59a 100644 --- a/Systems/a320-hydraulic.xml +++ b/Systems/a320-hydraulic.xml @@ -133,6 +133,16 @@ + + + @@ -204,6 +214,11 @@ + + @@ -233,7 +248,6 @@ /controls/hydraulic/switches/green-edp eq 1 - /systems/hydraulic/sources/green-edp/fire-valve lt 0.10 @@ -250,6 +264,15 @@ + + @@ -269,6 +292,12 @@ + + + @@ -298,7 +327,6 @@ /controls/hydraulic/switches/yellow-edp eq 1 - /systems/hydraulic/sources/yellow-edp/fire-valve lt 0.10 @@ -345,17 +373,20 @@ - - - /systems/hydraulic/green-qty - 1.0 - - - /systems/hydraulic/green-psi-cmd-pump - /systems/hydraulic/sources/ptu/yellow-green - - 0 - + + + + /systems/hydraulic/green-qty + 1.0 + + + /systems/hydraulic/green-psi-cmd-pump + /systems/hydraulic/sources/ptu/yellow-green + + 0 + + /systems/hydraulic/sources/green-edp/fire-valve + @@ -389,17 +420,20 @@ - - - /systems/hydraulic/yellow-qty - 1.0 - - - /systems/hydraulic/yellow-psi-cmd-pump - /systems/hydraulic/sources/ptu/green-yellow - - 0 - + + + + /systems/hydraulic/yellow-qty + 1.0 + + + /systems/hydraulic/yellow-psi-cmd-pump + /systems/hydraulic/sources/ptu/green-yellow + + 0 + + /systems/hydraulic/sources/yellow-edp/fire-valve + @@ -442,10 +476,6 @@ /systems/hydraulic/sys-decr-rate - - - - @@ -455,9 +485,15 @@ + + + + + + /systems/electrical/bus/dc-service-bus ge 25 /gear/gear[0]/compression-norm ne 0 @@ -501,18 +537,38 @@ + + + /position/altitude-ft ge 1500 + /gear/gear[0]/compression-norm ne 0 + + /systems/electrical/bus/dc-service-bus ge 25 /controls/hydraulic/switches/ptu eq 1 /systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1 /systems/hydraulic/sources/ptu/ptu-inhibited eq 0 - /systems/electrical/bus/dc-2 ge 25 /systems/failures/hydraulic/ptu ne 1 - /systems/hydraulic/sources/yellow-edp/fire-valve lt 0.10 + + + + + /position/altitude-ft ge 1500 + /gear/gear[0]/compression-norm ne 0 + + /systems/electrical/bus/dc-service-bus ge 25 + /controls/hydraulic/switches/ptu eq 1 + /systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1 + /systems/hydraulic/sources/ptu/ptu-inhibited eq 0 + /systems/failures/hydraulic/ptu ne 1 + + + + @@ -527,18 +583,6 @@ 120 - - - - /controls/hydraulic/switches/ptu eq 1 - /systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1 - /systems/hydraulic/sources/ptu/ptu-inhibited eq 0 - /systems/electrical/bus/dc-2 ge 25 - /systems/failures/hydraulic/ptu ne 1 - /systems/hydraulic/sources/green-edp/fire-valve lt 0.10 - - - From 57de1cc8e3724e53dcee9148c04d90785c9b2feb Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Mon, 3 Jan 2022 21:47:35 +0000 Subject: [PATCH 5/6] Bugfix fire valve --- Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas | 2 +- Systems/a320-hydraulic.xml | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas index 93d1fb75..6e51edda 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-hyd.nas @@ -557,7 +557,7 @@ var input = { hydYellowEDPPumpSwitch: "/controls/hydraulic/switches/yellow-edp", hydPTUSwitch: "/controls/hydraulic/switches/ptu", hydPTUFault: "/systems/failures/hydraulic/ptu", - hydPTUActive: "/systems/hydraulic/sources/ptu/ptu-hydraulic-condition", + hydPTUActive: "/systems/hydraulic/sources/ptu/ptu-loop-sound-cmd", hydPTUDiff: "/systems/hydraulic/yellow-psi-diff", hydBlueQTY: "/systems/hydraulic/blue-qty", hydGreenQTY: "/systems/hydraulic/green-qty", diff --git a/Systems/a320-hydraulic.xml b/Systems/a320-hydraulic.xml index 13afd59a..b929eb70 100644 --- a/Systems/a320-hydraulic.xml +++ b/Systems/a320-hydraulic.xml @@ -385,7 +385,10 @@ 0 - /systems/hydraulic/sources/green-edp/fire-valve + + 1 + /systems/hydraulic/sources/green-edp/fire-valve + @@ -432,7 +435,10 @@ 0 - /systems/hydraulic/sources/yellow-edp/fire-valve + + 1 + /systems/hydraulic/sources/yellow-edp/fire-valve + @@ -557,7 +563,7 @@ - /position/altitude-ft ge 1500 + /position/gear-agl-ft ge 1500 /gear/gear[0]/compression-norm ne 0 /systems/electrical/bus/dc-service-bus ge 25 From eb08cabaaafdaba1ddaa9ea14c32d23f6f6e2f4f Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Mon, 3 Jan 2022 21:55:01 +0000 Subject: [PATCH 6/6] Prevent ALTN / DIRECT law during eng start because timer condition was incorrect --- Nasal/ECAM/ECAM-logic.nas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index b8f9a7d0..fe6a4406 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -2058,7 +2058,7 @@ var messages_priority_2 = func { } gearPosition = pts.Gear.position[1].getValue(); - if (directLaw.clearFlag == 0 and warningNodes.Timers.directLaw.getValue() and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) { + if (directLaw.clearFlag == 0 and warningNodes.Timers.directLaw.getValue() == 1 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) { directLaw.active = 1; directLawProt.active = 1; if (directLawMaxSpeed.clearFlag == 0 and !fbw.tripleADRFail and gearPosition != 1) { @@ -2096,7 +2096,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(directLawSpdBrk2); } - if (altnLaw.clearFlag == 0 and warningNodes.Timers.altnLaw.getValue() and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) { + if (altnLaw.clearFlag == 0 and warningNodes.Timers.altnLaw.getValue() == 1 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) { altnLaw.active = 1; altnLawProt.active = 1; if (altnLawMaxSpeed.clearFlag == 0 and altnLawMaxSpeed2.clearFlag == 0 and !fbw.tripleADRFail) {