New altitude alerter (should be more reliable, in JSBSim.)
This commit is contained in:
parent
5adce22c68
commit
46a1c7411d
5 changed files with 235 additions and 163 deletions
|
@ -15,7 +15,7 @@ var overflow = props.globals.initNode("/ECAM/warnings/overflow", 0, "BOOL");
|
|||
var dc_ess = props.globals.getNode("/systems/electrical/bus/dc-ess", 1);
|
||||
|
||||
var lights = [props.globals.initNode("/ECAM/warnings/master-warning-light", 0, "BOOL"), props.globals.initNode("/ECAM/warnings/master-caution-light", 0, "BOOL")];
|
||||
var aural = [props.globals.initNode("/sim/sound/warnings/crc", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/chime", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cricket", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/retard", 0, "BOOL")];
|
||||
var aural = [props.globals.initNode("/sim/sound/warnings/crc", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/chime", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cricket", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/retard", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cchord", 0, "BOOL")];
|
||||
var warningFlash = props.globals.initNode("/ECAM/warnings/master-warning-flash", 0, "BOOL");
|
||||
|
||||
var lineIndex = 0;
|
||||
|
@ -31,6 +31,9 @@ var storeFirstWarning = nil;
|
|||
|
||||
var warningNodes = {
|
||||
Logic: {
|
||||
altitudeAlert: props.globals.initNode("/ECAM/warnings/altitude-alert/c-chord"),
|
||||
altitudeAlertSteady: props.globals.initNode("/ECAM/warnings/altitude-alert/altitude-alert-steady"),
|
||||
altitudeAlertFlash: props.globals.initNode("/ECAM/warnings/altitude-alert/altitude-alert-flash"),
|
||||
crossbleedFault: props.globals.initNode("/ECAM/warnings/logic/crossbleed-fault"),
|
||||
crossbleedWai: props.globals.initNode("/ECAM/warnings/logic/crossbleed-wai"),
|
||||
bleed1LoTempUnsuc: props.globals.initNode("/ECAM/warnings/logic/bleed-1-lo-temp-unsucc"),
|
||||
|
|
|
@ -696,78 +696,24 @@ var messages_priority_3 = func {
|
|||
}
|
||||
|
||||
# C-Chord
|
||||
if ((pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("/systems/navigation/adr/output/baro-alt-1-capt")) < 200) or !pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("/systems/navigation/adr/output/baro-alt-corrected-1-capt")) < 200) {
|
||||
alt200 = 1;
|
||||
} else {
|
||||
alt200 = 0;
|
||||
}
|
||||
|
||||
if ((pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("/systems/navigation/adr/output/baro-alt-1-capt")) < 750) or !pts.Instrumentation.Altimeter.std.getValue() and abs(fcu.altSet.getValue() - getprop("/systems/navigation/adr/output/baro-alt-corrected-1-capt")) < 750) {
|
||||
alt750 = 1;
|
||||
} else {
|
||||
alt750 = 0;
|
||||
}
|
||||
|
||||
if (FWC.altChg.getValue() or pts.Gear.position[0].getValue() == 1 or (pts.Controls.Gear.gearDown.getValue() and pts.Fdm.JSBsim.Fcs.slatDeg.getValue() > 4) or fmgc.Output.vert.getValue() == 2) {
|
||||
altAlertInhibit = 1;
|
||||
} else {
|
||||
altAlertInhibit = 0;
|
||||
}
|
||||
|
||||
if (alt750 and !alt200 and !altAlertInhibit) {
|
||||
FWC.Monostable.altAlert2.setValue(1);
|
||||
} else {
|
||||
FWC.Monostable.altAlert2.setValue(0);
|
||||
}
|
||||
|
||||
if ((!fcu.ap1.getBoolValue() and !fcu.ap2.getBoolValue()) and FWC.Monostable.altAlert2.getValue()) {
|
||||
FWC.Monostable.altAlert1.setValue(1);
|
||||
} else {
|
||||
FWC.Monostable.altAlert1.setValue(0);
|
||||
}
|
||||
|
||||
if (alt750 and alt200 and !altAlertInhibit) {
|
||||
setprop("/ECAM/flipflop/alt-alert-2-rs-set", 1);
|
||||
} else {
|
||||
setprop("/ECAM/flipflop/alt-alert-2-rs-set", 0);
|
||||
}
|
||||
|
||||
if (getprop("/ECAM/flipflop/alt-alert-rs-reset") or (!alt750 and !alt200 and !altAlertInhibit)) {
|
||||
setprop("/ECAM/flipflop/alt-alert-2-rs-reset", 1);
|
||||
} else {
|
||||
setprop("/ECAM/flipflop/alt-alert-2-rs-reset", 0);
|
||||
}
|
||||
|
||||
if (alt750 and !alt200 and !altAlertInhibit and getprop("/ECAM/flipflop/alt-alert-2-rs-output")) {
|
||||
setprop("/ECAM/flipflop/alt-alert-3-rs-set", 1);
|
||||
} else {
|
||||
setprop("/ECAM/flipflop/alt-alert-3-rs-set", 0);
|
||||
}
|
||||
|
||||
if ((!alt750 and !alt200 and !altAlertInhibit and getprop("/ECAM/flipflop/alt-alert-rs-output")) or (!alt750 and !alt200 and !altAlertInhibit and getprop("/ECAM/flipflop/alt-alert-3-rs-output")) or getprop("/ECAM/flipflop/alt-alert-3-rs-set")) {
|
||||
bigThree = 1;
|
||||
} else {
|
||||
bigThree = 0;
|
||||
}
|
||||
|
||||
if (FWC.Timer.gnd.getValue() != 1 and (FWC.Monostable.altAlert1Output.getValue() or bigThree)) {
|
||||
if (warningNodes.Logic.altitudeAlert.getValue()) {
|
||||
if (!getprop("/sim/sound/warnings/cchord-inhibit")) {
|
||||
setprop("/sim/sound/warnings/cchord", 1);
|
||||
aural[4].setValue(1);
|
||||
} else {
|
||||
setprop("/sim/sound/warnings/cchord", 0);
|
||||
aural[4].setValue(0);
|
||||
}
|
||||
} else {
|
||||
setprop("/sim/sound/warnings/cchord", 0);
|
||||
aural[4].setValue(0);
|
||||
setprop("/sim/sound/warnings/cchord-inhibit", 0);
|
||||
}
|
||||
|
||||
if (FWC.Timer.gnd.getValue() != 1 and getprop("/ECAM/flipflop/alt-alert-3-rs-set") != 1 and alt750 and !alt200 and !altAlertInhibit) {
|
||||
if (warningNodes.Logic.altitudeAlertSteady.getValue()) {
|
||||
altAlertSteady = 1;
|
||||
} else {
|
||||
altAlertSteady = 0;
|
||||
}
|
||||
|
||||
if (FWC.Timer.gnd.getValue() != 1 and bigThree) {
|
||||
if (warningNodes.Logic.altitudeAlertFlash.getValue()) {
|
||||
altAlertFlash = 1;
|
||||
} else {
|
||||
altAlertFlash = 0;
|
||||
|
|
|
@ -65,12 +65,12 @@ var FWC = {
|
|||
eng1or2Output: props.globals.initNode("/ECAM/phases/timer/eng1or2-output", 0, "INT"),
|
||||
toInhibitOutput: props.globals.getNode("/ECAM/phases/timer/to-inhibit-output"),
|
||||
ldgInhibitOutput: props.globals.getNode("/ECAM/phases/timer/ldg-inhibit-output"),
|
||||
gnd: props.globals.getNode("/ECAM/timer/ground-calc"),
|
||||
gnd: props.globals.getNode("/ECAM/timer/ground-calc"), # ZGND
|
||||
gnd2Sec: props.globals.getNode("/ECAM/phases/monostable/gnd-output"),
|
||||
},
|
||||
speed80: props.globals.initNode("/ECAM/phases/speed-gt-80", 0, "BOOL"),
|
||||
toPower: props.globals.initNode("/ECAM/phases/to-power-set", 0, "BOOL"),
|
||||
altChg: props.globals.getNode("it-autoflight/input/alt-is-changing", 1),
|
||||
altChg: props.globals.getNode("/it-autoflight/input/alt-is-changing", 1),
|
||||
};
|
||||
|
||||
var phaseLoop = func() {
|
||||
|
|
|
@ -2378,4 +2378,188 @@
|
|||
|
||||
</channel>
|
||||
|
||||
<channel name="Altitude Alerter" execrate="8">
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/altInhibit">
|
||||
<default value="0"/>
|
||||
<test logic="OR" value="1">
|
||||
/it-autoflight/input/alt-is-changing eq 1
|
||||
<test logic="OR">
|
||||
<test logic="AND">
|
||||
/gear/gear[1]/position-norm ge 0.99
|
||||
/gear/gear[2]/position-norm ge 0.99
|
||||
</test>
|
||||
<test logic="AND">
|
||||
/controls/gear/gear-down eq 1
|
||||
/fdm/jsbsim/fcs/slat-pos-deg ge 4
|
||||
</test>
|
||||
</test>
|
||||
/it-autoflight/output/lat eq 4
|
||||
/it-autoflight/output/vert eq 2
|
||||
/it-autoflight/output/vert eq 6
|
||||
<!-- /it-autoflight/output/vert eq 7 check -->
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<fcs_function name="/ECAM/warnings/altitude-alert/altitude-difference">
|
||||
<function>
|
||||
<ifthen>
|
||||
<not><property>/instrumentation/altimeter[0]/std</property></not>
|
||||
<abs>
|
||||
<difference>
|
||||
<property>/systems/navigation/adr/output/baro-alt-corrected-1-capt</property>
|
||||
<property>/it-autoflight/input/alt</property>
|
||||
</difference>
|
||||
</abs>
|
||||
<abs>
|
||||
<difference>
|
||||
<property>/systems/navigation/adr/output/baro-alt-1-capt</property>
|
||||
<property>/it-autoflight/input/alt</property>
|
||||
</difference>
|
||||
</abs>
|
||||
</ifthen>
|
||||
</function>
|
||||
</fcs_function>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/alt200">
|
||||
<default value="0"/>
|
||||
<test logic="OR" value="1">
|
||||
/ECAM/warnings/altitude-alert/altitude-difference le 200
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/alt750">
|
||||
<default value="0"/>
|
||||
<test logic="OR" value="1">
|
||||
/ECAM/warnings/altitude-alert/altitude-difference le 750
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/big-3-1-off">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/ECAM/warnings/altitude-alert/altInhibit eq 0
|
||||
/ECAM/warnings/altitude-alert/alt200 eq 1
|
||||
/ECAM/warnings/altitude-alert/alt750 eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/big-3-2-off">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/ECAM/warnings/altitude-alert/altInhibit eq 0
|
||||
/ECAM/warnings/altitude-alert/alt200 eq 0
|
||||
/ECAM/warnings/altitude-alert/alt750 eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/big-3-all-off">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/ECAM/warnings/altitude-alert/altInhibit eq 0
|
||||
/ECAM/warnings/altitude-alert/alt200 eq 0
|
||||
/ECAM/warnings/altitude-alert/alt750 eq 0
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/flipflop-1-set">
|
||||
<default value="0"/>
|
||||
<test logic="OR" value="1">
|
||||
/ECAM/warnings/altitude-alert/big-3-1-off eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/flipflop-1-reset">
|
||||
<default value="0"/>
|
||||
<test logic="OR" value="1">
|
||||
/ECAM/warnings/altitude-alert/big-3-all-off eq 1
|
||||
/ECAM/warnings/altitude-alert/flipflop-2-reset eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/flipflop-2-set">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/ECAM/warnings/altitude-alert/big-3-2-off eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/flipflop-2-reset">
|
||||
<default value="0"/>
|
||||
<test logic="OR" value="1">
|
||||
<test logic="AND">
|
||||
/ECAM/warnings/altitude-alert/gear-downlocked-set eq 1
|
||||
/ECAM/warnings/altitude-alert/gear-downlocked-output eq 1
|
||||
</test>
|
||||
/ECAM/warnings/altitude-alert/alt-is-changing eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/flipflop-or-1">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/ECAM/warnings/altitude-alert/big-3-2-off eq 1
|
||||
/ECAM/warnings/altitude-alert/flipflop-1 eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/flipflop-or-2">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/ECAM/warnings/altitude-alert/big-3-all-off eq 1
|
||||
/ECAM/warnings/altitude-alert/flipflop-2 eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/flipflop-or">
|
||||
<default value="0"/>
|
||||
<test logic="OR" value="1">
|
||||
/ECAM/warnings/altitude-alert/flipflop-or-1 eq 1
|
||||
/ECAM/warnings/altitude-alert/flipflop-or-2 eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/monostable-autopilot">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/it-autoflight/output/ap1 eq 0
|
||||
/it-autoflight/output/ap2 eq 0
|
||||
/ECAM/warnings/altitude-alert/big-3-2-off eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/c-chord">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/ECAM/timer/ground-calc ne 1
|
||||
<test logic="OR">
|
||||
<test logic="AND">
|
||||
/ECAM/warnings/altitude-alert/monostable-autopilot eq 1
|
||||
/ECAM/warnings/altitude-alert/monostable-autopilot-output eq 1
|
||||
</test>
|
||||
/ECAM/warnings/altitude-alert/flipflop-or eq 1
|
||||
</test>
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/altitude-alert-steady">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/ECAM/timer/ground-calc ne 1
|
||||
/ECAM/warnings/altitude-alert/big-3-2-off eq 1
|
||||
/ECAM/warnings/altitude-alert/flipflop-or-1 eq 0
|
||||
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/ECAM/warnings/altitude-alert/altitude-alert-flash">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/ECAM/timer/ground-calc ne 1
|
||||
/ECAM/warnings/altitude-alert/flipflop-or eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
</channel>
|
||||
|
||||
</system>
|
||||
|
|
|
@ -239,44 +239,6 @@
|
|||
<output>ECAM/buttons/recall-status-normal-output</output>
|
||||
</flipflop>
|
||||
|
||||
<flipflop>
|
||||
<type>SR</type>
|
||||
<S>
|
||||
<property>ECAM/altitude-alert-monostable-set</property>
|
||||
</S>
|
||||
<R>
|
||||
<property>ECAM/altitude-alert-monostable-intermediate-output</property>
|
||||
</R>
|
||||
<output>ECAM/altitude-alert-monostable-flipflop-intermediate</output>
|
||||
</flipflop>
|
||||
|
||||
<flipflop>
|
||||
<type>monostable</type>
|
||||
<inverted type="bool">true</inverted>
|
||||
<time>
|
||||
<value>1.5</value>
|
||||
</time>
|
||||
<S>
|
||||
<not><property>ECAM/altitude-alert-monostable-flipflop-intermediate</property></not>
|
||||
</S>
|
||||
<output>ECAM/altitude-alert-monostable-intermediate-output</output>
|
||||
</flipflop>
|
||||
|
||||
<filter>
|
||||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<input>
|
||||
<condition>
|
||||
<and>
|
||||
<property>ECAM/altitude-alert-monostable-flipflop-intermediate</property>
|
||||
<not><property>ECAM/altitude-alert-monostable-intermediate-output</property></not>
|
||||
</and>
|
||||
</condition>
|
||||
<value>1</value>
|
||||
</input>
|
||||
<output>ECAM/altitude-alert-monostable-output</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<type>derivative</type>
|
||||
<input>it-autoflight/input/alt</input>
|
||||
|
@ -292,10 +254,12 @@
|
|||
<S>
|
||||
<property>it-autoflight/input/alt-is-changing</property>
|
||||
</S>
|
||||
<output>ECAM/alt-is-changing</output>
|
||||
<output>ECAM/warnings/altitude-alert/alt-is-changing</output>
|
||||
</flipflop>
|
||||
|
||||
<filter>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<input>
|
||||
<condition>
|
||||
<equals>
|
||||
|
@ -314,7 +278,7 @@
|
|||
</condition>
|
||||
<value>0</value>
|
||||
</input>
|
||||
<output>ECAM/gear-downlocked-set</output>
|
||||
<output>ECAM/warnings/altitude-alert/gear-downlocked-set</output>
|
||||
</filter>
|
||||
|
||||
<flipflop>
|
||||
|
@ -323,67 +287,9 @@
|
|||
<value>1</value>
|
||||
</time>
|
||||
<S>
|
||||
<property>ECAM/gear-downlocked-set</property>
|
||||
<not><property>ECAM/warnings/altitude-alert/gear-downlocked-set</property></not>
|
||||
</S>
|
||||
<output>ECAM/gear-downlocked-output</output>
|
||||
</flipflop>
|
||||
|
||||
|
||||
<filter>
|
||||
<type>gain</type>
|
||||
<gain>1.0</gain>
|
||||
<input>
|
||||
<condition>
|
||||
<or>
|
||||
<equals><property>ECAM/gear-downlocked-output</property><value>1</value></equals>
|
||||
<equals><property>ECAM/alt-is-changing</property><value>1</value></equals>
|
||||
</or>
|
||||
</condition>
|
||||
<value>1</value>
|
||||
</input>
|
||||
<input>
|
||||
<condition>
|
||||
<and>
|
||||
<equals><property>ECAM/gear-downlocked-output</property><value>0</value></equals>
|
||||
<equals><property>ECAM/alt-is-changing</property><value>0</value></equals>
|
||||
</and>
|
||||
</condition>
|
||||
<value>0</value>
|
||||
</input>
|
||||
<output>ECAM/flipflop/alt-alert-rs-reset</output>
|
||||
</filter>
|
||||
|
||||
<flipflop>
|
||||
<type>RS</type>
|
||||
<S>
|
||||
<property>ECAM/flipflop/altitude-alert-rs-set</property>
|
||||
</S>
|
||||
<R>
|
||||
<property>ECAM/flipflop/alt-alert-rs-reset</property>
|
||||
</R>
|
||||
<output>ECAM/flipflop/alt-alert-rs-output</output>
|
||||
</flipflop>
|
||||
|
||||
<flipflop>
|
||||
<type>RS</type>
|
||||
<S>
|
||||
<property>ECAM/flipflop/alt-alert-2-rs-set</property>
|
||||
</S>
|
||||
<R>
|
||||
<property>ECAM/flipflop/alt-alert-2-rs-reset</property>
|
||||
</R>
|
||||
<output>ECAM/flipflop/alt-alert-2-rs-output</output>
|
||||
</flipflop>
|
||||
|
||||
<flipflop>
|
||||
<type>RS</type>
|
||||
<S>
|
||||
<property>ECAM/flipflop/alt-alert-3-rs-set</property>
|
||||
</S>
|
||||
<R>
|
||||
<property>ECAM/flipflop/alt-alert-rs-reset</property>
|
||||
</R>
|
||||
<output>ECAM/flipflop/alt-alert-3-rs-output</output>
|
||||
<output>ECAM/warnings/altitude-alert/gear-downlocked-output</output>
|
||||
</flipflop>
|
||||
|
||||
<!-- falling edge detector - take inverse of following -->
|
||||
|
@ -1069,4 +975,37 @@
|
|||
<output>/ECAM/warnings/logic/green-yellow-press-on-monostable</output>
|
||||
</flipflop>
|
||||
|
||||
<flipflop>
|
||||
<type>RS</type>
|
||||
<S>
|
||||
<property>/ECAM/warnings/altitude-alert/flipflop-1-set</property>
|
||||
</S>
|
||||
<R>
|
||||
<property>/ECAM/warnings/altitude-alert/flipflop-1-reset</property>
|
||||
</R>
|
||||
<output>/ECAM/warnings/altitude-alert/flipflop-1</output>
|
||||
</flipflop>
|
||||
|
||||
<flipflop>
|
||||
<type>RS</type>
|
||||
<S>
|
||||
<property>/ECAM/warnings/altitude-alert/flipflop-2-set</property>
|
||||
</S>
|
||||
<R>
|
||||
<property>/ECAM/warnings/altitude-alert/flipflop-2-reset</property>
|
||||
</R>
|
||||
<output>/ECAM/warnings/altitude-alert/flipflop-2</output>
|
||||
</flipflop>
|
||||
|
||||
<flipflop>
|
||||
<type>monostable</type>
|
||||
<time>
|
||||
<value>1.5</value>
|
||||
</time>
|
||||
<S>
|
||||
<not><property>/ECAM/warnings/altitude-alert/monostable-autopilot</property></not>
|
||||
</S>
|
||||
<output>/ECAM/warnings/altitude-alert/monostable-autopilot-output</output>
|
||||
</flipflop>
|
||||
|
||||
</PropertyList>
|
||||
|
|
Loading…
Reference in a new issue