X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fnavradio.hxx;h=c731f1d2b7a3c896c2efce7c7035a1831d92931e;hb=52fd6986f88051ccc00fc2d01529568d79d5a56c;hp=96621b6d0cd207bc6662a2500d90fec6c3c5e571;hpb=3c3f3a096eec57273c4585e948f13cc8e37c36e7;p=flightgear.git diff --git a/src/Instrumentation/navradio.hxx b/src/Instrumentation/navradio.hxx index 96621b6d0..c731f1d2b 100644 --- a/src/Instrumentation/navradio.hxx +++ b/src/Instrumentation/navradio.hxx @@ -24,33 +24,18 @@ #ifndef _FG_NAVRADIO_HXX #define _FG_NAVRADIO_HXX - +#include #include
-#include "Sound/morse.hxx" #include #include #include -// forward decls -class SGInterpTable; - class SGSampleGroup; -class FGNavRecord; -typedef SGSharedPtr FGNavRecordPtr; class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener { - FGMorse morse; - - SGInterpTable *term_tbl; - SGInterpTable *low_tbl; - SGInterpTable *high_tbl; - SGPropertyNode_ptr _radio_node; - SGPropertyNode_ptr lon_node; - SGPropertyNode_ptr lat_node; - SGPropertyNode_ptr alt_node; SGPropertyNode_ptr bus_power_node; // property inputs @@ -59,6 +44,7 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener SGPropertyNode_ptr power_btn_node; SGPropertyNode_ptr freq_node; // primary freq SGPropertyNode_ptr alt_freq_node; // standby freq + SGPropertyNode_ptr is_loc_freq_node;// is the primary freq a loc/gs (paired) freq? SGPropertyNode_ptr sel_radial_node; // selected radial SGPropertyNode_ptr vol_btn_node; SGPropertyNode_ptr ident_btn_node; @@ -68,7 +54,6 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener SGPropertyNode_ptr cdi_serviceable_node; SGPropertyNode_ptr gs_serviceable_node; SGPropertyNode_ptr tofrom_serviceable_node; - SGPropertyNode_ptr dme_serviceable_node; // property outputs SGPropertyNode_ptr fmt_freq_node; // formated frequency @@ -130,13 +115,11 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener bool _operable; ///< is the unit serviceable, on, powered, etc int play_count; - time_t last_time; - FGNavRecordPtr _navaid; - FGNavRecordPtr _gs; + bool _nav_search; + double _last_freq; + FGNavRecordRef _navaid; + FGNavRecordRef _gs; - string nav_fx_name; - string dme_fx_name; - double target_radial; double effective_range; double target_gs; @@ -147,7 +130,7 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener double xrate_ms; double _localizerWidth; // cached localizer width in degrees - string _name; + std::string _name; int _num; // internal periodic station search timer @@ -155,9 +138,6 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener SGVec3d _gsCart, _gsAxis, _gsVertical, _gsBaseline; - FGNavRecordPtr _dme; - bool _dmeInRange; - // CDI properties bool _toFlag, _fromFlag; double _cdiDeflection; @@ -165,9 +145,8 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener double _gsNeedleDeflection; double _gsNeedleDeflectionNorm; double _gsDirect; - - SGSharedPtr _sgr; - std::vector _tiedNodes; + + class AudioIdent * _audioIdent; bool updateWithPower(double aDt); @@ -179,11 +158,9 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener double adjustILSRange( double stationElev, double aircraftElev, double offsetDegrees, double distance ); - void updateAudio(); - void audioNavidChanged(); + void updateAudio( double dt ); void updateReceiver(double dt); - void updateDME(const SGVec3d& aircraft); void updateGlideSlope(double dt, const SGVec3d& aircraft, double signal_quality_norm); void updateGPSSlaved(); void updateCDI(double dt); @@ -196,17 +173,6 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener bool isOperable() const { return _operable; } - /** - * Tied-properties helper, record nodes which are tied for easy un-tie-ing - */ - template - void tie(const char* aRelPath, const SGRawValue& aRawValue) - { - SGPropertyNode_ptr nd = _radio_node->getNode(aRelPath, true); - _tiedNodes.push_back(nd); - nd->tie(aRawValue); - } - // implement SGPropertyChangeListener virtual void valueChanged (SGPropertyNode * prop); public: @@ -215,12 +181,14 @@ public: ~FGNavRadio(); void init (); + void reinit (); void bind (); void unbind (); void update (double dt); // Update nav/adf radios based on current postition void search (); + void updateNav(); };