make update interval configurable, even though the default 1.0 is supposed
to be a realistic value
This commit is contained in:
parent
143e3f34d4
commit
bb413bf3e2
3 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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","");
|
||||
|
|
|
@ -58,6 +58,8 @@ private:
|
|||
|
||||
string _name;
|
||||
int _num;
|
||||
double _interval;
|
||||
double _time;
|
||||
|
||||
string _last_switchKnob;
|
||||
bool _sim_init_done;
|
||||
|
|
Loading…
Reference in a new issue