This commit is contained in:
Joshua Davidson 2017-06-02 16:08:32 -04:00
parent f5b6f8f571
commit a9fd24064c
4 changed files with 103 additions and 30 deletions

View file

@ -78,11 +78,11 @@
<or> <or>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac1</property> <property>/systems/electrical/bus/ac1</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac2</property> <property>/systems/electrical/bus/ac2</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
</or> </or>
<not-equals> <not-equals>
@ -128,6 +128,10 @@
<property>/modes/fo-du-xfr</property> <property>/modes/fo-du-xfr</property>
<value>2</value> <value>2</value>
</not-equals> </not-equals>
<not-equals>
<property>/controls/electrical/switches/emer-gen</property>
<value>1</value>
</not-equals>
</and> </and>
</condition> </condition>
</model> </model>
@ -159,16 +163,20 @@
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac1</property> <property>/systems/electrical/bus/ac1</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac2</property> <property>/systems/electrical/bus/ac2</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<not-equals> <not-equals>
<property>/modes/cpt-du-xfr</property> <property>/modes/cpt-du-xfr</property>
<value>2</value> <value>2</value>
</not-equals> </not-equals>
<not-equals>
<property>/controls/electrical/switches/emer-gen</property>
<value>1</value>
</not-equals>
</and> </and>
</condition> </condition>
</model> </model>
@ -198,16 +206,20 @@
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac1</property> <property>/systems/electrical/bus/ac1</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac2</property> <property>/systems/electrical/bus/ac2</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<not-equals> <not-equals>
<property>/modes/fo-du-xfr</property> <property>/modes/fo-du-xfr</property>
<value>2</value> <value>2</value>
</not-equals> </not-equals>
<not-equals>
<property>/controls/electrical/switches/emer-gen</property>
<value>1</value>
</not-equals>
</and> </and>
</condition> </condition>
</model> </model>
@ -245,11 +257,11 @@
<or> <or>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac1</property> <property>/systems/electrical/bus/ac1</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac2</property> <property>/systems/electrical/bus/ac2</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
</or> </or>
</and> </and>
@ -275,11 +287,11 @@
<or> <or>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac1</property> <property>/systems/electrical/bus/ac1</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac2</property> <property>/systems/electrical/bus/ac2</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
</or> </or>
</and> </and>
@ -305,11 +317,11 @@
<or> <or>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac1</property> <property>/systems/electrical/bus/ac1</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac2</property> <property>/systems/electrical/bus/ac2</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
</or> </or>
</and> </and>
@ -335,11 +347,11 @@
<or> <or>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac1</property> <property>/systems/electrical/bus/ac1</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac2</property> <property>/systems/electrical/bus/ac2</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
</or> </or>
</and> </and>
@ -361,12 +373,16 @@
<and> <and>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac1</property> <property>/systems/electrical/bus/ac1</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<greater-than-equals> <greater-than-equals>
<property>/systems/electrical/bus/ac2</property> <property>/systems/electrical/bus/ac2</property>
<value>25</value> <value>110</value>
</greater-than-equals> </greater-than-equals>
<not-equals>
<property>/controls/electrical/switches/emer-gen</property>
<value>1</value>
</not-equals>
</and> </and>
</condition> </condition>
</model> </model>

View file

@ -130,7 +130,7 @@ var master_elec = func {
var emergen = getprop("/controls/electrical/switches/emer-gen"); var emergen = getprop("/controls/electrical/switches/emer-gen");
var emergenvolts = getprop("/systems/electrical/extra/emergen-volts"); var emergenvolts = getprop("/systems/electrical/extra/emergen-volts");
var emergenhz = getprop("/systems/electrical/bus/emergen-hz"); 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 rat = getprop("/controls/hydraulic/rat");
var manrat = getprop("/controls/hydraulic/rat-man"); var manrat = getprop("/controls/hydraulic/rat-man");
var ac_ess_fail = getprop("/systems/failures/elec-ac-ess"); 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/dc1", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc1-amps", dc_amps_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 { } else {
setprop("/systems/electrical/bus/dc1", 0); setprop("/systems/electrical/bus/dc1", 0);
setprop("/systems/electrical/bus/dc1-amps", 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/dc2", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc2-amps", dc_amps_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 { } else {
setprop("/systems/electrical/bus/dc2", 0); setprop("/systems/electrical/bus/dc2", 0);
setprop("/systems/electrical/bus/dc2-amps", 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/bus/ac1", ac_volt_std);
setprop("/systems/electrical/extra/gen1-volts", ac_volt_std); setprop("/systems/electrical/extra/gen1-volts", ac_volt_std);
setprop("/systems/electrical/bus/gen1-hz", ac_hz_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 { } else {
setprop("/systems/electrical/bus/ac1", 0); setprop("/systems/electrical/bus/ac1", 0);
setprop("/systems/electrical/extra/ext-volts", 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/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 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 { } else {
setprop("/systems/electrical/bus/ac2", 0); setprop("/systems/electrical/bus/ac2", 0);
setprop("/systems/electrical/extra/ext-volts", 0); setprop("/systems/electrical/extra/ext-volts", 0);
@ -306,22 +330,16 @@ var master_elec = func {
setprop("/systems/electrical/gen-ext", 0); 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-deployed", 1);
setprop("/controls/hydraulic/rat", 1); setprop("/controls/hydraulic/rat", 1);
setprop("/controls/electrical/switches/emer-gen", 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/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 # Battery Amps
if (battery1_sw and !batt1_fail) { if (battery1_sw and !batt1_fail) {
setprop("/systems/electrical/battery1-amps", dc_amps_std); setprop("/systems/electrical/battery1-amps", dc_amps_std);

View file

@ -58,7 +58,7 @@ var master_hyd = func {
setprop("/systems/hydraulic/ptu-active", 0); 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", 1);
setprop("/controls/hydraulic/rat-deployed", 1); setprop("/controls/hydraulic/rat-deployed", 1);
} else if (gs < 100) { } else if (gs < 100) {

View file

@ -4,6 +4,44 @@
<PropertyList> <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 --> <!-- Aileron Control -->
<!-- =============================================================== --> <!-- =============================================================== -->
@ -74,7 +112,7 @@
</equals> </equals>
</or> </or>
</condition> </condition>
<value>0.5</value> <property>/systems/hydraulic/aileron-droop</property>
</input> </input>
<input> <input>
<condition> <condition>
@ -188,7 +226,8 @@
</equals> </equals>
</or> </or>
</condition> </condition>
<value>-0.5</value> <property>/systems/hydraulic/aileron-droop</property>
<scale>-1.0</scale>
</input> </input>
<input> <input>
<condition> <condition>
@ -754,7 +793,7 @@
</equals> </equals>
</or> </or>
</condition> </condition>
<value>0.1</value> <property>/systems/hydraulic/elevator-droop</property>
</input> </input>
<input> <input>
<condition> <condition>
@ -818,7 +857,7 @@
</equals> </equals>
</or> </or>
</condition> </condition>
<value>0.1</value> <property>/systems/hydraulic/elevator-droop</property>
</input> </input>
<input> <input>
<condition> <condition>