- Code: Select all
<logic>
<name>Altitude alert</name>
<enable>
<condition>
<not>
<or>
<greater-than>
<property>/fdm/jsbsim/fcs/flap-pos-norm</property>
<value>0.7</value> <!-- flaps more than 20 degrees -->
</greater-than>
<property>/autopilot/internal/VNAV-GS</property>
</or>
</not>
</condition>
</enable>
<debug>true</debug>
<input>
<condition>
<or>
<and>
<property>/autopilot/internal/CMDB</property>
<not><property>/autopilot/internal/CMDA</property></not>
</and>
<and>
<property>/instrumentation/flightdirector/fd-right-on</property>
<not><property>/instrumentation/flightdirector/fd-left-on</property></not>
</and>
</or>
</condition>
<and>
<greater-than>
<property>/b737/helpers/alt-diff-ft[1]</property>
<value>300</value>
</greater-than>
<less-than>
<property>/b737/helpers/alt-diff-ft[1]</property>
<value>900</value>
</less-than>
<greater-than>
<property>/b737/sound/mcp-period</property>
<value>3</value>
</greater-than>
</and>
</input>
<input>
<and>
<greater-than>
<property>/b737/helpers/alt-diff-ft[0]</property>
<value>300</value>
</greater-than>
<less-than>
<property>/b737/helpers/alt-diff-ft[0]</property>
<value>900</value>
</less-than>
<greater-than>
<property>/b737/sound/mcp-period</property>
<value>3</value>
</greater-than>
</and>
</input>
<output>/b737/warnings/altitude-alert</output>
</logic>
What I'm waiting: only if CMDB is on and CMDA is off or FD on right side is on while FD on left side is off, I want to have first input value (using altitude reference number 1). In all other cases I want to have second input (without condition parameters) using altitude reference number 0. Maybe I'm doing something wrong, but I was looking at this my code many times and don't see error in my logic (maybe I'm wrong) or, maybe, conditions in logic filter for input do not work. Can you help me please?