set_subsystem("od_gauge", new FGODGauge);
set_subsystem("hud", new HUD);
- config_props = new SGPropertyNode;
+ SGPropertyNode_ptr config_props = new SGPropertyNode;
SGPropertyNode *path_n = fgGetNode("/sim/instrumentation/path");
try {
readProperties( config.str(), config_props );
- if ( !build() ) {
+ if ( !build(config_props) ) {
throw sg_error(
"Detected an internal inconsistency in the instrumentation\n"
"system specification file. See earlier errors for details.");
"No instrumentation model specified for this model!");
}
- delete config_props;
-
if (!_explicitGps) {
SG_LOG(SG_INSTR, SG_INFO, "creating default GPS instrument");
SGPropertyNode_ptr nd(new SGPropertyNode);
{
}
-bool FGInstrumentMgr::build ()
+bool FGInstrumentMgr::build (SGPropertyNode* config_props)
{
for ( int i = 0; i < config_props->nChildren(); ++i ) {
SGPropertyNode *node = config_props->getChild(i);
FGInstrumentMgr ();
virtual ~FGInstrumentMgr ();
- bool build ();
+ bool build (SGPropertyNode* config_props);
private:
- SGPropertyNode_ptr config_props;
bool _explicitGps;
};
void FGElectricalSystem::init () {
- config_props = new SGPropertyNode;
+ SGPropertyNode_ptr config_props = new SGPropertyNode;
_volts_out = fgGetNode( "/systems/electrical/volts", true );
_amps_out = fgGetNode( "/systems/electrical/amps", true );
try {
readProperties( config.str(), config_props );
- if ( build() ) {
+ if ( build(config_props) ) {
enabled = true;
} else {
SG_LOG( SG_ALL, SG_ALERT,
_amps_out->setDoubleValue(0);
}
- delete config_props;
}
}
-bool FGElectricalSystem::build () {
+bool FGElectricalSystem::build (SGPropertyNode* config_props) {
SGPropertyNode *node;
int i;
virtual void unbind ();
virtual void update (double dt);
- bool build ();
+ bool build (SGPropertyNode* config_props);
float propagate( FGElectricalComponent *node, double dt,
float input_volts, float input_amps,
string s = "" );
string name;
int num;
string path;
- SGPropertyNode_ptr config_props;
bool enabled;
FGSystemMgr::FGSystemMgr ()
{
- config_props = new SGPropertyNode;
+ SGPropertyNode_ptr config_props = new SGPropertyNode;
SGPropertyNode *path_n = fgGetNode("/sim/systems/path");
try {
readProperties( config.str(), config_props );
- if ( build() ) {
+ if ( build(config_props) ) {
enabled = true;
} else {
SG_LOG( SG_ALL, SG_ALERT,
"No systems model specified for this model!");
}
- delete config_props;
}
FGSystemMgr::~FGSystemMgr ()
{
}
-bool FGSystemMgr::build ()
+bool FGSystemMgr::build (SGPropertyNode* config_props)
{
SGPropertyNode *node;
int i;
FGSystemMgr ();
virtual ~FGSystemMgr ();
- bool build ();
+ bool build (SGPropertyNode* config_props);
private:
- SGPropertyNode_ptr config_props;
bool enabled;
};