Fixed an property tieing issue on sim reset.
Oops, my commit f6fde388a2
untied the
tank properties also on reset - should also re-tie them after the
reset then...
This commit is contained in:
parent
18ada05d41
commit
b3d59ed563
3 changed files with 16 additions and 3 deletions
|
@ -43,6 +43,10 @@ TankProperties::TankProperties(SGPropertyNode_ptr rootNode ) :
|
||||||
_unusable_m3(0.0)
|
_unusable_m3(0.0)
|
||||||
{
|
{
|
||||||
_tiedProperties.setRoot( rootNode );
|
_tiedProperties.setRoot( rootNode );
|
||||||
|
}
|
||||||
|
|
||||||
|
void TankProperties::bind()
|
||||||
|
{
|
||||||
_tiedProperties.Tie("level-kg", this, &TankProperties::getContent_kg, &TankProperties::setContent_kg );
|
_tiedProperties.Tie("level-kg", this, &TankProperties::getContent_kg, &TankProperties::setContent_kg );
|
||||||
_tiedProperties.Tie("density-kgpm3", this, &TankProperties::getDensity_kgpm3, &TankProperties::setDensity_kgpm3 );
|
_tiedProperties.Tie("density-kgpm3", this, &TankProperties::getDensity_kgpm3, &TankProperties::setDensity_kgpm3 );
|
||||||
_tiedProperties.Tie("capacity-m3", this, &TankProperties::getCapacity_m3, &TankProperties::setCapacity_m3 );
|
_tiedProperties.Tie("capacity-m3", this, &TankProperties::getCapacity_m3, &TankProperties::setCapacity_m3 );
|
||||||
|
@ -291,6 +295,13 @@ double TankPropertiesList::getTotalContent_norm() const
|
||||||
return capacity > SGLimitsd::min() ? content / capacity : 0.0;
|
return capacity > SGLimitsd::min() ? content / capacity : 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TankPropertiesList::bind()
|
||||||
|
{
|
||||||
|
for( const_iterator it = begin(); it != end(); ++it ) {
|
||||||
|
(*it)->bind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TankPropertiesList::unbind()
|
void TankPropertiesList::unbind()
|
||||||
{
|
{
|
||||||
for( const_iterator it = begin(); it != end(); ++it ) {
|
for( const_iterator it = begin(); it != end(); ++it ) {
|
||||||
|
|
|
@ -34,6 +34,7 @@ public:
|
||||||
TankProperties( const TankProperties & );
|
TankProperties( const TankProperties & );
|
||||||
const TankProperties & operator = ( const TankProperties & );
|
const TankProperties & operator = ( const TankProperties & );
|
||||||
|
|
||||||
|
void bind();
|
||||||
void unbind();
|
void unbind();
|
||||||
|
|
||||||
double getContent_kg() const;
|
double getContent_kg() const;
|
||||||
|
@ -93,14 +94,15 @@ class TankPropertiesList : std::vector<SGSharedPtr<TankProperties> > {
|
||||||
public:
|
public:
|
||||||
TankPropertiesList( SGPropertyNode_ptr rootNode );
|
TankPropertiesList( SGPropertyNode_ptr rootNode );
|
||||||
|
|
||||||
|
void bind();
|
||||||
|
void unbind();
|
||||||
|
|
||||||
double getTotalContent_lbs() const;
|
double getTotalContent_lbs() const;
|
||||||
double getTotalContent_kg() const;
|
double getTotalContent_kg() const;
|
||||||
double getTotalContent_gal_us() const;
|
double getTotalContent_gal_us() const;
|
||||||
double getTotalContent_gal_imp() const;
|
double getTotalContent_gal_imp() const;
|
||||||
double getTotalContent_m3() const;
|
double getTotalContent_m3() const;
|
||||||
double getTotalContent_norm() const;
|
double getTotalContent_norm() const;
|
||||||
|
|
||||||
void unbind();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
simgear::TiedPropertyList _tiedProperties;
|
simgear::TiedPropertyList _tiedProperties;
|
||||||
|
|
|
@ -94,7 +94,7 @@ void FDMShell::bind()
|
||||||
if (_impl->get_bound()) {
|
if (_impl->get_bound()) {
|
||||||
throw sg_exception("FDMShell::bind of bound FGInterface impl");
|
throw sg_exception("FDMShell::bind of bound FGInterface impl");
|
||||||
}
|
}
|
||||||
|
_tankProperties.bind();
|
||||||
_impl->bind();
|
_impl->bind();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue