]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/runwayprefs.hxx
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / Airports / runwayprefs.hxx
index 17148de2bc617cf7df87c188b4f1db1a8b09012a..c9ac72709c82e4e0c0e00c8ead197a5ac155bebf 100644 (file)
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
 #ifndef _RUNWAYPREFS_HXX_
 #define _RUNWAYPREFS_HXX_
 
-#include <simgear/xml/easyxml.hxx>
+#include <time.h>
+#include <vector>
+#include <string>
+
+#include <simgear/compiler.h>
+
+using std::vector;
+using std::string;
 
 typedef vector<time_t> timeVec;
 typedef vector<time_t>::const_iterator timeVecConstIterator;
@@ -33,6 +40,7 @@ typedef vector<string> stringVec;
 typedef vector<string>::iterator stringVecIterator;
 typedef vector<string>::const_iterator stringVecConstIterator;
 
+class FGAirport;
 
 /***************************************************************************/
 class ScheduleTime {
@@ -96,6 +104,7 @@ private:
   //stringVec runwayNames;
   int choice[2];
   int nrActive;
+
 public:
   RunwayGroup() {};
   RunwayGroup(const RunwayGroup &other);
@@ -103,7 +112,7 @@ public:
 
   void setName(const string& nm) { name = nm;                };
   void add(const RunwayList& list) { rwyList.push_back(list);};
-  void setActive(const string& aptId, double windSpeed, double windHeading, double maxTail, double maxCross);
+  void setActive(const FGAirport* airport, double windSpeed, double windHeading, double maxTail, double maxCross, stringVec *curr);
 
   int getNrActiveRunways() { return nrActive;};
   void getActive(int i, string& name, string& type);
@@ -119,41 +128,39 @@ typedef vector<RunwayGroup>::const_iterator PreferenceListConstIterator;
 
 /******************************************************************************/
 
-class FGRunwayPreference  : public XMLVisitor {
+class FGRunwayPreference {
 private:
-  string value;
-  string scheduleName;
+  FGAirport* _ap;
 
   ScheduleTime comTimes; // Commercial Traffic;
   ScheduleTime genTimes; // General Aviation;
   ScheduleTime milTimes; // Military Traffic;
-  ScheduleTime currTimes; // Needed for parsing;
+  ScheduleTime ulTimes;  // Ultralight Traffic
 
-  RunwayList  rwyList;
-  RunwayGroup rwyGroup;
   PreferenceList preferences;
-
-  time_t processTime(const string&);
+  
   bool initialized;
 
 public:
-  FGRunwayPreference();
+  FGRunwayPreference(FGAirport* ap);
   FGRunwayPreference(const FGRunwayPreference &other);
   
   FGRunwayPreference & operator= (const FGRunwayPreference &other);
+
   ScheduleTime *getSchedule(const char *trafficType);
   RunwayGroup *getGroup(const string& groupName);
+
+  string getId();
+
   bool available() { return initialized; };
+  void setInitialized(bool state) { initialized = state; };
+
+  void setMilTimes(ScheduleTime& t) { milTimes = t; };
+  void setGenTimes(ScheduleTime& t) { genTimes = t; };
+  void setComTimes(ScheduleTime& t) { comTimes = t; };
+  void setULTimes (ScheduleTime& t) { ulTimes  = t; };
 
- // Some overloaded virtual XMLVisitor members
-  virtual void startXML (); 
-  virtual void endXML   ();
-  virtual void startElement (const char * name, const XMLAttributes &atts);
-  virtual void endElement (const char * name);
-  virtual void data (const char * s, int len);
-  virtual void pi (const char * target, const char * data);
-  virtual void warning (const char * message, int line, int column);
-  virtual void error (const char * message, int line, int column);
+  void addRunwayGroup(RunwayGroup& g) { preferences.push_back(g); };
 };
 
 #endif