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

View file

@ -75,6 +75,9 @@ var updateARPT = func {
var arr = getprop("/FMGC/internal/arr-arpt");
setprop("/autopilot/route-manager/departure/airport", dep);
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 {

View file

@ -1,5 +1,4 @@
# A3XX Electrical System
# Joshua Davidson (it0uchpods) and Jonathan Redpath (legoboyvdlp)
# Electrical system for A320 by Joshua Davidson (it0uchpods) and Johnathan Redpath (legoboyvdlp).
#############
# Init Vars #
@ -10,9 +9,7 @@ var ac_volt_min = 110;
var dc_volt_std = 28;
var dc_volt_min = 25;
var dc_amps_std = 150;
var dc_amps_std = 130;
var ac_hz_std = 400;
var ac_hz_std = 300;
var elec_init = func {
setprop("/controls/switches/annun-test", 0);
@ -102,8 +99,6 @@ var master_elec = func {
var gen2_sw = getprop("/controls/electrical/switches/gen2");
var gen_apu_sw = getprop("/controls/electrical/switches/gen-apu");
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 ac_ess_feed_sw = getprop("/controls/electrical/switches/ac-ess-feed");
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 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?
if (extpwr_on and gen_ext_sw) {
setprop("/controls/electrical/xtie/xtieR", 1);
@ -162,120 +172,115 @@ var master_elec = func {
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?
if (extpwr_on and gen_ext_sw) {
setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/ext-volts", ac_volt_std);
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) {
} else if (gen_apu and !genapu_fail) {
setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/apu-volts", ac_volt_std);
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) {
} else if (stateL == 3 and gen1_sw and !gen1_fail) {
setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/gen1-volts", ac_volt_std);
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) {
} else if (apu_ext_crosstie_sw == 1 and xtieL) {
setprop("/systems/electrical/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/gen1-volts", ac_volt_std);
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) {
} else if (emergen) {
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 {
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?
if (extpwr_on and gen_ext_sw) {
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-hz", ac_hz_std);
} else {
setprop("/systems/electrical/bus/ac2", 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/ac2", ac_volt_std);
setprop("/systems/electrical/extra/apu-volts", ac_volt_std);
setprop("/systems/electrical/extra/apu-hz", ac_hz_std);
} else {
setprop("/systems/electrical/bus/ac2", 0);
setprop("/systems/electrical/extra/apu-volts", 0);
setprop("/systems/electrical/extra/apu-hz", 0);
}
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/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 (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/bus/gen2-hz", 0);
}
@ -307,18 +312,6 @@ var master_elec = func {
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)) {
setprop("/controls/hydraulic/rat-deployed", 1);
setprop("/controls/hydraulic/rat", 1);

View file

@ -703,29 +703,20 @@
</switch>
<relay>
<name>RelayBatt1</name>
<name>RelayBatt</name>
<mode>once</mode>
<path>Aircraft/A320Family/Sounds/Cockpit/relay2.wav</path>
<condition>
<greater-than>
<property>/systems/electrical/battery1-amps</property>
<value>25</value>
</greater-than>
</condition>
<volume>
<factor>0.60</factor>
</volume>
</relay>
<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>
<or>
<greater-than>
<property>/systems/electrical/battery1-amps</property>
<value>25</value>
</greater-than>
<greater-than>
<property>/systems/electrical/battery2-amps</property>
<value>25</value>
</greater-than>
</or>
</condition>
<volume>
<factor>0.60</factor>
@ -753,5 +744,20 @@
</volume>
</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>
</PropertyList>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 KiB

After

Width:  |  Height:  |  Size: 962 KiB