]> git.mxchange.org Git - flightgear.git/commitdiff
Pass dt to update(...)
authordaveluff <daveluff>
Thu, 27 Mar 2003 15:44:35 +0000 (15:44 +0000)
committerdaveluff <daveluff>
Thu, 27 Mar 2003 15:44:35 +0000 (15:44 +0000)
src/ATC/ATC.cxx
src/ATC/ATC.hxx
src/ATC/approach.cxx
src/ATC/approach.hxx
src/ATC/atis.cxx
src/ATC/atis.hxx

index 2f4d944fb3d7791b67d338478d557ce134b78ee0..e5649bbdccb914c6270c8a2846c795a39df85d21 100644 (file)
@@ -28,7 +28,7 @@
 FGATC::~FGATC() {
 }
 
-void FGATC::Update() {
+void FGATC::Update(double dt) {
 }
 
 void FGATC::AddPlane(string pid) {
index 2dda84e0bacc5d3da30e7ed87d1db707a23e4bf5..cc952f4be1ab62f2144a6b56fca223cc1093abf7 100644 (file)
@@ -36,6 +36,25 @@ 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 {
@@ -51,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;
@@ -70,7 +92,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);
index a0c77b46a13a15a13330b12d8bc295845030c8b2..3bc528592b909fae45efedc8b5605ed082c7e462 100644 (file)
@@ -82,7 +82,7 @@ void FGApproach::Init() {
 // ============================================================================
 // the main update function
 // ============================================================================
-void FGApproach::Update() {
+void FGApproach::Update(double dt) {
        
        const int max_trans = 20;
        FGTransmission tmissions[max_trans];
index debcd77d33eca318064f9e80f897edbb545c780d..405de1a05426fa0e8947bc69f1e65c27c657b80c 100644 (file)
@@ -150,7 +150,7 @@ public:
 
   void Init();
 
-  void Update();
+  void Update(double dt);
 
   // Add new plane to stack if not already registered 
   // Input:  pid - id of plane (name) 
index 2e4909f3f192ebed767c6cff711f4fbea2f9f718..0021875dc2740f4f69b28bff5e21b8c52008cea9 100644 (file)
@@ -75,7 +75,7 @@ FGATIS::~FGATIS() {
 }
 
 // Main update function - checks whether we are displaying or not the correct message.
-void FGATIS::Update() {
+void FGATIS::Update(double dt) {
        if(display) {
                if(displaying) {
                        // Check if we need to update the message
index d74c6ef19f84c2fde40e31cfd604aa0a9d29726e..b46d1b47d88c72a31632ded520f35e64167722de 100644 (file)
@@ -78,7 +78,7 @@ class FGATIS : public FGATC {
        ~FGATIS(void);
        
        //run the ATIS instance
-       void Update(void);
+       void Update(double dt);
        
        //Indicate that this instance should be outputting to the ATC display
        inline void SetDisplay(void) {display = true;}