JSBSim-Team / jsbsim

An open source flight dynamics & control software library
GNU Lesser General Public License v2.1
1.33k stars 444 forks source link

Relocate break <equals> clause in function component #215

Closed NikolaiVChr closed 4 years ago

NikolaiVChr commented 5 years ago

The issue is that in the JA37 in Flightgear, at least one JSB function component stop working after relocation (move to another airport), from some investigation of it it seems like the property it reads has another value than the property really has.

The component looks like this:

<fcs_function name="systems/indicators/fuel-flow-primary">
            <function>
                <and>
                    <gt>
                        <property>/ja37/avionics/fuel-internal-ratio</property>
                        <value>0.43</value>
                    </gt>
                    <eq>
                        <property>/gear/gear[0]/position-norm</property>
                        <value>1</value>
                    </eq>
                    <eq>
                        <p>systems/fuel/pneumatic-low-pressure</p>
                        <v>0</v>
                    </eq>
                </and>
            </function>
        </fcs_function>

No matter if the systems/fuel/pneumatic-low-pressure is 0 or 1 the equal tags around it will yield true. Also tried with the opposite a not-equal tags on value 1, and it has the same issue. Plus tried with a function that only has that equal test, same result.

If relocate a second time, it starts working again.

Discovered a strange workaround to this issue; to load the jsb system file (jsb-indicators.xml) where this component is located after the jsb system file (jsb-fuel.xml) where systems/fuel/pneumatic-low-pressure is output.

A second workaround is that replacing the component with a switch also solves the issue.

It seems to happen 100% of the time in Flightgear 2019.1.1 (Windows).

You can read the details and how to reproduce here:
https://github.com/NikolaiVChr/flightgear-saab-ja-37-viggen/issues/77

bcoconni commented 4 years ago

Sorry but the "relocate" function is a FlightGear function and there is no evidence that the issue is caused by JSBSim. As long as this issue cannot be reproduced with JSBSim alone, it should be discussed with FG maintainers.