Howto:Methods to replace the NASAL code with JSBSim code: Difference between revisions

Jump to navigation Jump to search
Line 71: Line 71:


The animation of the switch in the '' <PropertyList> '' is made of two parts:
The animation of the switch in the '' <PropertyList> '' is made of two parts:
# Animation type ''pick'' to detect the switching action
# Animation type ''rotate'' to perform the switching action


The animation type ''pick'' is the trigger to activate the action and the property ''fdm/jsbsim/systems/switches/sw-test'' is the memory status that is placed directly inside the property list in the ''fdm/jsbsim'' area in order to have a location that is easy to find. It is possible to note that it is convenient to set up sub-folders (''../switches'') so that these properties are grouped together so that the code can be read more easily. The tags: ''<repeatable>false</repeatable>'' and ''<interval-sec>0.5</interval-sec>'' are essential because they avoid the rebound effect, the reason is due to the fact that the JSBSim code is executed with a different clock than the XML that defines the switch in the ''ProperyList'', so it is possible that the state of the switch changes when the JSBSim code has not yet been executed, generating a sort of virtual rebound that would make the change in status aleatory.
The animation type ''pick'' is the trigger to activate the action and the property ''fdm/jsbsim/systems/switches/sw-test'' is the memory status that is placed directly inside the property list in the ''fdm/jsbsim'' area in order to have a location that is easy to find. It is possible to note that it is convenient to set up sub-folders (''../switches'') so that these properties are grouped together so that the code can be read more easily. The tags: ''<repeatable>false</repeatable>'' and ''<interval-sec>0.5</interval-sec>'' are essential because they avoid the rebound effect, the reason is due to the fact that the JSBSim code is executed with a different clock than the XML that defines the switch in the ''ProperyList'', so it is possible that the state of the switch changes when the JSBSim code has not yet been executed, generating a sort of virtual rebound that would make the change in status aleatory.
408

edits

Navigation menu