Ensure we always create a GPS instrument.
This commit is contained in:
parent
093e267091
commit
5aa51e5780
2 changed files with 12 additions and 2 deletions
|
@ -51,7 +51,8 @@
|
||||||
#include "agradar.hxx"
|
#include "agradar.hxx"
|
||||||
#include "rad_alt.hxx"
|
#include "rad_alt.hxx"
|
||||||
|
|
||||||
FGInstrumentMgr::FGInstrumentMgr ()
|
FGInstrumentMgr::FGInstrumentMgr () :
|
||||||
|
_explicitGps(false)
|
||||||
{
|
{
|
||||||
set_subsystem("od_gauge", new FGODGauge);
|
set_subsystem("od_gauge", new FGODGauge);
|
||||||
set_subsystem("hud", new HUD);
|
set_subsystem("hud", new HUD);
|
||||||
|
@ -85,6 +86,14 @@ FGInstrumentMgr::FGInstrumentMgr ()
|
||||||
}
|
}
|
||||||
|
|
||||||
delete config_props;
|
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 ()
|
FGInstrumentMgr::~FGInstrumentMgr ()
|
||||||
|
@ -129,7 +138,7 @@ bool FGInstrumentMgr::build ()
|
||||||
|
|
||||||
} else if ( name == "gps" ) {
|
} else if ( name == "gps" ) {
|
||||||
set_subsystem( id, new GPS( node ) );
|
set_subsystem( id, new GPS( node ) );
|
||||||
|
_explicitGps = true;
|
||||||
} else if ( name == "gsdi" ) {
|
} else if ( name == "gsdi" ) {
|
||||||
set_subsystem( id, new GSDI( node ) );
|
set_subsystem( id, new GSDI( node ) );
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SGPropertyNode *config_props;
|
SGPropertyNode *config_props;
|
||||||
|
bool _explicitGps;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __INSTRUMENT_MGR_HXX
|
#endif // __INSTRUMENT_MGR_HXX
|
||||||
|
|
Loading…
Add table
Reference in a new issue