Fix conditions for fire, fix severe bug
This commit is contained in:
parent
8dfc6bc93d
commit
acdc4cb925
6 changed files with 34 additions and 26 deletions
|
@ -20,10 +20,7 @@
|
|||
<type>select</type>
|
||||
<object-name>Bounding_box</object-name>
|
||||
<condition>
|
||||
<greater-than>
|
||||
<property>systems/failures/engine-left-fire</property>
|
||||
<value>0.8</value>
|
||||
</greater-than>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
|
|
|
@ -20,10 +20,7 @@
|
|||
<type>select</type>
|
||||
<object-name>Bounding_box</object-name>
|
||||
<condition>
|
||||
<greater-than>
|
||||
<property>systems/failures/engine-left-fire</property>
|
||||
<value>0.8</value>
|
||||
</greater-than>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
|
|
|
@ -20,10 +20,7 @@
|
|||
<type>select</type>
|
||||
<object-name>Bounding_box</object-name>
|
||||
<condition>
|
||||
<greater-than>
|
||||
<property>systems/failures/engine-right-fire</property>
|
||||
<value>0.8</value>
|
||||
</greater-than>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
|
|
|
@ -20,10 +20,7 @@
|
|||
<type>select</type>
|
||||
<object-name>Bounding_box</object-name>
|
||||
<condition>
|
||||
<greater-than>
|
||||
<property>systems/failures/engine-right-fire</property>
|
||||
<value>0.8</value>
|
||||
</greater-than>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ var engFireDetectorUnit = {
|
|||
detector.updateTemp(detector.sys, detector.type);
|
||||
}
|
||||
|
||||
if ((me.loopOne == 1 and me.loopTwo == 1) or (me.loopOne == 9 and me.loopTwo == 1) or (me.loopOne == 1 and me.loopTwo == 9)) {
|
||||
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);
|
||||
}
|
||||
},
|
||||
|
@ -248,6 +248,12 @@ var engFireDetectorUnit = {
|
|||
|
||||
me.startFailTimer(loop);
|
||||
},
|
||||
noElec: func(loop) {
|
||||
if (loop != 1 and loop != 2) { return; }
|
||||
|
||||
if (loop == 1) { me.loopOne = 8; }
|
||||
else { me.loopTwo = 8; }
|
||||
},
|
||||
startFailTimer: func(loop) {
|
||||
if (me.sys != 2) {
|
||||
if (loop == 1) {
|
||||
|
@ -282,14 +288,14 @@ var engFireDetectorUnit = {
|
|||
};
|
||||
|
||||
var detectorLoop = {
|
||||
type: 0,
|
||||
sys: 9,
|
||||
type: 0,
|
||||
temperature: "",
|
||||
elecProp: "",
|
||||
new: func(type, sys, temperature, elecProp) {
|
||||
new: func(sys, type, temperature, elecProp) {
|
||||
var dL = {parents:[detectorLoop]};
|
||||
dL.type = type;
|
||||
dL.sys = sys;
|
||||
dL.type = type;
|
||||
dL.temperature = temperature;
|
||||
dL.elecProp = props.globals.getNode(elecProp, 1);
|
||||
|
||||
|
@ -304,9 +310,11 @@ var detectorLoop = {
|
|||
|
||||
if (propsNasFire.vector[index].getValue() > 250 and me.elecProp.getValue() >= 25) {
|
||||
me.sendSignal(system,typeLoop);
|
||||
} elsif (me.elecProp.getValue() < 25) {
|
||||
engFireDetectorUnits.vector[system].noElec(typeLoop);
|
||||
}
|
||||
},
|
||||
sendSignal: func(system,typeLoop) {
|
||||
sendSignal: func(system, typeLoop) {
|
||||
engFireDetectorUnits.vector[system].receiveSignal(typeLoop);
|
||||
}
|
||||
};
|
||||
|
@ -414,9 +422,9 @@ var engFireDetectorUnits = std.Vector.new([ engFireDetectorUnit.new(0), engFireD
|
|||
|
||||
# Create detector loops
|
||||
var detectorLoops = std.Vector.new([
|
||||
detectorLoop.new(0, 0, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dcess"), detectorLoop.new(1, 0, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dc2"),
|
||||
detectorLoop.new(0, 1, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dc2"), detectorLoop.new(1, 1, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dcess"),
|
||||
detectorLoop.new(0, 2, "/systems/fire/apu/temperature", "/systems/electrical/bus/dcbat"), detectorLoop.new(1, 2, "/systems/fire/apu/temperature", "/systems/electrical/bus/dcbat")
|
||||
detectorLoop.new(0, 1, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dc-ess"), detectorLoop.new(0, 2, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dc2"),
|
||||
detectorLoop.new(1, 1, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dc2"), detectorLoop.new(1, 2, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dc-ess"),
|
||||
detectorLoop.new(2, 1, "/systems/fire/apu/temperature", "/systems/electrical/bus/dcbat"), detectorLoop.new(2, 2, "/systems/fire/apu/temperature", "/systems/electrical/bus/dcbat")
|
||||
]);
|
||||
|
||||
# Create extinguisher bottles
|
||||
|
|
|
@ -11,14 +11,18 @@
|
|||
<table>
|
||||
<independentVar lookup="row">/systems/failures/engine-left-fire</independentVar>
|
||||
<tableData>
|
||||
0 0
|
||||
1 25
|
||||
0 -5
|
||||
1 10
|
||||
</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>
|
||||
|
||||
|
@ -30,14 +34,18 @@
|
|||
<table>
|
||||
<independentVar lookup="row">/systems/failures/engine-right-fire</independentVar>
|
||||
<tableData>
|
||||
0 0
|
||||
1 25
|
||||
0 -5
|
||||
1 10
|
||||
</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>
|
||||
|
||||
|
@ -49,14 +57,18 @@
|
|||
<table>
|
||||
<independentVar lookup="row">/systems/failures/apu-fire</independentVar>
|
||||
<tableData>
|
||||
0 0
|
||||
1 25
|
||||
0 -5
|
||||
1 10
|
||||
</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>
|
||||
|
|
Reference in a new issue