]> git.mxchange.org Git - flightgear.git/blob - src/FDM/TankProperties.hxx
27a2e9f40f11835655ec0b66d0320451f6033922
[flightgear.git] / src / FDM / TankProperties.hxx
1 // TankProperties.hxx -- expose (fuel)-tank properties 
2 //
3 // Written by Torsten Dreyer, started January 2011.
4 //
5 // Copyright (C) 2011  Torsten Dreyer - Torsten (at) t3r _dot_ de
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21
22 #ifndef __TANK_PROPERTIES_HXX
23 #define __TANK_PROPERTIES_HXX
24
25 #include <simgear/props/props.hxx>
26 #include <simgear/props/tiedpropertylist.hxx>
27
28 class TankProperties : public SGReferenced
29 {
30 public:
31   TankProperties(SGPropertyNode_ptr rootNode );
32   virtual ~TankProperties();
33
34   TankProperties( const TankProperties & );
35   const TankProperties & operator = ( const TankProperties & );
36
37   double getContent_kg() const;
38   void setContent_kg( double value );
39
40   double getDensity_kgpm3() const;
41   void setDensity_kgpm3( double value );
42
43   double getDensity_ppg() const;
44   void setDensity_ppg( double value );
45
46   double getContent_lbs() const;
47   void setContent_lbs( double value );
48
49   double getContent_m3() const;
50   void setContent_m3( double value );
51
52   double getContent_gal_us() const;
53   void setContent_gal_us( double value );
54
55   double getContent_gal_imp() const;
56   void setContent_gal_imp( double value );
57
58   double getCapacity_m3() const;
59   void setCapacity_m3( double value );
60
61   double getCapacity_gal_us() const;
62   void setCapacity_gal_us( double value );
63
64   double getCapacity_gal_imp() const;
65   void setCapacity_gal_imp( double value );
66
67   double getContent_norm() const;
68   void setContent_norm( double value );
69
70 protected:
71   simgear::TiedPropertyList _tiedProperties;
72
73   double _content_kg;
74   double _density_kgpm3;
75   double _capacity_m3;
76 };
77
78 class TankPropertiesList : std::vector<SGSharedPtr<TankProperties> > {
79 public:
80   TankPropertiesList( SGPropertyNode_ptr rootNode );
81
82   double getTotalContent_lbs() const;
83   double getTotalContent_kg() const;
84   double getTotalContent_gal_us() const;
85   double getTotalContent_gal_imp() const;
86   double getTotalContent_m3() const;
87   double getTotalContent_norm() const;
88
89 private:
90   simgear::TiedPropertyList _tiedProperties;
91 };
92
93 #endif // __TANK_PROPERTIES_HXX