1
0
Fork 0

make update interval configurable, even though the default 1.0 is supposed

to be a realistic value
This commit is contained in:
mfranz 2007-06-24 22:13:25 +00:00
parent 143e3f34d4
commit bb413bf3e2
3 changed files with 10 additions and 2 deletions

View file

@ -51,7 +51,7 @@
FGInstrumentMgr::FGInstrumentMgr () FGInstrumentMgr::FGInstrumentMgr ()
{ {
set_subsystem("od_gauge", new FGODGauge, 1.0); set_subsystem("od_gauge", new FGODGauge);
set_subsystem("hud", new HUD); set_subsystem("hud", new HUD);
config_props = new SGPropertyNode; config_props = new SGPropertyNode;

View file

@ -61,6 +61,8 @@ static const char *odgauge_name = "Aircraft/Instruments/Textures/od_wxradar.rgb"
wxRadarBg::wxRadarBg ( SGPropertyNode *node) : wxRadarBg::wxRadarBg ( SGPropertyNode *node) :
_name(node->getStringValue("name", "radar")), _name(node->getStringValue("name", "radar")),
_num(node->getIntValue("number", 0)), _num(node->getIntValue("number", 0)),
_interval(node->getDoubleValue("update-interval-sec", 1.0)),
_time( 0.0 ),
_last_switchKnob( "off" ), _last_switchKnob( "off" ),
_sim_init_done ( false ), _sim_init_done ( false ),
resultTexture( 0 ), resultTexture( 0 ),
@ -233,6 +235,11 @@ wxRadarBg::update (double delta_time_sec)
_Instrument->setStringValue("status",""); _Instrument->setStringValue("status","");
return; return;
} }
_time += delta_time_sec;
if (_time < _interval)
return;
_time = 0.0;
string switchKnob = _Instrument->getStringValue("switch", "on"); string switchKnob = _Instrument->getStringValue("switch", "on");
string modeButton = _Instrument->getStringValue("mode", "wx"); string modeButton = _Instrument->getStringValue("mode", "wx");
@ -254,7 +261,6 @@ wxRadarBg::update (double delta_time_sec)
_radarEchoBuffer = *sgEnviro.get_radar_echo(); _radarEchoBuffer = *sgEnviro.get_radar_echo();
updateRadar(); updateRadar();
//FGViewer *current__view = globals->get_current_view();
if ( switchKnob == "off" ) { if ( switchKnob == "off" ) {
_Instrument->setStringValue("status",""); _Instrument->setStringValue("status","");

View file

@ -58,6 +58,8 @@ private:
string _name; string _name;
int _num; int _num;
double _interval;
double _time;
string _last_switchKnob; string _last_switchKnob;
bool _sim_init_done; bool _sim_init_done;