Merge branch 'ECAM3'

This commit is contained in:
legoboyvdlp R 2019-07-31 16:37:30 +01:00
commit c6bf6746e1
59 changed files with 3071 additions and 670 deletions

View file

@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-fcs"/>
<system file="a320-spoiler"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<flight_control name="none"/>

View file

@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-fcs"/>
<system file="a320-spoiler"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<flight_control name="none"/>

View file

@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-fcs"/>
<system file="a320-spoiler"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<flight_control name="none"/>
<aerodynamics file="Systems/a320-aerodynamics.xml"/>

View file

@ -94,6 +94,17 @@
<output-property>/systems/pitot/icing</output-property>
</iceable>
</icing>
<flame>
<red-high type="double">1.0</red-high>
<red-low type="double">0.95</red-low>
<red-base type="double">1.0</red-base>
<green-high type="double">0.741</green-high>
<green-low type="double">0.32</green-low>
<green-base type="double">0.741</green-base>
<blue-high type="double">0.10</blue-high>
<blue-low type="double">0.02</blue-low>
<blue-base type="double">0.09</blue-base>
</flame>
</model>
<startup>
@ -636,6 +647,11 @@
<throttle-fdm type="double">0</throttle-fdm>
</engine>
</engines>
<fire>
<apu-test-btn type="bool">0</apu-test-btn>
<test-btn-1 type="bool">0</test-btn-1>
<test-btn-2 type="bool">0</test-btn-2>
</fire>
<flight>
<aileron-drives-tiller type="bool">0</aileron-drives-tiller>
<aileron-input>0</aileron-input>
@ -794,6 +810,9 @@
<transponder-code type="string">2000</transponder-code>
<failed type="bool">0</failed>
</atc>
<apu n="0">
<emer-shutdown type="bool">false</emer-shutdown>
</apu>
<electrical n="0">
<bus n="0">
<dc-ess>0</dc-ess>
@ -817,11 +836,36 @@
<spoiler-r3 type="bool">0</spoiler-r3>
<spoiler-r4 type="bool">0</spoiler-r4>
<spoiler-r5 type="bool">0</spoiler-r5>
<engine-left-fire type="bool">0</engine-left-fire>
<engine-right-fire type="bool">0</engine-right-fire>
<apu-fire type="bool">0</apu-fire>
<cargo-fwd-fire type="bool">0</cargo-fwd-fire>
<cargo-aft-fire type="bool">0</cargo-aft-fire>
</failures>
<fctl n="0">
<fac1 type="bool">0</fac1>
<fac2 type="bool">0</fac2>
</fctl>
<fire n="0">
<apu>
<temperature type="double">0</temperature>
</apu>
<engine1>
<temperature type="double">0</temperature>
</engine1>
<engine2>
<temperature type="double">0</temperature>
</engine2>
<cargo>
<disch type="bool">0</disch>
<aft>
<temperature type="double">0</temperature>
</aft>
<fwd>
<temperature type="double">0</temperature>
</fwd>
</cargo>
</fire>
<fuel n="0">
<only-use-ctr-tank type="bool">0</only-use-ctr-tank>
<tank n="0">

View file

@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-fcs"/>
<system file="a320-spoiler"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<flight_control name="none"/>

View file

@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-fcs"/>
<system file="a320-spoiler"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<flight_control name="none"/>

View file

@ -73,6 +73,8 @@ var failReset = func {
setprop("/systems/failures/fuelmode", 0);
setprop("/systems/failures/cargo-aft-fire", 0);
setprop("/systems/failures/cargo-fwd-fire", 0);
setprop("/systems/failures/engine-left-fire", 0);
setprop("/systems/failures/engine-right-fire", 0);
}
failReset();

View file

@ -487,6 +487,49 @@
</binding>
<live>true</live>
</checkbox>
<group>
<layout>hbox</layout>
<hrule>
<stretch type="bool">true</stretch>
</hrule>
<text>
<label>Engine Fire</label>
</text>
<hrule>
<stretch type="bool">true</stretch>
</hrule>
</group>
<checkbox>
<label>Left Engine</label>
<halign>left</halign>
<property>/systems/failures/engine-left-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>APU</label>
<halign>left</halign>
<property>/systems/failures/apu-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Right Engine</label>
<halign>left</halign>
<property>/systems/failures/engine-right-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<hrule/>
@ -502,9 +545,7 @@
</script>
</binding>
</button>
</group>
</group>
</PropertyList>

Binary file not shown.

View file

@ -404,5 +404,4 @@
</and>
</condition>
</animation>
</PropertyList>

View file

@ -434,5 +434,4 @@
</and>
</condition>
</animation>
</PropertyList>

View file

@ -433,5 +433,4 @@
</and>
</condition>
</animation>
</PropertyList>

View file

@ -414,5 +414,4 @@
</and>
</condition>
</animation>
</PropertyList>

View file

@ -420,5 +420,4 @@
</and>
</condition>
</animation>
</PropertyList>

View file

@ -0,0 +1,35 @@
<?xml version="1.0"?>
<PropertyList>
<path>Aircraft/Generic/Effects/Thruster/thrust_flame.ac</path>
<nopreview/>
<animation>
<type>scale</type>
<property>systems/failures/apu-fire</property>
<x-min>0.2</x-min>
<y-min>0.3</y-min>
<z-min>0.3</z-min>
<y-max>0.8</y-max>
<z-max>0.8</z-max>
<x-factor>0.2</x-factor>
<y-factor>0.2</y-factor>
<z-factor>0.2</z-factor>
</animation>
<animation>
<type>select</type>
<object-name>Bounding_box</object-name>
<condition>
<greater-than>
<property>systems/failures/apu-fire</property>
<value>0.8</value>
</greater-than>
</condition>
</animation>
<effect>
<inherits-from>Aircraft/IDG-A32X/Models/Effects/flame-apu</inherits-from>
<object-name>Bounding_box</object-name>
</effect>
</PropertyList>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>AB-flame</name>
<inherits-from>Effects/thrust-flame</inherits-from>
<parameters>
<base_flame_b type="float"><use>/sim/model/flame/blue-base</use></base_flame_b>
<base_flame_density type="float">0.01</base_flame_density>
<base_flame_g type="float"><use>/sim/model/flame/green-base</use></base_flame_g>
<base_flame_r type="float"><use>/sim/model/flame/red-base</use></base_flame_r>
<deflection_coeff type="float">0</deflection_coeff>
<flame_color_high_b type="float"><use>/sim/model/flame/blue-high</use></flame_color_high_b>
<flame_color_high_g type="float"><use>/sim/model/flame/green-high</use></flame_color_high_g>
<flame_color_high_r type="float"><use>/sim/model/flame/red-high</use></flame_color_high_r>
<flame_color_low_b type="float"><use>/sim/model/flame/blue-low</use></flame_color_low_b>
<flame_color_low_g type="float"><use>/sim/model/flame/green-low</use></flame_color_low_g>
<flame_color_low_r type="float"><use>/sim/model/flame/red-low</use></flame_color_low_r>
<flame_radius_fraction type="float">0.7</flame_radius_fraction>
<noise_scale type="float">0.8</noise_scale>
<noise_strength type="float">0.4</noise_strength>
<thrust_collimation type="float">0.2</thrust_collimation>
<thrust_density type="float">0.8</thrust_density>
<use_noise type="int">1</use_noise>
<use_shocks type="int">0</use_shocks>
</parameters>
</PropertyList>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>AB-flame</name>
<inherits-from>Effects/thrust-flame</inherits-from>
<parameters>
<base_flame_b type="float"><use>/sim/model/flame/blue-base</use></base_flame_b>
<base_flame_density type="float">0.01</base_flame_density>
<base_flame_g type="float"><use>/sim/model/flame/green-base</use></base_flame_g>
<base_flame_r type="float"><use>/sim/model/flame/red-base</use></base_flame_r>
<deflection_coeff type="float">0</deflection_coeff>
<flame_color_high_b type="float"><use>/sim/model/flame/blue-high</use></flame_color_high_b>
<flame_color_high_g type="float"><use>/sim/model/flame/green-high</use></flame_color_high_g>
<flame_color_high_r type="float"><use>/sim/model/flame/red-high</use></flame_color_high_r>
<flame_color_low_b type="float"><use>/sim/model/flame/blue-low</use></flame_color_low_b>
<flame_color_low_g type="float"><use>/sim/model/flame/green-low</use></flame_color_low_g>
<flame_color_low_r type="float"><use>/sim/model/flame/red-low</use></flame_color_low_r>
<flame_radius_fraction type="float">0.4</flame_radius_fraction>
<noise_scale type="float">0.8</noise_scale>
<noise_strength type="float">0.2</noise_strength>
<thrust_collimation type="float">0.5</thrust_collimation>
<thrust_density type="float">0.8</thrust_density>
<use_noise type="int">1</use_noise>
<use_shocks type="int">0</use_shocks>
</parameters>
</PropertyList>

25
Models/Effects/flame.eff Normal file
View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>AB-flame</name>
<inherits-from>Effects/thrust-flame</inherits-from>
<parameters>
<base_flame_b type="float"><use>/sim/model/flame/blue-base</use></base_flame_b>
<base_flame_density type="float">0.01</base_flame_density>
<base_flame_g type="float"><use>/sim/model/flame/green-base</use></base_flame_g>
<base_flame_r type="float"><use>/sim/model/flame/red-base</use></base_flame_r>
<deflection_coeff type="float">0</deflection_coeff>
<flame_color_high_b type="float"><use>/sim/model/flame/blue-high</use></flame_color_high_b>
<flame_color_high_g type="float"><use>/sim/model/flame/green-high</use></flame_color_high_g>
<flame_color_high_r type="float"><use>/sim/model/flame/red-high</use></flame_color_high_r>
<flame_color_low_b type="float"><use>/sim/model/flame/blue-low</use></flame_color_low_b>
<flame_color_low_g type="float"><use>/sim/model/flame/green-low</use></flame_color_low_g>
<flame_color_low_r type="float"><use>/sim/model/flame/red-low</use></flame_color_low_r>
<flame_radius_fraction type="float">0.82</flame_radius_fraction>
<noise_scale type="float">0.8</noise_scale>
<noise_strength type="float">0.2</noise_strength>
<thrust_collimation type="float">0.2</thrust_collimation>
<thrust_density type="float">0.8</thrust_density>
<use_noise type="int">1</use_noise>
<use_shocks type="int">0</use_shocks>
</parameters>
</PropertyList>

View file

@ -8,7 +8,7 @@
<params>
<n1>engines/engine[3]/n1</n1>
<on-fire>engines/engine[0]/on-fire</on-fire>
<on-fire>systems/failures/engine-left-fire</on-fire>
<contrail>engines/engine[0]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[2]</reverser-pos-norm>
</params>

View file

@ -8,7 +8,7 @@
<params>
<n1>engines/engine[4]/n1</n1>
<on-fire>engines/engine[1]/on-fire</on-fire>
<on-fire>systems/failures/engine-right-fire</on-fire>
<contrail>engines/engine[1]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[3]</reverser-pos-norm>
</params>

View file

@ -13,7 +13,7 @@
<params>
<n1>engines/engine[3]/n1</n1>
<on-fire>engines/engine[0]/on-fire</on-fire>
<on-fire>systems/failures/engine-left-fire</on-fire>
<contrail>engines/engine[0]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[2]</reverser-pos-norm>
</params>

View file

@ -13,7 +13,7 @@
<params>
<n1>engines/engine[4]/n1</n1>
<on-fire>engines/engine[1]/on-fire</on-fire>
<on-fire>systems/failures/engine-right-fire</on-fire>
<contrail>engines/engine[1]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[3]</reverser-pos-norm>
</params>

View file

@ -10,7 +10,7 @@
<params>
<n1>engines/engine[3]/n1</n1>
<on-fire>engines/engine[0]/on-fire</on-fire>
<on-fire>systems/failures/engine-left-fire</on-fire>
<contrail>engines/engine[0]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[2]</reverser-pos-norm>
<pylon-model-path>Aircraft/IDG-A32X/Models/Engines/XMLs/a320.pylon.cfm.left.xml</pylon-model-path>

View file

@ -10,7 +10,7 @@
<params>
<n1>engines/engine[4]/n1</n1>
<on-fire>engines/engine[1]/on-fire</on-fire>
<on-fire>systems/failures/engine-right-fire</on-fire>
<contrail>engines/engine[1]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[3]</reverser-pos-norm>
<pylon-model-path>Aircraft/IDG-A32X/Models/Engines/XMLs/a320.pylon.cfm.right.xml</pylon-model-path>

View file

@ -10,7 +10,7 @@
<params>
<n1>engines/engine[3]/n1</n1>
<on-fire>engines/engine[0]/on-fire</on-fire>
<on-fire>systems/failures/engine-left-fire</on-fire>
<contrail>engines/engine[0]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[2]</reverser-pos-norm>
<pylon-model-path>Aircraft/IDG-A32X/Models/Engines/XMLs/a320.pylon.iae.left.xml</pylon-model-path>

View file

@ -10,7 +10,7 @@
<params>
<n1>engines/engine[4]/n1</n1>
<on-fire>engines/engine[1]/on-fire</on-fire>
<on-fire>systems/failures/engine-right-fire</on-fire>
<contrail>engines/engine[1]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[3]</reverser-pos-norm>
<pylon-model-path>Aircraft/IDG-A32X/Models/Engines/XMLs/a320.pylon.iae.right.xml</pylon-model-path>

View file

@ -5168,6 +5168,17 @@
<property>ECAM/warnings/master-warning-light</property>
<value>0</value>
</binding>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>property-assign</command>
<property>sim/sound/warnings/crc</property>
<value>0</value>
</binding>
<binding>
<condition>
<greater-than-equals>
@ -5218,10 +5229,6 @@
if (getprop("/it-autoflight/output/athr-warning") == 1) {
setprop("/it-autoflight/output/athr-warning", 0);
}
if (getprop("/sim/sound/warnings/chime") == 1) {
setprop("/sim/sound/warnings/chime", 0);
}
</script>
</binding>
</action>

View file

@ -32,7 +32,7 @@
<z-m>0.95</z-m>
</offsets>
<condition>
<property>engines/apu/on-fire</property>
<property>systems/failures/apu-fire</property>
</condition>
</model>

View file

@ -32,7 +32,7 @@
<z-m>0.95</z-m>
</offsets>
<condition>
<property>engines/apu/on-fire</property>
<property>systems/failures/apu-fire</property>
</condition>
</model>

View file

@ -32,7 +32,7 @@
<z-m>0.95</z-m>
</offsets>
<condition>
<property>engines/apu/on-fire</property>
<property>systems/failures/apu-fire</property>
</condition>
</model>

File diff suppressed because it is too large Load diff

View file

@ -122,6 +122,85 @@
<object-name>vu112_dfdr</object-name>
</effect>
<animation>
<type>select</type>
<object-name>engine_fire_1</object-name>
<condition>
<property>systems/fire/engine1/warning-active</property>
</condition>
</animation>
<animation>
<type>material</type>
<object-name>engine_fire_1</object-name>
<condition>
<property>systems/fire/engine1/warning-active</property>
</condition>
<emission>
<red>1.0</red>
<green>1.0</green>
<blue>1.0</blue>
</emission>
</animation>
<animation>
<type>select</type>
<object-name>engine_fault_1</object-name>
<condition>
<property>systems/unused/unused-ped</property>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>engine_fire_1</object-name>
<condition>
<property>systems/fire/engine1/warning-active</property>
</condition>
</animation>
<animation>
<type>material</type>
<object-name>engine_fire_1</object-name>
<condition>
<property>systems/fire/engine1/warning-active</property>
</condition>
<emission>
<red>1.0</red>
<green>1.0</green>
<blue>1.0</blue>
</emission>
</animation>
<animation>
<type>select</type>
<object-name>engine_fault_2</object-name>
<condition>
<property>systems/unused/unused-ped</property>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>engine_fire_2</object-name>
<condition>
<property>systems/fire/engine2/warning-active</property>
</condition>
</animation>
<animation>
<type>material</type>
<object-name>engine_fire_2</object-name>
<condition>
<property>systems/fire/engine2/warning-active</property>
</condition>
<emission>
<red>1.0</red>
<green>1.0</green>
<blue>1.0</blue>
</emission>
</animation>
<effect>
<inherits-from>Aircraft/IDG-A32X/Models/Effects/cockpit-irradiance</inherits-from>
<object-name>atc_0</object-name>

View file

@ -106,6 +106,25 @@ var canvas_upperECAM_base = {
foreach(var key; svg_keys) {
me[key] = canvas_group.getElementById(key);
}
# set font
me["ECAML1"].setFont("LiberationMonoCustom.ttf");
me["ECAML2"].setFont("LiberationMonoCustom.ttf");
me["ECAML3"].setFont("LiberationMonoCustom.ttf");
me["ECAML4"].setFont("LiberationMonoCustom.ttf");
me["ECAML5"].setFont("LiberationMonoCustom.ttf");
me["ECAML6"].setFont("LiberationMonoCustom.ttf");
me["ECAML7"].setFont("LiberationMonoCustom.ttf");
me["ECAML8"].setFont("LiberationMonoCustom.ttf");
me["ECAMR1"].setFont("LiberationMonoCustom.ttf");
me["ECAMR2"].setFont("LiberationMonoCustom.ttf");
me["ECAMR3"].setFont("LiberationMonoCustom.ttf");
me["ECAMR4"].setFont("LiberationMonoCustom.ttf");
me["ECAMR5"].setFont("LiberationMonoCustom.ttf");
me["ECAMR6"].setFont("LiberationMonoCustom.ttf");
me["ECAMR7"].setFont("LiberationMonoCustom.ttf");
me["ECAMR8"].setFont("LiberationMonoCustom.ttf");
me.page = canvas_group;

View file

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<PropertyList>
<path>Aircraft/Generic/Effects/Thruster/thrust_flame.ac</path>
<nopreview/>
<animation>
<type>scale</type>
<property>systems/failures/engine-left-fire</property>
<x-min>0.2</x-min>
<y-min>0.3</y-min>
<z-min>0.3</z-min>
<y-max>0.8</y-max>
<z-max>0.8</z-max>
<x-factor>0.4</x-factor>
<y-factor>0.35</y-factor>
<z-factor>0.35</z-factor>
</animation>
<animation>
<type>select</type>
<object-name>Bounding_box</object-name>
<condition>
<property>systems/failures/engine-left-fire</property>
</condition>
</animation>
<effect>
<inherits-from>Aircraft/IDG-A32X/Models/Effects/flame-cfm</inherits-from>
<object-name>Bounding_box</object-name>
</effect>
</PropertyList>

View file

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<PropertyList>
<path>Aircraft/Generic/Effects/Thruster/thrust_flame.ac</path>
<nopreview/>
<animation>
<type>scale</type>
<property>systems/failures/engine-left-fire</property>
<x-min>0.2</x-min>
<y-min>0.3</y-min>
<z-min>0.3</z-min>
<y-max>0.8</y-max>
<z-max>0.8</z-max>
<x-factor>0.4</x-factor>
<y-factor>0.7</y-factor>
<z-factor>0.7</z-factor>
</animation>
<animation>
<type>select</type>
<object-name>Bounding_box</object-name>
<condition>
<property>systems/failures/engine-left-fire</property>
</condition>
</animation>
<effect>
<inherits-from>Aircraft/IDG-A32X/Models/Effects/flame</inherits-from>
<object-name>Bounding_box</object-name>
</effect>
</PropertyList>

View file

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<PropertyList>
<path>Aircraft/Generic/Effects/Thruster/thrust_flame.ac</path>
<nopreview/>
<animation>
<type>scale</type>
<property>systems/failures/engine-right-fire</property>
<x-min>0.2</x-min>
<y-min>0.3</y-min>
<z-min>0.3</z-min>
<y-max>0.8</y-max>
<z-max>0.8</z-max>
<x-factor>0.4</x-factor>
<y-factor>0.35</y-factor>
<z-factor>0.35</z-factor>
</animation>
<animation>
<type>select</type>
<object-name>Bounding_box</object-name>
<condition>
<property>systems/failures/engine-right-fire</property>
</condition>
</animation>
<effect>
<inherits-from>Aircraft/IDG-A32X/Models/Effects/flame-cfm</inherits-from>
<object-name>Bounding_box</object-name>
</effect>
</PropertyList>

View file

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<PropertyList>
<path>Aircraft/Generic/Effects/Thruster/thrust_flame.ac</path>
<nopreview/>
<animation>
<type>scale</type>
<property>systems/failures/engine-right-fire</property>
<x-min>0.2</x-min>
<y-min>0.3</y-min>
<z-min>0.3</z-min>
<y-max>0.8</y-max>
<z-max>0.8</z-max>
<x-factor>0.4</x-factor>
<y-factor>0.7</y-factor>
<z-factor>0.7</z-factor>
</animation>
<animation>
<type>select</type>
<object-name>Bounding_box</object-name>
<condition>
<property>systems/failures/engine-right-fire</property>
</condition>
</animation>
<effect>
<inherits-from>Aircraft/IDG-A32X/Models/Effects/flame</inherits-from>
<object-name>Bounding_box</object-name>
</effect>
</PropertyList>

View file

@ -24,7 +24,7 @@
<z-m>-1.0170087</z-m>
</offsets>
</model>
<!-- ANIMATIONS -->
<!-- Ailerons -->
<animation>

View file

@ -24,7 +24,7 @@
<z-m>-1.0170087</z-m>
</offsets>
</model>
<!-- ANIMATIONS -->
<!-- Ailerons -->
<animation>

View file

@ -24,7 +24,7 @@
<z-m>-1.0170087</z-m>
</offsets>
</model>
<!-- ANIMATIONS -->
<!-- Ailerons -->
<animation>

View file

@ -301,20 +301,19 @@ var LowerECAM = {
setprop("/it-autoflight/output/athr-warning", 0);
setprop("/ECAM/Lower/light/clr", 0);
setprop("/ECAM/warnings/master-caution-light", 0);
LowerECAM.failCall("sts");
return;
}
if (b == "clr" and getprop("/it-autoflight/output/ap-warning") == 2) {
setprop("/it-autoflight/output/ap-warning", 0);
setprop("/ECAM/Lower/light/clr", 0);
setprop("/ECAM/warnings/master-warning-light", 0);
LowerECAM.failCall("sts");
return;
}
if (b == "clr" and getprop("/ECAM/Lower/man-select") == 0 and getprop("/ECAM/Lower/fault-select") == 0) {
ecam.ECAM_controller.clear();
return;
}
if (getprop("/ECAM/Lower/fault-select") == 0) {

View file

@ -25,22 +25,31 @@ var lineIndex = 0;
var rightLineIndex = 0;
var statusIndex = 0;
var flash = 0;
var hasCleared = 0;
var statusFlag = 0;
var warning = {
new: func(msg,colour,aural,light) {
new: func(msg,colour = "g",aural = 9,light = 9,hasSubmsg = 0,lastSubmsg = 0, sdPage = "nil") {
var t = {parents:[warning]};
t.msg = msg;
t.active = 0;
t.colour = colour;
t.aural = aural;
t.light = light;
t.hasSubmsg = hasSubmsg;
t.lastSubmsg = lastSubmsg;
t.active = 0;
t.noRepeat = 0;
t.noRepeat2 = 0;
t.clearFlag = 0;
t.sdPage = sdPage;
t.hasCalled = 0;
return t
},
write: func() {
if (me.active == 0) {return;}
if (me.active == 0) { return; }
lineIndex = 0;
while (lineIndex < 7 and lines[lineIndex].getValue() != "") {
lineIndex = lineIndex + 1; # go to next line until empty line
@ -58,29 +67,34 @@ var warning = {
}
},
warnlight: func() {
if (me.light >= 1) {return;}
if (me.active == 1 and me.noRepeat == 0) { # only toggle light once per message, allows canceling
lights[me.light].setBoolValue(1);
me.noRepeat = 1;
}
if (me.light > 1 or me.noRepeat == 1 or me.active == 0) {return;}
lights[me.light].setBoolValue(1);
me.noRepeat = 1;
},
sound: func() {
if (me.aural > 1) {return;}
if (me.active == 1) {
if (!aural[me.aural].getBoolValue()) {
aural[me.aural].setBoolValue(1);
}
if (me.aural > 1 or me.noRepeat2 == 1 or me.active == 0) {return;}
if (me.aural != 0) {
aural[me.aural].setBoolValue(0);
}
},
me.noRepeat2 = 1;
settimer(func() {
aural[me.aural].setBoolValue(1);
}, 0.15);
},
callPage: func() {
if (me.sdPage == "nil" or me.hasCalled == 1) { return; }
#libraries.LowerECAM.failCall(me.sdPage);
me.hasCalled = 1;
}
};
var memo = {
new: func(msg,colour) {
new: func(msg,colour = "g") {
var t = {parents:[memo]};
t.msg = msg;
t.active = 0;
t.colour = colour;
t.active = 0;
return t
},
@ -110,8 +124,8 @@ var status = {
var t = {parents:[status]};
t.msg = msg;
t.active = 0;
t.colour = colour;
t.active = 0;
return t
},
@ -156,14 +170,19 @@ var ECAM_controller = {
}
# write to ECAM
var counter = 0;
foreach (var w; warnings.vector) {
w.write();
w.warnlight();
w.sound();
if (counter >= 9) { break; }
if (w.active == 1) {
w.write();
w.warnlight();
w.sound();
counter += 1;
}
}
if (lines[0].getValue() == "") { # disable left memos if a warning exists. Warnings are processed first, so this stops leftmemos if line1 is not empty
if (lines[0].getValue() == "" and flash == 0) { # disable left memos if a warning exists. Warnings are processed first, so this stops leftmemos if line1 is not empty
foreach (var l; leftmemos.vector) {
l.write();
}
@ -219,13 +238,21 @@ var ECAM_controller = {
}
},
clear: func() {
hasCleared = 0;
foreach (var w; warnings.vector) {
if (w.active == 1) {
# if (w.msg == "ENG DUAL FAILURE") { continue; }
if (w.hasSubmsg == 1) { continue; }
w.clearFlag = 1;
hasCleared = 1;
statusFlag = 1;
break;
}
}
if (hasCleared == 0 and statusFlag == 1) {
libraries.LowerECAM.failCall("sts");
statusFlag = 0;
}
},
recall: func() {
foreach (var w; warnings.vector) {
@ -236,6 +263,11 @@ var ECAM_controller = {
}
}
},
warningReset: func(warning) {
warning.active = 0;
warning.noRepeat = 0;
warning.noRepeat2 = 0;
},
};
setlistener("/systems/electrical/bus/dc-ess", func {
@ -244,11 +276,15 @@ setlistener("/systems/electrical/bus/dc-ess", func {
}
}, 0, 0);
var ECAMloopTimer = maketimer(0.2, func {
var ECAMloopTimer = maketimer(0.15, func {
ECAM_controller.loop();
});
# Flash Master Warning Light
var shutUpYou = func() {
lights[0].setBoolValue(0);
}
var warnTimer = maketimer(0.25, func {
if (!lights[0].getBoolValue()) {
warnTimer.stop();

View file

@ -11,8 +11,18 @@ var apWarn = props.globals.getNode("/it-autoflight/output/ap-warning", 1);
var athrWarn = props.globals.getNode("/it-autoflight/output/athr-warning", 1);
var emerGen = props.globals.getNode("/controls/electrical/switches/emer-gen", 1);
var fac1Node = props.globals.getNode("/controls/fctl/fac1", 1);
var fac1Node = props.globals.getNode("/controls/fctl/fac1", 1);
var state1Node = props.globals.getNode("/engines/engine[0]/state", 1);
var state2Node = props.globals.getNode("/engines/engine[1]/state", 1);
var wowNode = props.globals.getNode("/fdm/jsbsim/position/wow", 1);
var apu_rpm = props.globals.getNode("/systems/apu/rpm", 1);
var wing_pb = props.globals.getNode("/controls/switches/wing", 1);
var apumaster = props.globals.getNode("/controls/APU/master", 1);
var apu_bleedSw = props.globals.getNode("/controls/pneumatic/switches/bleedapu", 1);
var gear = props.globals.getNode("/gear/gear-pos-norm", 1);
var cutoff1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1);
var cutoff2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1);
var engOpt = props.globals.getNode("/options/eng", 1);
# local variables
var phaseVar = nil;
var dualFailFACActive = 1;
@ -24,19 +34,15 @@ var messages_priority_3 = func {
if ((flap_not_zero.clearFlag == 0) and phaseVar == 6 and getprop("/controls/flight/flap-lever") != 0 and getprop("/instrumentation/altimeter/indicated-altitude-ft") > 22000) {
flap_not_zero.active = 1;
} else {
flap_not_zero.active = 0;
flap_not_zero.noRepeat = 0;
flap_not_zero.clearFlag = 0;
ECAM_controller.warningReset(flap_not_zero);
}
# ENG DUAL FAIL
if (phaseVar >= 5 and phaseVar <= 7 and dualFailNode.getBoolValue()) {
dualFail.active = 1;
} elsif (dualFail.clearFlag == 1) {
dualFail.active = 0;
dualFail.noRepeat = 0;
dualFail.clearFlag = 0;
} elsif (dualFailbatt.clearFlag == 1 or !dualFailNode.getBoolValue()) {
ECAM_controller.warningReset(dualFail);
dualFailFACActive = 1; # reset FAC local variable
}
@ -45,116 +51,594 @@ var messages_priority_3 = func {
if (getprop("/controls/engines/engine-start-switch") != 2 and dualFailModeSel.clearFlag == 0) {
dualFailModeSel.active = 1;
} else {
dualFailModeSel.active = 0;
ECAM_controller.warningReset(dualFailModeSel);
}
if (getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01 and dualFailLevers.clearFlag == 0) {
dualFailLevers.active = 1;
} else {
dualFailLevers.active = 0;
ECAM_controller.warningReset(dualFailLevers);
}
if (getprop("/options/eng") == "IAE" and dualFailRelightSPD.clearFlag == 0) {
if (engOpt.getValue() == "IAE" and dualFailRelightSPD.clearFlag == 0) {
dualFailRelightSPD.active = 1;
} else {
dualFailRelightSPD.active = 0;
ECAM_controller.warningReset(dualFailRelightSPD);
}
if (getprop("/options/eng") != "IAE" and dualFailRelightSPDCFM.clearFlag == 0) {
if (engOpt.getValue() != "IAE" and dualFailRelightSPDCFM.clearFlag == 0) {
dualFailRelightSPDCFM.active = 1;
} else {
dualFailRelightSPDCFM.active = 0;
ECAM_controller.warningReset(dualFailRelightSPDCFM);
}
if (emerGen.getValue() == 0 and dualFailElec.clearFlag == 0) {
dualFailElec.active = 1;
} else {
dualFailElec.active = 0;
ECAM_controller.warningReset(dualFailElec);
}
if (dualFailRadio.clearFlag == 0) {
dualFailRadio.active = 1;
} else {
dualFailRadio.active = 0;
ECAM_controller.warningReset(dualFailRadio);
}
if (dualFailFACActive == 1 and dualFailFAC.clearFlag == 0) {
dualFailFAC.active = 1;
} else {
dualFailFAC.active = 0;
ECAM_controller.warningReset(dualFailFAC);
}
if (dualFailAPU.clearFlag == 0) { # assumption - not cleared till you clear APU message
dualFailRelight.active = 1;
if (dualFailMasters.clearFlag == 0) {
dualFailRelight.active = 1; # assumption
dualFailMasters.active = 1;
dualFailSuccess.active = 1;
} else {
ECAM_controller.warningReset(dualFailRelight);
ECAM_controller.warningReset(dualFailMasters);
}
if (dualFailSPDGD.clearFlag == 0) {
dualFailSuccess.active = 1; # assumption
dualFailSPDGD.active = 1;
} else {
ECAM_controller.warningReset(dualFailSuccess);
ECAM_controller.warningReset(dualFailSPDGD);
}
if (dualFailAPU.clearFlag == 0) {
dualFailAPU.active = 1;
} else {
dualFailRelight.active = 1;
dualFailMasters.active = 1;
dualFailSuccess.active = 1;
dualFailAPU.active = 1;
ECAM_controller.warningReset(dualFailAPU);
}
if (dualFailAPUwing.clearFlag == 0 and apu_rpm.getValue() > 94.9 and wing_pb.getBoolValue()) {
dualFailAPUwing.active = 1;
} else {
ECAM_controller.warningReset(dualFailAPUwing);
}
if (dualFailAPUbleed.clearFlag == 0 and apu_rpm.getValue() > 94.9 and !apu_bleedSw.getBoolValue()) {
dualFailAPUbleed.active = 1;
} else {
ECAM_controller.warningReset(dualFailAPUbleed);
}
if (dualFailMastersAPU.clearFlag == 0) {
dualFailMastersAPU.active = 1;
} else {
dualFailMastersAPU.active = 0;
}
if (dualFailSPDGD.clearFlag == 0) {
dualFailSPDGD.active = 1;
} else {
dualFailSPDGD.active = 0;
ECAM_controller.warningReset(dualFailMastersAPU);
}
if (dualFailflap.clearFlag == 0) {
dualFailAPPR.active = 1;
dualFailAPPR.active = 1; # assumption
dualFailflap.active = 1;
} else {
dualFailAPPR.active = 0;
ECAM_controller.warningReset(dualFailAPPR);
ECAM_controller.warningReset(dualFailflap);
}
if (dualFailcabin.clearFlag == 0) {
dualFailcabin.active = 1;
} else {
dualFailcabin.active = 0;
ECAM_controller.warningReset(dualFailcabin);
}
if (dualFailrudd.clearFlag == 0) {
dualFailrudd.active = 1;
} else {
dualFailrudd.active = 0;
ECAM_controller.warningReset(dualFailrudd);
}
if (dualFailflap.clearFlag == 0) {
dualFailflap.active = 1;
} else {
dualFailflap.active = 0;
}
if (dualFailfinalspeed.clearFlag == 0) {
dualFail5000.active = 1;
} else {
dualFail5000.active = 0;
}
if (dualFailgear.clearFlag == 0) {
if (dualFailgear.clearFlag == 0 and gear.getValue() != 1) {
dualFail5000.active = 1; # according to doc
dualFailgear.active = 1;
} else {
dualFailgear.active = 0;
ECAM_controller.warningReset(dualFailgear);
ECAM_controller.warningReset(dualFail5000);
}
if (dualFailfinalspeed.clearFlag == 0) {
dualFailfinalspeed.active = 1;
} else {
dualFailfinalspeed.active = 0;
ECAM_controller.warningReset(dualFailfinalspeed);
}
dualFailtouch.active = 1;
dualFailmasteroff.active = 1;
dualFailapuoff.active = 1;
dualFailevac.active = 1;
dualFailbatt.active = 1;
if (dualFailmasteroff.clearFlag == 0 and (!cutoff1.getBoolValue() or !cutoff2.getBoolValue())) {
dualFailmasteroff.active = 1;
} else {
ECAM_controller.warningReset(dualFailmasteroff);
}
if (dualFailapuoff.clearFlag == 0 and apumaster.getBoolValue()) {
dualFailapuoff.active = 1;
} else {
ECAM_controller.warningReset(dualFailapuoff);
}
if (dualFailevac.clearFlag == 0) {
dualFailevac.active = 1;
} else {
ECAM_controller.warningReset(dualFailevac);
}
if (dualFailbatt.clearFlag == 0) { # elec power lost when batt goes off anyway I guess
dualFailbatt.active = 1;
dualFailtouch.active = 1;
} else {
ECAM_controller.warningReset(dualFailbatt);
ECAM_controller.warningReset(dualFailtouch);
}
} else {
ECAM_controller.warningReset(dualFailModeSel);
ECAM_controller.warningReset(dualFailLevers);
ECAM_controller.warningReset(dualFailRelightSPD);
ECAM_controller.warningReset(dualFailRelightSPDCFM);
ECAM_controller.warningReset(dualFailElec);
ECAM_controller.warningReset(dualFailRadio);
ECAM_controller.warningReset(dualFailFAC);
ECAM_controller.warningReset(dualFailRelight);
ECAM_controller.warningReset(dualFailMasters);
ECAM_controller.warningReset(dualFailSuccess);
ECAM_controller.warningReset(dualFailSPDGD);
ECAM_controller.warningReset(dualFailAPU);
ECAM_controller.warningReset(dualFailAPUwing);
ECAM_controller.warningReset(dualFailAPUbleed);
ECAM_controller.warningReset(dualFailMastersAPU);
ECAM_controller.warningReset(dualFailAPPR);
ECAM_controller.warningReset(dualFailflap);
ECAM_controller.warningReset(dualFailcabin);
ECAM_controller.warningReset(dualFailrudd);
ECAM_controller.warningReset(dualFailgear);
ECAM_controller.warningReset(dualFail5000);
ECAM_controller.warningReset(dualFailfinalspeed);
ECAM_controller.warningReset(dualFailmasteroff);
ECAM_controller.warningReset(dualFailapuoff);
ECAM_controller.warningReset(dualFailevac);
ECAM_controller.warningReset(dualFailbatt);
ECAM_controller.warningReset(dualFailtouch);
}
# ENG FIRE
if ((eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and phaseVar >= 5 and phaseVar <= 7) or (eng1FireGnevacBat.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and (phaseVar < 5 or phaseVar > 7))) {
eng1Fire.active = 1;
} else {
ECAM_controller.warningReset(eng1Fire);
}
if ((eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/warning-active") == 1 and phaseVar >= 5 and phaseVar <= 7) or (eng2FireGnevacBat.clearFlag == 0 and getprop("/systems/fire/engine2/warning-active") == 1 and (phaseVar < 5 or phaseVar > 7))) {
eng2Fire.active = 1;
} else {
ECAM_controller.warningReset(eng2Fire);
}
if (apuFireMaster.clearFlag == 0 and getprop("/systems/fire/apu/warning-active")) {
apuFire.active = 1;
} else {
ECAM_controller.warningReset(apuFire);
}
if (eng1Fire.active == 1) {
if (phaseVar >= 5 and phaseVar <= 7) {
if (eng1FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01) {
eng1FireFllever.active = 1;
} else {
ECAM_controller.warningReset(eng1FireFllever);
}
if (eng1FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
eng1FireFlmaster.active = 1;
} else {
ECAM_controller.warningReset(eng1FireFlmaster);
}
if (eng1FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) {
eng1FireFlPB.active = 1;
} else {
ECAM_controller.warningReset(eng1FireFlPB);
}
if (getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) {
eng1FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine1/agent1-timer") ~ " S...DISCH";
}
if (eng1FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 1 and !getprop("/systems/fire/engine1/disch1") and getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) {
eng1FireFlAgent1Timer.active = 1;
} else {
ECAM_controller.warningReset(eng1FireFlAgent1Timer);
}
if (eng1FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1") and (getprop("/systems/fire/engine1/agent1-timer") == 0 or getprop("/systems/fire/engine1/agent1-timer") == 99)) {
eng1FireFlAgent1.active = 1;
} else {
ECAM_controller.warningReset(eng1FireFlAgent1);
}
if (eng1FireFlATC.clearFlag == 0) {
eng1FireFlATC.active = 1;
} else {
ECAM_controller.warningReset(eng1FireFlATC);
}
if (getprop("/systems/fire/engine1/agent2-timer") != 0 and getprop("/systems/fire/engine1/agent2-timer") != 99) {
eng1FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine1/agent2-timer") ~ " S:";
}
if (eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2") and getprop("/systems/fire/engine1/agent2-timer") > 0) {
eng1FireFl30Sec.active = 1;
} else {
ECAM_controller.warningReset(eng1FireFl30Sec);
}
if (eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2")) {
eng1FireFlAgent2.active = 1;
} else {
ECAM_controller.warningReset(eng1FireFlAgent2);
}
} else {
ECAM_controller.warningReset(eng1FireFllever);
ECAM_controller.warningReset(eng1FireFlmaster);
ECAM_controller.warningReset(eng1FireFlPB);
ECAM_controller.warningReset(eng1FireFlAgent1);
ECAM_controller.warningReset(eng1FireFlATC);
ECAM_controller.warningReset(eng1FireFl30Sec);
ECAM_controller.warningReset(eng1FireFlAgent2);
}
if (phaseVar < 5 or phaseVar > 7) {
if (eng1FireGnlever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) {
eng1FireGnlever.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnlever);
}
if (eng1FireGnparkbrk.clearFlag == 0 and getprop("/controls/gear/brake-parking") == 0) {
eng1FireGnstopped.active = 1;
eng1FireGnparkbrk.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnstopped);
ECAM_controller.warningReset(eng1FireGnparkbrk);
}
if (eng1FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
eng1FireGnmaster.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnmaster);
}
if (eng1FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) {
eng1FireGnPB.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnPB);
}
if (eng1FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1")) {
eng1FireGnAgent1.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnAgent1);
}
if (eng1FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine1/disch2")) {
eng1FireGnAgent2.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnAgent2);
}
if (eng1FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
eng1FireGnmaster2.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnmaster2);
}
if (eng1FireGnATC.clearFlag == 0) {
eng1FireGnATC.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnATC);
}
if (eng1FireGncrew.clearFlag == 0) {
eng1FireGncrew.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGncrew);
}
if (eng1FireGnevacSw.clearFlag == 0) {
eng1FireGnevac.active = 1;
eng1FireGnevacSw.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnevac);
ECAM_controller.warningReset(eng1FireGnevacSw);
}
if (eng1FireGnevacApu.clearFlag == 0 and getprop("/controls/APU/master") and getprop("/systems/apu/rpm") > 99) {
eng1FireGnevacApu.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnevacApu);
}
if (eng1FireGnevacBat.clearFlag == 0 and (getprop("/controls/electrical/switches/battery1") or getprop("/controls/electrical/switches/battery2"))) {
eng1FireGnevacBat.active = 1;
} else {
ECAM_controller.warningReset(eng1FireGnevacBat);
}
} else {
ECAM_controller.warningReset(eng1FireGnlever);
ECAM_controller.warningReset(eng1FireGnstopped);
ECAM_controller.warningReset(eng1FireGnparkbrk);
ECAM_controller.warningReset(eng1FireGnmaster);
ECAM_controller.warningReset(eng1FireGnPB);
ECAM_controller.warningReset(eng1FireGnAgent1);
ECAM_controller.warningReset(eng1FireGnAgent2);
ECAM_controller.warningReset(eng1FireGnmaster2);
ECAM_controller.warningReset(eng1FireGnATC);
ECAM_controller.warningReset(eng1FireGncrew);
ECAM_controller.warningReset(eng1FireGnevac);
ECAM_controller.warningReset(eng1FireGnevacSw);
ECAM_controller.warningReset(eng1FireGnevacApu);
ECAM_controller.warningReset(eng1FireGnevacBat);
}
} else {
ECAM_controller.warningReset(eng1FireFllever);
ECAM_controller.warningReset(eng1FireFlmaster);
ECAM_controller.warningReset(eng1FireFlPB);
ECAM_controller.warningReset(eng1FireFlAgent1);
ECAM_controller.warningReset(eng1FireFlATC);
ECAM_controller.warningReset(eng1FireFl30Sec);
ECAM_controller.warningReset(eng1FireFlAgent2);
ECAM_controller.warningReset(eng1FireGnlever);
ECAM_controller.warningReset(eng1FireGnstopped);
ECAM_controller.warningReset(eng1FireGnparkbrk);
ECAM_controller.warningReset(eng1FireGnmaster);
ECAM_controller.warningReset(eng1FireGnPB);
ECAM_controller.warningReset(eng1FireGnAgent1);
ECAM_controller.warningReset(eng1FireGnAgent2);
ECAM_controller.warningReset(eng1FireGnmaster2);
ECAM_controller.warningReset(eng1FireGnATC);
ECAM_controller.warningReset(eng1FireGncrew);
ECAM_controller.warningReset(eng1FireGnevac);
ECAM_controller.warningReset(eng1FireGnevacSw);
ECAM_controller.warningReset(eng1FireGnevacApu);
ECAM_controller.warningReset(eng1FireGnevacBat);
}
if (eng2Fire.active == 1) {
if (phaseVar >= 5 and phaseVar <= 7) {
if (eng2FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) {
eng2FireFllever.active = 1;
} else {
ECAM_controller.warningReset(eng2FireFllever);
}
if (eng2FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
eng2FireFlmaster.active = 1;
} else {
ECAM_controller.warningReset(eng2FireFlmaster);
}
if (eng2FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) {
eng2FireFlPB.active = 1;
} else {
ECAM_controller.warningReset(eng2FireFlPB);
}
if (getprop("/systems/fire/engine2/agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) {
eng2FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine2/agent1-timer") ~ " S...DISCH";
}
if (eng2FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 1 and !getprop("/systems/fire/engine2/disch1") and getprop("/systems/fire/engine2agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) {
eng2FireFlAgent1Timer.active = 1;
} else {
ECAM_controller.warningReset(eng2FireFlAgent1Timer);
}
if (eng2FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1") and (getprop("/systems/fire/engine2/agent1-timer") == 0 or getprop("/systems/fire/engine2/agent1-timer") == 99)) {
eng2FireFlAgent1.active = 1;
} else {
ECAM_controller.warningReset(eng2FireFlAgent1);
}
if (eng2FireFlATC.clearFlag == 0) {
eng2FireFlATC.active = 1;
} else {
ECAM_controller.warningReset(eng2FireFlATC);
}
if (getprop("/systems/fire/engine2/agent2-timer") != 0 and getprop("/systems/fire/engine2/agent2-timer") != 99) {
eng2FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine2/agent2-timer") ~ " S:";
}
if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2") and getprop("/systems/fire/engine2/agent2-timer") > 0) {
eng2FireFl30Sec.active = 1;
} else {
ECAM_controller.warningReset(eng2FireFl30Sec);
}
if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2")) {
eng2FireFlAgent2.active = 1;
} else {
ECAM_controller.warningReset(eng2FireFlAgent2);
}
} else {
ECAM_controller.warningReset(eng2FireFllever);
ECAM_controller.warningReset(eng2FireFlmaster);
ECAM_controller.warningReset(eng2FireFlPB);
ECAM_controller.warningReset(eng2FireFlAgent1);
ECAM_controller.warningReset(eng2FireFlATC);
ECAM_controller.warningReset(eng2FireFl30Sec);
ECAM_controller.warningReset(eng2FireFlAgent2);
}
if (phaseVar < 5 or phaseVar > 7) {
if (eng2FireGnlever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) {
eng2FireGnlever.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnlever);
}
if (eng2FireGnparkbrk.clearFlag == 0 and getprop("/controls/gear/brake-parking") == 0) {
eng2FireGnstopped.active = 1;
eng2FireGnparkbrk.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnstopped);
ECAM_controller.warningReset(eng2FireGnparkbrk);
}
if (eng2FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
eng2FireGnmaster.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnmaster);
}
if (eng2FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) {
eng2FireGnPB.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnPB);
}
if (eng2FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1")) {
eng2FireGnAgent1.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnAgent1);
}
if (eng2FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine2/disch2")) {
eng2FireGnAgent2.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnAgent2);
}
if (eng2FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
eng2FireGnmaster2.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnmaster2);
}
if (eng2FireGnATC.clearFlag == 0) {
eng2FireGnATC.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnATC);
}
if (eng2FireGncrew.clearFlag == 0) {
eng2FireGncrew.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGncrew);
}
if (eng2FireGnevacSw.clearFlag == 0) {
eng2FireGnevac.active = 1;
eng2FireGnevacSw.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnevac);
ECAM_controller.warningReset(eng2FireGnevacSw);
}
if (eng2FireGnevacApu.clearFlag == 0 and getprop("/controls/APU/master") and getprop("/systems/apu/rpm") > 99) {
eng2FireGnevacApu.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnevacApu);
}
if (eng2FireGnevacBat.clearFlag == 0 and (getprop("/controls/electrical/switches/battery1") or getprop("/controls/electrical/switches/battery2"))) {
eng2FireGnevacBat.active = 1;
} else {
ECAM_controller.warningReset(eng2FireGnevacBat);
}
} else {
ECAM_controller.warningReset(eng2FireGnlever);
ECAM_controller.warningReset(eng2FireGnstopped);
ECAM_controller.warningReset(eng2FireGnparkbrk);
ECAM_controller.warningReset(eng2FireGnmaster);
ECAM_controller.warningReset(eng2FireGnPB);
ECAM_controller.warningReset(eng2FireGnAgent1);
ECAM_controller.warningReset(eng2FireGnAgent2);
ECAM_controller.warningReset(eng2FireGnmaster2);
ECAM_controller.warningReset(eng2FireGnATC);
ECAM_controller.warningReset(eng2FireGncrew);
ECAM_controller.warningReset(eng2FireGnevac);
ECAM_controller.warningReset(eng2FireGnevacSw);
ECAM_controller.warningReset(eng2FireGnevacApu);
ECAM_controller.warningReset(eng2FireGnevacBat);
}
} else {
ECAM_controller.warningReset(eng2FireFllever);
ECAM_controller.warningReset(eng2FireFlmaster);
ECAM_controller.warningReset(eng2FireFlPB);
ECAM_controller.warningReset(eng2FireFlAgent1);
ECAM_controller.warningReset(eng2FireFlATC);
ECAM_controller.warningReset(eng2FireFl30Sec);
ECAM_controller.warningReset(eng2FireFlAgent2);
ECAM_controller.warningReset(eng2FireGnlever);
ECAM_controller.warningReset(eng2FireGnstopped);
ECAM_controller.warningReset(eng2FireGnparkbrk);
ECAM_controller.warningReset(eng2FireGnmaster);
ECAM_controller.warningReset(eng2FireGnPB);
ECAM_controller.warningReset(eng2FireGnAgent1);
ECAM_controller.warningReset(eng2FireGnAgent2);
ECAM_controller.warningReset(eng2FireGnmaster2);
ECAM_controller.warningReset(eng2FireGnATC);
ECAM_controller.warningReset(eng2FireGncrew);
ECAM_controller.warningReset(eng2FireGnevac);
ECAM_controller.warningReset(eng2FireGnevacSw);
ECAM_controller.warningReset(eng2FireGnevacApu);
ECAM_controller.warningReset(eng2FireGnevacBat);
}
# APU Fire
if (apuFire.active == 1) {
if (apuFirePB.clearFlag == 0 and !getprop("/controls/APU/fire-btn")) {
apuFirePB.active = 1;
} else {
ECAM_controller.warningReset(apuFirePB);
}
if (getprop("/systems/fire/apu/agent-timer") != 0 and getprop("/systems/fire/apu/agent-timer") != 99) {
apuFireAgentTimer.msg = " -AGENT AFT " ~ getprop("/systems/fire/apu/agent-timer") ~ " S...DISCH";
}
if (apuFireAgent.clearFlag == 0 and getprop("/controls/APU/fire-btn") and !getprop("/systems/fire/apu/disch") and getprop("/systems/fire/apu/agent-timer") != 0) {
apuFireAgentTimer.active = 1;
} else {
ECAM_controller.warningReset(apuFireAgentTimer);
}
if (apuFireAgent.clearFlag == 0 and getprop("/controls/APU/fire-btn") and !getprop("/systems/fire/apu/disch") and getprop("/systems/fire/apu/agent-timer") == 0) {
apuFireAgent.active = 1;
} else {
ECAM_controller.warningReset(apuFireAgent);
}
if (apuFireMaster.clearFlag == 0 and getprop("/controls/APU/master")) {
apuFireMaster.active = 1;
} else {
ECAM_controller.warningReset(apuFireMaster);
}
} else {
ECAM_controller.warningReset(apuFirePB);
ECAM_controller.warningReset(apuFireAgentTimer);
ECAM_controller.warningReset(apuFireAgent);
ECAM_controller.warningReset(apuFireMaster);
}
# CONFIG
@ -162,99 +646,220 @@ var messages_priority_3 = func {
slats_config.active = 1;
slats_config_1.active = 1;
} else {
slats_config.active = 0;
slats_config.noRepeat = 0;
slats_config_1.active = 0;
slats_config_1.noRepeat = 0;
ECAM_controller.warningReset(slats_config);
ECAM_controller.warningReset(slats_config_1);
}
if ((flaps_config.clearFlag == 0) and (getprop("/controls/flight/flap-lever") == 0 or getprop("/controls/flight/flap-lever") == 4) and phaseVar >= 3 and phaseVar <= 4) {
flaps_config.active = 1;
flaps_config_1.active = 1;
} else {
flaps_config.active = 0;
flaps_config.noRepeat = 0;
flaps_config_1.active = 0;
flaps_config_1.noRepeat = 0;
ECAM_controller.warningReset(flaps_config);
ECAM_controller.warningReset(flaps_config_1);
}
if ((spd_brk_config.clearFlag == 0) and getprop("/controls/flight/speedbrake") != 0 and phaseVar >= 3 and phaseVar <= 4) {
spd_brk_config.active = 1;
spd_brk_config_1.active = 1;
} else {
spd_brk_config.active = 0;
spd_brk_config.noRepeat = 0;
spd_brk_config_1.active = 0;
spd_brk_config_1.noRepeat = 0;
ECAM_controller.warningReset(spd_brk_config);
ECAM_controller.warningReset(spd_brk_config_1);
}
if ((pitch_trim_config.clearFlag == 0) and (getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65) and phaseVar >= 3 and phaseVar <= 4) {
pitch_trim_config.active = 1;
pitch_trim_config_1.active = 1;
} else {
pitch_trim_config.active = 0;
pitch_trim_config.noRepeat = 0;
pitch_trim_config_1.active = 0;
pitch_trim_config_1.noRepeat = 0;
ECAM_controller.warningReset(pitch_trim_config);
ECAM_controller.warningReset(pitch_trim_config_1);
}
if ((rud_trim_config.clearFlag == 0) and (getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) and phaseVar >= 3 and phaseVar <= 4) {
rud_trim_config.active = 1;
rud_trim_config_1.active = 1;
} else {
rud_trim_config.active = 0;
rud_trim_config.noRepeat = 0;
rud_trim_config_1.active = 0;
rud_trim_config_1.noRepeat = 0;
ECAM_controller.warningReset(rud_trim_config);
ECAM_controller.warningReset(rud_trim_config_1);
}
if ((park_brk_config.clearFlag == 0) and getprop("/controls/gear/brake-parking") == 1 and phaseVar >= 3 and phaseVar <= 4) {
park_brk_config.active = 1;
} else {
park_brk_config.active = 0;
park_brk_config.noRepeat = 0;
ECAM_controller.warningReset(park_brk_config);
}
# AUTOFLT
if ((ap_offw.clearFlag == 0) and apWarn.getValue() == 2) {
ap_offw.active = 1;
} else {
ap_offw.active = 0;
ap_offw.noRepeat = 0;
ECAM_controller.warningReset(ap_offw);
if (getprop("/it-autoflight/output/ap-warning") == 2) {
setprop("/it-autoflight/output/ap-warning", 0);
setprop("/ECAM/Lower/light/clr", 0);
setprop("/ECAM/warnings/master-warning-light", 0);
}
}
if ((athr_lock.clearFlag == 0) and phaseVar >= 5 and phaseVar <= 7 and getprop("/systems/thrust/thr-locked") == 1) {
if ((athr_lock.clearFlag == 0) and phaseVar >= 5 and phaseVar <= 7 and getprop("/systems/thrust/thr-locked-alert") == 1) {
if (getprop("/systems/thrust/thr-locked-flash") == 0) {
athr_lock.msg = " ";
} else {
athr_lock.msg = msgSave
}
athr_lock.active = 1;
athr_lock_1.active = 1;
} else {
athr_lock.active = 0;
athr_lock_1.active = 0;
athr_lock.noRepeat = 0;
athr_lock_1.noRepeat = 0;
ECAM_controller.warningReset(athr_lock);
ECAM_controller.warningReset(athr_lock_1);
}
if ((athr_offw.clearFlag == 0) and athrWarn.getValue() == 2 and phaseVar != 4 and phaseVar != 8 and phaseVar != 10) {
athr_offw.active = 1;
athr_offw_1.active = 1;
} else {
athr_offw.active = 0;
athr_offw_1.active = 0;
athr_offw.noRepeat = 0;
athr_offw_1.noRepeat = 0;
ECAM_controller.warningReset(athr_offw);
ECAM_controller.warningReset(athr_offw_1);
if (getprop("/it-autoflight/output/athr-warning") == 2) {
setprop("/it-autoflight/output/athr-warning", 0);
setprop("/ECAM/Lower/light/clr", 0);
setprop("/ECAM/warnings/master-caution-light", 0);
}
}
if ((athr_lim.clearFlag == 0) and getprop("/it-autoflight/output/athr") == 1 and ((getprop("/systems/thrust/eng-out") != 1 and (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN")) or (getprop("/systems/thrust/eng-out") == 1 and (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN" or (getprop("/systems/thrust/state1") == "MAN THR" and getprop("/controls/engines/engine[0]/throttle-pos") <= 0.83) or (getprop("/systems/thrust/state2") == "MAN THR" and getprop("/controls/engines/engine[0]/throttle-pos") <= 0.83)))) and (phaseVar >= 5 and phaseVar <= 7)) {
athr_lim.active = 1;
athr_lim_1.active = 1;
} else {
athr_lim.active = 0;
athr_lim_1.active = 0;
athr_lim.noRepeat = 0;
athr_lim_1.noRepeat = 0;
ECAM_controller.warningReset(athr_lim);
ECAM_controller.warningReset(athr_lim_1);
}
if (!systems.cargoTestBtn.getBoolValue()) {
if (cargoSmokeFwd.clearFlag == 0 and systems.fwdCargoFireWarn.getBoolValue() and (getprop("/ECAM/warning-phase") <= 3 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") == 6)) {
cargoSmokeFwd.active = 1;
} elsif (cargoSmokeFwd.clearFlag == 1 or systems.cargoTestBtnOff.getBoolValue()) {
ECAM_controller.warningReset(cargoSmokeFwd);
cargoSmokeFwd.hasSubmsg = 1;
}
if (cargoSmokeFwdAgent.clearFlag == 0 and cargoSmokeFwd.active == 1 and !getprop("/systems/fire/cargo/disch")) {
cargoSmokeFwdAgent.active = 1;
} else {
ECAM_controller.warningReset(cargoSmokeFwdAgent);
cargoSmokeFwd.hasSubmsg = 0;
}
if (cargoSmokeAft.clearFlag == 0 and systems.aftCargoFireWarn.getBoolValue() and (getprop("/ECAM/warning-phase") <= 3 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") == 6)) {
cargoSmokeAft.active = 1;
} elsif (cargoSmokeAft.clearFlag == 1 or systems.cargoTestBtnOff.getBoolValue()) {
ECAM_controller.warningReset(cargoSmokeAft);
cargoSmokeAft.hasSubmsg = 1;
systems.cargoTestBtnOff.setBoolValue(0);
}
if (cargoSmokeAftAgent.clearFlag == 0 and cargoSmokeAft.active == 1 and !getprop("/systems/fire/cargo/disch")) {
cargoSmokeAftAgent.active = 1;
} else {
ECAM_controller.warningReset(cargoSmokeAftAgent);
cargoSmokeAft.hasSubmsg = 0;
}
} else {
if (systems.aftCargoFireWarn.getBoolValue()) {
cargoSmokeFwd.active = 1;
cargoSmokeFwdAgent.active = 1;
cargoSmokeAft.active = 1;
cargoSmokeAftAgent.active = 1;
} else {
ECAM_controller.warningReset(cargoSmokeFwd);
ECAM_controller.warningReset(cargoSmokeFwdAgent);
ECAM_controller.warningReset(cargoSmokeAft);
ECAM_controller.warningReset(cargoSmokeAftAgent);
}
}
}
var messages_priority_2 = func {
if (apuEmerShutdown.clearFlag == 0 and systems.apuEmerShutdown.getBoolValue() and !getprop("/systems/fire/apu/warning-active") and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
apuEmerShutdown.active = 1;
} elsif (apuEmerShutdown.clearFlag == 1) {
ECAM_controller.warningReset(apuEmerShutdown);
apuEmerShutdown.hasSubmsg = 1;
}
if (apuEmerShutdownMast.clearFlag == 0 and getprop("/controls/APU/master") and apuEmerShutdown.active == 1) {
apuEmerShutdownMast.active = 1;
} else {
ECAM_controller.warningReset(apuEmerShutdownMast);
apuEmerShutdown.hasSubmsg = 0;
}
if (eng1FireDetFault.clearFlag == 0 and (systems.engFireDetectorUnits.vector[0].condition == 0 or (systems.engFireDetectorUnits.vector[0].loopOne == 9 and systems.engFireDetectorUnits.vector[0].loopTwo == 9 and systems.eng1Inop.getBoolValue())) and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
eng1FireDetFault.active = 1;
} else {
ECAM_controller.warningReset(eng1FireDetFault);
}
if (eng1LoopAFault.clearFlag == 0 and systems.engFireDetectorUnits.vector[0].loopOne == 9 and systems.engFireDetectorUnits.vector[0].loopTwo != 9 and !systems.eng1Inop.getBoolValue() and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
eng1LoopAFault.active = 1;
} else {
ECAM_controller.warningReset(eng1LoopAFault);
}
if (eng1LoopBFault.clearFlag == 0 and systems.engFireDetectorUnits.vector[0].loopOne != 9 and systems.engFireDetectorUnits.vector[0].loopTwo == 9 and !systems.eng1Inop.getBoolValue() and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
eng1LoopBFault.active = 1;
} else {
ECAM_controller.warningReset(eng1LoopBFault);
}
if (eng2FireDetFault.clearFlag == 0 and (systems.engFireDetectorUnits.vector[1].condition == 0 or (systems.engFireDetectorUnits.vector[1].loopOne == 9 and systems.engFireDetectorUnits.vector[1].loopTwo == 9 and systems.eng2Inop.getBoolValue())) and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
eng2FireDetFault.active = 1;
} else {
ECAM_controller.warningReset(eng2FireDetFault);
}
if (eng2LoopAFault.clearFlag == 0 and systems.engFireDetectorUnits.vector[1].loopOne == 9 and systems.engFireDetectorUnits.vector[1].loopTwo != 9 and !systems.eng2Inop.getBoolValue() and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
eng2LoopAFault.active = 1;
} else {
ECAM_controller.warningReset(eng2LoopAFault);
}
if (eng2LoopBFault.clearFlag == 0 and systems.engFireDetectorUnits.vector[1].loopOne != 9 and systems.engFireDetectorUnits.vector[1].loopTwo == 9 and !systems.eng2Inop.getBoolValue() and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
eng2LoopBFault.active = 1;
} else {
ECAM_controller.warningReset(eng2LoopBFault);
}
if (apuFireDetFault.clearFlag == 0 and (systems.engFireDetectorUnits.vector[2].condition == 0 or (systems.engFireDetectorUnits.vector[2].loopOne == 9 and systems.engFireDetectorUnits.vector[2].loopTwo == 9 and systems.apuInop.getBoolValue())) and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
apuFireDetFault.active = 1;
} else {
ECAM_controller.warningReset(apuFireDetFault);
}
if (apuLoopAFault.clearFlag == 0 and systems.engFireDetectorUnits.vector[2].loopOne == 9 and systems.engFireDetectorUnits.vector[2].loopTwo != 9 and !systems.apuInop.getBoolValue() and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
apuLoopAFault.active = 1;
} else {
ECAM_controller.warningReset(apuLoopAFault);
}
if (apuLoopBFault.clearFlag == 0 and systems.engFireDetectorUnits.vector[2].loopOne != 9 and systems.engFireDetectorUnits.vector[2].loopTwo == 9 and !systems.apuInop.getBoolValue() and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
apuLoopBFault.active = 1;
} else {
ECAM_controller.warningReset(apuLoopBFault);
}
if (crgAftFireDetFault.clearFlag == 0 and (systems.cargoSmokeDetectorUnits.vector[0].condition == 0 or systems.cargoSmokeDetectorUnits.vector[1].condition == 0) and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
crgAftFireDetFault.active = 1;
} else {
ECAM_controller.warningReset(crgAftFireDetFault);
}
if (crgFwdFireDetFault.clearFlag == 0 and systems.cargoSmokeDetectorUnits.vector[2].condition == 0 and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
crgFwdFireDetFault.active = 1;
} else {
ECAM_controller.warningReset(crgFwdFireDetFault);
}
}
var messages_priority_2 = func {}
var messages_priority_1 = func {}
var messages_priority_0 = func {}
@ -318,7 +923,7 @@ var messages_right_memo = func {
ldg_inhibit.active = 0;
}
if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/systems/failures/cargo-aft-fire") == 1 or getprop("/systems/failures/cargo-fwd-fire") == 1) or (((getprop("/systems/hydraulic/green-psi") < 1500 and getprop("/engines/engine[0]/state") == 3) and (getprop("/systems/hydraulic/yellow-psi") < 1500 and getprop("/engines/engine[1]/state") == 3)) or ((getprop("/systems/hydraulic/green-psi") < 1500 or getprop("/systems/hydraulic/yellow-psi") < 1500) and getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") == 3) and phaseVar >= 3 and phaseVar <= 8)) {
if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/systems/fire/engine1/warning-active") == 1 or getprop("/systems/fire/engine2/warning-active") == 1 or getprop("/systems/fire/apu/warning-active") == 1 or getprop("/systems/failures/cargo-aft-fire") == 1 or getprop("/systems/failures/cargo-fwd-fire") == 1) or (((getprop("/systems/hydraulic/green-psi") < 1500 and getprop("/engines/engine[0]/state") == 3) and (getprop("/systems/hydraulic/yellow-psi") < 1500 and getprop("/engines/engine[1]/state") == 3)) or ((getprop("/systems/hydraulic/green-psi") < 1500 or getprop("/systems/hydraulic/yellow-psi") < 1500) and getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") == 3) and phaseVar >= 3 and phaseVar <= 8)) {
# todo: emer elec
land_asap_r.active = 1;
} else {
@ -492,7 +1097,7 @@ var messages_right_memo = func {
}
}
# Listener
# Listeners
setlistener("/controls/fctl/fac1", func() {
if (dualFail.active == 0) { return; }
@ -501,4 +1106,20 @@ setlistener("/controls/fctl/fac1", func() {
} else {
dualFailFACActive = 1;
}
}, 0, 0);
setlistener("/engines/engine[0]/state", func() {
if ((state1Node.getValue() != 3 and state2Node.getValue() != 3) and wowNode.getValue() == 0) {
dualFailNode.setBoolValue(1);
} else {
dualFailNode.setBoolValue(0);
}
}, 0, 0);
setlistener("/engines/engine[1]/state", func() {
if ((state1Node.getValue() != 3 and state2Node.getValue() != 3) and wowNode.getValue() == 0) {
dualFailNode.setBoolValue(1);
} else {
dualFailNode.setBoolValue(0);
}
}, 0, 0);

View file

@ -13,32 +13,95 @@ var warnings = std.Vector.new([
var flap_not_zero = warning.new(msg: "F/CTL FLAP LVR NOT ZERO", colour: "r", aural: 0, light: 0),
# DUAL ENG FAIL
var dualFail = warning.new(msg: "ENG DUAL FAILURE", colour: "r", aural: 0, light: 0),
var dualFailModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c", aural: 9, light: 9),
var dualFailLevers = warning.new(msg: " -THR LEVERS........IDLE", colour: "c", aural: 9, light: 9),
var dualFailRelightSPD = warning.new(msg: " OPTIMUM RELIGHT SPD.280", colour: "c", aural: 9, light: 9),
var dualFailRelightSPDCFM = warning.new(msg: " OPTIMUM RELIGHT SPD.300", colour: "c", aural: 9, light: 9),
var dualFailElec = warning.new(msg: " -EMER ELEC PWR...MAN ON", colour: "c", aural: 9, light: 9),
var dualFailRadio = warning.new(msg: " -VHF1/ATC1..........USE", colour: "c", aural: 9, light: 9),
var dualFailFAC = warning.new(msg: " -FAC 1......OFF THEN ON", colour: "c", aural: 9, light: 9),
var dualFailRelight = warning.new(msg: "•IF NO RELIGHT AFTER 30S", colour: "w", aural: 9, light: 9),
var dualFailMasters = warning.new(msg: " -ENG MASTERS.OFF 30S/ON", colour: "c", aural: 9, light: 9),
var dualFailSuccess = warning.new(msg: " •IF UNSUCCESSFUL : ", colour: "w", aural: 9, light: 9),
var dualFailAPU = warning.new(msg: " -APU (IF AVAIL)...START", colour: "c", aural: 9, light: 9),
var dualFailMastersAPU = warning.new(msg: " -ENG MASTERS.OFF 30S/ON", colour: "c", aural: 9, light: 9),
var dualFailSPDGD = warning.new(msg: " OPTIMUM SPEED.....G DOT", colour: "c", aural: 9, light: 9),
var dualFailAPPR = warning.new(msg: " •EARLY IN APPR : ", colour: "w", aural: 9, light: 9),
var dualFailcabin = warning.new(msg: " -CAB SECURE.......ORDER", colour: "c", aural: 9, light: 9),
var dualFailrudd = warning.new(msg: " -USE RUDDER WITH CARE ", colour: "c", aural: 9, light: 9),
var dualFailflap = warning.new(msg: " -FOR LDG.....USE FLAP 3", colour: "c", aural: 9, light: 9),
var dualFail5000 = warning.new(msg: " •AT 5000 FT AGL : ", colour: "w", aural: 9, light: 9),
var dualFailgear = warning.new(msg: " -L/G.........GRVTY EXTN", colour: "c", aural: 9, light: 9),
var dualFailfinalspeed = warning.new(msg: " TARGET SPEED.....150 KT", colour: "c", aural: 9, light: 9),
var dualFailtouch = warning.new(msg: " •AT TOUCH DOWN : ", colour: "w", aural: 9, light: 9),
var dualFailmasteroff = warning.new(msg: " -ENG MASTERS........OFF", colour: "c", aural: 9, light: 9),
var dualFailapuoff = warning.new(msg: " -APU MASTER SW......OFF", colour: "c", aural: 9, light: 9),
var dualFailevac = warning.new(msg: " -EVAC..........INITIATE", colour: "c", aural: 9, light: 9),
var dualFailbatt = warning.new(msg: " -BAT 1+2............OFF", colour: "c", aural: 9, light: 9),
var dualFail = warning.new(msg: "ENG DUAL FAILURE", colour: "r", aural: 0, light: 0, hasSubmsg: 1),
var dualFailModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"),
var dualFailLevers = warning.new(msg: " -THR LEVERS........IDLE", colour: "c"),
var dualFailRelightSPD = warning.new(msg: " OPTIMUM RELIGHT SPD.280", colour: "c"),
var dualFailRelightSPDCFM = warning.new(msg: " OPTIMUM RELIGHT SPD.300", colour: "c"),
var dualFailElec = warning.new(msg: " -EMER ELEC PWR...MAN ON", colour: "c"),
var dualFailRadio = warning.new(msg: " -VHF1/ATC1..........USE", colour: "c"),
var dualFailFAC = warning.new(msg: " -FAC 1......OFF THEN ON", colour: "c"),
var dualFailRelight = warning.new(msg: "•IF NO RELIGHT AFTER 30S", colour: "w", hasSubmsg: 1),
var dualFailMasters = warning.new(msg: " -ENG MASTERS.OFF 30S/ON", colour: "c"),
var dualFailSuccess = warning.new(msg: " •IF UNSUCCESSFUL : ", colour: "w", hasSubmsg: 1),
var dualFailAPU = warning.new(msg: " -APU (IF AVAIL)...START", colour: "c"),
var dualFailAPUwing = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"),
var dualFailAPUbleed = warning.new(msg: " -APU BLEED...........ON", colour: "c"),
var dualFailMastersAPU = warning.new(msg: " -ENG MASTERS.OFF 30S/ON", colour: "c"),
var dualFailSPDGD = warning.new(msg: " OPTIMUM SPEED.....G DOT", colour: "c"),
var dualFailAPPR = warning.new(msg: " •EARLY IN APPR : ", colour: "w", hasSubmsg: 1),
var dualFailcabin = warning.new(msg: " -CAB SECURE.......ORDER", colour: "c"),
var dualFailrudd = warning.new(msg: " -USE RUDDER WITH CARE ", colour: "c"),
var dualFailflap = warning.new(msg: " -FOR LDG.....USE FLAP 3", colour: "c"),
var dualFail5000 = warning.new(msg: " •AT 5000 FT AGL : ", colour: "w", hasSubmsg: 1),
var dualFailgear = warning.new(msg: " -L/G.........GRVTY EXTN", colour: "c"),
var dualFailfinalspeed = warning.new(msg: " TARGET SPEED.....150 KT", colour: "c"),
var dualFailtouch = warning.new(msg: " •AT TOUCH DOWN : ", colour: "w", hasSubmsg: 1),
var dualFailmasteroff = warning.new(msg: " -ENG MASTERS........OFF", colour: "c"),
var dualFailapuoff = warning.new(msg: " -APU MASTER SW......OFF", colour: "c"),
var dualFailevac = warning.new(msg: " -EVAC..........INITIATE", colour: "c"),
var dualFailbatt = warning.new(msg: " -BAT 1+2............OFF", colour: "c"),
# ENG 1 FIRE (flight)
var eng1Fire = warning.new(msg: "ENG 1 FIRE", colour: "r", aural: 0, light: 0, hasSubmsg: 1),
var eng1FireFllever = warning.new(msg: " -THR LEVER 1.......IDLE", colour: "c"),
var eng1FireFlmaster = warning.new(msg: " -ENG MASTER 1.......OFF", colour: "c"),
var eng1FireFlPB = warning.new(msg: " -ENG 1 FIRE P/B....PUSH", colour: "c"),
var eng1FireFlAgent1Timer = warning.new(msg: " -AGENT 1 AFT 10 S.DISCH", colour: "w"),
var eng1FireFlAgent1 = warning.new(msg: " -AGENT 1..........DISCH", colour: "c"),
var eng1FireFlATC = warning.new(msg: " -ATC.............NOTIFY", colour: "c"),
var eng1FireFl30Sec = warning.new(msg: " •IF FIRE AFTER 30 S:", colour: "w", hasSubmsg: 1),
var eng1FireFlAgent2 = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"),
# ENG 1 FIRE (ground)
var eng1FireGnlever = warning.new(msg: " -THR LEVERS........IDLE", colour: "c"),
var eng1FireGnstopped = warning.new(msg: " •WHEN A/C IS STOPPED:", colour: "w", hasSubmsg: 1),
var eng1FireGnparkbrk = warning.new(msg: " -PARKING BRK.........ON", colour: "c"),
var eng1FireGnmaster = warning.new(msg: " -ENG MASTER 1.......OFF", colour: "c"),
var eng1FireGnPB = warning.new(msg: " -ENG 1 FIRE P/B....PUSH", colour: "c"),
var eng1FireGnAgent1 = warning.new(msg: " -AGENT 1..........DISCH", colour: "c"),
var eng1FireGnAgent2 = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"),
var eng1FireGnmaster2 = warning.new(msg: " -ENG MASTER 2.......OFF", colour: "c"),
var eng1FireGnATC = warning.new(msg: " -ATC.............NOTIFY", colour: "c"),
var eng1FireGncrew = warning.new(msg: " -CABIN CREW.......ALERT", colour: "c"),
var eng1FireGnevac = warning.new(msg: " •IF EVAC RQRD:", colour: "w", hasSubmsg: 1),
var eng1FireGnevacSw = warning.new(msg: " -EVAC COMMAND........ON", colour: "c"),
var eng1FireGnevacApu = warning.new(msg: " -APU MASTER SW......OFF", colour: "c"),
var eng1FireGnevacBat = warning.new(msg: " -BAT 1+2............OFF", colour: "c"),
# ENG 2 FIRE (flight)
var eng2Fire = warning.new(msg: "ENG 2 FIRE", colour: "r", aural: 0, light: 0, hasSubmsg: 1),
var eng2FireFllever = warning.new(msg: " -THR LEVER 2.......IDLE", colour: "c"),
var eng2FireFlmaster = warning.new(msg: " -ENG MASTER 2.......OFF", colour: "c"),
var eng2FireFlPB = warning.new(msg: " -ENG 2 FIRE P/B....PUSH", colour: "c"),
var eng2FireFlAgent1Timer = warning.new(msg: " -AGENT 1 AFT 10 S.DISCH", colour: "w"),
var eng2FireFlAgent1 = warning.new(msg: " -AGENT 1..........DISCH", colour: "c"),
var eng2FireFlATC = warning.new(msg: " -ATC.............NOTIFY", colour: "c"),
var eng2FireFl30Sec = warning.new(msg: " •IF FIRE AFTER 30 S:", colour: "w", hasSubmsg: 1),
var eng2FireFlAgent2 = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"),
# ENG 2 FIRE (ground)
var eng2FireGnlever = warning.new(msg: " -THR LEVERS........IDLE", colour: "c"),
var eng2FireGnstopped = warning.new(msg: " •WHEN A/C IS STOPPED:", colour: "w", hasSubmsg: 1),
var eng2FireGnparkbrk = warning.new(msg: " -PARKING BRK.........ON", colour: "c"),
var eng2FireGnmaster = warning.new(msg: " -ENG MASTER 2.......OFF", colour: "c"),
var eng2FireGnPB = warning.new(msg: " -ENG 2 FIRE P/B....PUSH", colour: "c"),
var eng2FireGnAgent1 = warning.new(msg: " -AGENT 1..........DISCH", colour: "c"),
var eng2FireGnAgent2 = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"),
var eng2FireGnmaster2 = warning.new(msg: " -ENG MASTER 1.......OFF", colour: "c"),
var eng2FireGnATC = warning.new(msg: " -ATC.............NOTIFY", colour: "c"),
var eng2FireGncrew = warning.new(msg: " -CABIN CREW.......ALERT", colour: "c"),
var eng2FireGnevac = warning.new(msg: " •IF EVAC RQRD:", colour: "w", hasSubmsg: 1),
var eng2FireGnevacSw = warning.new(msg: " -EVAC COMMAND........ON", colour: "c"),
var eng2FireGnevacApu = warning.new(msg: " -APU MASTER SW......OFF", colour: "c"),
var eng2FireGnevacBat = warning.new(msg: " -BAT 1+2............OFF", colour: "c"),
# APU FIRE
var apuFire = warning.new(msg: "APU FIRE ", colour: "r", aural: 0, light: 0, hasSubmsg: 1, sdPage: "apu"),
var apuFirePB = warning.new(msg: " -APU FIRE P/B......PUSH", colour: "c"),
var apuFireAgentTimer = warning.new(msg: " -AGENT AFT 10 S...DISCH", colour: "c"),
var apuFireAgent = warning.new(msg: " -AGENT............DISCH", colour: "c"),
var apuFireMaster = warning.new(msg: " -MASTER SW..........OFF", colour: "c"),
# Config
var slats_config = warning.new(msg: "CONFIG", colour: "r", aural: 0, light: 0),
@ -54,28 +117,51 @@ var warnings = std.Vector.new([
var park_brk_config = warning.new(msg: "CONFIG PARK BRK ON", colour: "r", aural: 0, light: 0),
# Autopilot
var ap_offw = warning.new(msg: "AUTO FLT AP OFF", colour: "r", aural: 9, light: 0),
var ap_offw = warning.new(msg: "AUTO FLT AP OFF", colour: "r", light: 0),
var athr_offw = warning.new(msg: "AUTO FLT A/THR OFF", colour: "a", aural: 1, light: 1),
var athr_offw_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c", aural: 9, light: 9),
var athr_offw_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c"),
var athr_lock = warning.new(msg: "ENG THRUST LOCKED", colour: "a", aural: 1, light: 1),
var athr_lock_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c", aural: 9, light: 9),
var athr_lock_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c"),
var athr_lim = warning.new(msg: "AUTO FLT A/THR LIMITED", colour: "a", aural: 1, light: 1),
var athr_lim_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c", aural: 9, light: 9)
var athr_lim_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c"),
# Cargo smoke
var cargoSmokeFwd = warning.new(msg: "SMOKE FWD CARGO SMOKE", colour: "r", aural: 0, light: 0, hasSubmsg: 1),
var cargoSmokeFwdAgent = warning.new(msg: "-AGENT............DISCH", colour: "c"),
var cargoSmokeAft = warning.new(msg: "SMOKE AFT CARGO SMOKE", colour: "r", aural: 0, light: 0, hasSubmsg: 1),
var cargoSmokeAftAgent = warning.new(msg: "-AGENT............DISCH", colour: "c"),
# APU shutdown
var apuEmerShutdown = warning.new(msg: "APU EMER SHUT DOWN", colour: "a", aural: 1, light: 1, hasSubmsg: 1),
var apuEmerShutdownMast = warning.new(msg: " -MASTER SW..........OFF", colour: "c"),
# FIRE det fault
var eng1FireDetFault = warning.new(msg: "ENG 1 FIRE DET FAULT", colour: "a", aural: 1, light: 1),
var eng1LoopAFault = warning.new(msg: "ENG 1 FIRE LOOP A FAULT", colour: "a"),
var eng1LoopBFault = warning.new(msg: "ENG 1 FIRE LOOP B FAULT", colour: "a"),
var eng2FireDetFault = warning.new(msg: "ENG 2 FIRE DET FAULT", colour: "a", aural: 1, light: 1),
var eng2LoopAFault = warning.new(msg: "ENG 2 FIRE LOOP A FAULT", colour: "a"),
var eng2LoopBFault = warning.new(msg: "ENG 2 FIRE LOOP B FAULT", colour: "a"),
var apuFireDetFault = warning.new(msg: "APU FIRE DET FAULT", colour: "a", aural: 1, light: 1),
var apuLoopAFault = warning.new(msg: "APU FIRE LOOP A FAULT", colour: "a"),
var apuLoopBFault = warning.new(msg: "APU FIRE LOOP B FAULT", colour: "a"),
var crgFwdFireDetFault = warning.new(msg: "FWD CRG DET FAULT", colour: "a"),
var crgAftFireDetFault = warning.new(msg: "AFT CRG DET FAULT", colour: "a"),
]);
var leftmemos = std.Vector.new([
var company_alert = warning.new(msg: "COMPANY ALERT", colour: "g", aural: 9, light: 9), # Not yet implemented, buzzer sound
var refuelg = warning.new(msg: "REFUELG", colour: "g", aural: 9, light: 9),
var irs_in_align = warning.new(msg: "IRS IN ALIGN", colour: "g", aural: 9, light: 9), # Not yet implemented
var gnd_splrs = warning.new(msg: "GND SPLRS ARMED", colour: "g", aural: 9, light: 9),
var seatbelts = warning.new(msg: "SEAT BELTS", colour: "g", aural: 9, light: 9),
var nosmoke = warning.new(msg: "NO SMOKING", colour: "g", aural: 9, light: 9),
var strobe_lt_off = warning.new(msg: "STROBE LT OFF", colour: "g", aural: 9, light: 9),
var outr_tk_fuel_xfrd = warning.new(msg: "OUTR TK FUEL XFRD", colour: "g", aural: 9, light: 9), # Not yet implemented
var fob_3T = warning.new(msg: "FOB BELOW 3T", colour: "g", aural: 9, light: 9),
var gpws_flap_mode_off = warning.new(msg: "GPWS FLAP MODE OFF", colour: "g", aural: 9, light: 9),
var atc_datalink_stby = warning.new(msg: "ATC DATALINK STBY", colour: "g", aural: 9, light: 9), # Not yet implemented
var company_datalink_stby = warning.new(msg: "COMPANY DATALINK STBY", colour: "g", aural: 9, light: 9) # Not yet implemented
var company_alert = warning.new(msg: "COMPANY ALERT" ), # Not yet implemented, buzzer sound
var refuelg = warning.new(msg: "REFUELG" ),
var irs_in_align = warning.new(msg: "IRS IN ALIGN" ), # Not yet implemented
var gnd_splrs = warning.new(msg: "GND SPLRS ARMED" ),
var seatbelts = warning.new(msg: "SEAT BELTS" ),
var nosmoke = warning.new(msg: "NO SMOKING" ),
var strobe_lt_off = warning.new(msg: "STROBE LT OFF" ),
var outr_tk_fuel_xfrd = warning.new(msg: "OUTR TK FUEL XFRD" ), # Not yet implemented
var fob_3T = warning.new(msg: "FOB BELOW 3T" ),
var gpws_flap_mode_off = warning.new(msg: "GPWS FLAP MODE OFF" ),
var atc_datalink_stby = warning.new(msg: "ATC DATALINK STBY" ), # Not yet implemented
var company_datalink_stby = warning.new(msg: "COMPANY DATALINK STBY") # Not yet implemented
]);
# Right E/WD
@ -103,45 +189,45 @@ var secondaryFailures = std.Vector.new([
]);
var memos = std.Vector.new([
var spd_brk = memo.new(msg: "SPEED BRK", colour: "g"),
var park_brk = memo.new(msg: "PARK BRK", colour: "g"),
var ptu = memo.new(msg: "HYD PTU", colour: "g"),
var rat = memo.new(msg: "RAT OUT", colour: "g"),
var emer_gen = memo.new(msg: "EMER GEN", colour: "g"),
var ram_air = memo.new(msg: "RAM AIR ON", colour: "g"),
var nw_strg_disc = memo.new(msg: "NW STRG DISC", colour: "g"),
var ignition = memo.new(msg: "IGNITION", colour: "g"),
var cabin_ready = memo.new(msg: "CABIN READY", colour: "g"), # Not yet implemented
var pred_ws_off = memo.new(msg: "PRED W/S OFF", colour: "g"), # Not yet implemented
var terr_stby = memo.new(msg: "TERR STBY", colour: "g"), # Not yet implemented
var tcas_stby = memo.new(msg: "TCAS STBY", colour: "g"), # Not yet implemented
var acars_call = memo.new(msg: "ACARS CALL", colour: "g"), # Not yet implemented
var company_call = memo.new(msg: "COMPANY CALL", colour: "g"), # Not yet implemented
var satcom_alert = memo.new(msg: "SATCOM ALERT", colour: "g"), # Not yet implemented
var acars_msg = memo.new(msg: "ACARS MSG", colour: "g"), # Not yet implemented
var company_msg = memo.new(msg: "COMPANY MSG", colour: "g"), # Not yet implemented
var eng_aice = memo.new(msg: "ENG A.ICE", colour: "g"),
var wing_aice = memo.new(msg: "WING A.ICE", colour: "g"),
var ice_not_det = memo.new(msg: "ICE NOT DET", colour: "g"), # Not yet implemented
var hi_alt = memo.new(msg: "HI ALT", colour: "g"), # Not yet implemented
var apu_avail = memo.new(msg: "APU AVAIL", colour: "g"),
var apu_bleed = memo.new(msg: "APU BLEED", colour: "g"),
var ldg_lt = memo.new(msg: "LDG LT", colour: "g"),
var brk_fan = memo.new(msg: "BRK FAN", colour: "g"), # Not yet implemented
var audio3_xfrd = memo.new(msg: "AUDIO 3 XFRD", colour: "g"), # Not yet implemented
var switchg_pnl = memo.new(msg: "SWITCHG PNL", colour: "g"), # Not yet implemented
var gpws_flap3 = memo.new(msg: "GPWS FLAP 3", colour: "g"),
var hf_data_ovrd = memo.new(msg: "HF DATA OVRD", colour: "g"), # Not yet implemented
var hf_voice = memo.new(msg: "HF VOICE", colour: "g"), # Not yet implemented
var acars_stby = memo.new(msg: "ACARS STBY", colour: "g"), # Not yet implemented
var vhf3_voice = memo.new(msg: "VHF3 VOICE", colour: "g"),
var auto_brk_lo = memo.new(msg: "AUTO BRK LO", colour: "g"),
var auto_brk_med = memo.new(msg: "AUTO BRK MED", colour: "g"),
var auto_brk_max = memo.new(msg: "AUTO BRK MAX", colour: "g"),
var auto_brk_off = memo.new(msg: "AUTO BRK OFF", colour: "g"), # Not yet implemented
var man_ldg_elev = memo.new(msg: "MAN LDG ELEV", colour: "g"), # Not yet implemented
var ctr_tk_feedg = memo.new(msg: "CTR TK FEEDG", colour: "g"),
var fuelx = memo.new(msg: "FUEL X FEED", colour: "g")
var spd_brk = memo.new(msg: "SPEED BRK" ),
var park_brk = memo.new(msg: "PARK BRK" ),
var ptu = memo.new(msg: "HYD PTU" ),
var rat = memo.new(msg: "RAT OUT" ),
var emer_gen = memo.new(msg: "EMER GEN" ),
var ram_air = memo.new(msg: "RAM AIR ON" ),
var nw_strg_disc = memo.new(msg: "NW STRG DISC"),
var ignition = memo.new(msg: "IGNITION" ),
var cabin_ready = memo.new(msg: "CABIN READY" ), # Not yet implemented
var pred_ws_off = memo.new(msg: "PRED W/S OFF"), # Not yet implemented
var terr_stby = memo.new(msg: "TERR STBY" ), # Not yet implemented
var tcas_stby = memo.new(msg: "TCAS STBY" ), # Not yet implemented
var acars_call = memo.new(msg: "ACARS CALL" ), # Not yet implemented
var company_call = memo.new(msg: "COMPANY CALL"), # Not yet implemented
var satcom_alert = memo.new(msg: "SATCOM ALERT"), # Not yet implemented
var acars_msg = memo.new(msg: "ACARS MSG" ), # Not yet implemented
var company_msg = memo.new(msg: "COMPANY MSG" ), # Not yet implemented
var eng_aice = memo.new(msg: "ENG A.ICE" ),
var wing_aice = memo.new(msg: "WING A.ICE" ),
var ice_not_det = memo.new(msg: "ICE NOT DET" ), # Not yet implemented
var hi_alt = memo.new(msg: "HI ALT" ), # Not yet implemented
var apu_avail = memo.new(msg: "APU AVAIL" ),
var apu_bleed = memo.new(msg: "APU BLEED" ),
var ldg_lt = memo.new(msg: "LDG LT" ),
var brk_fan = memo.new(msg: "BRK FAN" ), # Not yet implemented
var audio3_xfrd = memo.new(msg: "AUDIO 3 XFRD"), # Not yet implemented
var switchg_pnl = memo.new(msg: "SWITCHG PNL" ), # Not yet implemented
var gpws_flap3 = memo.new(msg: "GPWS FLAP 3" ),
var hf_data_ovrd = memo.new(msg: "HF DATA OVRD"), # Not yet implemented
var hf_voice = memo.new(msg: "HF VOICE" ), # Not yet implemented
var acars_stby = memo.new(msg: "ACARS STBY" ), # Not yet implemented
var vhf3_voice = memo.new(msg: "VHF3 VOICE" ),
var auto_brk_lo = memo.new(msg: "AUTO BRK LO" ),
var auto_brk_med = memo.new(msg: "AUTO BRK MED"),
var auto_brk_max = memo.new(msg: "AUTO BRK MAX"),
var auto_brk_off = memo.new(msg: "AUTO BRK OFF"), # Not yet implemented
var man_ldg_elev = memo.new(msg: "MAN LDG ELEV"), # Not yet implemented
var ctr_tk_feedg = memo.new(msg: "CTR TK FEEDG"),
var fuelx = memo.new(msg: "FUEL X FEED" )
]);
var clearWarnings = std.Vector.new();
@ -278,4 +364,7 @@ var statusProc = std.Vector.new();
var statusInfo = std.Vector.new();
var statusCancelled = std.Vector.new();
var statusInop = std.Vector.new();
var statusMaintenance = std.Vector.new();
var statusMaintenance = std.Vector.new();
# hack thrust lock message:
var msgSave = athr_lock.msg;

View file

@ -180,6 +180,7 @@ var Custom = {
athrOff: props.globals.initNode("/it-autoflight/sound/athrsound", 0, "BOOL"),
enableAthrOff: 0,
},
ThrLock: props.globals.getNode("/systems/thrust/thr-locked", 1)
};
var ITAF = {
@ -492,6 +493,7 @@ var ITAF = {
if (s == 1) {
if (Misc.acEss.getValue() >= 110) {
Output.athr.setBoolValue(1);
Custom.ThrLock.setValue(0);
Custom.Sound.enableAthrOff = 1;
Custom.Sound.athrOff.setBoolValue(0);
}

View file

@ -638,20 +638,98 @@ var lockThr = func() {
state1 = getprop("/systems/thrust/state1");
state2 = getprop("/systems/thrust/state2");
if ((state1 == "CL" and state2 == "CL" and getprop("/systems/thrust/eng-out") == 0) or (state1 == "MCT" and state2 == "MCT" and getprop("/systems/thrust/eng-out") == 1)) {
setprop("/systems/thrust/thr-lock-time", getprop("/sim/time/elapsed-sec"));
setprop("/systems/thrust/thr-locked", 1);
lockTimer.start();
}
lockTimer.start();
}
var checkLockThr = func() {
if (getprop("/systems/thrust/thr-lock-time") + 5 > getprop("/sim/time/elapsed-sec")) { return; }
if (fmgc.Output.athr.getBoolValue()) {
lockTimer.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
return;
}
if (getprop("/systems/thrust/thr-locked") == 0) {
lockTimer.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
return;
}
state1 = getprop("/systems/thrust/state1");
state2 = getprop("/systems/thrust/state2");
if ((state1 != "CL" and state2 != "CL" and getprop("/systems/thrust/eng-out") == 0) or (state1 != "MCT" and state2 != "MCT" and getprop("/systems/thrust/eng-out") == 1)) {
setprop("/systems/thrust/thr-locked", 0);
lockTimer.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
} elsif ((state1 == "CL" and state2 == "CL" and getprop("/systems/thrust/eng-out") == 0) or (state1 == "MCT" and state2 == "MCT" and getprop("/systems/thrust/eng-out") == 1)) {
setprop("/systems/thrust/thr-locked-alert", 1);
setprop("/systems/thrust/thr-lock-time", getprop("/sim/time/elapsed-sec"));
setprop("/systems/thrust/thr-locked-flash", 1);
lockTimer.stop();
lockTimer2.start();
}
}
var checkLockThr2 = func() {
if (fmgc.Output.athr.getBoolValue()) {
lockTimer2.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
return;
}
if (getprop("/systems/thrust/thr-locked") == 0) {
lockTimer2.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
return;
}
if (getprop("/systems/thrust/thr-lock-time") + 5 < getprop("/sim/time/elapsed-sec")) {
setprop("/systems/thrust/thr-locked-flash", 0);
settimer(func() {
setprop("/systems/thrust/thr-locked-flash", 1);
setprop("/systems/thrust/thr-lock-time", getprop("/sim/time/elapsed-sec"));
ecam.athr_lock.noRepeat = 0;
ecam.athr_lock.noRepeat2 = 0;
}, 0.2);
}
state1 = getprop("/systems/thrust/state1");
state2 = getprop("/systems/thrust/state2");
if ((state1 != "CL" and state2 != "CL" and getprop("/systems/thrust/eng-out") == 0) or (state1 != "MCT" and state2 != "MCT" and getprop("/systems/thrust/eng-out") == 1)) {
lockTimer2.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
}
}
var lockTimer = maketimer(0.02, checkLockThr);
setlistener("/controls/APU/master", func() {
if (!getprop("/controls/APU/master") and systems.apuEmerShutdown.getBoolValue()) {
systems.apuEmerShutdown.setBoolValue(0);
}
}, 0, 0);
var lockTimer = maketimer(0.1, checkLockThr);
var lockTimer2 = maketimer(0.1, checkLockThr2);

View file

@ -52,6 +52,9 @@ setprop("/systems/thrust/lim-flex", 0);
setprop("/engines/flex-derate", 0);
setprop("/systems/thrust/eng-out", 0);
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-lock-cmd[0]", 0);
setprop("/systems/thrust/thr-lock-cmd[1]", 0);

View file

@ -3,205 +3,818 @@
# Copyright (c) 2019 Joshua Davidson (Octal450)
#############
# Init Vars #
#############
var level = 0;
var fwdsquib = 0;
var aftsquib = 0;
var fwddet = 0;
var aftdet = 0;
var test = 0;
var guard1 = 0;
var guard2 = 0;
var dischpb1 = 0;
var dischpb2 = 0;
var smokedet1 = 0;
var smokedet2 = 0;
var bottleIsEmpty = 0;
var WeCanExt = 0;
var test2 = 0;
var state = 0;
var dc1 = 0;
var dc2 = 0;
var dcbat = 0;
var pause = 0;
var elapsedTime = props.globals.getNode("/sim/time/elapsed-sec");
var apuTestBtn = props.globals.getNode("/controls/fire/apu-test-btn", 1);
var testBtn = props.globals.getNode("/controls/fire/test-btn-1", 1);
var testBtn2 = props.globals.getNode("/controls/fire/test-btn-2", 1);
var dischTest = props.globals.initNode("/systems/fire/cargo/disch-test", 0, "BOOL");
var cargoTestBtn = props.globals.initNode("/controls/fire/cargo/test", 0, "BOOL");
var cargoTestTime = props.globals.initNode("/controls/fire/cargo/test-time", 0, "DOUBLE");
var cargoTestTime2 = props.globals.initNode("/controls/fire/cargo/test-time2", 0, "DOUBLE");
var cargoTestTime3 = props.globals.initNode("/controls/fire/cargo/test-time3", 0, "DOUBLE");
var cargoTestTime4 = props.globals.initNode("/controls/fire/cargo/test-time4", 0, "DOUBLE");
var cargoTestBtnOff = props.globals.initNode("/controls/fire/cargo/test-off", 0, "BOOL");
var eng1FireWarn = props.globals.initNode("/systems/fire/engine1/warning-active", 0, "BOOL");
var eng2FireWarn = props.globals.initNode("/systems/fire/engine2/warning-active", 0, "BOOL");
var apuFireWarn = props.globals.initNode("/systems/fire/apu/warning-active", 0, "BOOL");
var eng1Inop = props.globals.initNode("/systems/fire/engine1/det-inop", 0, "BOOL");
var eng2Inop = props.globals.initNode("/systems/fire/engine2/det-inop", 0, "BOOL");
var apuInop = props.globals.initNode("/systems/fire/apu/det-inop", 0, "BOOL");
var aftCargoFireWarn = props.globals.initNode("/systems/fire/cargo/aft/warning-active", 0, "BOOL");
var fwdCargoFireWarn = props.globals.initNode("/systems/fire/cargo/fwd/warning-active", 0, "BOOL");
var apuEmerShutdown = props.globals.getNode("/systems/apu/emer-shutdown", 1);
var eng1AgentTimer = props.globals.initNode("/systems/fire/engine1/agent1-timer", 99, "INT");
var eng2AgentTimer = props.globals.initNode("/systems/fire/engine2/agent1-timer", 99, "INT");
var eng1Agent2Timer = props.globals.initNode("/systems/fire/engine1/agent2-timer", 99, "INT");
var eng2Agent2Timer = props.globals.initNode("/systems/fire/engine2/agent2-timer", 99, "INT");
var apuAgentTimer = props.globals.initNode("/systems/fire/apu/agent-timer", 99, "INT");
var eng1AgentTimerTime = props.globals.initNode("/systems/fire/engine1/agent1-timer-time", 0, "INT");
var eng2AgentTimerTime = props.globals.initNode("/systems/fire/engine2/agent1-timer-time", 0, "INT");
var eng1Agent2TimerTime = props.globals.initNode("/systems/fire/engine1/agent2-timer-time", 0, "INT");
var eng2Agent2TimerTime = props.globals.initNode("/systems/fire/engine2/agent2-timer-time", 0, "INT");
var apuAgentTimerTime = props.globals.initNode("/systems/fire/apu/agent-timer-time", 0, "INT");
var wow = props.globals.getNode("/fdm/jsbsim/position/wow", 1);
var dcbatNode = props.globals.getNode("systems/electrical/bus/dcbat", 1);
var dcessNode = props.globals.getNode("systems/electrical/bus/dc-ess", 1);
var apuBleedNode = props.globals.getNode("/systems/apu/bleed-used", 1);
var apuMaster = props.globals.getNode("/controls/APU/master", 1);
var fire_init = func {
setprop("/controls/OH/protectors/fwddisch", 0);
setprop("/controls/OH/protectors/aftdisch", 0);
setprop("/controls/fire/cargo/fwddisch", 0);
setprop("/controls/fire/cargo/aftdisch", 0);
setprop("/systems/failures/cargo-fwd-fire", 0);
setprop("/systems/failures/cargo-aft-fire", 0);
setprop("/systems/fire/cargo/fwdsquib", 0);
setprop("/systems/fire/cargo/aftsquib", 0);
setprop("/systems/fire/cargo/bottlelevel", 100);
setprop("/systems/fire/cargo/test", 0);
setprop("/controls/fire/cargo/test", 0);
setprop("/controls/fire/cargo/fwddisch", 0); # pushbutton
setprop("/controls/fire/cargo/aftdisch", 0);
setprop("/controls/fire/cargo/fwddischLight", 0);
setprop("/controls/fire/cargo/aftdischLight", 0);
setprop("/controls/fire/cargo/fwdsmokeLight", 0);
setprop("/controls/fire/cargo/aftsmokeLight", 0);
setprop("/controls/fire/cargo/bottleempty", 0);
# status: 1 is ready, 0 is already disch
setprop("/controls/fire/cargo/status", 1);
setprop("/controls/fire/cargo/warnfwd", 0);
setprop("/controls/fire/cargo/warnaft", 0);
setprop("/controls/fire/cargo/squib1fault", 0);
setprop("/controls/fire/cargo/squib2fault", 0);
setprop("/controls/fire/cargo/detfault", 0);
setprop("/controls/fire/cargo/test/state", 0);
fire_timer.start();
}
##############
# Main Loops #
##############
var master_fire = func {
level = getprop("/systems/fire/cargo/bottlelevel");
fwdsquib = getprop("/systems/fire/cargo/fwdsquib");
aftsquib = getprop("/systems/fire/cargo/aftsquib");
fwddet = getprop("/systems/failures/cargo-fwd-fire");
aftdet = getprop("/systems/failures/cargo-aft-fire");
test = getprop("/controls/fire/cargo/test");
guard1 = getprop("/controls/fire/cargo/fwdguard");
guard2 = getprop("/controls/fire/cargo/aftguard");
dischpb1 = getprop("/controls/fire/cargo/fwddisch");
dischpb2 = getprop("/controls/fire/cargo/aftdisch");
smokedet1 = getprop("/controls/fire/cargo/fwdsmokeLight");
smokedet2 = getprop("/controls/fire/cargo/aftsmokeLight");
bottleIsEmpty = getprop("/controls/fire/cargo/bottleempty");
WeCanExt = getprop("/controls/fire/cargo/status");
test2 = getprop("/systems/fire/cargo/test");
state = getprop("/controls/fire/cargo/test/state");
dc1 = getprop("/systems/electrical/bus/dc1");
dc2 = getprop("/systems/electrical/bus/dc2");
dcbat = getprop("/systems/electrical/bus/dcbat");
pause = getprop("/sim/freeze/master");
###################
# Fire System #
###################
var engFireDetectorUnit = {
sys: 0,
active: 0,
loopOne: 0,
loopTwo: 0,
condition: 100,
fireProp: "",
wow: "",
new: func(sys, fireProp, testProp) {
var eF = {parents:[engFireDetectorUnit]};
eF.sys = sys;
eF.active = 0;
eF.loopOne = 0;
eF.loopTwo = 0;
eF.fireProp = props.globals.getNode(fireProp, 1);
eF.testProp = props.globals.getNode(testProp, 1);
eF.wow = props.globals.getNode("/fdm/jsbsim/position/wow", 1);
eF.condition = 100;
return eF;
},
update: func() {
if (me.condition == 0) { return; }
foreach(var detector; engDetectorLoops.vector) {
detector.updateTemp(detector.sys, detector.type);
}
if (me.fireProp.getValue() == 0 and me.testProp.getValue() == 0 and (me.loopOne != 9 and me.loopOne != 8) and (me.loopTwo != 9 and me.loopTwo != 8)) {
me.loopOne = 0;
me.loopTwo = 0;
me.reset(me.sys);
return;
}
if ((me.loopOne == 1 and me.loopTwo == 1) or ((me.loopOne == 9 or me.loopOne == 8) and me.loopTwo == 1) or (me.loopOne == 1 and (me.loopTwo == 9 or me.loopTwo == 8))) {
me.TriggerWarning(me.sys);
}
},
receiveSignal: func(type) {
if (type == 1 and me.loopOne != 9 and me.loopOne != 8 and me.condition != 0) {
me.loopOne = 1;
} elsif (type == 2 and me.loopTwo != 9 and me.loopTwo != 8 and me.condition != 0) {
me.loopTwo = 1;
}
},
failUnit: func() {
me.condition = 0;
},
recoverUnit: func() {
me.condition = 100;
},
fail: func(loop) {
if (loop != 1 and loop != 2) { return; }
if (loop == 1) { me.loopOne = 9; }
else { me.loopTwo = 9; }
me.startFailTimer(loop);
},
restore: func(loop) {
if (loop != 1 and loop != 2) { return; }
if (loop == 1) { me.loopOne = 0; }
else { me.loopTwo = 0; }
if (me.sys == 0) {
eng1Inop.setBoolValue(0);
checkTwoInop1Timer.stop();
} elsif (me.sys == 1) {
eng2Inop.setBoolValue(0);
checkTwoInop2Timer.stop();
} elsif (me.sys == 2) {
apuInop.setBoolValue(0);
checkTwoInop3Timer.stop();
}
},
noElec: func(loop) {
if (loop != 1 and loop != 2) { return; }
###############
# Discharging #
###############
if (dischpb1) {
if (WeCanExt == 1 and !fwdsquib and !bottleIsEmpty and (dc1 > 0 or dc2 > 0 or dcbat > 0)) {
setprop("/systems/fire/cargo/fwdsquib", 1);
if (loop == 1) { me.loopOne = 8; }
else { me.loopTwo = 8; }
},
restoreElec: func(loop) {
if (loop != 1 and loop != 2) { return; }
if (loop == 1 and me.loopOne != 9) { me.loopOne = 0; }
elsif (loop == 2 and me.loopTwo != 9) { me.loopTwo = 0; }
},
startFailTimer: func(loop) {
if (loop == 1 and me.loopTwo == 9) { return; }
if (loop == 2 and me.loopOne == 9) { return; }
if (me.sys != 2) {
if (loop == 1) {
propsNasFireTime.vector[me.sys].setValue(elapsedTime.getValue());
} elsif (loop == 2) {
propsNasFireTime.vector[me.sys + 1].setValue(elapsedTime.getValue());
}
if (me.sys == 0) {
if (!fireTimer1.isRunning) {
fireTimer1.start();
}
} elsif (me.sys == 1) {
if (!fireTimer2.isRunning) {
fireTimer2.start();
}
}
} else {
if (loop == 1) {
propsNasFireTime.vector[4].setValue(elapsedTime.getValue());
} elsif (loop == 2) {
propsNasFireTime.vector[5].setValue(elapsedTime.getValue());
}
if (!fireTimer3.isRunning) {
fireTimer3.start();
}
}
},
TriggerWarning: func(system) {
if (system == 0) {
eng1FireWarn.setBoolValue(1);
} elsif (system == 1) {
eng2FireWarn.setBoolValue(1);
} elsif (system == 2) {
apuFireWarn.setBoolValue(1);
if (me.wow.getValue() == 1) {
if (apuMaster.getBoolValue()) {
apuBleedNode.setValue(0);
systems.apu_stop();
apuEmerShutdown.setBoolValue(1);
settimer(func() { # 3 sec delay - source TTM ATA 26 FIRE PROTECTION p102
extinguisherBottles.vector[4].discharge();
}, 3);
} else {
settimer(func() {
extinguisherBottles.vector[4].discharge();
}, 3);
}
}
}
},
reset: func(system) {
if (system == 0) {
eng1FireWarn.setBoolValue(0);
} elsif (system == 1) {
eng2FireWarn.setBoolValue(0);
} elsif (system == 2) {
apuFireWarn.setBoolValue(0);
}
}
if (dischpb1 and fwdsquib and !bottleIsEmpty and !pause) {
setprop("/systems/fire/cargo/bottlelevel", getprop("/systems/fire/cargo/bottlelevel") - 0.33);
}
if (dischpb2) {
if (WeCanExt == 1 and !aftsquib and !bottleIsEmpty and (dc1 > 0 or dc2 > 0 or dcbat > 0)) {
setprop("/systems/fire/cargo/aftsquib", 1);
};
var CIDSchannel = {
elecProp: "",
condition: 100,
new: func(elecProp) {
var cC = {parents:[CIDSchannel]};
cC.elecProp = props.globals.getNode(elecProp, 1);
return cC;
},
update: func() {
if (me.condition == 0 or me.elecProp.getValue() < 25) { return; }
if ((cargoSmokeDetectorUnits.vector[0].loopOne == 1 and cargoSmokeDetectorUnits.vector[0].loopTwo == 1) or (cargoSmokeDetectorUnits.vector[0].loopOne == 1 and cargoSmokeDetectorUnits.vector[0].loopTwo == 9) or (cargoSmokeDetectorUnits.vector[0].loopOne == 9 and cargoSmokeDetectorUnits.vector[0].loopTwo == 1) or (cargoSmokeDetectorUnits.vector[1].loopOne == 1 and cargoSmokeDetectorUnits.vector[1].loopTwo == 1) or (cargoSmokeDetectorUnits.vector[1].loopOne == 1 and cargoSmokeDetectorUnits.vector[1].loopTwo == 9) or (cargoSmokeDetectorUnits.vector[1].loopOne == 9 and cargoSmokeDetectorUnits.vector[1].loopTwo == 1)) {
aftCargoFireWarn.setBoolValue(1);
}
}
if ((cargoSmokeDetectorUnits.vector[2].loopOne == 1 and cargoSmokeDetectorUnits.vector[2].loopTwo == 1) or (cargoSmokeDetectorUnits.vector[2].loopOne == 1 and cargoSmokeDetectorUnits.vector[2].loopTwo == 9) or (cargoSmokeDetectorUnits.vector[2].loopOne == 9 and cargoSmokeDetectorUnits.vector[2].loopTwo == 1)) {
fwdCargoFireWarn.setBoolValue(1);
}
}
};
var cargoSmokeDetectorUnit = {
sys: 0,
active: 0,
loopOne: 0,
loopTwo: 0,
condition: 100,
new: func(sys) {
var cF = {parents:[cargoSmokeDetectorUnit]};
cF.sys = sys;
cF.active = 0;
cF.loopOne = 0;
cF.loopTwo = 0;
cF.condition = 100;
return cF;
},
receiveSignal: func(type) {
if (type == 1 and me.loopOne != 9 and me.condition != 0) {
me.loopOne = 1;
} elsif (type == 2 and me.loopTwo != 9 and me.condition != 0) {
me.loopTwo = 1;
}
},
failUnit: func() {
me.condition = 0;
},
recoverUnit: func() {
me.condition = 100;
},
failLoop: func(loop) {
if (loop != 1 and loop != 2) { return; }
if (loop == 1) { me.loopOne = 9; }
else { me.loopTwo = 9; }
},
};
var detectorLoop = {
sys: 9,
type: 0,
temperature: "",
elecProp: "",
fireProp: "",
new: func(sys, type, temperature, elecProp, fireProp) {
var dL = {parents:[detectorLoop]};
dL.sys = sys;
dL.type = type;
dL.temperature = props.globals.getNode(temperature, 1);
dL.elecProp = props.globals.getNode(elecProp, 1);
dL.fireProp = props.globals.getNode(fireProp, 1);
return dL;
},
updateTemp: func(system, typeLoop) {
if ((me.temperature.getValue() > 250 and me.fireProp.getBoolValue()) and me.elecProp.getValue() >= 25) {
if (rand() >= 0.98) { # flame damage may possibly fail the loop
engFireDetectorUnits.vector[system].fail(1);
engFireDetectorUnits.vector[system].fail(2);
}
me.sendSignal(system, typeLoop);
} elsif (me.elecProp.getValue() >= 25) {
engFireDetectorUnits.vector[system].restoreElec(typeLoop);
} else {
engFireDetectorUnits.vector[system].noElec(typeLoop);
}
},
sendSignal: func(system, typeLoop) {
if (system == 0 and !getprop("/systems/failures/engine-left-fire")) { return; }
elsif (system == 1 and !getprop("/systems/failures/engine-right-fire")) { return; }
elsif (system == 2 and !getprop("/systems/failures/apu-fire")) { return; }
engFireDetectorUnits.vector[system].receiveSignal(typeLoop);
}
};
var cargoDetectorLoop = {
sys: 9,
type: 0,
temperature: "",
fireProp: "",
new: func(sys, type, temperature, fireProp) {
var cdL = {parents:[cargoDetectorLoop]};
cdL.sys = sys;
cdL.type = type;
cdL.temperature = props.globals.getNode(temperature, 1);
cdL.fireProp = props.globals.getNode(fireProp, 1);
return cdL;
},
updateTemp: func(system, typeLoop) {
if (me.temperature.getValue() > 250 and me.fireProp.getBoolValue()) {
me.sendSignal(system, typeLoop);
}
},
sendSignal: func(system, typeLoop) {
if ((system == 0 or system == 1) and !getprop("/systems/failures/cargo-aft-fire")) { return; }
elsif (system == 2 and !getprop("/systems/failures/cargo-fwd-fire")) { return; }
cargoSmokeDetectorUnits.vector[system].receiveSignal(typeLoop);
}
};
var extinguisherBottle = {
quantity: 100,
squib: 0,
number: 0,
lightProp: "",
elecProp: "",
failProp: "",
warningProp: "",
hack: 0,
new: func(number, lightProp, elecProp, failProp, warningProp, quantity = 100, hack = 0) {
var eB = {parents:[extinguisherBottle]};
eB.quantity = quantity;
eB.squib = 0;
eB.number = number;
eB.lightProp = props.globals.getNode(lightProp, 1);
eB.elecProp = props.globals.getNode(elecProp, 1);
eB.failProp = props.globals.getNode(failProp, 1);
eB.warningProp = props.globals.getNode(warningProp, 1);
eB.hack = hack;
return eB;
},
emptyBottle: func() {
# reduce quantity
me.quantity -= 10;
# quick hack for cargo bottles
if (me.number == 7) {
cargoExtinguisherBottles.vector[0].quantity -= 10;
} elsif (me.number == 8) {
cargoExtinguisherBottles.vector[1].quantity -= 10;
}
if (me.quantity > 0) {
settimer(func() {
me.emptyBottle()
}, 0.05);
} elsif (me.hack == 0) {
me.lightProp.setValue(1);
# make things interesting. If your fire won't go out you should play the lottery
if (me.number == 0) {
if (rand() < 0.90) {
settimer(func() {
me.failProp.setValue(0);
me.warningProp.setValue(0);
}, rand() * 3);
}
} elsif (me.number == 1) {
if (rand() < 0.999) {
settimer(func() {
me.failProp.setValue(0);
me.warningProp.setValue(0);
}, rand() * 3);
}
} elsif (me.number == 7) {
if (rand() <= 0.95) {
settimer(func() {
me.failProp.setValue(0);
if (rand() <= 0.20) {
me.warningProp.setValue(0); # extinguishing agent detected as smoke, so warning likely to stay on
}
}, rand() * 3);
cargoExtinguisherBottles.vector[0].hack == 1;
}
} elsif (me.number == 8) {
if (rand() <= 0.95) {
settimer(func() {
me.failProp.setValue(0);
if (rand() <= 0.20) {
me.warningProp.setValue(0);
}
}, rand() * 3);
cargoExtinguisherBottles.vector[1].hack == 1;
}
} elsif (me.number == 9) {
if (rand() <= 0.999) {
settimer(func() {
me.failProp.setValue(0);
me.warningProp.setValue(0);
}, rand() * 3);
}
}
}
},
discharge: func() {
if (me.elecProp.getValue() < 25) { return; }
me.squib = 1;
me.emptyBottle();
}
};
# If two loops fail within five seconds then assume there is a fire
var propsNasFireTime = std.Vector.new([
props.globals.initNode("/systems/fire/engine1/loop1-failtime", 0, "DOUBLE"), props.globals.initNode("/systems/fire/engine1/loop2-failtime", 0, "DOUBLE"),
props.globals.initNode("/systems/fire/engine2/loop1-failtime", 0, "DOUBLE"), props.globals.initNode("/systems/fire/engine2/loop2-failtime", 0, "DOUBLE"),
props.globals.initNode("/systems/fire/apu/loop1-failtime", 0, "DOUBLE"), props.globals.initNode("/systems/fire/apu/loop2-failtime", 0, "DOUBLE")
]);
var checkTimeFire1 = func() {
et = elapsedTime.getValue();
var loop1 = propsNasFireTime.vector[0].getValue();
var loop2 = propsNasFireTime.vector[1].getValue();
if (dischpb2 and aftsquib and !bottleIsEmpty and !pause) {
setprop("/systems/fire/cargo/bottlelevel", getprop("/systems/fire/cargo/bottlelevel") - 0.33);
if ((loop1 != 0 and et > loop1 + 5) or (loop2 != 0 and et > loop2 + 5)) {
fireTimer1.stop();
checkTwoInop1Timer.start();
}
#################
# Test Sequence #
#################
if (test) {
setprop("/systems/fire/cargo/test", 1);
} else {
setprop("/systems/fire/cargo/test", 0);
if (engFireDetectorUnits.vector[0].loopOne == 9 and engFireDetectorUnits.vector[0].loopTwo == 9) {
fireTimer1.stop();
engFireDetectorUnits.vector[0].TriggerWarning(engFireDetectorUnits.vector[0].sys);
}
if (test2 and state == 0) {
setprop("/controls/fire/cargo/fwddischLight", 1);
setprop("/controls/fire/cargo/aftdischLight", 1);
settimer(func(){
setprop("/controls/fire/cargo/fwddischLight", 0);
setprop("/controls/fire/cargo/aftdischLight", 0);
setprop("/controls/fire/cargo/test/state", 1);
}, 5);
} else if (test2 and state == 1) {
setprop("/controls/fire/cargo/fwdsmokeLight", 1);
setprop("/controls/fire/cargo/warnfwd", 1);
setprop("/controls/fire/cargo/aftsmokeLight", 1);
setprop("/controls/fire/cargo/warnaft", 1);
settimer(func(){
setprop("/controls/fire/cargo/fwdsmokeLight", 0);
setprop("/controls/fire/cargo/aftsmokeLight", 0);
setprop("/controls/fire/cargo/warnfwd", 0);
setprop("/controls/fire/cargo/warnaft", 0);
setprop("/controls/fire/cargo/test/state", 2);
}, 5);
} else if (test2 and state == 2) {
settimer(func(){
setprop("/controls/fire/cargo/test/state", 3);
}, 5);
} else if (test2 and state == 3) {
setprop("/controls/fire/cargo/fwdsmokeLight", 1);
setprop("/controls/fire/cargo/warnfwd", 1);
setprop("/controls/fire/cargo/aftsmokeLight", 1);
setprop("/controls/fire/cargo/warnaft", 1);
settimer(func(){
setprop("/controls/fire/cargo/fwdsmokeLight", 0);
setprop("/controls/fire/cargo/aftsmokeLight", 0);
setprop("/controls/fire/cargo/warnfwd", 0);
setprop("/controls/fire/cargo/warnaft", 0);
setprop("/systems/fire/cargo/test", 0);
setprop("/controls/fire/cargo/test", 0);
setprop("/controls/fire/cargo/test/state", 0);
}, 5);
}
##########
# Status #
##########
if (level < 0.1 and !test) {
setprop("/controls/fire/cargo/bottleempty", 1);
setprop("/controls/fire/cargo/status", 0);
setprop("/controls/fire/cargo/fwddischLight", 1);
setprop("/controls/fire/cargo/aftdischLight", 1);
} else if (!test) {
setprop("/controls/fire/cargo/bottleempty", 0);
setprop("/controls/fire/cargo/status", 1);
setprop("/controls/fire/cargo/fwddischLight", 0);
setprop("/controls/fire/cargo/aftdischLight", 0);
}
}
###################
# Detection Logic #
###################
setlistener("/systems/failures/cargo-fwd-fire", func() {
if (getprop("/systems/failures/cargo-fwd-fire")) {
setprop("/controls/fire/cargo/fwdsmokeLight", 1);
setprop("/controls/fire/cargo/warnfwd", 1);
} else {
setprop("/controls/fire/cargo/fwdsmokeLight", 0);
var checkTwoInop1 = func() {
if (engFireDetectorUnits.vector[0].loopOne == 9 and engFireDetectorUnits.vector[0].loopTwo == 9) {
eng1Inop.setBoolValue(1);
checkTwoInop1Timer.stop();
}
}, 0, );
}
setlistener("/systems/failures/cargo-aft-fire", func() {
if (getprop("/systems/failures/cargo-aft-fire")) {
setprop("/controls/fire/cargo/aftsmokeLight", 1);
setprop("/controls/fire/cargo/warnaft", 1);
} else {
setprop("/controls/fire/cargo/aftsmokeLight", 0);
var checkTimeFire2 = func() {
et = elapsedTime.getValue();
var loop3 = propsNasFireTime.vector[2].getValue();
var loop4 = propsNasFireTime.vector[3].getValue();
if ((loop3 != 0 and et > loop3 + 5) or (loop4 != 0 and et > loop4 + 5)) {
fireTimer2.stop();
checkTwoInop2Timer.start();
}
}, 0, );
if (engFireDetectorUnits.vector[1].loopOne == 9 and engFireDetectorUnits.vector[1].loopTwo == 9) {
fireTimer2.stop();
engFireDetectorUnits.vector[1].TriggerWarning(engFireDetectorUnits.vector[1].sys);
}
}
var checkTwoInop2 = func() {
if (engFireDetectorUnits.vector[1].loopOne == 9 and engFireDetectorUnits.vector[1].loopTwo == 9) {
eng2Inop.setBoolValue(1);
checkTwoInop2Timer.stop();
}
}
var checkTimeFire3 = func() {
et = elapsedTime.getValue();
var loop5 = propsNasFireTime.vector[4].getValue();
var loop6 = propsNasFireTime.vector[5].getValue();
if ((loop5 != 0 and et > loop6 + 5) or (loop6 != 0 and et > loop6 + 5)) {
fireTimer3.stop();
checkTwoInop3Timer.start();
}
if (engFireDetectorUnits.vector[2].loopOne == 9 and engFireDetectorUnits.vector[2].loopTwo == 9) {
fireTimer3.stop();
engFireDetectorUnits.vector[2].TriggerWarning(engFireDetectorUnits.vector[2].sys);
}
}
var checkTwoInop3 = func() {
if (engFireDetectorUnits.vector[2].loopOne == 9 and engFireDetectorUnits.vector[2].loopTwo == 9) {
apuInop.setBoolValue(1);
checkTwoInop3Timer.stop();
}
}
var fireTimer1 = maketimer(0.1, checkTimeFire1);
fireTimer1.simulatedTime = 1;
var fireTimer2 = maketimer(0.1, checkTimeFire2);
fireTimer2.simulatedTime = 1;
var fireTimer3 = maketimer(0.1, checkTimeFire3);
fireTimer3.simulatedTime = 1;
var checkTwoInop1Timer = maketimer(0.1, checkTwoInop1);
var checkTwoInop2Timer = maketimer(0.1, checkTwoInop2);
var checkTwoInop3Timer = maketimer(0.1, checkTwoInop3);
# Create fire systems
var engFireDetectorUnits = std.Vector.new([ engFireDetectorUnit.new(0, "/systems/failures/engine-left-fire", "/controls/fire/test-btn-1"), engFireDetectorUnit.new(1, "/systems/failures/engine-right-fire", "/controls/fire/test-btn-2"), engFireDetectorUnit.new(2, "/systems/failures/apu-fire", "/controls/fire/apu-test-btn") ]);
var cargoSmokeDetectorUnits = std.Vector.new([cargoSmokeDetectorUnit.new(0, "/systems/failures/cargo-aft-fire"), cargoSmokeDetectorUnit.new(1, "/systems/failures/cargo-aft-fire"), cargoSmokeDetectorUnit.new(1, "/systems/failures/cargo-fwd-fire")]);
# Create detector loops
var engDetectorLoops = std.Vector.new([
detectorLoop.new(0, 1, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dc-ess", "/systems/failures/engine-left-fire"), detectorLoop.new(0, 2, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dc2", "/systems/failures/engine-left-fire"),
detectorLoop.new(1, 1, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dc2", "/systems/failures/engine-right-fire"), detectorLoop.new(1, 2, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dc-ess", "/systems/failures/engine-right-fire"),
detectorLoop.new(2, 1, "/systems/fire/apu/temperature", "/systems/electrical/bus/dcbat", "/systems/failures/apu-fire"), detectorLoop.new(2, 2, "/systems/fire/apu/temperature", "/systems/electrical/bus/dcbat", "/systems/failures/apu-fire")
]);
var cargoDetectorLoops = std.Vector.new([
cargoDetectorLoop.new(0, 1, "/systems/fire/cargo/aft/temperature", "/systems/failures/cargo-aft-fire"), cargoDetectorLoop.new(0, 2, "/systems/fire/cargo/aft/temperature", "/systems/failures/cargo-aft-fire"),
cargoDetectorLoop.new(1, 1, "/systems/fire/cargo/aft/temperature", "/systems/failures/cargo-aft-fire"), cargoDetectorLoop.new(1, 2, "/systems/fire/cargo/aft/temperature", "/systems/failures/cargo-aft-fire"),
cargoDetectorLoop.new(2, 1, "/systems/fire/cargo/fwd/temperature", "/systems/failures/cargo-fwd-fire"), cargoDetectorLoop.new(2, 2, "/systems/fire/cargo/fwd/temperature", "/systems/failures/cargo-fwd-fire")
]);
# Create extinguisher bottles
var extinguisherBottles = std.Vector.new([extinguisherBottle.new(0, "/systems/fire/engine1/disch1", "/systems/electrical/bus/dcbat", "/systems/failures/engine-left-fire", "/systems/fire/engine1/warning-active"), extinguisherBottle.new(1, "/systems/fire/engine1/disch2", "/systems/electrical/bus/dc2", "/systems/failures/engine-left-fire", "/systems/fire/engine1/warning-active"),
extinguisherBottle.new(0, "/systems/fire/engine2/disch1", "/systems/electrical/bus/dcbat", "/systems/failures/engine-right-fire", "/systems/fire/engine2/warning-active"), extinguisherBottle.new(1, "/systems/fire/engine2/disch2", "/systems/electrical/bus/dc2", "/systems/failures/engine-right-fire", "/systems/fire/engine2/warning-active"),
extinguisherBottle.new(9, "/systems/fire/apu/disch", "/systems/electrical/bus/dcbat", "/systems/failures/apu-fire", "/systems/fire/apu/warning-active") ]);
# There is only one bottle but the system will think there are two, so other parts work
var cargoExtinguisherBottles = std.Vector.new([extinguisherBottle.new(8, "/systems/fire/cargo/disch", "/systems/electrical/bus/dcbat", "/systems/failures/cargo-aft-fire", "/systems/fire/cargo/aft/warning-active", 250), extinguisherBottle.new(7, "/systems/fire/cargo/disch", "/systems/electrical/bus/dcbat", "/systems/failures/cargo-fwd-fire", "/systems/fire/cargo/fwd/warning-active", 250)]);
# Create CIDS channels
var CIDSchannels = std.Vector.new([CIDSchannel.new("/systems/electrical/bus/dc-ess"), CIDSchannel.new("/systems/electrical/bus/dc2")]);
# Setlistener helper
var createFireBottleListener = func(prop, fireBtnProp, index) {
if (index >= extinguisherBottles.size()) {
print("Error - calling listener on non-existent fire extinguisher bottle, index: " ~ index);
return;
}
setlistener(prop, func() {
if (getprop(prop) == 1 and getprop(fireBtnProp) == 1) {
extinguisherBottles.vector[index].discharge();
}
}, 0, 0);
}
var createCargoFireBottleListener = func(prop, index) {
if (index >= extinguisherBottles.size()) {
print("Error - calling listener on non-existent fire extinguisher bottle, index: " ~ index);
return;
}
setlistener(prop, func() {
if (getprop(prop) == 1) {
cargoExtinguisherBottles.vector[index].discharge();
}
}, 0, 0);
}
# Listeners
setlistener("/controls/engines/engine[0]/fire-btn", func() {
if (getprop("/controls/engines/engine[0]/fire-btn") == 1) {
ecam.shutUpYou();
eng1AgentTimerMakeTimer.stop();
eng1AgentTimer.setValue(10);
eng1AgentTimerTime.setValue(elapsedTime.getValue() + 11);
eng1AgentTimerMakeTimer.start();
}
}, 0, 0);
setlistener("/systems/fire/engine1/disch1", func() {
if (getprop("/systems/fire/engine1/disch1") == 1) {
eng1Agent2TimerMakeTimer.stop();
eng1Agent2Timer.setValue(30);
eng1Agent2TimerTime.setValue(elapsedTime.getValue() + 31);
eng1Agent2TimerMakeTimer.start();
}
}, 0, 0);
eng1AgentTimerMakeTimerFunc = func() {
if (eng1AgentTimer.getValue() > 0) {
var eng1Time = eng1AgentTimerTime.getValue();
var etEng1 = elapsedTime.getValue();
var timeToSetEng1 = eng1Time - etEng1;
eng1AgentTimer.setValue(timeToSetEng1);
} else {
eng1AgentTimerMakeTimer.stop();
}
}
eng1Agent2TimerMakeTimerFunc = func() {
if (eng1Agent2Timer.getValue() > 0) {
var eng1Time2 = eng1Agent2TimerTime.getValue();
var etEng12 = elapsedTime.getValue();
var timeToSetEng12 = eng1Time2 - etEng12;
eng1Agent2Timer.setValue(timeToSetEng12);
} else {
eng1Agent2TimerMakeTimer.stop();
}
}
setlistener("/controls/engines/engine[1]/fire-btn", func() {
if (getprop("/controls/engines/engine[1]/fire-btn") == 1) {
ecam.shutUpYou();
eng2AgentTimerMakeTimer.stop();
eng2AgentTimer.setValue(10);
eng2AgentTimerTime.setValue(elapsedTime.getValue() + 11);
eng2AgentTimerMakeTimer.start();
}
}, 0, 0);
setlistener("/systems/fire/engine2/disch1", func() {
if (getprop("/systems/fire/engine2/disch1") == 1) {
eng2Agent2TimerMakeTimer.stop();
eng2Agent2Timer.setValue(30);
eng2Agent2TimerTime.setValue(elapsedTime.getValue() + 31);
eng2Agent2TimerMakeTimer.start();
}
}, 0, 0);
eng2AgentTimerMakeTimerFunc = func() {
if (eng2AgentTimer.getValue() > 0) {
var eng2Time = eng2AgentTimerTime.getValue();
var etEng2 = elapsedTime.getValue();
var timeToSetEng2 = eng2Time - etEng2;
eng2AgentTimer.setValue(timeToSetEng2);
} else {
eng2AgentTimerMakeTimer.stop();
}
}
eng2Agent2TimerMakeTimerFunc = func() {
if (eng2Agent2Timer.getValue() > 0) {
var eng2Time2 = eng2Agent2TimerTime.getValue();
var etEng22 = elapsedTime.getValue();
var timeToSetEng22 = eng2Time2 - etEng22;
eng2Agent2Timer.setValue(timeToSetEng22);
} else {
eng2Agent2TimerMakeTimer.stop();
}
}
setlistener("/controls/APU/fire-btn", func() {
if (getprop("/controls/APU/fire-btn") == 1) {
ecam.shutUpYou();
apuAgentTimerMakeTimer.stop();
apuAgentTimer.setValue(10);
apuAgentTimerTime.setValue(elapsedTime.getValue() + 11);
apuAgentTimerMakeTimer.start();
}
}, 0, 0);
apuAgentTimerMakeTimerFunc = func() {
if (apuAgentTimer.getValue() > 0) {
var apuTime = apuAgentTimerTime.getValue();
var etApu = elapsedTime.getValue();
var timeToSetApu = apuTime - etApu;
apuAgentTimer.setValue(timeToSetApu);
} else {
apuAgentTimerMakeTimer.stop();
}
}
setlistener("/controls/fire/test-btn-1", func() {
if (getprop("/systems/failures/engine-left-fire")) { return; }
if (testBtn.getValue() == 1) {
if (dcbatNode.getValue() > 25 or dcessNode.getValue() > 25) {
eng1FireWarn.setBoolValue(1);
}
} else {
eng1FireWarn.setBoolValue(0);
ecam.shutUpYou();
}
}, 0, 0);
setlistener("/controls/fire/test-btn-2", func() {
if (getprop("/systems/failures/engine-right-fire")) { return; }
if (testBtn2.getValue() == 1) {
if (dcbatNode.getValue() > 25 or dcessNode.getValue() > 25) {
eng2FireWarn.setBoolValue(1);
}
} else {
eng2FireWarn.setBoolValue(0);
ecam.shutUpYou();
}
}, 0, 0);
setlistener("/controls/fire/apu-test-btn", func() {
if (getprop("/systems/failures/apu-fire")) { return; }
if (apuTestBtn.getValue() == 1) {
if (dcbatNode.getValue() > 25 or dcessNode.getValue() > 25) {
apuFireWarn.setBoolValue(1);
}
} else {
apuFireWarn.setBoolValue(0);
ecam.shutUpYou();
}
}, 0, 0);
setlistener("/controls/fire/cargo/test", func() {
if (getprop("/systems/failures/aft-cargo-fire") or getprop("/systems/failures/fwd-cargo-fire") or dcbatNode.getValue() < 25 or dcessNode.getValue() < 25) { return; }
if (cargoTestBtn.getBoolValue()) {
cargoTestTime.setValue(elapsedTime.getValue());
cargoTestChecker.start();
} else {
aftCargoFireWarn.setBoolValue(0);
fwdCargoFireWarn.setBoolValue(0);
dischTest.setBoolValue(0);
ecam.shutUpYou();
cargoTestBtnOff.setBoolValue(1);
}
}, 0, 0);
var doCargoTest = func() {
if (dcbatNode.getValue() >= 25 or dcessNode.getValue() >= 25) {
aftCargoFireWarn.setBoolValue(1);
fwdCargoFireWarn.setBoolValue(1);
cargoTestTime2.setValue(elapsedTime.getValue());
cargoTestChecker2.start();
}
}
var doCargoTest2 = func() {
aftCargoFireWarn.setBoolValue(0);
fwdCargoFireWarn.setBoolValue(0);
ecam.shutUpYou();
cargoTestTime3.setValue(elapsedTime.getValue());
dischTest.setBoolValue(1);
cargoTestChecker3.start();
}
var doCargoTest3 = func() {
dischTest.setBoolValue(0);
if (dcbatNode.getValue() >= 25 or dcessNode.getValue() >= 25) {
aftCargoFireWarn.setBoolValue(1);
fwdCargoFireWarn.setBoolValue(1);
cargoTestTime4.setValue(elapsedTime.getValue());
cargoTestChecker4.start();
}
}
var doCargoTest4 = func() {
aftCargoFireWarn.setBoolValue(0);
fwdCargoFireWarn.setBoolValue(0);
}
var cargoTestCheckerFunc = func() {
if (!cargoTestBtn.getBoolValue()) {
cargoTestChecker.stop();
} elsif (elapsedTime.getValue() > (cargoTestTime.getValue() + 3)) {
doCargoTest();
cargoTestChecker.stop();
}
}
var cargoTestCheckerFunc2 = func() {
if (!cargoTestBtn.getBoolValue()) {
cargoTestChecker2.stop();
} elsif (elapsedTime.getValue() > (cargoTestTime2.getValue() + 3)) {
doCargoTest2();
cargoTestChecker2.stop();
}
}
var cargoTestCheckerFunc3 = func() {
if (!cargoTestBtn.getBoolValue()) {
cargoTestChecker3.stop();
} elsif (elapsedTime.getValue() > (cargoTestTime3.getValue() + 3)) {
doCargoTest3();
cargoTestChecker3.stop();
}
}
var cargoTestCheckerFunc4 = func() {
if (!cargoTestBtn.getBoolValue()) {
cargoTestChecker4.stop();
} elsif (elapsedTime.getValue() > (cargoTestTime4.getValue() + 3)) {
doCargoTest4();
cargoTestChecker4.stop();
}
}
createFireBottleListener("/controls/engines/engine[0]/agent1-btn", "/controls/engines/engine[0]/fire-btn", 0);
createFireBottleListener("/controls/engines/engine[0]/agent2-btn", "/controls/engines/engine[0]/fire-btn", 1);
createFireBottleListener("/controls/engines/engine[1]/agent1-btn", "/controls/engines/engine[1]/fire-btn", 2);
createFireBottleListener("/controls/engines/engine[1]/agent2-btn", "/controls/engines/engine[1]/fire-btn", 3);
createFireBottleListener("/controls/APU/agent-btn", "/controls/APU/fire-btn", 4);
createCargoFireBottleListener("/controls/fire/cargo/aftdisch", 0);
createCargoFireBottleListener("/controls/fire/cargo/fwddisch", 1);
var updateUnitsAndChannels = func() {
foreach (var units; engFireDetectorUnits.vector) {
units.update();
}
foreach(var CargoDetector; cargoDetectorLoops.vector) {
CargoDetector.updateTemp(CargoDetector.sys, CargoDetector.type);
}
foreach (var channels; CIDSchannels.vector) {
channels.update();
}
}
###################
# Update Function #
###################
var update_fire = func {
master_fire();
}
var fire_timer = maketimer(0.2, update_fire);
var fire_timer = maketimer(0.25, updateUnitsAndChannels);
var eng1AgentTimerMakeTimer = maketimer(0.1, eng1AgentTimerMakeTimerFunc);
var eng2AgentTimerMakeTimer = maketimer(0.1, eng2AgentTimerMakeTimerFunc);
var eng1Agent2TimerMakeTimer = maketimer(0.1, eng1Agent2TimerMakeTimerFunc);
var eng2Agent2TimerMakeTimer = maketimer(0.1, eng2Agent2TimerMakeTimerFunc);
var apuAgentTimerMakeTimer = maketimer(0.1, apuAgentTimerMakeTimerFunc);
var cargoTestChecker = maketimer(0.1, cargoTestCheckerFunc);
var cargoTestChecker2 = maketimer(0.2, cargoTestCheckerFunc2);
var cargoTestChecker3 = maketimer(0.2, cargoTestCheckerFunc3);
var cargoTestChecker4 = maketimer(0.2, cargoTestCheckerFunc4);

View file

@ -837,7 +837,7 @@
<apoff>
<name>apoff-looped</name>
<mode>looped</mode>
<path>Aircraft/IDG-A32X/Sounds/apoff.wav</path>
<path>Aircraft/IDG-A32X/Sounds/Cockpit/calvary-charge-loop.wav</path>
<condition>
<and>
<equals>
@ -867,7 +867,7 @@
<apoff>
<name>apoff-single</name>
<mode>once</mode>
<path>Aircraft/IDG-A32X/Sounds/apoff.wav</path>
<path>Aircraft/IDG-A32X/Sounds/Cockpit/calvary-charge-once.wav</path>
<condition>
<and>
<equals>
@ -1697,11 +1697,16 @@
<mode>looped</mode>
<type>avionics</type>
<condition>
<property>/ECAM/warnings/master-warning-light</property>
<property>/sim/sound/warnings/crc</property>
<and>
<property>/ECAM/warnings/master-warning-light</property>
<property>/sim/sound/warnings/crc</property>
</and>
</condition>
<volume>
<property>/systems/acconfig/options/sound/avionics-volume</property>
<product>
<property>/systems/acconfig/options/sound/avionics-volume</property>
<value>0.8</value>
</product>
</volume>
<reference-dist>10</reference-dist>
<max-dist>100</max-dist>

BIN
Sounds/Cockpit/c-chord.wav Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Sounds/Cockpit/click.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
Sounds/Cockpit/cricket.wav Normal file

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,123 @@
<!-- Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) -->
<system name="A320: Engine Fire">
<channel name="Engine Fire">
<fcs_function name="enginefire1">
<function>
<sum>
<property>/systems/fire/engine1/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/engine-left-fire</independentVar>
<tableData>
0 -5
1 30
</tableData>
</table>
<property>simulation/channel-dt</property>
</product>
</sum>
</function>
<clipto>
<min>0</min>
<max>300</max>
</clipto>
<output>/systems/fire/engine1/temperature</output>
</fcs_function>
<fcs_function name="enginefire2">
<function>
<sum>
<property>/systems/fire/engine2/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/engine-right-fire</independentVar>
<tableData>
0 -5
1 30
</tableData>
</table>
<property>simulation/channel-dt</property>
</product>
</sum>
</function>
<clipto>
<min>0</min>
<max>300</max>
</clipto>
<output>/systems/fire/engine2/temperature</output>
</fcs_function>
<fcs_function name="apufire">
<function>
<sum>
<property>/systems/fire/apu/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/apu-fire</independentVar>
<tableData>
0 -5
1 45
</tableData>
</table>
<property>simulation/channel-dt</property>
</product>
</sum>
</function>
<clipto>
<min>0</min>
<max>300</max>
</clipto>
<output>/systems/fire/apu/temperature</output>
</fcs_function>
</channel>
<channel name="Cargo Fire">
<fcs_function name="fwdfire">
<function>
<sum>
<property>/systems/fire/cargo/fwd/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/cargo-fwd-fire</independentVar>
<tableData>
0 -5
1 30
</tableData>
</table>
<property>simulation/channel-dt</property>
</product>
</sum>
</function>
<clipto>
<min>0</min>
<max>300</max>
</clipto>
<output>/systems/fire/cargo/fwd/temperature</output>
</fcs_function>
<fcs_function name="aftfire">
<function>
<sum>
<property>/systems/fire/cargo/aft/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/cargo-aft-fire</independentVar>
<tableData>
0 -5
1 45
</tableData>
</table>
<property>simulation/channel-dt</property>
</product>
</sum>
</function>
<clipto>
<min>0</min>
<max>300</max>
</clipto>
<output>/systems/fire/cargo/aft/temperature</output>
</fcs_function>
</channel>
</system>

View file

@ -1165,5 +1165,4 @@
<output>/instrumentation/ddrmi/flag-2</output>
<filter-time>0.64</filter-time>
</filter>
</PropertyList>

View file

@ -1,3 +1,6 @@
Thank you to:
Amanda Santos for the sound "botaodepressao", used for the overhead panel under the CC0 license:
https://freesound.org/people/amandasantos/sounds/392148/
https://freesound.org/people/amandasantos/sounds/392148/
Nguyen Van Hai for the sound "crc", used for the warning system
https://www.youtube.com/watch?v=IzNeDvVgrhg