From: Gijs de R. <gij...@ho...> - 2019-03-11 17:11:51
|
Hi all, I've got a question about nested tests in switches. The following code does not work as advertised in current FlightGear. Whenever fcs/flaps/cmd-detent-deg == 25 or 30, fcs/flaps/int-cmd-deg is set to 20, even tough the velocity is smaller than 203 (in fact it is 0). Apparently the first nested test ignores the velocity test. <switch name="fcs/flaps/int-cmd-deg"> <default value="fcs/flaps/cmd-detent-deg"/> <test logic="AND" value="20"> velocities/vc-kts GT 203 <test logic="OR"> fcs/flaps/cmd-detent-deg == 25 fcs/flaps/cmd-detent-deg == 30 </test> </test> <test logic="AND" value="25"> velocities/vc-kts GT 170 velocities/vc-kts LT 203 fcs/flaps/cmd-detent-deg == 30 </test> </switch> The following does work, but it leads to more duplicated code: <switch name="fcs/flaps/int-cmd-deg"> <default value="fcs/flaps/cmd-detent-deg"/> <test logic="AND" value="20"> velocities/vc-kts GT 203 fcs/flaps/cmd-detent-deg == 25 </test> <test logic="AND" value="20"> velocities/vc-kts GT 203 fcs/flaps/cmd-detent-deg == 30 </test> <test logic="AND" value="25"> velocities/vc-kts GT 170 velocities/vc-kts LT 203 fcs/flaps/cmd-detent-deg == 30 </test> </switch> According to an old message by Jon [1], the first one was known to fail back in 2012, but I think it should work nowadays, right? Is it broken (again) or did I miss anything? Thanks! Gijs [1] https://sourceforge.net/p/jsbsim/mailman/message/30022194/ |