Add fire button, fix major bug in engine fire

This commit is contained in:
legoboyvdlp R 2019-05-02 12:31:26 +01:00
parent ed54d8d047
commit 1861639991
3 changed files with 99 additions and 5 deletions

View file

@ -106,4 +106,83 @@
<object-name>vu112_aids</object-name>
<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>
</PropertyList>

View file

@ -847,13 +847,13 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(apuLoopBFault);
}
if (crgAftFireDetFault.clearFlag == 0 and (cargoSmokeDetectorUnits.vector[0].condition == 0 or cargoSmokeDetectorUnits.vector[1].condition == 0) and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
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 cargoSmokeDetectorUnits.vector[2].condition == 0 and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
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);

View file

@ -72,7 +72,6 @@ var engFireDetectorUnit = {
},
update: func() {
if (me.condition == 0) { return; }
foreach(var detector; engDetectorLoops.vector) {
detector.updateTemp(detector.sys, detector.type);
}
@ -84,7 +83,7 @@ var engFireDetectorUnit = {
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))) {
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);
}
},
@ -98,6 +97,9 @@ var engFireDetectorUnit = {
failUnit: func() {
me.condition = 0;
},
restoreUnit: func() {
me.condition = 100;
},
fail: func(loop) {
if (loop != 1 and loop != 2) { return; }
@ -106,12 +108,23 @@ var engFireDetectorUnit = {
me.startFailTimer(loop);
},
restore: func(loop) {
if (loop != 1 and loop != 2) { return; }
if (loop == 1) { me.loopOne = 0; }
else { me.loopTwo = 0; }
},
noElec: func(loop) {
if (loop != 1 and loop != 2) { return; }
if (loop == 1) { me.loopOne = 8; }
else { me.loopTwo = 8; }
},
restoreElec: func(loop) {
if (loop != 1 and loop != 2) { return; }
if (loop == 1) { me.loopOne = 0; }
else { me.loopTwo = 0; }
},
startFailTimer: func(loop) {
if (me.sys != 2) {
if (loop == 1) {
@ -240,7 +253,9 @@ var detectorLoop = {
updateTemp: func(system, typeLoop) {
if ((me.temperature.getValue() > 250 and me.fireProp.getBoolValue()) and me.elecProp.getValue() >= 25) {
me.sendSignal(system, typeLoop);
} elsif (me.elecProp.getValue() < 25) {
} elsif (me.elecProp.getValue() >= 25) {
engFireDetectorUnits.vector[system].restoreElec(typeLoop);
} else {
engFireDetectorUnits.vector[system].noElec(typeLoop);
}
},