+ bool fdmUnavailable = false;
+
+ if ( model == "ufo" ) {
+ _impl = new FGUFO( dt );
+ } else if ( model == "external" ) {
+ // external is a synonym for "--fdm=null" and is
+ // maintained here for backwards compatibility
+ _impl = new FGNullFDM( dt );
+ } else if ( model.find("network") == 0 ) {
+ string host = "localhost";
+ int port1 = 5501;
+ int port2 = 5502;
+ int port3 = 5503;
+ string net_options = model.substr(8);
+ string::size_type begin, end;
+ begin = 0;
+ // host
+ end = net_options.find( ",", begin );
+ if ( end != string::npos ) {
+ host = net_options.substr(begin, end - begin);
+ begin = end + 1;
+ }
+ // port1
+ end = net_options.find( ",", begin );
+ if ( end != string::npos ) {
+ port1 = atoi( net_options.substr(begin, end - begin).c_str() );
+ begin = end + 1;
+ }
+ // port2
+ end = net_options.find( ",", begin );
+ if ( end != string::npos ) {
+ port2 = atoi( net_options.substr(begin, end - begin).c_str() );
+ begin = end + 1;
+ }
+ // port3
+ end = net_options.find( ",", begin );
+ if ( end != string::npos ) {
+ port3 = atoi( net_options.substr(begin, end - begin).c_str() );
+ begin = end + 1;
+ }
+ _impl = new FGExternalNet( dt, host, port1, port2, port3 );
+ } else if ( model.find("pipe") == 0 ) {
+ // /* old */ string pipe_path = model.substr(5);
+ // /* old */ _impl = new FGExternalPipe( dt, pipe_path );
+ string pipe_path = "";
+ string pipe_protocol = "";
+ string pipe_options = model.substr(5);
+ string::size_type begin, end;
+ begin = 0;
+ // pipe file path
+ end = pipe_options.find( ",", begin );
+ if ( end != string::npos ) {
+ pipe_path = pipe_options.substr(begin, end - begin);
+ begin = end + 1;
+ }
+ // protocol (last option)
+ pipe_protocol = pipe_options.substr(begin);
+ _impl = new FGExternalPipe( dt, pipe_path, pipe_protocol );
+ } else if ( model == "null" ) {
+ _impl = new FGNullFDM( dt );
+ }
+ else if ( model == "larcsim" ) {
+#ifdef ENABLE_LARCSIM