]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATCdisplay.hxx
More efficient rotation matrix calc from Norm Vine.
[flightgear.git] / src / ATC / ATCdisplay.hxx
index 867dc7ea07942eac8348a7cad5b4e1a542a74860..c17d36c0659f60007e5f20bab50af672663cf879 100644 (file)
@@ -1,6 +1,6 @@
 // ATCdisplay.hxx - class to manage the graphical display of ATC messages.
 //                - The idea is to separate the display of ATC messages from their
-//               - generation so that the generation may come from any source.
+//               - generation so that the generation may come from any source.
 //
 // Written by David Luff, started October 2001.
 //
@@ -27,6 +27,8 @@
 #  include <config.h>
 #endif
 
+#include <Main/fgfs.hxx>
+
 #include <vector>
 #include <string>
 
@@ -36,14 +38,18 @@ SG_USING_STD(string);
 struct atcMessage {
     string msg;
     bool repeating;
+    int counter;       // count of how many iterations since posting
+    int start_count;   // value of counter at which display should start
+    int stop_count;    // value of counter at which display should stop
     int id;
 };
 
 // ASSUMPTION - with two radios the list won't be long so we don't need to map the id's
 typedef vector<atcMessage> atcMessageList;
-typedef vector<atcMessage>::iterator atcMessageListIterator;
+typedef atcMessageList::iterator atcMessageListIterator;
 
-class FGATCDisplay {
+class FGATCDisplay : public FGSubsystem 
+{
 
 private:
     bool rep_msg;              // Flag to indicate there is a repeating transmission to display
@@ -60,13 +66,18 @@ public:
 
     void init();
 
+    void bind();
+
+    void unbind();
+
     // Display any registered messages
-    void update();
+    void update(double dt);
 
-    // Register a single message for display when possible
-    void RegisterSingleMessage(string msg);    // OK - I know passing a string in and out is probably not good but it will have to do for now.
+    // Register a single message for display after a delay of delay seconds
+    // Will automatically stop displaying after a suitable interval.
+    void RegisterSingleMessage(string msg, int delay); // OK - I know passing a string in and out is probably not good but it will have to do for now.
 
-/* For now we will assume only one repeating message at once */
+    // For now we will assume only one repeating message at once
     // This is not really robust
 
     // Register a continuously repeating message
@@ -79,6 +90,4 @@ public:
     void CancelRepeatingMessage();
 };
 
-extern FGATCDisplay *current_atcdisplay;
-
 #endif // _FG_ATC_DISPLAY_HXX