Remove legacy ventilation code; move legacy braking code to JSB
This commit is contained in:
parent
19e0b0b9aa
commit
a1b5edf397
4 changed files with 33 additions and 44 deletions
|
@ -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");
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -500,6 +500,27 @@
|
|||
|
||||
</channel>
|
||||
|
||||
<channel name="Brakes" execrate="8">
|
||||
|
||||
<switch name="/systems/hydraulic/brakes/mode">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/controls/gear/brake-parking ne 1
|
||||
/systems/hydraulic/brakes/askidnwssw eq 1
|
||||
/systems/hydraulic/green-psi ge 2500
|
||||
</test>
|
||||
<test logic="AND" value="2">
|
||||
/controls/gear/brake-parking ne 1
|
||||
/systems/hydraulic/brakes/askidnwssw eq 1
|
||||
/systems/hydraulic/yellow-psi ge 2500
|
||||
</test>
|
||||
<test logic="AND" value="2">
|
||||
/controls/gear/brake-parking ne 1
|
||||
/systems/hydraulic/brakes/accumulator-pressure-psi ge 0
|
||||
</test>
|
||||
</switch>
|
||||
</channel>
|
||||
|
||||
<channel name="Lights" execrate="8">
|
||||
|
||||
<switch name="/systems/hydraulic/lights/blue-elec-fault">
|
||||
|
|
Loading…
Reference in a new issue