From: Jon B. <js...@ha...> - 2005-08-12 14:05:24
|
As you know, JSBSim has been undergoing some major design upgrades including the incorporation of a more robust XML parser and config file format. This necessitates converting older aircraft config files into the new format. That can be done by hand, but is tedious. A facility has been added to the last release of "old" JSBSim (standalone application) that converts an aircraft config file into the new format. Getting or Building the Converter --------------------------------- You can download a copy of the converter application executable for Cygwin from the JSBSim web site here: http://sourceforge.net/project/showfiles.php?group_id=19399 You can also do an anonymous check out of the code from CVS like this: cvs -d:pserver:ano...@cv...:/cvsroot/jsbsim login cvs -z3 -d:pserver:ano...@cv...:/cvsroot/jsbsim co -r HEAD_LEGACY_1 JSBSim Then, cd to the JSBSim/ directory and type: make -fMakefile.solo Using the converter ------------------- The converter is simply the JSBSim standalone application with added features. You run it like normal, but add the "--convert" option: ./jsbsim --convert --aircraft=myaircraft For example: ./jsbsim --convert --aircraft=T38 The aircraft to be converted must be in the aircraft/ directory under a directory with the same name as the aircraft, as before. Caveats ------- This converter will not (at this time) convert engines, thrusters, scripts, or autopilots (that are in separate files) to the new format. Engines, thrusters, and scripts must be hand converted (it's not a big deal, really). Any autopilot definitions that are in a separate file can be temporarily copied into the <autopilot> section of the main aircraft config file. That should work. I haven't tried this yet. If that does not work, then copy the autopilot into the <flight_control> section. After conversion, copy it back. All files must now be properly formatted XML files. Scripts have changed. To make them well-formed XML files you must now place a "/" at the end of single element definitions: The new way: <use aircraft="c172x"/> <use initialize="reset00"/> <run start="0.0" end="100" dt="0.00833333"> <when> <parameter name="sim-time-sec" comparison="ge" value="0.25"/> <parameter name="sim-time-sec" comparison="le" value="1.00"/> <set name="fcs/throttle-cmd-norm" value="1.0" action="FG_RAMP" tc ="0.05"/> <set name="fcs/mixture-cmd-norm" value="0.55" action="FG_RAMP" tc ="0.05"/> <set name="propulsion/magneto_cmd" value="3"/> <set name="propulsion/starter_cmd" value="1"/> </when> ... Notice also that type="FG_VALUE" action="FG_STEP" persistent="false" are all now the default and do not need to be explicitly specified. Also, the tc (time constant) is superfluous if the action is FG_STEP. In the new format above, notice the "/" character at the end of the set, parameter, and use lines. Information on the new engine format and thrusters will be forthcoming in the new format definition document. Until then, look at examples in the CVS repository for new aircraft which have already been converted. Also, post any questions here. Thanks, Jon |