1
0
Fork 0
flightgear/src/ATCDCL/AIGAVFRTraffic.hxx
frohlich a99ea1c7b5 Port over remaining Point3D usage to the more type and unit safe SG* classes.
Remove leftover headers from plib/sg.

Modified Files:
 	src/AIModel/AIBase.cxx
 	src/AIModel/AIFlightPlanCreateCruise.cxx
 	src/ATCDCL/AIEntity.cxx src/ATCDCL/AIEntity.hxx
 	src/ATCDCL/AIGAVFRTraffic.cxx src/ATCDCL/AIGAVFRTraffic.hxx
 	src/ATCDCL/AILocalTraffic.cxx src/ATCDCL/AILocalTraffic.hxx
 	src/ATCDCL/AIMgr.cxx src/ATCDCL/ATC.hxx
 	src/ATCDCL/ATCDialog.cxx src/ATCDCL/ATCProjection.cxx
 	src/ATCDCL/ATCProjection.hxx src/ATCDCL/ATCutils.cxx
 	src/ATCDCL/ATCutils.hxx src/ATCDCL/approach.cxx
 	src/ATCDCL/commlist.cxx src/ATCDCL/ground.cxx
	src/ATCDCL/ground.hxx src/ATCDCL/tower.cxx
 	src/ATCDCL/tower.hxx src/Airports/calc_loc.cxx
 	src/Airports/dynamics.cxx src/Airports/groundnetwork.cxx
 	src/Airports/parking.cxx src/Airports/runwayprefs.cxx
 	src/Airports/simple.cxx src/Cockpit/cockpit.cxx
 	src/Cockpit/hud.hxx src/Cockpit/hud_card.cxx
 	src/Cockpit/hud_rwy.cxx src/Environment/environment.cxx
 	src/FDM/UFO.cxx src/FDM/SP/MagicCarpet.cxx src/GUI/dialog.hxx
 	src/Instrumentation/HUD/HUD.hxx
 	src/Instrumentation/HUD/HUD_runway.cxx
 	src/Instrumentation/KLN89/kln89.cxx src/Main/fg_init.cxx
 	src/Main/viewer.cxx src/Main/viewmgr.cxx
 	src/Model/panelnode.cxx src/MultiPlayer/mpmessages.hxx
 	src/Scenery/tilemgr.cxx src/Traffic/SchedFlight.cxx
 	src/Traffic/TrafficMgr.cxx
2009-03-18 08:00:08 +01:00

124 lines
3.7 KiB
C++

// FGAILocalTraffic - AIEntity derived class with enough logic to
// fly and interact with the traffic pattern.
//
// Written by David Luff, started March 2002.
//
// Copyright (C) 2002 David C. Luff - david.luff@nottingham.ac.uk
//
// 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 _FG_AIGAVFRTraffic_HXX
#define _FG_AIGAVFRTraffic_HXX
#include <simgear/math/SGMath.hxx>
#include <Main/fg_props.hxx>
#include "AILocalTraffic.hxx"
#include <string>
using std::string;
class FGAIGAVFRTraffic : public FGAILocalTraffic {
public:
FGAIGAVFRTraffic();
~FGAIGAVFRTraffic();
// Init en-route to destID at point pt. (lat, lon, elev) (elev in meters, lat and lon in degrees).
bool Init(const SGGeod& pt, const string& destID, const string& callsign);
// Init at srcID to fly to destID
bool Init(const string& srcID, const string& destID, const string& callsign, OperatingState state = PARKED);
// Run the internal calculations
void Update(double dt);
// Return what type of landing we're doing on this circuit
//LandingType GetLandingOption();
void RegisterTransmission(int code);
// Process callbacks sent by base class
// (These codes are not related to the codes above)
void ProcessCallback(int code);
protected:
// Do what is necessary to land and parkup at home airport
void ReturnToBase(double dt);
//void GetRwyDetails(string id);
private:
FGATCMgr* ATC;
// This is purely for synactic convienience to avoid writing globals->get_ATC_mgr()-> all through the code!
// High-level stuff
OperatingState operatingState;
bool touchAndGo; //True if circuits should be flown touch and go, false for full stop
// Performance characteristics of the plane in knots and ft/min - some of this might get moved out into FGAIPlane
double best_rate_of_climb_speed;
double best_rate_of_climb;
double nominal_climb_speed;
double nominal_climb_rate;
double nominal_cruise_speed;
double nominal_circuit_speed;
double nominal_descent_rate;
double nominal_approach_speed;
double nominal_final_speed;
double stall_speed_landing_config;
// environment - some of this might get moved into FGAIPlane
SGPropertyNode_ptr wind_from_hdg; //degrees
SGPropertyNode_ptr wind_speed_knots; //knots
atc_type changeFreqType; // the service we need to change to
void CalculateSoD(double base_leg_pos, double downwind_leg_pos, bool pattern_direction);
// GA VFR specific
bool _towerContactedIncoming;
bool _straightIn;
bool _clearedStraightIn;
bool _downwindEntry;
bool _clearedDownwindEntry;
SGGeod _wp; // Next waypoint (ie. the one we're currently heading for)
bool _enroute;
string _destID;
bool _climbout;
double _cruise_alt;
double _cruise_ias;
double _cruise_climb_ias;
SGGeod _destPos;
bool _local;
bool _incoming;
bool _established;
bool _e45;
bool _entering;
bool _turning;
int GetQuadrangleAltitude(int dir, int des_alt);
SGGeod GetPatternApproachPos();
void FlyPlane(double dt);
// HACK for testing - remove or comment out before CVS commit!!!
//bool _towerContactPrinted;
};
#endif // _FG_AILocalTraffic_HXX