15#include <simgear/compiler.h>
16#include <simgear/math/SGMath.hxx>
17#include <simgear/structure/SGSharedPtr.hxx>
18#include <simgear/structure/exception.hxx>
27 std::string name =
"unnamed";
31 bool finished =
false;
32 bool gear_down =
true;
34 double spoilers = 0.0;
35 double speedbrakes = 0.0;
39 double trackLength = 0.0;
42 bool beacon_light =
false;
43 bool landing_light =
false;
44 bool nav_light =
false;
45 bool strobe_light =
false;
46 bool taxi_light =
false;
47 bool cabin_light =
false;
53 void setName(
const std::string& nam) { name = nam; };
57 void setPos(
const SGGeod& aPos) { pos = aPos; }
69 void setTime(
const std::string& tme) { time = tme; };
70 void setLights(
bool beacon,
bool cabin,
bool ldg,
bool nav,
bool strobe,
bool taxi)
72 beacon_light = beacon;
76 strobe_light = strobe;
95 const std::string&
getName() {
return name; };
96 const SGGeod&
getPos() {
return pos; };
113 const std::string&
getTime() {
return time; };
129 const std::string&
p,
132 time_t remainingTime,
141 const std::string& fltType,
142 const std::string& acType,
143 const std::string& airline);
158 bool readFlightplan(std::istream& stream,
const sg_location& loc = sg_location{});
183 bool firstLeg,
double radius,
const std::string& fltType,
const std::string& aircraftType,
const std::string& airline,
double distance);
189 SG_LOG(SG_AI, SG_BULK,
"Set Leg " << leg);
209 SG_LOG(SG_AI, SG_BULK,
"Increment Leg " << leg);
213 void setRunway(
const std::string& rwy) { activeRunway = rwy; };
218 void setName(
const std::string& n) { name = n; };
219 const std::string&
getName() {
return name; };
238 typedef std::vector<FGAIWaypoint*> wpt_vector_type;
239 typedef wpt_vector_type::const_iterator wpt_vector_iterator;
242 wpt_vector_type waypoints;
243 wpt_vector_iterator wpt_iterator;
246 double distance_to_go = 0;
248 double lead_distance_ft = 0;
249 double leadInAngle = 0;
250 double nextTurnAngle = 0;
256 std::string activeRunway;
261 time_t calcArrivalTimes()
const;
263 void createPushBackFallBack(
FGAIAircraft*,
bool,
FGAirport*,
double radius,
const std::string&,
const std::string&,
const std::string&);
264 bool createTakeoffTaxi(
FGAIAircraft*,
bool firstFlight,
FGAirport* apt,
double radius,
const std::string& fltType,
const std::string& acType,
const std::string& airline);
267 bool createDescent(
FGAIAircraft*,
FGAirport*,
const SGGeod& current,
double speed,
double alt,
const std::string&,
double distance);
268 bool createHold(
FGAIAircraft*,
FGAirport*,
const SGGeod& current,
double speed,
double alt,
const std::string&,
double distance);
270 bool createLandingTaxi(
FGAIAircraft*,
FGAirport* apt,
double radius,
const std::string& fltType,
const std::string& acType,
const std::string& airline);
274 void deleteWaypoints();
275 void resetWaypoints();
276 void eraseLastWaypoint();
280 void createArc(
FGAIAircraft* ac,
const SGGeod& center,
int startAngle,
int endAngle,
int increment,
int radius,
double aElev,
double altDiff,
double aSpeed,
const char* pattern);
282 void createLine(
FGAIAircraft* ac,
const SGGeod& startPoint,
double azimuth,
double dist,
double aElev,
double dAlt,
double vDescent,
const char* pattern);
284 double getTurnRadius(
double,
bool);
286 FGAIWaypoint* createOnGround(
FGAIAircraft*,
const std::string& aName,
const SGGeod& aPos,
double aElev,
double aSpeed);
287 FGAIWaypoint* createOnRunway(
FGAIAircraft*,
const std::string& aName,
const SGGeod& aPos,
double aElev,
double aSpeed);
288 FGAIWaypoint* createInAir(
FGAIAircraft*,
const std::string& aName,
const SGGeod& aPos,
double aElev,
double aSpeed);
294 void evaluateRoutePart(
double deplat,
double deplon,
double arrlat,
double arrlon);
300 bool parseProperties(
const std::string& filename);
309 time_t remainingTime,
318 const std::string& fltType,
319 const std::string& acType,
320 const std::string& airline);
SGSharedPtr< FGTaxiNode > FGTaxiNodeRef
SGSharedPtr< FGAirport > FGAirportRef
void setGate(const ParkingAssignment &pka)
void IncrementWaypoint(bool erase)
const char * getRunwayClassFromTrafficType(const std::string &fltType)
const std::string & getRunway() const
FGAIWaypoint * getWayPoint(int i)
void setLeadDistance(double speed, double bearing, FGAIWaypoint *current, FGAIWaypoint *next)
Set lead_distance_ft.
double getLeadInAngle() const
int getRouteIndex(int i) const
FGAIWaypoint * getNextWaypoint(void) const
FGParking * getParkingGate() const
bool createTakeOff(FGAIAircraft *, bool, FGAirport *, const SGGeod &pos, double speed, const std::string &flightType)
FGAirportRef departureAirport() const
double getDistanceToGo(double lat, double lon, FGAIWaypoint *wp) const
static FGAIFlightPlan * createDummyUserPlan()
create a nearly empty FlightPlan for the user aircraft, based on the current position and route-manag...
FGAIFlightPlan * getSID()
void setRunway(const std::string &rwy)
FGAirportRef arrivalAirport() const
double checkTrackLength(const std::string &wptName) const
void shortenToFirst(unsigned int number, const std::string &name)
bool readFlightplan(const SGPath &file)
read a flight-plan from a file.
void setName(const std::string &n)
virtual ~FGAIFlightPlan()
void setSID(FGAIFlightPlan *fp)
bool create(FGAIAircraft *, FGAirport *dep, FGAirport *arr, int leg, double alt, double speed, double lat, double lon, bool firstLeg, double radius, const std::string &fltType, const std::string &aircraftType, const std::string &airline, double distance)
time_t getArrivalTime() const
bool getRepeat(void) const
time_t getStartTime() const
const std::string & getName()
wpt_vector_iterator getFirstWayPoint()
int getNextTurnAngle(void) const
wpt_vector_iterator getLastWayPoint()
FGAIFlightPlan(FGAIAircraft *, const std::string &p, double course, time_t start, time_t remainingTime, FGAirport *dep, FGAirport *arr, bool firstLeg, double radius, double alt, double lat, double lon, double speed, const std::string &fltType, const std::string &acType, const std::string &airline)
bool isActive(time_t time)
double getLeadDistance(void) const
FGAIWaypoint * getPreviousWaypoint(void) const
FGAIWaypoint * getCurrentWaypoint(void) const
FGAIWaypoint * getLastWaypoint() const
bool createPushBack(FGAIAircraft *, bool, FGAirport *, double radius, const std::string &, const std::string &, const std::string &)
FGAIFlightPlan(const std::string &filename)
void addWaypoint(FGAIWaypoint *wpt)
const std::string & getRunway()
double getBearing(FGAIWaypoint *previous, FGAIWaypoint *next) const
void setGear_down(bool grd)
void setAltitude(double alt)
void setCrossat(double val)
bool contains(const std::string &name)
void setName(const std::string &nam)
double getLatitude() const
void setStrobeLight(bool strobe)
void setOn_ground(bool grn)
void setTrackLength(double tl)
const std::string & getName()
void setSpoilers(double val)
void setTime_sec(double ts)
void setFinished(bool fin)
void setLongitude(double lon)
void setTime(const std::string &tme)
void setLatitude(double lat)
const std::string & getTime()
void setSpeed(double spd)
void setBeaconLight(bool beacon)
void setLandingLight(bool ldg)
void setPos(const SGGeod &aPos)
void setPowerDownLights()
double getLongitude() const
void setFlaps(double val)
void setTaxiLight(bool taxi)
void setCabinLight(bool cabin)
double getAltitude() const
void setSpeedBrakes(double val)
void setLights(bool beacon, bool cabin, bool ldg, bool nav, bool strobe, bool taxi)
void setNavLight(bool nav)
void setRouteIndex(int rte)