1
0
Fork 0

Ensure we always create a GPS instrument.

This commit is contained in:
jmt 2009-10-13 22:01:48 +00:00 committed by Tim Moore
parent 093e267091
commit 5aa51e5780
2 changed files with 12 additions and 2 deletions

View file

@ -51,7 +51,8 @@
#include "agradar.hxx"
#include "rad_alt.hxx"
FGInstrumentMgr::FGInstrumentMgr ()
FGInstrumentMgr::FGInstrumentMgr () :
_explicitGps(false)
{
set_subsystem("od_gauge", new FGODGauge);
set_subsystem("hud", new HUD);
@ -85,6 +86,14 @@ FGInstrumentMgr::FGInstrumentMgr ()
}
delete config_props;
if (!_explicitGps) {
SG_LOG(SG_INSTR, SG_INFO, "creating default GPS instrument");
SGPropertyNode_ptr nd(new SGPropertyNode);
nd->setStringValue("name", "gps");
nd->setIntValue("number", 0);
set_subsystem("gps[0]", new GPS(nd));
}
}
FGInstrumentMgr::~FGInstrumentMgr ()
@ -129,7 +138,7 @@ bool FGInstrumentMgr::build ()
} else if ( name == "gps" ) {
set_subsystem( id, new GPS( node ) );
_explicitGps = true;
} else if ( name == "gsdi" ) {
set_subsystem( id, new GSDI( node ) );

View file

@ -35,6 +35,7 @@ public:
private:
SGPropertyNode *config_props;
bool _explicitGps;
};
#endif // __INSTRUMENT_MGR_HXX