Fix RAT
This commit is contained in:
parent
f5b6f8f571
commit
a9fd24064c
4 changed files with 103 additions and 30 deletions
|
@ -78,11 +78,11 @@
|
|||
<or>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac1</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac2</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
</or>
|
||||
<not-equals>
|
||||
|
@ -128,6 +128,10 @@
|
|||
<property>/modes/fo-du-xfr</property>
|
||||
<value>2</value>
|
||||
</not-equals>
|
||||
<not-equals>
|
||||
<property>/controls/electrical/switches/emer-gen</property>
|
||||
<value>1</value>
|
||||
</not-equals>
|
||||
</and>
|
||||
</condition>
|
||||
</model>
|
||||
|
@ -159,16 +163,20 @@
|
|||
<and>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac1</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac2</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<not-equals>
|
||||
<property>/modes/cpt-du-xfr</property>
|
||||
<value>2</value>
|
||||
</not-equals>
|
||||
<not-equals>
|
||||
<property>/controls/electrical/switches/emer-gen</property>
|
||||
<value>1</value>
|
||||
</not-equals>
|
||||
</and>
|
||||
</condition>
|
||||
</model>
|
||||
|
@ -198,16 +206,20 @@
|
|||
<and>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac1</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac2</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<not-equals>
|
||||
<property>/modes/fo-du-xfr</property>
|
||||
<value>2</value>
|
||||
</not-equals>
|
||||
<not-equals>
|
||||
<property>/controls/electrical/switches/emer-gen</property>
|
||||
<value>1</value>
|
||||
</not-equals>
|
||||
</and>
|
||||
</condition>
|
||||
</model>
|
||||
|
@ -245,11 +257,11 @@
|
|||
<or>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac1</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac2</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
</or>
|
||||
</and>
|
||||
|
@ -275,11 +287,11 @@
|
|||
<or>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac1</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac2</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
</or>
|
||||
</and>
|
||||
|
@ -305,11 +317,11 @@
|
|||
<or>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac1</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac2</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
</or>
|
||||
</and>
|
||||
|
@ -335,11 +347,11 @@
|
|||
<or>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac1</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac2</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
</or>
|
||||
</and>
|
||||
|
@ -361,12 +373,16 @@
|
|||
<and>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac1</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<property>/systems/electrical/bus/ac2</property>
|
||||
<value>25</value>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<not-equals>
|
||||
<property>/controls/electrical/switches/emer-gen</property>
|
||||
<value>1</value>
|
||||
</not-equals>
|
||||
</and>
|
||||
</condition>
|
||||
</model>
|
||||
|
|
|
@ -130,7 +130,7 @@ var master_elec = func {
|
|||
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 ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt");
|
||||
var rat = getprop("/controls/hydraulic/rat");
|
||||
var manrat = getprop("/controls/hydraulic/rat-man");
|
||||
var ac_ess_fail = getprop("/systems/failures/elec-ac-ess");
|
||||
|
@ -180,6 +180,10 @@ var master_elec = func {
|
|||
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);
|
||||
|
@ -205,6 +209,10 @@ var master_elec = func {
|
|||
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);
|
||||
|
@ -230,6 +238,14 @@ var master_elec = func {
|
|||
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 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);
|
||||
|
@ -257,6 +273,14 @@ var master_elec = func {
|
|||
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 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);
|
||||
|
@ -306,22 +330,16 @@ var master_elec = func {
|
|||
setprop("/systems/electrical/gen-ext", 0);
|
||||
}
|
||||
|
||||
if ((ac1 == 0) and (ac2 == 0) and (gs > 100) or (manrat)) {
|
||||
if ((ac1 == 0) and (ac2 == 0) and (ias > 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)) {
|
||||
if (ias < 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 and !batt1_fail) {
|
||||
setprop("/systems/electrical/battery1-amps", dc_amps_std);
|
||||
|
|
|
@ -58,7 +58,7 @@ var master_hyd = func {
|
|||
setprop("/systems/hydraulic/ptu-active", 0);
|
||||
}
|
||||
|
||||
if ((rat_man_sw == 1) and (gs > 100)) {
|
||||
if ((rat_man_sw == 1 or getprop("/controls/electrical/switches/emer-gen") == 1) and (gs > 100)) {
|
||||
setprop("/controls/hydraulic/rat", 1);
|
||||
setprop("/controls/hydraulic/rat-deployed", 1);
|
||||
} else if (gs < 100) {
|
||||
|
|
|
@ -4,6 +4,44 @@
|
|||
|
||||
<PropertyList>
|
||||
|
||||
<!-- =============================================================== -->
|
||||
<!-- Surface Droop -->
|
||||
<!-- =============================================================== -->
|
||||
|
||||
<filter>
|
||||
<name>Aileron Droop</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
|
||||
<entry><ind> 72</ind><dep>0.5</dep></entry>
|
||||
<entry><ind>116</ind><dep>0.0</dep></entry>
|
||||
</table>
|
||||
</expression>
|
||||
</input>
|
||||
<output>/systems/hydraulic/aileron-droop</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>Elevator Droop</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
|
||||
<entry><ind> 87</ind><dep>0.5</dep></entry>
|
||||
<entry><ind>121</ind><dep>0.0</dep></entry>
|
||||
</table>
|
||||
</expression>
|
||||
</input>
|
||||
<output>/systems/hydraulic/elevator-droop</output>
|
||||
</filter>
|
||||
|
||||
<!-- =============================================================== -->
|
||||
<!-- Aileron Control -->
|
||||
<!-- =============================================================== -->
|
||||
|
@ -74,7 +112,7 @@
|
|||
</equals>
|
||||
</or>
|
||||
</condition>
|
||||
<value>0.5</value>
|
||||
<property>/systems/hydraulic/aileron-droop</property>
|
||||
</input>
|
||||
<input>
|
||||
<condition>
|
||||
|
@ -188,7 +226,8 @@
|
|||
</equals>
|
||||
</or>
|
||||
</condition>
|
||||
<value>-0.5</value>
|
||||
<property>/systems/hydraulic/aileron-droop</property>
|
||||
<scale>-1.0</scale>
|
||||
</input>
|
||||
<input>
|
||||
<condition>
|
||||
|
@ -754,7 +793,7 @@
|
|||
</equals>
|
||||
</or>
|
||||
</condition>
|
||||
<value>0.1</value>
|
||||
<property>/systems/hydraulic/elevator-droop</property>
|
||||
</input>
|
||||
<input>
|
||||
<condition>
|
||||
|
@ -818,7 +857,7 @@
|
|||
</equals>
|
||||
</or>
|
||||
</condition>
|
||||
<value>0.1</value>
|
||||
<property>/systems/hydraulic/elevator-droop</property>
|
||||
</input>
|
||||
<input>
|
||||
<condition>
|
||||
|
|
Reference in a new issue