Merge pull request #42 from legoboyvdlp/master

add RAT / EMER GEN. It works, but the flight controls don't work even…
This commit is contained in:
Joshua Davidson 2017-05-31 13:40:21 -04:00 committed by GitHub
commit 2bb9b41156
8 changed files with 5028 additions and 3 deletions

View file

@ -444,4 +444,14 @@
</axis>
</animation>
<model>
<name>RAT</name>
<path>Aircraft/A320Family/Models/RAT/RAT.xml</path>
<offsets>
<x-m>18</x-m>
<y-m>-1</y-m>
<z-m>-2.9</z-m>
</offsets>
</model>
</PropertyList>

View file

@ -354,4 +354,14 @@
</axis>
</animation>
<model>
<name>RAT</name>
<path>Aircraft/A320Family/Models/RAT/RAT.xml</path>
<offsets>
<x-m>18</x-m>
<y-m>-1</y-m>
<z-m>-2.9</z-m>
</offsets>
</model>
</PropertyList>

View file

@ -669,4 +669,14 @@
</axis>
</animation>
<model>
<name>RAT</name>
<path>Aircraft/A320Family/Models/RAT/RAT.xml</path>
<offsets>
<x-m>18</x-m>
<y-m>-1</y-m>
<z-m>-2.9</z-m>
</offsets>
</model>
</PropertyList>

View file

@ -444,4 +444,14 @@
</axis>
</animation>
<model>
<name>RAT</name>
<path>Aircraft/A320Family/Models/RAT/RAT.xml</path>
<offsets>
<x-m>18</x-m>
<y-m>-1</y-m>
<z-m>-2.9</z-m>
</offsets>
</model>
</PropertyList>

4912
Models/RAT/RAT.ac Normal file

File diff suppressed because it is too large Load diff

36
Models/RAT/RAT.xml Normal file
View file

@ -0,0 +1,36 @@
<?xml version = '1.0' encoding = 'UTF-8' ?>
<PropertyList>
<path>RAT.ac</path>
<!-- Ram Air Turbine Select and Spin Animations -->
<animation>
<name>Ram Air Turbine Spin</name>
<type>spin</type>
<object-name>fan</object-name>
<factor>5</factor>
<property>velocities/airspeed-kt</property>
<center>
<x-m>0</x-m>
<y-m>0</y-m>
<z-m>0</z-m>
</center>
<axis>
<x>1</x>
<y>0</y>
<z>0</z>
</axis>
</animation>
<animation>
<name>Ram Air Turbine Select</name>
<type>select</type>
<object-name>fan</object-name>
<object-name>holder</object-name>
<condition>
<property>/controls/hydraulic/rat-deployed</property>
</condition>
</animation>
</PropertyList>

View file

@ -18,6 +18,7 @@ var elec_init = func {
setprop("/controls/electrical/switches/idg2", 0);
setprop("/controls/electrical/switches/gen1", 0);
setprop("/controls/electrical/switches/gen2", 0);
setprop("/controls/electrical/switches/emer-gen", 0);
setprop("/controls/electrical/switches/gen-apu", 0);
setprop("/controls/electrical/switches/gen-ext", 0);
setprop("/controls/electrical/switches/apu-ext-crosstie", 1);
@ -36,11 +37,13 @@ var elec_init = func {
setprop("/systems/electrical/bus/dc-ess", 0);
setprop("/systems/electrical/bus/ac1", 0);
setprop("/systems/electrical/bus/ac2", 0);
setprop("/systems/electrical/bus/emergen-hz", 0);
setprop("/systems/electrical/bus/gen1-hz", 0);
setprop("/systems/electrical/bus/gen2-hz", 0);
setprop("/systems/electrical/bus/ac-ess", 0);
setprop("/systems/electrical/extra/ext-volts", 0);
setprop("/systems/electrical/extra/apu-volts", 0);
setprop("/systems/electrical/extra/emergen-volts", 0);
setprop("/systems/electrical/extra/gen1-volts", 0);
setprop("/systems/electrical/extra/gen2-volts", 0);
setprop("/systems/electrical/extra/ext-hz", 0);
@ -124,6 +127,12 @@ var master_elec = func {
var galley_shed = getprop("/systems/electrical/extra/galleyshed");
var bat1_con = getprop("/systems/electrical/extra/battery/bat1-contact");
var bat2_con = getprop("/systems/electrical/extra/battery/bat2-contact");
var emergen = getprop("/controls/electrical/switches/emer-gen");
var emergenvolts = getprop("/systems/electrical/extra/emergen-volts");
var emergenhz = getprop("/systems/electrical/bus/emergen-hz");
var gs = getprop("/velocities/groundspeed-kt");
var rat = getprop("/controls/hydraulic/rat");
var manrat = getprop("/controls/hydraulic/rat-man");
# Left cross tie yes?
@ -274,6 +283,22 @@ var master_elec = func {
setprop("/systems/electrical/gen-ext", 0);
}
if ((ac1 == 0) and (ac2 == 0) and (gs > 100) or (manrat)) {
setprop("/controls/hydraulic/rat-deployed", 1);
setprop("/controls/hydraulic/rat", 1);
setprop("/controls/electrical/switches/emer-gen", 1);
setprop("/systems/electrical/bus/dc-ess", ac_volt_std);
setprop("/systems/electrical/bus/ac-ess", dc_volt_std);
}
if (rat and (gs < 100)) {
setprop("/controls/electrical/switches/emer-gen", 0);
setprop("/controls/hydraulic/rat", 0);
setprop("/systems/electrical/bus/dc-ess", 0);
setprop("/systems/electrical/bus/ac-ess", 0);
}
# Battery Amps
if (battery1_sw) {
setprop("/systems/electrical/battery1-amps", dc_amps_std);
@ -414,11 +439,11 @@ var charge2 = maketimer(6, func {
var bat2_volts = getprop("/systems/electrical/battery2-volts");
setprop("/systems/electrical/battery2-volts", bat2_volts + 0.1);
});
var decharge1 = maketimer(60, func {
var decharge1 = maketimer(69, func { # interval is at 69 seconds, to allow about 30 min from 25.9
var bat1_volts = getprop("/systems/electrical/battery1-volts");
setprop("/systems/electrical/battery1-volts", bat1_volts - 0.1);
});
var decharge2 = maketimer(60, func {
var decharge2 = maketimer(69, func {
var bat2_volts = getprop("/systems/electrical/battery2-volts");
setprop("/systems/electrical/battery2-volts", bat2_volts - 0.1);
});

View file

@ -12,6 +12,8 @@ var hyd_init = func {
setprop("/controls/hydraulic/elec-pump-yellow", 0);
setprop("/controls/hydraulic/ptu", 1);
setprop("/controls/hydraulic/rat-man", 0);
setprop("/controls/hydraulic/rat", 0);
setprop("/controls/hydraulic/rat-deployed", 0);
setprop("/systems/hydraulic/ptu-active", 0);
setprop("/systems/hydraulic/blue-psi", 0);
setprop("/systems/hydraulic/green-psi", 0);
@ -38,6 +40,9 @@ var master_hyd = func {
var stateR = getprop("/engines/engine[1]/state");
var dc_ess = getprop("/systems/electrical/bus/dc-ess");
var psi_diff = green_psi - yellow_psi;
var rat = getprop("/controls/hydraulic/rat");
var ratout = getprop("/controls/hydraulic/rat-deployed");
var gs = getprop("/velocities/groundspeed-kt");
if (psi_diff > 500 or psi_diff < -500 and ptu_sw) {
setprop("/systems/hydraulic/ptu-active", 1);
@ -45,6 +50,13 @@ var master_hyd = func {
setprop("/systems/hydraulic/ptu-active", 0);
}
if ((rat_man_sw == 1) and (gs > 100)) {
setprop("/controls/hydraulic/rat", 1);
setprop("/controls/hydraulic/rat-deployed", 1);
} else if (gs < 100) {
setprop("/controls/hydraulic/rat", 0);
}
var ptu_active = getprop("/systems/hydraulic/ptu-active");
if (elec_pump_blue_sw and dc_ess >= 25 and (stateL == 3 or stateR == 3)) {
@ -53,7 +65,7 @@ var master_hyd = func {
} else {
setprop("/systems/hydraulic/blue-psi", 3000);
}
} else if (getprop("/instrumentation/airspeed-indicator/indicated-speed-kt") >= 120 and rat_man_sw == 1) {
} else if (gs >= 100 and rat) {
if (blue_psi < 2400) {
setprop("/systems/hydraulic/blue-psi", blue_psi + 100);
} else {