]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/wxradar.hxx
ADF: code clean-up/documentation
[flightgear.git] / src / Instrumentation / wxradar.hxx
index 533a4587254db7db5677d47852dc66034ab09a2a..7aff7771718b2be81c13b5b560f3de7d2b8a3223 100644 (file)
 
 #include <simgear/props/props.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
-#include <simgear/environment/visual_enviro.hxx>
 
 #include <vector>
 #include <string>
-using std::vector;
-using std::string;
 
 class FGODGauge;
 
@@ -51,13 +48,15 @@ public:
     virtual void valueChanged(SGPropertyNode *);
 
 protected:
-    string _name;
+    std::string _name;
     int _num;
-    double _interval;
     double _time;
-    bool _sim_init_done;
+    double _interval;
+    double _elapsed_time;
+    double _persistance;
 
     SGPropertyNode_ptr _serviceable_node;
+    SGPropertyNode_ptr _sceneryLoaded;
     SGPropertyNode_ptr _Instrument;
     SGPropertyNode_ptr _radar_mode_control_node;
 
@@ -68,19 +67,31 @@ protected:
 
     FGODGauge *_odg;
 
+    typedef struct {
+        double bearing;
+        double range;
+        double elevation;
+        double bumpiness;
+        double elapsed_time;
+    }ground_echo;
+
+    typedef std::vector <ground_echo*> ground_echo_vector_type;
+    typedef ground_echo_vector_type::iterator ground_echo_vector_iterator;
+
+    ground_echo_vector_type       ground_echoes;
+    ground_echo_vector_iterator   ground_echoes_iterator;
+
     // Convenience function for creating a property node with a
     // default value
     template<typename DefaultType>
     SGPropertyNode *getInstrumentNode(const char *name, DefaultType value);
 
 private:
-    string _texture_path;
+    std::string _texture_path;
 
-    typedef enum { ARC, MAP, PLAN, ROSE } DisplayMode;
+    typedef enum { ARC, MAP, PLAN, ROSE, BSCAN} DisplayMode;
     DisplayMode _display_mode;
 
-    string _last_switchKnob;
-
     float _range_nm;
     float _scale;   // factor to convert nm to display units
     float _angle_offset;
@@ -89,6 +100,7 @@ private:
 
     double _radar_ref_rng;
     double _lat, _lon;
+    double _antenna_ht;
 
     SGPropertyNode_ptr _Tacan;
     SGPropertyNode_ptr _Radar_controls;
@@ -112,6 +124,8 @@ private:
     SGPropertyNode_ptr _radar_ref_rng_node;
     SGPropertyNode_ptr _radar_hdg_marker_node;
     SGPropertyNode_ptr _radar_rotate_node;
+    SGPropertyNode_ptr _radar_tcas_node;
+    SGPropertyNode_ptr _radar_absalt_node;
 
     SGPropertyNode_ptr _font_node;
     SGPropertyNode_ptr _ai_enabled_node;
@@ -126,27 +140,32 @@ private:
     osg::Matrixf _centerTrans;
     osg::ref_ptr<osgText::Font> _font;
     osg::Vec4 _font_color;
+    osg::Vec4 _tcas_colors[4];
     float _font_size;
     float _font_spacing;
 
-    list_of_SGWxRadarEcho _radarEchoBuffer;
+// FIXME: implementation of radar echoes missing
+//    list_of_SGWxRadarEcho _radarEchoBuffer;
 
     void update_weather();
     void update_aircraft();
     void update_tacan();
     void update_heading_marker();
     void update_data(const SGPropertyNode *ac, double alt, double heading,
-            double radius, double bearing, bool selected);
+        double radius, double bearing, bool selected);
+    bool update_tcas(const SGPropertyNode *model,double range,double user_alt,double alt,
+                     double bearing,double radius, bool absMode);
     void center_map();
     void apply_map_offset();
     void updateFont();
     void calcRangeBearing(double lat, double lon, double lat2, double lon2,
-            double &range, double &bearing) const;
+        double &range, double &bearing) const;
 
     bool withinRadarHorizon(double user_alt, double alt, double range);
     bool inRadarRange(double sigma, double range);
 
     float calcRelBearing(float bearing, float heading);
+    float calcRelBearingDeg(float bearing, float heading);
 };