Add fire button, fix major bug in engine fire
This commit is contained in:
parent
ed54d8d047
commit
1861639991
3 changed files with 99 additions and 5 deletions
|
@ -106,4 +106,83 @@
|
||||||
<object-name>vu112_aids</object-name>
|
<object-name>vu112_aids</object-name>
|
||||||
<object-name>vu112_dfdr</object-name>
|
<object-name>vu112_dfdr</object-name>
|
||||||
</effect>
|
</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>
|
</PropertyList>
|
||||||
|
|
|
@ -847,13 +847,13 @@ var messages_priority_2 = func {
|
||||||
ECAM_controller.warningReset(apuLoopBFault);
|
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;
|
crgAftFireDetFault.active = 1;
|
||||||
} else {
|
} else {
|
||||||
ECAM_controller.warningReset(crgAftFireDetFault);
|
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;
|
crgFwdFireDetFault.active = 1;
|
||||||
} else {
|
} else {
|
||||||
ECAM_controller.warningReset(crgFwdFireDetFault);
|
ECAM_controller.warningReset(crgFwdFireDetFault);
|
||||||
|
|
|
@ -72,7 +72,6 @@ var engFireDetectorUnit = {
|
||||||
},
|
},
|
||||||
update: func() {
|
update: func() {
|
||||||
if (me.condition == 0) { return; }
|
if (me.condition == 0) { return; }
|
||||||
|
|
||||||
foreach(var detector; engDetectorLoops.vector) {
|
foreach(var detector; engDetectorLoops.vector) {
|
||||||
detector.updateTemp(detector.sys, detector.type);
|
detector.updateTemp(detector.sys, detector.type);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +83,7 @@ var engFireDetectorUnit = {
|
||||||
return;
|
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);
|
me.TriggerWarning(me.sys);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -98,6 +97,9 @@ var engFireDetectorUnit = {
|
||||||
failUnit: func() {
|
failUnit: func() {
|
||||||
me.condition = 0;
|
me.condition = 0;
|
||||||
},
|
},
|
||||||
|
restoreUnit: func() {
|
||||||
|
me.condition = 100;
|
||||||
|
},
|
||||||
fail: func(loop) {
|
fail: func(loop) {
|
||||||
if (loop != 1 and loop != 2) { return; }
|
if (loop != 1 and loop != 2) { return; }
|
||||||
|
|
||||||
|
@ -106,12 +108,23 @@ var engFireDetectorUnit = {
|
||||||
|
|
||||||
me.startFailTimer(loop);
|
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) {
|
noElec: func(loop) {
|
||||||
if (loop != 1 and loop != 2) { return; }
|
if (loop != 1 and loop != 2) { return; }
|
||||||
|
|
||||||
if (loop == 1) { me.loopOne = 8; }
|
if (loop == 1) { me.loopOne = 8; }
|
||||||
else { me.loopTwo = 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) {
|
startFailTimer: func(loop) {
|
||||||
if (me.sys != 2) {
|
if (me.sys != 2) {
|
||||||
if (loop == 1) {
|
if (loop == 1) {
|
||||||
|
@ -240,7 +253,9 @@ var detectorLoop = {
|
||||||
updateTemp: func(system, typeLoop) {
|
updateTemp: func(system, typeLoop) {
|
||||||
if ((me.temperature.getValue() > 250 and me.fireProp.getBoolValue()) and me.elecProp.getValue() >= 25) {
|
if ((me.temperature.getValue() > 250 and me.fireProp.getBoolValue()) and me.elecProp.getValue() >= 25) {
|
||||||
me.sendSignal(system, typeLoop);
|
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);
|
engFireDetectorUnits.vector[system].noElec(typeLoop);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Reference in a new issue