4e89d05fb4
user attribute "version" of the airplane element of the YASim config file to define the version this config uses. Example: <airplane mass="1344" version="YASIM_VERSION_CURRENT"> Initially, the following can be used: YASIM_VERSION_ORIGINAL - The original version of YASim as implemented up to FlightGear 3.0.0 YASIM_VERSION_32 - The version of YASim implemented in FlightGear 3.2.x (and the development version 3.1.x) YASIM_VERSION_CURRENT - The current and latest version of YASim.
25 lines
627 B
C++
25 lines
627 B
C++
#ifdef HAVE_CONFIG_H
|
|
# include "config.h"
|
|
#endif
|
|
|
|
#include "Version.hpp"
|
|
#include <simgear/debug/logstream.hxx>
|
|
#include <string>
|
|
|
|
namespace yasim {
|
|
void Version::setVersion( const char * version )
|
|
{
|
|
const std::string v(version);
|
|
|
|
if( v == "YASIM_VERSION_ORIGINAL" ) {
|
|
_version = YASIM_VERSION_ORIGINAL;
|
|
} else if( v == "YASIM_VERSION_32" ) {
|
|
_version = YASIM_VERSION_32;
|
|
} else if( v == "YASIM_VERSION_CURRENT" ) {
|
|
_version = YASIM_VERSION_CURRENT;
|
|
} else {
|
|
SG_LOG(SG_FLIGHT,SG_ALERT,"unknown yasim version '" << version << "' ignored, using YASIM_VERSION_ORIGINAL");
|
|
}
|
|
}
|
|
|
|
} // namespace yasim
|