1
0
Fork 0

fix #296: FDMshell+TankProperties not bound after sim reset

Well, when we need to unbind something temporarily, it's wise to really
bind it again...
This commit is contained in:
ThorstenB 2011-03-29 23:31:59 +02:00
parent 7ec9d036d6
commit 4141b80b0c
3 changed files with 10 additions and 7 deletions

View file

@ -236,12 +236,6 @@ TankPropertiesList::TankPropertiesList( SGPropertyNode_ptr rootNode )
}
_tiedProperties.setRoot( rootNode );
_tiedProperties.Tie("total-fuel-kg", this, &TankPropertiesList::getTotalContent_kg );
_tiedProperties.Tie("total-fuel-lbs", this, &TankPropertiesList::getTotalContent_lbs );
_tiedProperties.Tie("total-fuel-gal_us", this, &TankPropertiesList::getTotalContent_gal_us );
_tiedProperties.Tie("total-fuel-gals", this, &TankPropertiesList::getTotalContent_gal_us );
_tiedProperties.Tie("total-fuel-gal_imp", this, &TankPropertiesList::getTotalContent_gal_imp );
_tiedProperties.Tie("total-fuel-norm", this, &TankPropertiesList::getTotalContent_norm );
}
double TankPropertiesList::getTotalContent_lbs() const
@ -297,6 +291,12 @@ double TankPropertiesList::getTotalContent_norm() const
void TankPropertiesList::bind()
{
_tiedProperties.Tie("total-fuel-kg", this, &TankPropertiesList::getTotalContent_kg );
_tiedProperties.Tie("total-fuel-lbs", this, &TankPropertiesList::getTotalContent_lbs );
_tiedProperties.Tie("total-fuel-gal_us", this, &TankPropertiesList::getTotalContent_gal_us );
_tiedProperties.Tie("total-fuel-gals", this, &TankPropertiesList::getTotalContent_gal_us );
_tiedProperties.Tie("total-fuel-gal_imp", this, &TankPropertiesList::getTotalContent_gal_imp );
_tiedProperties.Tie("total-fuel-norm", this, &TankPropertiesList::getTotalContent_norm );
for( const_iterator it = begin(); it != end(); ++it ) {
(*it)->bind();
}

View file

@ -90,13 +90,13 @@ void FDMShell::reinit()
void FDMShell::bind()
{
_tankProperties.bind();
if (_impl && _impl->get_inited()) {
if (_impl->get_bound()) {
throw sg_exception("FDMShell::bind of bound FGInterface impl");
}
_impl->bind();
}
_tankProperties.bind();
}
void FDMShell::unbind()

View file

@ -1561,6 +1561,9 @@ void fgReInitSubsystems()
globals->get_subsystem("time")->reinit();
// need to bind FDMshell again, since we manually unbound it above...
globals->get_subsystem("flight")->bind();
// setup state to end re-init
fgSetBool("/sim/signals/reinit", false);
if ( !freeze ) {