X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FTankProperties.cxx;h=05e83ce117f25a02b0e1ba908240da6342a8ea03;hb=38226af24ec01e8f0a20d7fd73ef838a69f6ef25;hp=d42871a61f9f497fd5a7fff4106ee089009833e0;hpb=9c98258ab08b48420c86cf09c0f6ba9d1ff82700;p=flightgear.git diff --git a/src/FDM/TankProperties.cxx b/src/FDM/TankProperties.cxx index d42871a61..05e83ce11 100644 --- a/src/FDM/TankProperties.cxx +++ b/src/FDM/TankProperties.cxx @@ -43,6 +43,10 @@ TankProperties::TankProperties(SGPropertyNode_ptr rootNode ) : _unusable_m3(0.0) { _tiedProperties.setRoot( rootNode ); +} + +void TankProperties::bind() +{ _tiedProperties.Tie("level-kg", this, &TankProperties::getContent_kg, &TankProperties::setContent_kg ); _tiedProperties.Tie("density-kgpm3", this, &TankProperties::getDensity_kgpm3, &TankProperties::setDensity_kgpm3 ); _tiedProperties.Tie("capacity-m3", this, &TankProperties::getCapacity_m3, &TankProperties::setCapacity_m3 ); @@ -68,6 +72,11 @@ TankProperties::~TankProperties() { } +void TankProperties::unbind() +{ + _tiedProperties.Untie(); +} + double TankProperties::getContent_kg() const { return _content_kg; @@ -286,4 +295,17 @@ double TankPropertiesList::getTotalContent_norm() const return capacity > SGLimitsd::min() ? content / capacity : 0.0; } +void TankPropertiesList::bind() +{ + for( const_iterator it = begin(); it != end(); ++it ) { + (*it)->bind(); + } +} +void TankPropertiesList::unbind() +{ + for( const_iterator it = begin(); it != end(); ++it ) { + (*it)->unbind(); + } + _tiedProperties.Untie(); +}