1
0
Fork 0

Merge branch 'dev' into 3D

This commit is contained in:
legoboyvdlp R 2020-09-12 19:16:11 +01:00
commit 3241f5b592
20 changed files with 413 additions and 377 deletions

View file

@ -289,6 +289,7 @@
<system file="a320-adr"/>
<system file="a320-apu"/>
<system file="a320-fmgc"/>
<system file="a320-misc"/>
<flight_control name="none"/>
<aerodynamics file="Systems/a320-aerodynamics.xml"/>

View file

@ -289,6 +289,7 @@
<system file="a320-adr"/>
<system file="a320-apu"/>
<system file="a320-fmgc"/>
<system file="a320-misc"/>
<flight_control name="none"/>
<aerodynamics file="Systems/a320-aerodynamics.xml"/>

View file

@ -289,6 +289,7 @@
<system file="a320-adr"/>
<system file="a320-apu"/>
<system file="a320-fmgc"/>
<system file="a320-misc"/>
<flight_control name="none"/>
<aerodynamics file="Systems/a320-aerodynamics.xml"/>

View file

@ -1280,6 +1280,8 @@
<valves>
<apu-lp-valve-cmd type="bool">0</apu-lp-valve-cmd>
</valves>
<offset-left type="double">0</offset-left>
<offset-right type="double">0</offset-right>
<fuel-used-1 type="double">0</fuel-used-1>
<fuel-used-2 type="double">0</fuel-used-2>
<mode-fault type="bool">0</mode-fault>

View file

@ -289,6 +289,7 @@
<system file="a320-adr"/>
<system file="a320-apu"/>
<system file="a320-fmgc"/>
<system file="a320-misc"/>
<flight_control name="none"/>
<aerodynamics file="Systems/a320-aerodynamics.xml"/>

View file

@ -289,6 +289,7 @@
<system file="a320-adr"/>
<system file="a320-apu"/>
<system file="a320-fmgc"/>
<system file="a320-misc"/>
<flight_control name="none"/>
<aerodynamics file="Systems/a320-aerodynamics.xml"/>

View file

@ -211,6 +211,7 @@ var eng2_n1 = props.globals.getNode("/engines/engine[1]/n1-actual", 1);
var total_fuel_lbs = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1);
var fadec1 = props.globals.getNode("/systems/fadec/powered1", 1);
var fadec2 = props.globals.getNode("/systems/fadec/powered2", 1);
var fadecPowerUp = props.globals.getNode("/systems/fadec/powerup", 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);
@ -2440,7 +2441,7 @@ var canvas_lowerECAM_fuel = {
me["FFlow-weight-unit"].setText("LBS/MIN");
}
if (fadec1.getValue() == 1 and fadec2.getValue() == 1) {
if (fadec1.getValue() and fadec2.getValue() or fadecPowerUp.getValue()) {
me["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941);
if (_weight_kgs == 1) {
me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round(((fuel_flow1.getValue() + fuel_flow2.getValue()) * LBS2KGS) / 60, 10)));

View file

@ -7204,14 +7204,37 @@
<repeatable>false</repeatable>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<or>
<not>
<property>gear/gear[1]/wow</property>
</not>
<equals>
<property>/engines/engine[0]/state</property>
<value>3</value>
</equals>
<equals>
<property>/engines/engine[1]/state</property>
<value>3</value>
</equals>
</or>
</and>
</condition>
<command>property-toggle</command>
<command>property-assign</command>
<property>controls/switches/LrainRpt</property>
<value>1</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>controls/switches/LrainRpt</property>
<value>0</value>
</binding>
</mod-up>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/oh-btn", 1);</script>
@ -7227,14 +7250,37 @@
<repeatable>false</repeatable>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-2</property>
<value>25</value>
</greater-than-equals>
<or>
<not>
<property>gear/gear[1]/wow</property>
</not>
<equals>
<property>/engines/engine[0]/state</property>
<value>3</value>
</equals>
<equals>
<property>/engines/engine[1]/state</property>
<value>3</value>
</equals>
</or>
</and>
</condition>
<command>property-toggle</command>
<command>property-assign</command>
<property>controls/switches/RrainRpt</property>
<value>1</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>controls/switches/RrainRpt</property>
<value>0</value>
</binding>
</mod-up>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/oh-btn", 1);</script>

View file

@ -1013,12 +1013,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");

View file

@ -5,77 +5,71 @@
var wow = nil;
var wowr = nil;
var Lrain = props.globals.getNode("/controls/switches/LrainRpt");
var Rrain = props.globals.getNode("/controls/switches/RrainRpt");
var OnLt = props.globals.getNode("/controls/switches/emerCallLtO");
var CallLt = props.globals.getNode("/controls/switches/emerCallLtC");
var EmerCall = props.globals.getNode("/controls/switches/emerCall");
var CabinCall = props.globals.getNode("/controls/switches/cabinCall");
var MechCall = props.globals.getNode("/controls/switches/mechCall");
var cvr_gndCtl = props.globals.getNode("/controls/CVR/gndctl");
var cvr_power = props.globals.getNode("/controls/CVR/power");
var cvr_tone = props.globals.getNode("/controls/CVR/tone");
# Resets buttons to the default values
var variousReset = func {
setprop("modes/cpt-du-xfr", 0);
setprop("modes/fo-du-xfr", 0);
setprop("controls/fadec/n1mode1", 0);
setprop("controls/fadec/n1mode2", 0);
setprop("/controls/fadec/n1mode1", 0);
setprop("/controls/fadec/n1mode2", 0);
setprop("instrumentation/mk-viii/serviceable", 1);
setprop("instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit", 0);
setprop("instrumentation/mk-viii/inputs/discretes/gpws-inhibit", 0);
setprop("instrumentation/mk-viii/inputs/discretes/glideslope-inhibit", 0);
setprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-all-override", 0);
setprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 0);
setprop("controls/switches/cabinCall", 0);
setprop("controls/switches/mechCall", 0);
setprop("controls/switches/emer-lights", 0.5);
setprop("/controls/switches/cabinCall", 0);
setprop("/controls/switches/mechCall", 0);
setprop("/controls/switches/emer-lights", 0.5);
# cockpit voice recorder stuff
setprop("controls/CVR/power", 0);
setprop("controls/CVR/test", 0);
setprop("controls/CVR/tone", 0);
setprop("controls/CVR/gndctl", 0);
setprop("controls/CVR/erase", 0);
setprop("controls/switches/pneumatics/cabin-fans", 1);
setprop("controls/oxygen/crewOxyPB", 1); # 0 = OFF 1 = AUTO
setprop("controls/switches/emerCallLtO", 0); # ON light, flashes white for 10s
setprop("controls/switches/emerCallLtC", 0); # CALL light, flashes amber for 10s
setprop("controls/switches/emerCall", 0);
setprop("controls/switches/LrainRpt", 0);
setprop("controls/switches/RrainRpt", 0);
setprop("controls/switches/wiperLspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
setprop("controls/switches/wiperRspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
setprop("controls/lighting/strobe", 0);
setprop("controls/lighting/beacon", 0);
setprop("controls/switches/beacon", 0);
setprop("controls/switches/wing-lights", 0);
setprop("controls/switches/landing-lights-l", 0);
setprop("controls/switches/landing-lights-r", 0);
setprop("controls/lighting/wing-lights", 0);
setprop("controls/lighting/nav-lights-switch", 0);
setprop("controls/lighting/landing-lights[1]", 0);
setprop("controls/lighting/landing-lights[2]", 0);
setprop("controls/lighting/taxi-light-switch", 0);
setprop("controls/lighting/DU/du1", 1);
setprop("controls/lighting/DU/du2", 1);
setprop("controls/lighting/DU/du3", 1);
setprop("controls/lighting/DU/du4", 1);
setprop("controls/lighting/DU/du5", 1);
setprop("controls/lighting/DU/du6", 1);
setprop("controls/lighting/DU/mcdu1", 1);
setprop("controls/lighting/DU/mcdu2", 1);
setprop("/controls/CVR/power", 0);
setprop("/controls/CVR/test", 0);
setprop("/controls/CVR/tone", 0);
setprop("/controls/CVR/gndctl", 0);
setprop("/controls/CVR/erase", 0);
setprop("/controls/switches/pneumatics/cabin-fans", 1);
setprop("/controls/oxygen/crewOxyPB", 1); # 0 = OFF 1 = AUTO
setprop("/controls/switches/emerCallLtO", 0); # ON light, flashes white for 10s
setprop("/controls/switches/emerCallLtC", 0); # CALL light, flashes amber for 10s
setprop("/controls/switches/emerCall", 0);
setprop("/controls/switches/LrainRpt", 0);
setprop("/controls/switches/RrainRpt", 0);
setprop("/controls/switches/wiperLspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
setprop("/controls/switches/wiperRspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
setprop("/controls/lighting/strobe", 0);
setprop("/controls/lighting/beacon", 0);
setprop("/controls/switches/beacon", 0);
setprop("/controls/switches/wing-lights", 0);
setprop("/controls/switches/landing-lights-l", 0);
setprop("/controls/switches/landing-lights-r", 0);
setprop("/controls/lighting/wing-lights", 0);
setprop("/controls/lighting/nav-lights-switch", 0);
setprop("/controls/lighting/landing-lights[1]", 0);
setprop("/controls/lighting/landing-lights[2]", 0);
setprop("/controls/lighting/taxi-light-switch", 0);
setprop("/controls/lighting/DU/du1", 1);
setprop("/controls/lighting/DU/du2", 1);
setprop("/controls/lighting/DU/du3", 1);
setprop("/controls/lighting/DU/du4", 1);
setprop("/controls/lighting/DU/du5", 1);
setprop("/controls/lighting/DU/du6", 1);
setprop("/controls/lighting/DU/mcdu1", 1);
setprop("/controls/lighting/DU/mcdu2", 1);
setprop("modes/fcu/hdg-time", -45);
setprop("controls/switching/ATTHDG", 0);
setprop("controls/switching/AIRDATA", 0);
setprop("controls/switches/no-smoking-sign", 1);
setprop("controls/switches/seatbelt-sign", 1);
setprop("/controls/switching/ATTHDG", 0);
setprop("/controls/switching/AIRDATA", 0);
setprop("/controls/switches/no-smoking-sign", 1);
setprop("/controls/switches/seatbelt-sign", 1);
}
var BUTTONS = {
update: func() {
rainRepel();
CVR_master();
if (EmerCall.getValue()) {
EmerCallOnLight();
EmerCallLight();
@ -83,17 +77,6 @@ var BUTTONS = {
},
};
var rainRepel = func() {
if (pts.Engines.Engine.state[0].getValue() != 3 and pts.Engines.Engine.state[1].getValue() != 3 and pts.Gear.wow[0].getValue()) {
if (Lrain.getValue()) {
Lrain.setValue(0);
}
if (Rrain.getValue()) {
Rrain.setValue(0);
}
}
}
var _OnLt = nil;
var _EmerCall = nil;
@ -120,18 +103,6 @@ var EmerCallLight = func() {
}
}
var CVR_master = func() {
wow = pts.Gear.wow[0].getValue();
wowr = pts.Gear.wow[1].getValue();
if (systems.ELEC.Bus.acEss.getValue() > 0 and wow and wowr and (cvr_gndCtl.getValue() or (pts.Engines.Engine.state[0].getValue() == 3 or pts.Engines.Engine.state[1].getValue() == 3))) {
cvr_power.setValue(1);
} else if (!wow and !wowr and systems.ELEC.Bus.acEss.getValue() > 0) {
cvr_power.setValue(1);
} else {
cvr_power.setValue(0);
}
}
var EmerCallFunc = func {
EmerCall.setValue(1);
settimer(func() {

View file

@ -252,17 +252,16 @@ var systemsLoop = maketimer(0.1, func {
systems.ELEC.loop();
systems.PNEU.loop();
systems.HYD.loop();
systems.FUEL.loop();
systems.ADIRS.loop();
systems.APUController.loop();
ecam.ECAM.loop();
libraries.BUTTONS.update();
fadec.FADEC.loop();
rmp.rmpUpdate();
fcu.FCUController.loop();
dmc.DMController.loop();
systems.APUController.loop();
systems.HFLoop();
atsu.ATSU.loop();
libraries.BUTTONS.update();
systems.HFLoop();
groundspeed = pts.Velocities.groundspeed.getValue();
if ((groundAir.getBoolValue() or groundCart.getBoolValue()) and ((groundspeed > 2) or (!pts.Controls.Gear.parkingBrake.getBoolValue() and !chocks.getBoolValue()))) {

View file

@ -2,139 +2,139 @@
# Copyright (c) 2020 Josh Davidson (Octal450)
setprop("systems/fadec/n1mode1", 0); # Doesn't do anything, just here for other logic #
setprop("systems/fadec/n1mode2", 0); # Doesn't do anything, just here for other logic #
setprop("systems/fadec/eng1/egt", 1);
setprop("systems/fadec/eng1/n1", 1);
setprop("systems/fadec/eng1/n2", 1);
setprop("systems/fadec/eng1/ff", 1);
setprop("systems/fadec/eng2/egt", 1);
setprop("systems/fadec/eng2/n1", 1);
setprop("systems/fadec/eng2/n2", 1);
setprop("systems/fadec/eng2/ff", 1);
setprop("systems/fadec/power-avail", 0);
setprop("systems/fadec/powered1", 0);
setprop("systems/fadec/powered2", 0);
setprop("systems/fadec/powered-time", -300);
setprop("systems/fadec/powerup", 0);
setprop("systems/fadec/eng1-master-count", 0);
setprop("systems/fadec/eng1-master-time", -300);
setprop("systems/fadec/eng1-off-power", 0);
setprop("systems/fadec/eng2-master-count", 0);
setprop("systems/fadec/eng2-master-time", -300);
setprop("systems/fadec/eng2-off-power", 0);
setprop("/systems/fadec/n1mode1", 0); # Doesn't do anything, just here for other logic #
setprop("/systems/fadec/n1mode2", 0); # Doesn't do anything, just here for other logic #
setprop("/systems/fadec/eng1/egt", 1);
setprop("/systems/fadec/eng1/n1", 1);
setprop("/systems/fadec/eng1/n2", 1);
setprop("/systems/fadec/eng1/ff", 1);
setprop("/systems/fadec/eng2/egt", 1);
setprop("/systems/fadec/eng2/n1", 1);
setprop("/systems/fadec/eng2/n2", 1);
setprop("/systems/fadec/eng2/ff", 1);
setprop("/systems/fadec/power-avail", 0);
setprop("/systems/fadec/powered1", 0);
setprop("/systems/fadec/powered2", 0);
setprop("/systems/fadec/powered-time", -300);
setprop("/systems/fadec/powerup", 0);
setprop("/systems/fadec/eng1-master-count", 0);
setprop("/systems/fadec/eng1-master-time", -300);
setprop("/systems/fadec/eng1-off-power", 0);
setprop("/systems/fadec/eng2-master-count", 0);
setprop("/systems/fadec/eng2-master-time", -300);
setprop("/systems/fadec/eng2-off-power", 0);
var FADEC = {
init: func() {
setprop("systems/fadec/powered-time", 0);
setprop("systems/fadec/eng1-master-time", -300);
setprop("systems/fadec/eng2-master-time", -300);
setprop("/systems/fadec/powered-time", 0);
setprop("/systems/fadec/eng1-master-time", -300);
setprop("/systems/fadec/eng2-master-time", -300);
},
loop: func() {
var ac1 = getprop("systems/electrical/bus/ac-1");
var ac2 = getprop("systems/electrical/bus/ac-2");
var acess = getprop("systems/electrical/bus/ac-ess");
var state1 = getprop("engines/engine[0]/state");
var state2 = getprop("engines/engine[1]/state");
var master1 = getprop("controls/engines/engine[0]/cutoff-switch");
var master2 = getprop("controls/engines/engine[1]/cutoff-switch");
var modeSel = getprop("controls/engines/engine-start-switch");
var elapsedSec = getprop("sim/time/elapsed-sec");
var ac1 = systems.ELEC.Bus.ac1.getValue();
var ac2 = systems.ELEC.Bus.ac2.getValue();
var acess = systems.ELEC.Bus.acEss.getValue();
var state1 = pts.Engines.Engine.state[0].getValue();
var state2 = pts.Engines.Engine.state[1].getValue();
var master1 = pts.Controls.Engines.Engine.cutoffSw[0].getValue();
var master2 = pts.Controls.Engines.Engine.cutoffSw[1].getValue();
var modeSel = pts.Controls.Engines.startSw.getValue();
var elapsedSec = pts.Sim.Time.elapsedSec.getValue();
if (ac1 >= 110 or ac2 >= 110 or acess >= 110) {
if (getprop("systems/fadec/power-avail") != 1) {
setprop("systems/fadec/powered-time", elapsedSec);
setprop("systems/fadec/power-avail", 1);
if (getprop("/systems/fadec/power-avail") != 1) {
setprop("/systems/fadec/powered-time", elapsedSec);
setprop("/systems/fadec/power-avail", 1);
}
} else {
if (getprop("systems/fadec/power-avail") != 0) {
setprop("systems/fadec/power-avail", 0);
if (getprop("/systems/fadec/power-avail") != 0) {
setprop("/systems/fadec/power-avail", 0);
}
}
var powerAvail = getprop("systems/fadec/power-avail");
var powerAvail = getprop("/systems/fadec/power-avail");
if (getprop("systems/fadec/powered-time") + 300 >= elapsedSec) {
setprop("systems/fadec/powerup", 1);
if (getprop("/systems/fadec/powered-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/powerup", 1);
} else {
setprop("systems/fadec/powerup", 0);
setprop("/systems/fadec/powerup", 0);
}
if (master1 == 1) {
if (getprop("systems/fadec/eng1-master-count") != 1) {
setprop("systems/fadec/eng1-master-time", elapsedSec);
setprop("systems/fadec/eng1-master-count", 1);
if (getprop("/systems/fadec/eng1-master-count") != 1) {
setprop("/systems/fadec/eng1-master-time", elapsedSec);
setprop("/systems/fadec/eng1-master-count", 1);
}
} else {
if (getprop("systems/fadec/eng1-master-count") != 0) {
setprop("systems/fadec/eng1-master-count", 0);
if (getprop("/systems/fadec/eng1-master-count") != 0) {
setprop("/systems/fadec/eng1-master-count", 0);
}
}
if (getprop("systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
setprop("systems/fadec/eng1-off-power", 1);
if (getprop("/systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/eng1-off-power", 1);
} else {
setprop("systems/fadec/eng1-off-power", 0);
setprop("/systems/fadec/eng1-off-power", 0);
}
if (master2 == 1) {
if (getprop("systems/fadec/eng2-master-count") != 1) {
setprop("systems/fadec/eng2-master-time", elapsedSec);
setprop("systems/fadec/eng2-master-count", 1);
if (getprop("/systems/fadec/eng2-master-count") != 1) {
setprop("/systems/fadec/eng2-master-time", elapsedSec);
setprop("/systems/fadec/eng2-master-count", 1);
}
} else {
if (getprop("systems/fadec/eng2-master-count") != 0) {
setprop("systems/fadec/eng2-master-count", 0);
if (getprop("/systems/fadec/eng2-master-count") != 0) {
setprop("/systems/fadec/eng2-master-count", 0);
}
}
if (getprop("systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
setprop("systems/fadec/eng2-off-power", 1);
if (getprop("/systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/eng2-off-power", 1);
} else {
setprop("systems/fadec/eng2-off-power", 0);
setprop("/systems/fadec/eng2-off-power", 0);
}
if (state1 == 3) {
setprop("systems/fadec/powered1", 1);
setprop("/systems/fadec/powered1", 1);
} else if (powerAvail and modeSel == 2) {
setprop("systems/fadec/powered1", 1);
setprop("/systems/fadec/powered1", 1);
} else {
setprop("systems/fadec/powered1", 0);
setprop("/systems/fadec/powered1", 0);
}
if (state2 == 3) {
setprop("systems/fadec/powered2", 1);
setprop("/systems/fadec/powered2", 1);
} else if (powerAvail and modeSel == 2) {
setprop("systems/fadec/powered2", 1);
setprop("/systems/fadec/powered2", 1);
} else {
setprop("systems/fadec/powered2", 0);
setprop("/systems/fadec/powered2", 0);
}
var powered1 = getprop("systems/fadec/powered1");
var powered2 = getprop("systems/fadec/powered2");
var powered1 = getprop("/systems/fadec/powered1");
var powered2 = getprop("/systems/fadec/powered2");
if (powered1 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng1-off-power")) {
setprop("systems/fadec/eng1/n1", 1);
setprop("systems/fadec/eng1/egt", 1);
setprop("systems/fadec/eng1/n2", 1);
setprop("systems/fadec/eng1/ff", 1);
if (powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) {
setprop("/systems/fadec/eng1/n1", 1);
setprop("/systems/fadec/eng1/egt", 1);
setprop("/systems/fadec/eng1/n2", 1);
setprop("/systems/fadec/eng1/ff", 1);
} else {
setprop("systems/fadec/eng1/n1", 0);
setprop("systems/fadec/eng1/egt", 0);
setprop("systems/fadec/eng1/n2", 0);
setprop("systems/fadec/eng1/ff", 0);
setprop("/systems/fadec/eng1/n1", 0);
setprop("/systems/fadec/eng1/egt", 0);
setprop("/systems/fadec/eng1/n2", 0);
setprop("/systems/fadec/eng1/ff", 0);
}
if (powered2 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng2-off-power")) {
setprop("systems/fadec/eng2/n1", 1);
setprop("systems/fadec/eng2/egt", 1);
setprop("systems/fadec/eng2/n2", 1);
setprop("systems/fadec/eng2/ff", 1);
if (powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) {
setprop("/systems/fadec/eng2/n1", 1);
setprop("/systems/fadec/eng2/egt", 1);
setprop("/systems/fadec/eng2/n2", 1);
setprop("/systems/fadec/eng2/ff", 1);
} else {
setprop("systems/fadec/eng2/n1", 0);
setprop("systems/fadec/eng2/egt", 0);
setprop("systems/fadec/eng2/n2", 0);
setprop("systems/fadec/eng2/ff", 0);
setprop("/systems/fadec/eng2/n1", 0);
setprop("/systems/fadec/eng2/egt", 0);
setprop("/systems/fadec/eng2/n2", 0);
setprop("/systems/fadec/eng2/ff", 0);
}
},
};

View file

@ -2,191 +2,191 @@
# Copyright (c) 2020 Josh Davidson (Octal450)
setprop("controls/fadec/n1mode1", 0);
setprop("controls/fadec/n1mode2", 0);
setprop("systems/fadec/n1mode1", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
setprop("systems/fadec/n1mode2", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
setprop("systems/fadec/eng1/epr", 1);
setprop("systems/fadec/eng1/egt", 1);
setprop("systems/fadec/eng1/n1", 1);
setprop("systems/fadec/eng1/n2", 1);
setprop("systems/fadec/eng1/ff", 1);
setprop("systems/fadec/eng2/epr", 1);
setprop("systems/fadec/eng2/egt", 1);
setprop("systems/fadec/eng2/n1", 1);
setprop("systems/fadec/eng2/n2", 1);
setprop("systems/fadec/eng2/ff", 1);
setprop("systems/fadec/power-avail", 0);
setprop("systems/fadec/powered1", 0);
setprop("systems/fadec/powered2", 0);
setprop("systems/fadec/powered-time", -300);
setprop("systems/fadec/powerup", 0);
setprop("systems/fadec/eng1-master-count", 0);
setprop("systems/fadec/eng1-master-time", -300);
setprop("systems/fadec/eng1-off-power", 0);
setprop("systems/fadec/eng2-master-count", 0);
setprop("systems/fadec/eng2-master-time", -300);
setprop("systems/fadec/eng2-off-power", 0);
setprop("/controls/fadec/n1mode1", 0);
setprop("/controls/fadec/n1mode2", 0);
setprop("/systems/fadec/n1mode1", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
setprop("/systems/fadec/n1mode2", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
setprop("/systems/fadec/eng1/epr", 1);
setprop("/systems/fadec/eng1/egt", 1);
setprop("/systems/fadec/eng1/n1", 1);
setprop("/systems/fadec/eng1/n2", 1);
setprop("/systems/fadec/eng1/ff", 1);
setprop("/systems/fadec/eng2/epr", 1);
setprop("/systems/fadec/eng2/egt", 1);
setprop("/systems/fadec/eng2/n1", 1);
setprop("/systems/fadec/eng2/n2", 1);
setprop("/systems/fadec/eng2/ff", 1);
setprop("/systems/fadec/power-avail", 0);
setprop("/systems/fadec/powered1", 0);
setprop("/systems/fadec/powered2", 0);
setprop("/systems/fadec/powered-time", -300);
setprop("/systems/fadec/powerup", 0);
setprop("/systems/fadec/eng1-master-count", 0);
setprop("/systems/fadec/eng1-master-time", -300);
setprop("/systems/fadec/eng1-off-power", 0);
setprop("/systems/fadec/eng2-master-count", 0);
setprop("/systems/fadec/eng2-master-time", -300);
setprop("/systems/fadec/eng2-off-power", 0);
var FADEC = {
init: func() {
setprop("systems/fadec/powered-time", 0);
setprop("systems/fadec/eng1-master-time", -300);
setprop("systems/fadec/eng2-master-time", -300);
setprop("/systems/fadec/powered-time", 0);
setprop("/systems/fadec/eng1-master-time", -300);
setprop("/systems/fadec/eng2-master-time", -300);
},
loop: func() {
var ac1 = getprop("systems/electrical/bus/ac-1");
var ac2 = getprop("systems/electrical/bus/ac-2");
var acess = getprop("systems/electrical/bus/ac-ess");
var state1 = getprop("engines/engine[0]/state");
var state2 = getprop("engines/engine[1]/state");
var master1 = getprop("controls/engines/engine[0]/cutoff-switch");
var master2 = getprop("controls/engines/engine[1]/cutoff-switch");
var modeSel = getprop("controls/engines/engine-start-switch");
var N1Mode1_sw = getprop("controls/fadec/n1mode1");
var N1Mode2_sw = getprop("controls/fadec/n1mode2");
var elapsedSec = getprop("sim/time/elapsed-sec");
var ac1 = systems.ELEC.Bus.ac1.getValue();
var ac2 = systems.ELEC.Bus.ac2.getValue();
var acess = systems.ELEC.Bus.acEss.getValue();
var state1 = pts.Engines.Engine.state[0].getValue();
var state2 = pts.Engines.Engine.state[1].getValue();
var master1 = pts.Controls.Engines.Engine.cutoffSw[0].getValue();
var master2 = pts.Controls.Engines.Engine.cutoffSw[1].getValue();
var modeSel = pts.Controls.Engines.startSw.getValue();
var elapsedSec = pts.Sim.Time.elapsedSec.getValue();
var N1Mode1_sw = getprop("/controls/fadec/n1mode1");
var N1Mode2_sw = getprop("/controls/fadec/n1mode2");
if (ac1 >= 110 or ac2 >= 110 or acess >= 110) {
if (getprop("systems/fadec/power-avail") != 1) {
setprop("systems/fadec/powered-time", elapsedSec);
setprop("systems/fadec/power-avail", 1);
if (getprop("/systems/fadec/power-avail") != 1) {
setprop("/systems/fadec/powered-time", elapsedSec);
setprop("/systems/fadec/power-avail", 1);
}
} else {
if (getprop("systems/fadec/power-avail") != 0) {
setprop("systems/fadec/power-avail", 0);
if (getprop("/systems/fadec/power-avail") != 0) {
setprop("/systems/fadec/power-avail", 0);
}
}
var powerAvail = getprop("systems/fadec/power-avail");
var powerAvail = getprop("/systems/fadec/power-avail");
if (getprop("systems/fadec/powered-time") + 300 >= elapsedSec) {
setprop("systems/fadec/powerup", 1);
if (getprop("/systems/fadec/powered-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/powerup", 1);
} else {
setprop("systems/fadec/powerup", 0);
setprop("/systems/fadec/powerup", 0);
}
if (master1 == 1) {
if (getprop("systems/fadec/eng1-master-count") != 1) {
setprop("systems/fadec/eng1-master-time", elapsedSec);
setprop("systems/fadec/eng1-master-count", 1);
if (getprop("/systems/fadec/eng1-master-count") != 1) {
setprop("/systems/fadec/eng1-master-time", elapsedSec);
setprop("/systems/fadec/eng1-master-count", 1);
}
} else {
if (getprop("systems/fadec/eng1-master-count") != 0) {
setprop("systems/fadec/eng1-master-count", 0);
if (getprop("/systems/fadec/eng1-master-count") != 0) {
setprop("/systems/fadec/eng1-master-count", 0);
}
}
if (getprop("systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
setprop("systems/fadec/eng1-off-power", 1);
if (getprop("/systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/eng1-off-power", 1);
} else {
setprop("systems/fadec/eng1-off-power", 0);
setprop("/systems/fadec/eng1-off-power", 0);
}
if (master2 == 1) {
if (getprop("systems/fadec/eng2-master-count") != 1) {
setprop("systems/fadec/eng2-master-time", elapsedSec);
setprop("systems/fadec/eng2-master-count", 1);
if (getprop("/systems/fadec/eng2-master-count") != 1) {
setprop("/systems/fadec/eng2-master-time", elapsedSec);
setprop("/systems/fadec/eng2-master-count", 1);
}
} else {
if (getprop("systems/fadec/eng2-master-count") != 0) {
setprop("systems/fadec/eng2-master-count", 0);
if (getprop("/systems/fadec/eng2-master-count") != 0) {
setprop("/systems/fadec/eng2-master-count", 0);
}
}
if (getprop("systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
setprop("systems/fadec/eng2-off-power", 1);
if (getprop("/systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/eng2-off-power", 1);
} else {
setprop("systems/fadec/eng2-off-power", 0);
setprop("/systems/fadec/eng2-off-power", 0);
}
if (state1 == 3) {
setprop("systems/fadec/powered1", 1);
setprop("/systems/fadec/powered1", 1);
} else if (powerAvail and modeSel == 2) {
setprop("systems/fadec/powered1", 1);
setprop("/systems/fadec/powered1", 1);
} else {
setprop("systems/fadec/powered1", 0);
setprop("/systems/fadec/powered1", 0);
}
if (state2 == 3) {
setprop("systems/fadec/powered2", 1);
setprop("/systems/fadec/powered2", 1);
} else if (powerAvail and modeSel == 2) {
setprop("systems/fadec/powered2", 1);
setprop("/systems/fadec/powered2", 1);
} else {
setprop("systems/fadec/powered2", 0);
setprop("/systems/fadec/powered2", 0);
}
if (N1Mode1_sw == 1) {
setprop("systems/fadec/n1mode1", 1);
setprop("/systems/fadec/n1mode1", 1);
} else {
setprop("systems/fadec/n1mode1", 0);
setprop("/systems/fadec/n1mode1", 0);
}
if (N1Mode2_sw == 1) {
setprop("systems/fadec/n1mode2", 1);
setprop("/systems/fadec/n1mode2", 1);
} else {
setprop("systems/fadec/n1mode2", 0);
setprop("/systems/fadec/n1mode2", 0);
}
var powered1 = getprop("systems/fadec/powered1");
var powered2 = getprop("systems/fadec/powered2");
var N1Mode1 = getprop("systems/fadec/n1mode1");
var N1Mode2 = getprop("systems/fadec/n1mode2");
var powered1 = getprop("/systems/fadec/powered1");
var powered2 = getprop("/systems/fadec/powered2");
var N1Mode1 = getprop("/systems/fadec/n1mode1");
var N1Mode2 = getprop("/systems/fadec/n1mode2");
var N11 = getprop("engines/engine[0]/n1-actual");
var N12 = getprop("engines/engine[1]/n1-actual");
var N21 = getprop("engines/engine[0]/n2-actual");
var N22 = getprop("engines/engine[1]/n2-actual");
if ((powered1 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng1-off-power")) and N1Mode1 == 0) {
setprop("systems/fadec/eng1/epr", 1);
if ((powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) and N1Mode1 == 0) {
setprop("/systems/fadec/eng1/epr", 1);
} else {
setprop("systems/fadec/eng1/epr", 0);
setprop("/systems/fadec/eng1/epr", 0);
}
if ((powered2 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng2-off-power")) and N1Mode2 == 0) {
setprop("systems/fadec/eng2/epr", 1);
if ((powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) and N1Mode2 == 0) {
setprop("/systems/fadec/eng2/epr", 1);
} else {
setprop("systems/fadec/eng2/epr", 0);
setprop("/systems/fadec/eng2/epr", 0);
}
if (powered1 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng1-off-power")) {
setprop("systems/fadec/eng1/egt", 1);
setprop("systems/fadec/eng1/ff", 1);
if (powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) {
setprop("/systems/fadec/eng1/egt", 1);
setprop("/systems/fadec/eng1/ff", 1);
} else {
setprop("systems/fadec/eng1/egt", 0);
setprop("systems/fadec/eng1/ff", 0);
setprop("/systems/fadec/eng1/egt", 0);
setprop("/systems/fadec/eng1/ff", 0);
}
if (powered2 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng2-off-power")) {
setprop("systems/fadec/eng2/egt", 1);
setprop("systems/fadec/eng2/ff", 1);
if (powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) {
setprop("/systems/fadec/eng2/egt", 1);
setprop("/systems/fadec/eng2/ff", 1);
} else {
setprop("systems/fadec/eng2/egt", 0);
setprop("systems/fadec/eng2/ff", 0);
setprop("/systems/fadec/eng2/egt", 0);
setprop("/systems/fadec/eng2/ff", 0);
}
if (powered1 and N11 >= 3.5) {
setprop("systems/fadec/eng1/n1", 1);
setprop("/systems/fadec/eng1/n1", 1);
} else {
setprop("systems/fadec/eng1/n1", 0);
setprop("/systems/fadec/eng1/n1", 0);
}
if (powered2 and N12 >= 3.5) {
setprop("systems/fadec/eng2/n1", 1);
setprop("/systems/fadec/eng2/n1", 1);
} else {
setprop("systems/fadec/eng2/n1", 0);
setprop("/systems/fadec/eng2/n1", 0);
}
if (powered1 and N21 >= 3.5) {
setprop("systems/fadec/eng1/n2", 1);
setprop("/systems/fadec/eng1/n2", 1);
} else {
setprop("systems/fadec/eng1/n2", 0);
setprop("/systems/fadec/eng1/n2", 0);
}
if (powered2 and N22 >= 3.5) {
setprop("systems/fadec/eng2/n2", 1);
setprop("/systems/fadec/eng2/n2", 1);
} else {
setprop("systems/fadec/eng2/n2", 0);
setprop("/systems/fadec/eng2/n2", 0);
}
},
};

View file

@ -7,8 +7,8 @@ var FUEL = {
offset1: 0,
offset2: 0,
timeEngStart: 0,
cmdCtrOn: props.globals.getNode("systems/fuel/ctr-pump-cmd-on-eng-start"),
refuelling: props.globals.getNode("systems/fuel/refuel/refuelling"),
cmdCtrOn: props.globals.getNode("/systems/fuel/ctr-pump-cmd-on-eng-start"),
refuelling: props.globals.getNode("/systems/fuel/refuel/refuelling"),
Fail: {
pumpLeft1: props.globals.getNode("/systems/failures/fuel/left-tank-pump-1"),
@ -19,43 +19,43 @@ var FUEL = {
pumpRight2: props.globals.getNode("/systems/failures/fuel/right-tank-pump-2"),
},
Switches: {
centerTkMode: props.globals.getNode("controls/fuel/switches/center-mode"),
crossfeed: props.globals.getNode("controls/fuel/switches/crossfeed"),
pumpLeft1: props.globals.getNode("controls/fuel/switches/pump-left-1"),
pumpLeft2: props.globals.getNode("controls/fuel/switches/pump-left-2"),
pumpCenter1: props.globals.getNode("controls/fuel/switches/pump-center-1"),
pumpCenter2: props.globals.getNode("controls/fuel/switches/pump-center-2"),
pumpRight1: props.globals.getNode("controls/fuel/switches/pump-right-1"),
pumpRight2: props.globals.getNode("controls/fuel/switches/pump-right-2"),
centerTkMode: props.globals.getNode("/controls/fuel/switches/center-mode"),
crossfeed: props.globals.getNode("/controls/fuel/switches/crossfeed"),
pumpLeft1: props.globals.getNode("/controls/fuel/switches/pump-left-1"),
pumpLeft2: props.globals.getNode("/controls/fuel/switches/pump-left-2"),
pumpCenter1: props.globals.getNode("/controls/fuel/switches/pump-center-1"),
pumpCenter2: props.globals.getNode("/controls/fuel/switches/pump-center-2"),
pumpRight1: props.globals.getNode("/controls/fuel/switches/pump-right-1"),
pumpRight2: props.globals.getNode("/controls/fuel/switches/pump-right-2"),
},
Pumps: {
apu: props.globals.getNode("systems/fuel/pumps/apu-operate"),
allOff: props.globals.getNode("systems/fuel/pumps/all-eng-pump-off"),
apu: props.globals.getNode("/systems/fuel/pumps/apu-operate"),
allOff: props.globals.getNode("/systems/fuel/pumps/all-eng-pump-off"),
},
Valves: {
apu: props.globals.getNode("systems/fuel/valves/apu-lp-valve"),
crossfeed: props.globals.getNode("systems/fuel/valves/crossfeed-valve"),
lpValve1: props.globals.getNode("systems/fuel/valves/engine-1-lp-valve"),
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"),
apu: props.globals.getNode("/systems/fuel/valves/apu-lp-valve"),
crossfeed: props.globals.getNode("/systems/fuel/valves/crossfeed-valve"),
lpValve1: props.globals.getNode("/systems/fuel/valves/engine-1-lp-valve"),
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"),
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"),
offsetLeft: props.globals.getNode("/systems/fuel/offset-left"),
offsetRight: props.globals.getNode("/systems/fuel/offset-right"),
},
resetFail: func() {
me.Fail.pumpLeft1.setValue(0);
@ -68,13 +68,11 @@ var FUEL = {
init: func() {
me.resetFail();
},
loop: func() {
systems.FUEL.Quantity.usedLeft.setValue(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue() + me.offset1);
systems.FUEL.Quantity.usedRight.setValue(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[1].getValue() + me.offset2);
setOffsetLeft: func() {
me.Quantity.offsetLeft.setValue(me.Quantity.offsetLeft.getValue() - pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue());
},
setOffset: func() {
me.offset1 = me.offset1 -(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue());
me.offset2 = me.offset2 -(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[1].getValue());
setOffsetRight: func() {
me.Quantity.offsetRight.setValue(me.Quantity.offsetRight.getValue() - pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[1].getValue());
}
};
@ -83,6 +81,8 @@ setlistener("/engines/engine[0]/state", func() {
FUEL.timeEngStart = pts.Sim.Time.elapsedSec.getValue();
FUEL.cmdCtrOn.setValue(1);
ctrTkTimer.start();
} elsif (pts.Engines.Engine.state[0].getValue() == 2) {
FUEL.setOffsetLeft();
}
}, 0, 0);
@ -91,6 +91,8 @@ setlistener("/engines/engine[1]/state", func() {
FUEL.timeEngStart = pts.Sim.Time.elapsedSec.getValue();
FUEL.cmdCtrOn.setValue(1);
ctrTkTimer.start();
} elsif (pts.Engines.Engine.state[1].getValue() == 2) {
FUEL.setOffsetRight();
}
}, 0, 0);

View file

@ -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);
}
}
},
};

View file

@ -8,10 +8,7 @@ var ambient = nil;
var cabinpsi = nil;
var state1 = nil;
var state2 = nil;
var stateL = nil;
var stateR = nil;
var pressmode = nil;
var wowc = nil;
var wowl = nil;
var wowr = nil;
var vs = nil;
@ -135,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
@ -163,26 +157,8 @@ var PNEU = {
me.Fail.xbleed.setBoolValue(0);
},
loop: func() {
stateL = getprop("engines/engine[0]/state");
stateR = getprop("engines/engine[1]/state");
wowc = getprop("gear/gear[0]/wow");
wowl = getprop("gear/gear[1]/wow");
wowr = getprop("gear/gear[2]/wow");
eng1_starter = getprop("/systems/pneumatics/valves/starter-valve-1");
eng2_starter = getprop("/systems/pneumatics/valves/starter-valve-2");
if (stateL == 1 or stateR == 1 or stateL == 2 or stateR == 2) {
setprop("/systems/pneumatics/start-psi", 18);
} else {
setprop("/systems/pneumatics/start-psi", 0);
}
if (getprop("/controls/engines/engine-start-switch") == 2 and wowc == 1 and (stateL != 3 or stateR != 3)) {
setprop("/systems/pneumatics/starting", 1);
} else if (wowc == 1 and eng1_starter == 1 or eng2_starter == 1) {
setprop("/systems/pneumatics/starting", 1);
} else {
setprop("/systems/pneumatics/starting", 0);
}
# Legacy pressurization
cabinalt = getprop("/systems/pressurization/cabinalt");
@ -220,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) {

View file

@ -411,6 +411,16 @@
<channel name="Flow Rates" execrate="2">
<summer name="/systems/fuel/fuel-used-1">
<input>/systems/fuel/offset-left</input>
<input>propulsion/engine[0]/fuel-used-lbs</input>
</summer>
<summer name="/systems/fuel/fuel-used-2">
<input>/systems/fuel/offset-right</input>
<input>propulsion/engine[1]/fuel-used-lbs</input>
</summer>
<switch name="/systems/fuel/feed-left-inner">
<default value="0"/>
<test logic="OR" value="1">

View file

@ -561,6 +561,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">

32
Systems/a320-misc.xml Normal file
View file

@ -0,0 +1,32 @@
<!-- Airbus A320 Misc Systems -->
<!-- Copyright (c) 2020 Jonathan Redpath -->
<system name="A320: APU">
<channel name="CVR" execrate="8">
<switch name="/controls/CVR/power">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/ac-ess ge 110
<test logic="OR">
/gear/gear[1]/wow eq 1
/gear/gear[2]/wow eq 1
</test>
<test logic="OR">
/controls/CVR/gndctl eq 1
/engines/engine[0]/state eq 3
/engines/engine[1]/state eq 3
</test>
</test>
<test logic="AND" value="1">
/systems/electrical/bus/ac-ess ge 110
/gear/gear[1]/wow eq 0
/gear/gear[2]/wow eq 0
</test>
</switch>
</channel>
</system>

View file

@ -750,7 +750,7 @@
</channel>
<channel name="System PSI" execrate="8">
<fcs_function name="/systems/pneumatics/psi/engine-1-upstream-src">
<function>
<ifthen>