]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/mrg.hxx
GPS: fix bad init when far from any airport
[flightgear.git] / src / Instrumentation / mrg.hxx
index b10f653ce61ff13c63157240e9bfa3d4622d9cfb..7f8f9774255fe835d2328c4db6891ef0d3757e23 100644 (file)
@@ -15,7 +15,7 @@
 
 
 /**
- * Model a vacuum-powered attitude indicator.
+ * Model an electrically-powered master reference gyro.
  *
  * Input properties:
  *
@@ -25,7 +25,6 @@
  * /instrumentation/"name"/tumble-norm
  * /orientation/pitch-deg
  * /orientation/roll-deg
- * "vacuum-system"/suction-inhg
  *
  * Output properties:
  *
@@ -44,14 +43,17 @@ public:
     virtual ~MasterReferenceGyro ();
 
     virtual void init ();
+    virtual void reinit ();
     virtual void bind ();
     virtual void unbind ();
     virtual void update (double dt);
 
 private:
 
-    string name;
-    int num;
+    static const double gravity; //conversion factor
+
+    std::string _name;
+    int _num;
 
     double _last_roll;
     double _last_pitch;
@@ -65,6 +67,9 @@ private:
     double _last_roll_rate;
     double _last_pitch_rate;
     double _last_yaw_rate;
+    double _last_g;
+    double _erect_time;
+    double _g_error;
 
     Gyro _gyro;
 
@@ -75,6 +80,7 @@ private:
     SGPropertyNode_ptr _pitch_in_node;
     SGPropertyNode_ptr _roll_in_node;
     SGPropertyNode_ptr _hdg_in_node;
+    SGPropertyNode_ptr _hdg_mag_in_node;
     SGPropertyNode_ptr _g_in_node;
     SGPropertyNode_ptr _electrical_node;
     SGPropertyNode_ptr _pitch_int_node;
@@ -83,6 +89,7 @@ private:
     SGPropertyNode_ptr _pitch_out_node;
     SGPropertyNode_ptr _roll_out_node;
     SGPropertyNode_ptr _hdg_out_node;
+    SGPropertyNode_ptr _hdg_mag_out_node;
     SGPropertyNode_ptr _pitch_rate_out_node;
     SGPropertyNode_ptr _roll_rate_out_node;
     SGPropertyNode_ptr _hdg_rate_out_node;
@@ -91,6 +98,8 @@ private:
     SGPropertyNode_ptr _roll_rate_node;
     SGPropertyNode_ptr _pitch_rate_node;
     SGPropertyNode_ptr _responsiveness_node;
+    SGPropertyNode_ptr _hdg_input_source_node;
+    SGPropertyNode_ptr _fast_erect_node;
 };
 
 #endif // __INSTRUMENTS_MRG_HXX