A3XX: Fix bug in Electrical, Overhead, add Relay APU, MCDU Improved

MCDU: Now activates route manager
Systems: Fixed Electrical Bugs
Sound: Add sound for APU Relay engaging
This commit is contained in:
Joshua Davidson 2017-06-09 14:17:54 -04:00
parent b70af109be
commit 7f51e73263
5 changed files with 126 additions and 123 deletions

View file

@ -1280,7 +1280,8 @@
<animation> <animation>
<type>pick</type> <type>pick</type>
<object-name>FuelXfeedBtn</object-name> <object-name>FuelXfeedBtn1</object-name>
<object-name>FuelXfeedBtn2</object-name>
<object-name>FuelXfeedBtn2O</object-name> <object-name>FuelXfeedBtn2O</object-name>
<action> <action>
<button>0</button> <button>0</button>
@ -1299,7 +1300,7 @@
<!-- Did not make light yet--> <!-- Did not make light yet-->
<!--animation> <!--animation>
<type>select</type> <type>select</type>
<object-name>FuelModeBtn1O</object-name> <object-name>FuelXfeedBtn1F</object-name>
<condition> <condition>
<or> <or>
<equals> <equals>
@ -1315,7 +1316,7 @@
</animation--> </animation-->
<animation> <animation>
<type>select</type> <type>select</type>
<object-name>FuelModeBtn2O</object-name> <object-name>FuelXfeedBtn2O</object-name>
<condition> <condition>
<or> <or>
<equals> <equals>

View file

@ -75,6 +75,9 @@ var updateARPT = func {
var arr = getprop("/FMGC/internal/arr-arpt"); var arr = getprop("/FMGC/internal/arr-arpt");
setprop("/autopilot/route-manager/departure/airport", dep); setprop("/autopilot/route-manager/departure/airport", dep);
setprop("/autopilot/route-manager/destination/airport", arr); setprop("/autopilot/route-manager/destination/airport", arr);
if (getprop("/autopilot/route-manager/active") != 1) {
fgcommand("activate-flightplan", props.Node.new({"activate": 1}));
}
} }
setlistener("/FMGC/internal/cruise-ft", func { setlistener("/FMGC/internal/cruise-ft", func {

View file

@ -1,5 +1,4 @@
# A3XX Electrical System # Electrical system for A320 by Joshua Davidson (it0uchpods) and Johnathan Redpath (legoboyvdlp).
# Joshua Davidson (it0uchpods) and Jonathan Redpath (legoboyvdlp)
############# #############
# Init Vars # # Init Vars #
@ -10,9 +9,7 @@ var ac_volt_min = 110;
var dc_volt_std = 28; var dc_volt_std = 28;
var dc_volt_min = 25; var dc_volt_min = 25;
var dc_amps_std = 150; var dc_amps_std = 150;
var dc_amps_std = 130;
var ac_hz_std = 400; var ac_hz_std = 400;
var ac_hz_std = 300;
var elec_init = func { var elec_init = func {
setprop("/controls/switches/annun-test", 0); setprop("/controls/switches/annun-test", 0);
@ -102,8 +99,6 @@ var master_elec = func {
var gen2_sw = getprop("/controls/electrical/switches/gen2"); var gen2_sw = getprop("/controls/electrical/switches/gen2");
var gen_apu_sw = getprop("/controls/electrical/switches/gen-apu"); var gen_apu_sw = getprop("/controls/electrical/switches/gen-apu");
var gen_ext_sw = getprop("/controls/electrical/switches/gen-ext"); var gen_ext_sw = getprop("/controls/electrical/switches/gen-ext");
var gen_apu = getprop("/systems/electrical/gen-apu");
var gen_apu = getprop("/systems/electrical/gen-ext");
var apu_ext_crosstie_sw = getprop("/controls/electrical/switches/apu-ext-crosstie"); var apu_ext_crosstie_sw = getprop("/controls/electrical/switches/apu-ext-crosstie");
var ac_ess_feed_sw = getprop("/controls/electrical/switches/ac-ess-feed"); var ac_ess_feed_sw = getprop("/controls/electrical/switches/ac-ess-feed");
var battery1_sw = getprop("/controls/electrical/switches/battery1"); var battery1_sw = getprop("/controls/electrical/switches/battery1");
@ -140,6 +135,21 @@ var master_elec = func {
var gen1_fail = getprop("/systems/failures/elec-gen1"); var gen1_fail = getprop("/systems/failures/elec-gen1");
var gen2_fail = getprop("/systems/failures/elec-gen2"); var gen2_fail = getprop("/systems/failures/elec-gen2");
if (rpmapu >= 94.9 and gen_apu_sw) {
setprop("/systems/electrical/gen-apu", 1);
} else {
setprop("/systems/electrical/gen-apu", 0);
}
if (extpwr_on and gen_ext_sw) {
setprop("/systems/electrical/gen-ext", 1);
} else {
setprop("/systems/electrical/gen-ext", 0);
}
var gen_apu = getprop("/systems/electrical/gen-apu");
var gen_ext = getprop("/systems/electrical/gen-ext");
# Left cross tie yes? # Left cross tie yes?
if (extpwr_on and gen_ext_sw) { if (extpwr_on and gen_ext_sw) {
setprop("/controls/electrical/xtie/xtieR", 1); setprop("/controls/electrical/xtie/xtieR", 1);
@ -162,120 +172,115 @@ var master_elec = func {
setprop("/controls/electrical/xtie/xtieL", 0); setprop("/controls/electrical/xtie/xtieL", 0);
} }
# Left DC bus yes?
if (extpwr_on and gen_ext_sw) {
setprop("/systems/electrical/bus/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
} else if (gen_apu and !genapu_fail) {
setprop("/systems/electrical/bus/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
} else if (stateL == 3 and gen1_sw and !gen1_fail) {
setprop("/systems/electrical/bus/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
} else if (apu_ext_crosstie_sw == 1 and xtieL) {
setprop("/systems/electrical/bus/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
} else if (emergen) {
setprop("/systems/electrical/bus/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
} else {
setprop("/systems/electrical/bus/dc1", 0);
setprop("/systems/electrical/bus/dc1-amps", 0);
if (getprop("/systems/electrical/bus/dc2") == 0) {
setprop("/systems/electrical/bus/dc-ess", 0);
}
}
# Right DC bus yes?
if (extpwr_on and gen_ext_sw) {
setprop("/systems/electrical/bus/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
} else if (gen_apu and !genapu_fail) {
setprop("/systems/electrical/bus/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
} else if (stateR == 3 and gen2_sw and !gen2_fail) {
setprop("/systems/electrical/bus/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
} else if (apu_ext_crosstie_sw == 1 and xtieR) {
setprop("/systems/electrical/bus/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
} else if (emergen) {
setprop("/systems/electrical/bus/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
} else {
setprop("/systems/electrical/bus/dc2", 0);
setprop("/systems/electrical/bus/dc2-amps", 0);
if (getprop("/systems/electrical/bus/dc1") == 0) {
setprop("/systems/electrical/bus/dc-ess", 0);
}
}
# Left AC bus yes? # Left AC bus yes?
if (extpwr_on and gen_ext_sw) { if (extpwr_on and gen_ext_sw) {
setprop("/systems/electrical/bus/ac1", ac_volt_std); setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/ext-volts", ac_volt_std); } else if (gen_apu and !genapu_fail) {
setprop("/systems/electrical/extra/ext-hz", ac_volt_std);
} else {
setprop("/systems/electrical/bus/ac1", 0);
setprop("/systems/electrical/extra/ext-volts", 0);
setprop("/systems/electrical/extra/ext-hz", 0);
}
if (gen_apu and !genapu_fail) {
setprop("/systems/electrical/bus/ac1", ac_volt_std); setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/apu-volts", ac_volt_std); } else if (stateL == 3 and gen1_sw and !gen1_fail) {
setprop("/systems/electrical/extra/apu-hz", ac_volt_std);
} else {
setprop("/systems/electrical/bus/ac1", 0);
setprop("/systems/electrical/extra/apu-volts", 0);
setprop("/systems/electrical/extra/apu-hz", 0);
}
if (stateL == 3 and gen1_sw and !gen1_fail) {
setprop("/systems/electrical/bus/ac1", ac_volt_std); setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/gen1-volts", ac_volt_std); } else if (apu_ext_crosstie_sw == 1 and xtieL) {
setprop("/systems/electrical/bus/gen1-hz", ac_hz_std);
} else {
setprop("/systems/electrical/bus/ac1", 0);
setprop("/systems/electrical/extra/gen1-volts", 0);
setprop("/systems/electrical/bus/gen1-hz", 0);
}
if (apu_ext_crosstie_sw == 1 and xtieL) {
setprop("/systems/electrical/bus/ac1", ac_volt_std); setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/gen1-volts", ac_volt_std); } else if (emergen) {
setprop("/systems/electrical/bus/gen1-hz", ac_hz_std);
} else {
setprop("/systems/electrical/bus/ac1", 0);
setprop("/systems/electrical/extra/gen1-volts", 0);
setprop("/systems/electrical/bus/gen1-hz", 0);
}
if (emergen) {
setprop("/systems/electrical/bus/ac1", ac_volt_std); setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/ext-volts", 0);
setprop("/systems/electrical/extra/apu-volts", 0);
setprop("/systems/electrical/extra/ext-hz", 0);
setprop("/systems/electrical/extra/apu-hz", 0);
setprop("/systems/electrical/extra/gen1-volts", 0);
setprop("/systems/electrical/bus/gen1-hz", 0);
} else { } else {
setprop("/systems/electrical/bus/ac1", 0); setprop("/systems/electrical/bus/ac1", 0);
setprop("/systems/electrical/extra/ext-volts", 0);
setprop("/systems/electrical/extra/apu-volts", 0);
setprop("/systems/electrical/extra/ext-hz", 0);
setprop("/systems/electrical/extra/apu-hz", 0);
setprop("/systems/electrical/extra/gen1-volts", 0);
setprop("/systems/electrical/bus/gen1-hz", 0);
} }
# Right AC bus yes? # Right AC bus yes?
if (extpwr_on and gen_ext_sw) { if (extpwr_on and gen_ext_sw) {
setprop("/systems/electrical/bus/ac2", ac_volt_std); setprop("/systems/electrical/bus/ac2", ac_volt_std);
} else if (gen_apu and !genapu_fail) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
} else if (stateR == 3 and gen2_sw and !gen2_fail) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
} else if (apu_ext_crosstie_sw == 1 and xtieR) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
} else if (emergen) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
} else {
setprop("/systems/electrical/bus/ac2", 0);
}
# HZ/Volts yes?
if (extpwr_on and gen_ext_sw) {
setprop("/systems/electrical/extra/ext-volts", ac_volt_std); setprop("/systems/electrical/extra/ext-volts", ac_volt_std);
setprop("/systems/electrical/extra/ext-hz", ac_hz_std); setprop("/systems/electrical/extra/ext-hz", ac_hz_std);
} else { } else {
setprop("/systems/electrical/bus/ac2", 0);
setprop("/systems/electrical/extra/ext-volts", 0); setprop("/systems/electrical/extra/ext-volts", 0);
setprop("/systems/electrical/extra/ext-hz", 0); setprop("/systems/electrical/extra/ext-hz", 0);
} }
if (gen_apu and !genapu_fail) { if (gen_apu and !genapu_fail) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
setprop("/systems/electrical/extra/apu-volts", ac_volt_std); setprop("/systems/electrical/extra/apu-volts", ac_volt_std);
setprop("/systems/electrical/extra/apu-hz", ac_hz_std); setprop("/systems/electrical/extra/apu-hz", ac_hz_std);
} else { } else {
setprop("/systems/electrical/bus/ac2", 0);
setprop("/systems/electrical/extra/apu-volts", 0); setprop("/systems/electrical/extra/apu-volts", 0);
setprop("/systems/electrical/extra/apu-hz", 0); setprop("/systems/electrical/extra/apu-hz", 0);
} }
if (stateR == 3 and gen2_sw and !gen2_fail) { if (stateR == 3 and gen2_sw and !gen2_fail) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
setprop("/systems/electrical/extra/gen2-volts", ac_volt_std); setprop("/systems/electrical/extra/gen2-volts", ac_volt_std);
setprop("/systems/electrical/bus/gen2-hz", ac_hz_std); setprop("/systems/electrical/bus/gen2-hz", ac_hz_std);
} else { } else {
setprop("/systems/electrical/bus/ac2", 0);
setprop("/systems/electrical/extra/gen2-volts", 0);
setprop("/systems/electrical/bus/gen2-hz", 0);
}
if (apu_ext_crosstie_sw == 1 and xtieR) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
setprop("/systems/electrical/extra/gen2-volts", ac_volt_std);
setprop("/systems/electrical/bus/gen2-hz", ac_hz_std);
} else {
setprop("/systems/electrical/bus/ac2", 0);
setprop("/systems/electrical/extra/gen2-volts", 0);
setprop("/systems/electrical/bus/gen2-hz", 0);
}
if (emergen) {
setprop("/systems/electrical/bus/ac2", ac_volt_std);
setprop("/systems/electrical/extra/ext-volts", 0);
setprop("/systems/electrical/extra/apu-volts", 0);
setprop("/systems/electrical/extra/ext-hz", 0);
setprop("/systems/electrical/extra/apu-hz", 0);
setprop("/systems/electrical/extra/gen2-volts", 0);
setprop("/systems/electrical/bus/gen2-hz", 0);
} else {
setprop("/systems/electrical/bus/ac2", 0);
setprop("/systems/electrical/extra/ext-volts", 0);
setprop("/systems/electrical/extra/apu-volts", 0);
setprop("/systems/electrical/extra/ext-hz", 0);
setprop("/systems/electrical/extra/apu-hz", 0);
setprop("/systems/electrical/extra/gen2-volts", 0); setprop("/systems/electrical/extra/gen2-volts", 0);
setprop("/systems/electrical/bus/gen2-hz", 0); setprop("/systems/electrical/bus/gen2-hz", 0);
} }
@ -307,18 +312,6 @@ var master_elec = func {
setprop("/systems/electrical/extra/galleyshed", 0); setprop("/systems/electrical/extra/galleyshed", 0);
} }
if (rpmapu >= 94.9 and gen_apu_sw) {
setprop("/systems/electrical/gen-apu", 1);
} else {
setprop("/systems/electrical/gen-apu", 0);
}
if (extpwr_on and gen_ext_sw) {
setprop("/systems/electrical/gen-ext", 1);
} else {
setprop("/systems/electrical/gen-ext", 0);
}
if ((ac1 == 0) and (ac2 == 0) and (ias > 100) or (manrat)) { if ((ac1 == 0) and (ac2 == 0) and (ias > 100) or (manrat)) {
setprop("/controls/hydraulic/rat-deployed", 1); setprop("/controls/hydraulic/rat-deployed", 1);
setprop("/controls/hydraulic/rat", 1); setprop("/controls/hydraulic/rat", 1);

View file

@ -703,29 +703,20 @@
</switch> </switch>
<relay> <relay>
<name>RelayBatt1</name> <name>RelayBatt</name>
<mode>once</mode> <mode>once</mode>
<path>Aircraft/A320Family/Sounds/Cockpit/relay2.wav</path> <path>Aircraft/A320Family/Sounds/Cockpit/relay2.wav</path>
<condition> <condition>
<greater-than> <or>
<property>/systems/electrical/battery1-amps</property> <greater-than>
<value>25</value> <property>/systems/electrical/battery1-amps</property>
</greater-than> <value>25</value>
</condition> </greater-than>
<volume> <greater-than>
<factor>0.60</factor> <property>/systems/electrical/battery2-amps</property>
</volume> <value>25</value>
</relay> </greater-than>
</or>
<relay>
<name>RelayBatt2</name>
<mode>once</mode>
<path>Aircraft/A320Family/Sounds/Cockpit/relay2.wav</path>
<condition>
<greater-than>
<property>/systems/electrical/battery2-amps</property>
<value>25</value>
</greater-than>
</condition> </condition>
<volume> <volume>
<factor>0.60</factor> <factor>0.60</factor>
@ -753,5 +744,20 @@
</volume> </volume>
</relay> </relay>
<relay>
<name>RelayAPU</name>
<mode>once</mode>
<path>Aircraft/A320Family/Sounds/Cockpit/relay1.wav</path>
<condition>
<equals>
<property>/systems/electrical/gen-apu</property>
<value>1</value>
</equals>
</condition>
<volume>
<factor>0.60</factor>
</volume>
</relay>
</fx> </fx>
</PropertyList> </PropertyList>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 KiB

After

Width:  |  Height:  |  Size: 962 KiB