#include <simgear/compiler.h>
#include <simgear/math/point3d.hxx>
#include <simgear/misc/sgstream.hxx>
-//#include <simgear/math/sg_geodesy.hxx>
#include <plib/sg.h>
-//#include <Airports/runways.hxx>
#include STL_IOSTREAM
#include STL_STRING
SG_USING_STD(ios);
#include "ATC.hxx"
-//#include "ATCmgr.hxx"
-#include "ground.hxx"
#include "ATCProjection.hxx"
#include "AIPlane.hxx"
+class FGATCMgr;
+class FGGround;
+
//DCL - a complete guess for now.
#define FG_TOWER_DEFAULT_RANGE 30
USER_REPORT_3_MILE_FINAL = 5,
USER_REPORT_DOWNWIND = 6,
USER_REPORT_RWY_VACATED = 7,
- USER_REPORT_GOING_AROUND = 8
+ USER_REPORT_GOING_AROUND = 8,
+ USER_REQUEST_TAKE_OFF = 9
};
// TODO - need some differentiation of IFR and VFR traffic in order to give the former priority.
bool clearedToTakeOff;
// ought to add time cleared to depart so we can nag if necessary
bool holdShortReported;
+ bool lineUpReported;
bool downwindReported;
bool longFinalReported;
bool longFinalAcknowledged;
bool instructedToGoAround; // set true if plane told by tower to go around.
bool onRwy; // is physically on the runway
bool nextOnRwy; // currently projected by tower to be the next on the runway
+ bool gearWasUp; // Tell to ATC about gear
+ bool gearUpReported; // Tell to pilot about landing gear
bool vfrArrivalReported;
bool vfrArrivalAcknowledged;
void VFRArrivalContact(const PlaneRec& plane, FGAIPlane* requestee, const LandingType& lt = AIP_LT_UNKNOWN);
void RequestDepartureClearance(const string& ID);
+ void RequestTakeOffClearance(const string& ID);
void ReportFinal(const string& ID);
void ReportLongFinal(const string& ID);
void ReportOuterMarker(const string& ID);
bool GetBaseConstraint(double& bpos);
string GenText(const string& m, int c);
+ string GetWeather();
+ string GetATISID();
private:
- FGATCMgr* ATCmgr;
+ FGATCMgr* ATCmgr;
// This is purely for synactic convienience to avoid writing globals->get_ATC_mgr()-> all through the code!
// Respond to a transmission
bool OnActiveRunway(const Point3D& pt);
// Figure out if a given position lies on a runway or not
- bool OnAnyRunway(const Point3D& pt);
+ bool OnAnyRunway(const Point3D& pt, bool onGround);
// Calculate the eta of a plane to the threshold.
// For ground traffic this is the fastest they can get there.
bool departed; // set true when the above needs incrementing with time, false when it doesn't.
// environment - need to make sure we're getting the surface winds and not winds aloft.
- SGPropertyNode* wind_from_hdg; //degrees
- SGPropertyNode* wind_speed_knots; //knots
+ SGPropertyNode_ptr wind_from_hdg; //degrees
+ SGPropertyNode_ptr wind_speed_knots; //knots
double aptElev; // Airport elevation
string activeRwy; // Active runway number - For now we'll disregard multiple / alternate runway operation.
RunwayDetails rwy; // Assumed to be the active one for now.
bool rwyOccupied; // Active runway occupied flag. For now we'll disregard land-and-hold-short operations.
FGATCAlignedProjection ortho; // Orthogonal mapping of the local area with the active runway threshold at the origin
+ FGATCAlignedProjection ortho_temp; // Ortho for any runway (needed to get plane position in airport)
// Figure out which runways are active.
// For now we'll just be simple and do one active runway - eventually this will get much more complex
// Add to vacated list only if not already present
void AddToVacatedList(TowerPlaneRec* t);
+
+ void AddToHoldingList(TowerPlaneRec* t);
// Ground can be separate or handled by tower in real life.
// In the program we will always use a separate FGGround class, but we need to know
bool tower_failed; // tower failed?
// Pointers to current users position and orientation
- SGPropertyNode* user_lon_node;
- SGPropertyNode* user_lat_node;
- SGPropertyNode* user_elev_node;
- SGPropertyNode* user_hdg_node;
+ SGPropertyNode_ptr user_lon_node;
+ SGPropertyNode_ptr user_lat_node;
+ SGPropertyNode_ptr user_elev_node;
+ SGPropertyNode_ptr user_hdg_node;
// Details of the general traffic flow etc in the circuit
double crosswind_leg_pos; // Distance from threshold crosswind leg is being turned to in meters (actual operation - *not* ideal circuit)