# error This library requires C++
#endif
+#include <osg/Geode>
+#include <osg/Geometry>
+#include <osg/MatrixTransform>
+#include <osg/Shape>
#include <simgear/compiler.h>
// There is probably a better include than sg_geodesy to get the SG_NM_TO_METER...
#include <simgear/structure/SGReferenced.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
-
-
#include <string>
#include <vector>
class FGAIFlightPlan; // forward reference
class FGGroundNetwork; // forward reference
class FGAIAircraft; // forward reference
+class FGAirportDynamics;
/**************************************************************************************
* class FGATCInstruction
void allowRepeatedTransmissions () { allowTransmission=true; };
void nextFrequency() { frequencyId++; };
int getNextFrequency() { return frequencyId; };
+ intVec& getIntentions() { return intentions; };
+ int getCurrentPosition() { return currentPos; };
};
typedef vector<FGTrafficRecord> TrafficVector;
*************************************************************************************/
class FGATCController
{
+private:
+ bool initialized;
+
protected:
bool available;
time_t lastTransmission;
double dt_count;
-
+ osg::Group* group;
string formatATCFrequency3_2(int );
string genTransponderCode(string fltRules);
+ bool isUserAircraft(FGAIAircraft*);
public:
typedef enum {
ATC_GROUND_TO_AIR } AtcMsgDir;
FGATCController();
virtual ~FGATCController();
+ void init();
+
virtual void announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentRoute,
double lat, double lon,
double hdg, double spd, double alt, double radius, int leg,
double getDt() { return dt_count; };
void setDt(double dt) { dt_count = dt;};
- void transmit(FGTrafficRecord *rec, AtcMsgId msgId, AtcMsgDir msgDir);
+ void transmit(FGTrafficRecord *rec, AtcMsgId msgId, AtcMsgDir msgDir, bool audible);
string getGateName(FGAIAircraft *aircraft);
+ virtual void render(bool) = 0;
+ virtual string getName() = 0;
+
+
+private:
+
+ AtcMsgDir lastTransmissionDirection;
};
/******************************************************************************
private:
TrafficVector activeTraffic;
ActiveRunwayVec activeRunways;
+ FGAirportDynamics *parent;
public:
- FGTowerController();
+ FGTowerController(FGAirportDynamics *parent);
virtual ~FGTowerController() {};
virtual void announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentRoute,
double lat, double lon,
virtual bool hasInstruction(int id);
virtual FGATCInstruction getInstruction(int id);
+ virtual void render(bool);
+ virtual string getName();
bool hasActiveTraffic() { return activeTraffic.size() != 0; };
TrafficVector &getActiveTraffic() { return activeTraffic; };
};
private:
TrafficVector activeTraffic;
//ActiveRunwayVec activeRunways;
+ FGAirportDynamics *parent;
public:
- FGStartupController();
+ FGStartupController(FGAirportDynamics *parent);
virtual ~FGStartupController() {};
virtual void announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentRoute,
double lat, double lon,
virtual bool hasInstruction(int id);
virtual FGATCInstruction getInstruction(int id);
+ virtual void render(bool);
+ virtual string getName();
+
bool hasActiveTraffic() { return activeTraffic.size() != 0; };
TrafficVector &getActiveTraffic() { return activeTraffic; };
+ // Hpoefully, we can move this function to the base class, but I need to verify what is needed for the other controllers before doing so.
+ bool checkTransmissionState(int st, time_t now, time_t startTime, TrafficVectorIterator i, AtcMsgId msgId,
+ AtcMsgDir msgDir);
+
};
/******************************************************************************
private:
TrafficVector activeTraffic;
ActiveRunwayVec activeRunways;
+ FGAirportDynamics *parent;
public:
- FGApproachController();
- virtual ~FGApproachController() {};
+ FGApproachController(FGAirportDynamics * parent);
+ virtual ~FGApproachController() { };
virtual void announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentRoute,
double lat, double lon,
double hdg, double spd, double alt, double radius, int leg,
virtual bool hasInstruction(int id);
virtual FGATCInstruction getInstruction(int id);
+ virtual void render(bool);
+ virtual string getName();
+
ActiveRunway* getRunway(string name);
bool hasActiveTraffic() { return activeTraffic.size() != 0; };