diff --git a/src/Instrumentation/instrument_mgr.cxx b/src/Instrumentation/instrument_mgr.cxx index aaaba40b8..e8b5eb64c 100644 --- a/src/Instrumentation/instrument_mgr.cxx +++ b/src/Instrumentation/instrument_mgr.cxx @@ -51,7 +51,7 @@ FGInstrumentMgr::FGInstrumentMgr () { - set_subsystem("od_gauge", new FGODGauge, 1.0); + set_subsystem("od_gauge", new FGODGauge); set_subsystem("hud", new HUD); config_props = new SGPropertyNode; diff --git a/src/Instrumentation/wxradar.cxx b/src/Instrumentation/wxradar.cxx index 943a660a5..b7670f0be 100644 --- a/src/Instrumentation/wxradar.cxx +++ b/src/Instrumentation/wxradar.cxx @@ -61,6 +61,8 @@ static const char *odgauge_name = "Aircraft/Instruments/Textures/od_wxradar.rgb" wxRadarBg::wxRadarBg ( SGPropertyNode *node) : _name(node->getStringValue("name", "radar")), _num(node->getIntValue("number", 0)), + _interval(node->getDoubleValue("update-interval-sec", 1.0)), + _time( 0.0 ), _last_switchKnob( "off" ), _sim_init_done ( false ), resultTexture( 0 ), @@ -233,6 +235,11 @@ wxRadarBg::update (double delta_time_sec) _Instrument->setStringValue("status",""); return; } + _time += delta_time_sec; + if (_time < _interval) + return; + + _time = 0.0; string switchKnob = _Instrument->getStringValue("switch", "on"); string modeButton = _Instrument->getStringValue("mode", "wx"); @@ -254,7 +261,6 @@ wxRadarBg::update (double delta_time_sec) _radarEchoBuffer = *sgEnviro.get_radar_echo(); updateRadar(); - //FGViewer *current__view = globals->get_current_view(); if ( switchKnob == "off" ) { _Instrument->setStringValue("status",""); diff --git a/src/Instrumentation/wxradar.hxx b/src/Instrumentation/wxradar.hxx index b31842612..1ba5a0ae8 100644 --- a/src/Instrumentation/wxradar.hxx +++ b/src/Instrumentation/wxradar.hxx @@ -58,6 +58,8 @@ private: string _name; int _num; + double _interval; + double _time; string _last_switchKnob; bool _sim_init_done;