From a1b5edf3979f1e341df5189ddced5b366ef420ba Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 12 Sep 2020 18:13:34 +0100 Subject: [PATCH] Remove legacy ventilation code; move legacy braking code to JSB --- Nasal/FMGC/FMGC.nas | 6 ------ Nasal/Systems/hydraulics.nas | 22 ++++------------------ Nasal/Systems/pneumatics.nas | 28 ++++++++-------------------- Systems/a320-hydraulic.xml | 21 +++++++++++++++++++++ 4 files changed, 33 insertions(+), 44 deletions(-) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 532532ea..2bde3628 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -1015,12 +1015,6 @@ var reset_FMGC = func { setprop("systems/pressurization/diff-to-target", "0"); setprop("systems/pressurization/ditchingpb", 0); setprop("systems/pressurization/targetvs", "0"); - setprop("systems/ventilation/cabin/fans", 0); # aircon fans - setprop("systems/ventilation/avionics/fan", 0); - setprop("systems/ventilation/avionics/extractvalve", "0"); - setprop("systems/ventilation/avionics/inletvalve", "0"); - setprop("systems/ventilation/lavatory/extractfan", 0); - setprop("systems/ventilation/lavatory/extractvalve", "0"); setprop("systems/pressurization/ambientpsi", "0"); setprop("systems/pressurization/cabinpsi", "0"); diff --git a/Nasal/Systems/hydraulics.nas b/Nasal/Systems/hydraulics.nas index 1497f52a..3b95f47b 100644 --- a/Nasal/Systems/hydraulics.nas +++ b/Nasal/Systems/hydraulics.nas @@ -4,14 +4,11 @@ # Copyright (c) 2019 Jonathan Redpath var accum = 0; -var parking = 0; -var askidnws_sw = 0; var down = 0; var HYD = { Brakes: { accumPressPsi: props.globals.initNode("/systems/hydraulic/brakes/accumulator-pressure-psi", 0, "INT"), - accumPressPsi1: props.globals.initNode("/systems/hydraulic/brakes/accumulator-pressure-psi-1", 0, "INT"), leftPressPsi: props.globals.initNode("/systems/hydraulic/brakes/pressure-left-psi", 0, "INT"), rightPressPsi: props.globals.initNode("/systems/hydraulic/brakes/pressure-right-psi", 0, "INT"), askidSw: props.globals.initNode("/systems/hydraulic/brakes/askidnwssw", 1, "BOOL"), @@ -86,22 +83,11 @@ var HYD = { }, loop: func() { accum = me.Brakes.accumPressPsi.getValue(); - parking = getprop("/controls/gear/brake-parking"); - askidnws_sw = me.Brakes.askidSw.getBoolValue(); - if (!parking and askidnws_sw and me.Psi.green.getValue() > 2500) { - # set mode to on - me.Brakes.mode.setValue(1); - } else if ((!parking and askidnws_sw and me.Psi.yellow.getValue() > 2500) or (!parking and askidnws_sw and accum > 0)) { - # set mode to altn - me.Brakes.mode.setValue(2); - } else { - # set mode to off - me.Brakes.mode.setValue(0); - } - - if (me.Brakes.mode.getValue() == 2 and me.Psi.yellow.getValue() > 2500 and accum < 700) { - me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() + 50); + if (me.Brakes.mode.getValue() == 2) { + if (me.Psi.yellow.getValue() > 2500 and accum < 700) { + me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() + 50); + } } }, }; diff --git a/Nasal/Systems/pneumatics.nas b/Nasal/Systems/pneumatics.nas index 4da9eeee..6ba11a8d 100644 --- a/Nasal/Systems/pneumatics.nas +++ b/Nasal/Systems/pneumatics.nas @@ -132,12 +132,9 @@ var PNEU = { setprop("/systems/pressurization/pack-2-comp-out-temp", 0); setprop("/systems/pressurization/pack-1-valve", 0); setprop("/systems/pressurization/pack-2-valve", 0); - setprop("/systems/ventilation/cabin/fans", 0); # aircon fans - setprop("/systems/ventilation/avionics/fan", 0); - setprop("/systems/ventilation/avionics/extractvalve", "0"); - setprop("/systems/ventilation/avionics/inletvalve", "0"); - setprop("/systems/ventilation/lavatory/extractfan", 0); - setprop("/systems/ventilation/lavatory/extractvalve", "0"); + #setprop("/systems/ventilation/cabin/fans", 0); # aircon fans + #setprop("/systems/ventilation/avionics/extractvalve", "0"); + #setprop("/systems/ventilation/avionics/inletvalve", "0"); setprop("/controls/oxygen/masksDeploy", 0); setprop("/controls/oxygen/masksDeployMan", 0); setprop("/controls/oxygen/masksReset", 0); # this is the TMR RESET pb on the maintenance panel, needs 3D model @@ -199,20 +196,11 @@ var PNEU = { setprop("/systems/pressurization/cabinalt", cabinalt + ((manvs / 60) / 10)); } - if (ditch and auto) { - setprop("/systems/pressurization/outflowpos", "1"); - setprop("/systems/ventilation/avionics/extractvalve", "1"); - setprop("/systems/ventilation/avionics/inletvalve", "1"); - } - - if (systems.ELEC.Bus.dcEss.getValue() >= 25 or systems.ELEC.Bus.acEss.getValue() > 110) { - setprop("/systems/ventilation/avionics/fan", 1); - setprop("/systems/ventilation/lavatory/extractfan", 1); - } else { - setprop("/systems/ventilation/avionics/fan", 0); - setprop("/systems/ventilation/lavatory/extractfan", 0); - } - + #if (ditch and auto) { + #setprop("/systems/pressurization/outflowpos", "1"); + #setprop("/systems/ventilation/avionics/extractvalve", "1"); + #setprop("/systems/ventilation/avionics/inletvalve", "1"); + #} # Oxygen if (cabinalt > 13500) { diff --git a/Systems/a320-hydraulic.xml b/Systems/a320-hydraulic.xml index e0a87d7e..ec49d1e7 100644 --- a/Systems/a320-hydraulic.xml +++ b/Systems/a320-hydraulic.xml @@ -500,6 +500,27 @@ + + + + + + /controls/gear/brake-parking ne 1 + /systems/hydraulic/brakes/askidnwssw eq 1 + /systems/hydraulic/green-psi ge 2500 + + + /controls/gear/brake-parking ne 1 + /systems/hydraulic/brakes/askidnwssw eq 1 + /systems/hydraulic/yellow-psi ge 2500 + + + /controls/gear/brake-parking ne 1 + /systems/hydraulic/brakes/accumulator-pressure-psi ge 0 + + + +