parking.cxx parking.hxx \
groundnetwork.cxx groundnetwork.hxx \
dynamics.cxx dynamics.hxx \
- trafficcontrol.hxx trafficcontrol.cxx \
- dynamicloader.hxx dynamicloader.cxx \
- runwayprefloader.hxx runwayprefloader.cxx \
- xmlloader.hxx xmlloader.cxx
-
+ trafficcontrol.cxx trafficcontrol.hxx \
+ dynamicloader.cxx dynamicloader.hxx \
+ runwayprefloader.cxx runwayprefloader.hxx \
+ xmlloader.cxx xmlloader.hxx \
+ gnnode.hxx
calc_loc_SOURCES = calc_loc.cxx
calc_loc_LDADD = -lsgmath -lsgdebug -lsgmisc -lz $(base_LIBS)
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+
#include "dynamicloader.hxx"
FGAirportDynamicsXMLLoader::FGAirportDynamicsXMLLoader(FGAirportDynamics* dyn):
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+
#ifndef _DYNAMIC_LOADER_HXX_
#define _DYNAMIC_LOADER_HXX_
--- /dev/null
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+
+#ifndef _GN_NODE_HXX_
+#define _GN_NODE_HXX_
+
+#include <vector>
+#include <string>
+#include <simgear/compiler.h>
+
+SG_USING_STD(string);
+SG_USING_STD(vector);
+
+class FGTaxiSegment;
+typedef vector<FGTaxiSegment*> FGTaxiSegmentVector;
+typedef FGTaxiSegmentVector::iterator FGTaxiSegmentVectorIterator;
+
+double processPosition(const string& pos);
+
+class FGTaxiNode
+{
+private:
+ double lat;
+ double lon;
+ int index;
+ FGTaxiSegmentVector next; // a vector of pointers to all the segments leaving from this node
+
+public:
+ FGTaxiNode();
+ FGTaxiNode(double, double, int);
+
+ void setIndex(int idx) { index = idx;};
+ void setLatitude (double val) { lat = val;};
+ void setLongitude(double val) { lon = val;};
+ void setLatitude (const string& val) { lat = processPosition(val); };
+ void setLongitude(const string& val) { lon = processPosition(val); };
+ void addSegment(FGTaxiSegment *segment) { next.push_back(segment); };
+
+ double getLatitude() { return lat;};
+ double getLongitude(){ return lon;};
+
+ int getIndex() { return index; };
+ FGTaxiNode *getAddress() { return this;};
+ FGTaxiSegmentVectorIterator getBeginRoute() { return next.begin(); };
+ FGTaxiSegmentVectorIterator getEndRoute() { return next.end(); };
+ bool operator<(const FGTaxiNode &other) const { return index < other.index; };
+
+ void sortEndSegments(bool);
+
+ // used in way finding
+ double pathscore;
+ FGTaxiNode* previousnode;
+ FGTaxiSegment* previousseg;
+
+};
+
+typedef vector<FGTaxiNode*> FGTaxiNodeVector;
+typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator;
+
+#endif
//#include <Main/fg_props.hxx>
//#include <Airports/runways.hxx>
-
#include <AIModel/AIFlightPlan.hxx>
//#include STL_STRING
SG_USING_STD(sort);
-
+/*****************************************************************************
+ * 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 <<endl;
+ //exit(1);
+ return value;
+}
/**************************************************************************
* FGTaxiNode
#include <simgear/compiler.h>
#include <simgear/route/waypoint.hxx>
-
#include STL_STRING
#include <vector>
SG_USING_STD(string);
SG_USING_STD(vector);
+#include "gnnode.hxx"
#include "parking.hxx"
#include "trafficcontrol.hxx"
-
-
class FGTaxiSegment; // forward reference
class FGAIFlightPlan; // forward reference
class FGAirport; // forward reference
//typedef vector<FGTaxiSegment*> FGTaxiSegmentPointerVector;
//typedef vector<FGTaxiSegment*>::iterator FGTaxiSegmentPointerVectorIterator;
-/**************************************************************************************
- * class FGTaxiNode
- *************************************************************************************/
-class FGTaxiNode
-{
-private:
- double lat;
- double lon;
- int index;
- FGTaxiSegmentVector next; // a vector of pointers to all the segments leaving from this node
-
-public:
- FGTaxiNode();
- FGTaxiNode(double, double, int);
-
- void setIndex(int idx) { index = idx;};
- void setLatitude (double val) { lat = val;};
- void setLongitude(double val) { lon = val;};
- void setLatitude (const string& val) { lat = processPosition(val); };
- void setLongitude(const string& val) { lon = processPosition(val); };
- void addSegment(FGTaxiSegment *segment) { next.push_back(segment); };
-
- double getLatitude() { return lat;};
- double getLongitude(){ return lon;};
-
- int getIndex() { return index; };
- FGTaxiNode *getAddress() { return this;};
- FGTaxiSegmentVectorIterator getBeginRoute() { return next.begin(); };
- FGTaxiSegmentVectorIterator getEndRoute() { return next.end(); };
- bool operator<(const FGTaxiNode &other) const { return index < other.index; };
-
- void sortEndSegments(bool);
-
- // used in way finding
- double pathscore;
- FGTaxiNode* previousnode;
- FGTaxiSegment* previousseg;
-
-};
-
-typedef vector<FGTaxiNode*> FGTaxiNodeVector;
-typedef vector<FGTaxiNode*>::iterator FGTaxiNodeVectorIterator;
-
/***************************************************************************************
* class FGTaxiSegment
**************************************************************************************/
#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 <<endl;
- //exit(1);
- return value;
-}
-
-
/*********************************************************************************
* FGParking
********************************************************************************/
const string &name,
const string &tpe,
const string &codes)
+ : FGTaxiNode(lat,lon,idx)
{
- latitude = lat;
- longitude = lon;
heading = hdg;
parkingName = name;
- index = idx;
type = tpe;
airlineCodes = codes;
}
#include STL_STRING
#include <vector>
+#include "gnnode.hxx"
SG_USING_STD(string);
SG_USING_STD(vector);
-double processPosition(const string& pos);
-
-class FGParking {
+class FGParking : public FGTaxiNode {
private:
- double latitude;
- double longitude;
double heading;
double radius;
- int index;
string parkingName;
string type;
string airlineCodes;
const string& name,
const string& tpe,
const string& codes);
- void setLatitude (const string& lat) { latitude = processPosition(lat); };
- void setLongitude(const string& lon) { longitude = processPosition(lon); };
+
void setHeading (double hdg) { heading = hdg; };
void setRadius (double rad) { radius = rad; };
- void setIndex (int idx) { index = idx; };
+
void setName (const string& name) { parkingName = name; };
void setType (const string& tpe) { type = tpe; };
void setCodes (const string& codes){ airlineCodes= codes;};
bool isAvailable () { return available;};
void setAvailable(bool val) { available = val; };
- double getLatitude () { return latitude; };
- double getLongitude() { return longitude; };
double getHeading () { return heading; };
double getRadius () { return radius; };
- int getIndex () { return index; };
+
string getType () { return type; };
string getCodes () { return airlineCodes;};
string getName () { return parkingName; };
- bool operator< (const FGParking &other) const {return radius < other.radius; };
+ bool operator< (const FGParking &other) const {
+ return radius < other.radius; };
};
typedef vector<FGParking> FGParkingVec;
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+
#include <simgear/debug/logstream.hxx>
#include "runwayprefloader.hxx"
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+
#ifndef _RUNWAY_PREF_LOADER_HXX_
#define _RUNWAY_PREF_LOADER_HXX_
FGAirport(const string& id, double lon, double lat, double elev, const string& name, bool has_metar);
~FGAirport();
- string getId() const { return _id; }
- const string &getName() const { return _name; }
+ const string& getId() const { return _id; }
+ const string& getName() const { return _name; }
double getLongitude() const { return _longitude; }
// Returns degrees
double getLatitude() const { return _latitude; }
/***************************************************************************
* FGTrafficRecord
**************************************************************************/
+FGTrafficRecord::FGTrafficRecord() :
+ id(0), waitsForId(0),
+ currentPos(0),
+ leg(0),
+ latitude(0),
+ longitude(0),
+ heading(0),
+ speed(0),
+ altitude(0),
+ radius(0) {
+}
+
void FGTrafficRecord::setPositionAndIntentions(int pos, FGAIFlightPlan *route)
{
if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
FGTrafficRecord rec;
rec.setId(id);
+
rec.setPositionAndHeading(lat, lon, heading, speed, alt);
rec.setRunway(intendedRoute->getRunway());
rec.setLeg(leg);
public:
- FGTrafficRecord() {};
+ FGTrafficRecord();
void setId(int val) { id = val; };
void setRadius(double rad) { radius = rad;};
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+
#include <simgear/misc/sg_path.hxx>
#include <Main/globals.hxx>
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+
#ifndef _XML_LOADER_HXX_
#define _XML_LOADER_HXX_