Just this evening another FIAT G91R1B user told me about the problem with the cart reported in this post (I never modified the GIT after the beginning of this post on the forum so the user used a version of the previous plane). The user had not updated his version of FGFS for several months, but he updated it this morning ... and the G91R1B was with the landing gear closed if the simulation starts on the landing strip. For some weeks now I had solved the problem by entering a code that checks the status of the landing gear.
This modification also allows to solve another problem, when the plane is in flight the landing gear must stay closed ...
Unfortunately it does not solve the problem in the case of repositioning because the code is a file that is followed only once.
However, the incident confirms that the problem arose from a revision of FGFS 2019.2 which took place around mid-November 2019. I am convinced that JSBSim does not see all the information necessary for its initialization, it could be a binding problem with the property tree of FGFS, I think, but it is only a suspicion, that missing JSBSim of a synchronization system with the calling application (it is a problem that will arise tomorrow if JSBSim is run on a different CPU). In fact, on my system, if I query the "/sim/presets/onground" ... this property for JSBSim, it does not exist in the first few moments of execution and therefore the plane crashes.
However, this change, even if it looks like a patch, solves the problem and has the advantage of placing the landing gear closed when the simulation starts with the flying plane, which was actually what I wanted. Unfortunately it does not solve the problem when the plane is again positioned during the simulation ... as this script is not executed in that context.
File: G91-R1B-Common.xml
- Code: Select all
<nasal>
....
<set-gear-down-script>
<script>
if(getprop("/sim/presets/onground")) {
setprop("controls/gear/gear-down", "true");
} else {
setprop("controls/gear/gear-down", "false");
}
print("#### initialize > controls/gear/gear-down set to true");
print("#### initialize > /sim/presets/onground:",getprop("/sim/presets/onground"),":");
</script>
</set-gear-down-script>
</nasal>