// parking.cxx - Implementation of a class to manage aircraft parking in // FlightGear. This code is intended to be used by AI code and // initial user-startup location selection. // // Written by Durk Talsma, started December 2004. // // Copyright (C) 2004 Durk Talsma. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as // published by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id$ #ifdef HAVE_CONFIG_H # include #endif //#include #include //#include //#include //#include //#include //#include //#include //#include //#include //#include
//#include
//#include #include STL_STRING #include "parking.hxx" /***************************************************************************** * Helper function for parsing position string ****************************************************************************/ double processPosition(const string &pos) { string prefix; string subs; string degree; string decimal; int sign = 1; double value; subs = pos; prefix= subs.substr(0,1); if (prefix == string("S") || (prefix == string("W"))) sign = -1; subs = subs.substr(1, subs.length()); degree = subs.substr(0, subs.find(" ",0)); decimal = subs.substr(subs.find(" ",0), subs.length()); //cerr << sign << " "<< degree << " " << decimal << endl; value = sign * (atof(degree.c_str()) + atof(decimal.c_str())/60.0); //cerr << value <