/* -*- C++ -*- * Copyright ©2004 Hugo Mills * * This software is distributed under the terms of the GNU GPL v3 * For more information on the GPL, see the file COPYING or * visit http://www.gnu.org/ * * This software is distributed without warranty */ #include "xforbit_fixed.h" extern "C" PluginInfo* getmodules(int i) { if(i==0) { PluginInfo_Orbit* pi = new PluginInfo_Orbit(); pi->name = "Fixed-position Orbit"; pi->author = "Hugo Mills"; pi->copyright = "©2005 Hugo Mills"; pi->version = 0x10000; pi->parser = XfOrbit_Fixed::parser; return pi; } else return NULL; } XfOrbit* XfOrbit_Fixed::parser( ConfigLexer* lex, const std::string& type, const std::string& subtype ) { if(type != "fixed-position") return NULL; double lon = 0.0; double lat = 0.0; while(!lex->eos()) { if(readkeyedvalue(lex, "longitude", &lon) || readkeyedvalue(lex, "latitude", &lat) || readkeyedvalue(lex, "position", &lon, &lat) ) ; else throw(UnknownConfigToken(lex)); } return new XfOrbit_Fixed(lon, lat); } XfOrbit_Fixed::XfOrbit_Fixed(double lon, double lat) : XfOrbit() { setmatrices(lon, lat); }