]> git.mxchange.org Git - flightgear.git/commitdiff
make update interval configurable, even though the default 1.0 is supposed
authormfranz <mfranz>
Sun, 24 Jun 2007 22:13:25 +0000 (22:13 +0000)
committermfranz <mfranz>
Sun, 24 Jun 2007 22:13:25 +0000 (22:13 +0000)
to be a realistic value

src/Instrumentation/instrument_mgr.cxx
src/Instrumentation/wxradar.cxx
src/Instrumentation/wxradar.hxx

index aaaba40b804a9309906cf821adc51586af9bc4b5..e8b5eb64c59fa249ab8660264603913cff28a81d 100644 (file)
@@ -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;
index 943a660a5c85b67fdd607f8ed527624a746ac56f..b7670f0be2a0712935d36438d694f169fea04a80 100644 (file)
@@ -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","");
index b31842612795ffbf97bd8d1ac6d259f20d6b0e7b..1ba5a0ae89164619f6a2070654014348bb6f3a22 100644 (file)
@@ -58,6 +58,8 @@ private:
 
     string _name;
     int _num;
+    double _interval;
+    double _time;
 
     string _last_switchKnob;
     bool _sim_init_done;