]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/navradio.hxx
Merge branch 'ehofman/generic'
[flightgear.git] / src / Instrumentation / navradio.hxx
index c3d38f86a81a9318abf2b4d9eda641fe7c7b8583..41d662ff06f7ad6ddd540032c7ecacac7a713466 100644 (file)
@@ -35,6 +35,7 @@
 // forward decls
 class SGInterpTable;
 
+class SGSampleGroup;
 class FGNavRecord;
 typedef SGSharedPtr<FGNavRecord> FGNavRecordPtr;
 
@@ -46,6 +47,7 @@ class FGNavRadio : public SGSubsystem
     SGInterpTable *low_tbl;
     SGInterpTable *high_tbl;
 
+    SGPropertyNode_ptr _radio_node;
     SGPropertyNode_ptr lon_node;
     SGPropertyNode_ptr lat_node;
     SGPropertyNode_ptr alt_node;
@@ -101,6 +103,7 @@ class FGNavRadio : public SGSubsystem
     SGPropertyNode_ptr gs_deflection_deg_node;
     SGPropertyNode_ptr gs_deflection_norm_node;
     SGPropertyNode_ptr gs_rate_of_climb_node;
+    SGPropertyNode_ptr gs_rate_of_climb_fpm_node;
     SGPropertyNode_ptr gs_dist_node;
     SGPropertyNode_ptr gs_inrange_node;
     SGPropertyNode_ptr nav_id_node;
@@ -119,8 +122,12 @@ class FGNavRadio : public SGSubsystem
     SGPropertyNode_ptr gps_xtrack_error_nm_node;
     SGPropertyNode_ptr _magvarNode;
     
+    // realism setting, are false courses and GS lobes enabled?
+    SGPropertyNode_ptr falseCoursesEnabledNode;
+
     // internal (private) values
 
+    bool _operable; ///< is the unit serviceable, on, powered, etc
     int play_count;
     time_t last_time;
     FGNavRecordPtr _navaid;
@@ -160,8 +167,8 @@ class FGNavRadio : public SGSubsystem
     double _gsNeedleDeflection;
     double _gsNeedleDeflectionNorm;
     
-    // realism setting, are false courses and GS lobes enabled?
-    bool _falseCoursesEnabled;
+    SGSharedPtr<SGSampleGroup> _sgr;
+    std::vector<SGPropertyNode_ptr> _tiedNodes;
     
     bool updateWithPower(double aDt);
 
@@ -190,6 +197,21 @@ class FGNavRadio : public SGSubsystem
      */
     double localizerWidth(FGNavRecord* aLOC);
     FGNavRecord* findPrimaryNavaid(const SGGeod& aPos, double aFreqMHz);
+    
+    /// accessor for tied, read-only 'operable' property
+    bool isOperable() const
+      { return _operable; }
+      
+    /**
+     * Tied-properties helper, record nodes which are tied for easy un-tie-ing
+     */
+    template <typename T>
+    void tie(const char* aRelPath, const SGRawValue<T>& aRawValue)
+    {
+      SGPropertyNode_ptr nd = _radio_node->getNode(aRelPath, true);
+      _tiedNodes.push_back(nd);
+      nd->tie(aRawValue);
+    }
 public:
 
     FGNavRadio(SGPropertyNode *node);