]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATC.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / ATC / ATC.hxx
index 1babf06f7208d7d74d27be09f56cfbcac290e5c7..38750898ace9fb214b35286b284968b181de0461 100644 (file)
 #include STL_IOSTREAM
 #include STL_STRING
 
+#include "ATCVoice.hxx"
+
 SG_USING_STD(ostream);
 SG_USING_STD(string);
 SG_USING_STD(ios);
 
+enum plane_type {
+       UNKNOWN,
+       GA_SINGLE,
+       GA_HP_SINGLE,
+       GA_TWIN,
+       GA_JET,
+       MEDIUM,
+       HEAVY,
+       MIL_JET
+};
+
+// PlaneRec - a structure holding ATC-centric details of planes under control
+// This might move or change eventually
+struct PlaneRec {
+       plane_type type;
+       string callsign;
+       int squawkcode;
+};
+
 // Possible types of ATC type that the radios may be tuned to.
 // INVALID implies not tuned in to anything.
 enum atc_type {
@@ -49,6 +70,9 @@ enum atc_type {
 // DCL - new experimental ATC data store
 struct ATCData {
        atc_type type;
+       // I've deliberately used float instead of double here to keep the size down - we'll be storing thousands of these in memory.
+       // In fact, we could probably ditch x, y and z and generate on the fly as needed.
+       // On the other hand, we'll probably end up reading this data directly from the DAFIF eventually anyway!!
        float lon, lat, elev;
        float x, y, z;
        //int freq;
@@ -59,6 +83,18 @@ struct ATCData {
        string name;
 };
 
+// perhaps we could use an FGRunway instead of this.
+// That wouldn't cache the orthopos though.
+struct RunwayDetails {
+       Point3D threshold_pos;
+       Point3D end1ortho;      // ortho projection end1 (the threshold ATM)
+       Point3D end2ortho;      // ortho projection end2 (the take off end in the current hardwired scheme)
+       double hdg;             // true runway heading
+       double length;  // In *METERS*
+       double width;   // ditto
+       string rwyID;
+};
+
 ostream& operator << (ostream& os, atc_type atc);
 
 class FGATC {
@@ -68,7 +104,7 @@ public:
     virtual ~FGATC();
 
     // Run the internal calculations
-    virtual void Update();
+    virtual void Update(double dt);
 
     // Add plane to a stack
     virtual void AddPlane(string pid);
@@ -111,12 +147,28 @@ public:
        
 protected:
 
+       // Render a transmission
+       // Outputs the transmission either on screen or as audio depending on user preference
+       // The refname is a string to identify this sample to the sound manager
+       // The repeating flag indicates whether the message should be repeated continuously or played once.
+       void Render(string msg, string refname, bool repeating);
+
+       // Cease rendering a transmission.
+       // Requires the sound manager refname if audio, else "".
+       void NoRender(string refname);
+
        double lon, lat, elev;
        double x, y, z;
        int freq;
        int range;
        string ident;           // Code of the airport its at.
        string name;            // Name transmitted in the broadcast.
+       
+       // Rendering related stuff
+       bool voice;                     // Flag - true if we are using voice
+       bool playing;           // Indicates a message in progress      
+       bool voiceOK;           // Flag - true if at least one voice has loaded OK
+       FGATCVoice* vPtr;
 };
 
 inline istream&