]> git.mxchange.org Git - flightgear.git/blob - src/FDM/TankProperties.hxx
4a61d2d99277f055b4634f6f026bd12cab541999
[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   void unbind();
38   
39   double getContent_kg() const;
40   void setContent_kg( double value );
41
42   double getDensity_kgpm3() const;
43   void setDensity_kgpm3( double value );
44
45   double getDensity_ppg() const;
46   void setDensity_ppg( double value );
47
48   double getContent_lbs() const;
49   void setContent_lbs( double value );
50
51   double getContent_m3() const;
52   void setContent_m3( double value );
53
54   double getContent_gal_us() const;
55   void setContent_gal_us( double value );
56
57   double getContent_gal_imp() const;
58   void setContent_gal_imp( double value );
59
60   double getCapacity_m3() const;
61   void setCapacity_m3( double value );
62
63   double getCapacity_gal_us() const;
64   void setCapacity_gal_us( double value );
65
66   double getCapacity_gal_imp() const;
67   void setCapacity_gal_imp( double value );
68
69   double getUnusable_m3() const;
70   void setUnusable_m3( double value );
71
72   double getUnusable_gal_us() const;
73   void setUnusable_gal_us( double value );
74
75   double getUnusable_gal_imp() const;
76   void setUnusable_gal_imp( double value );
77
78   double getContent_norm() const;
79   void setContent_norm( double value );
80
81   bool getEmpty() const;
82
83 protected:
84   simgear::TiedPropertyList _tiedProperties;
85
86   double _content_kg;
87   double _density_kgpm3;
88   double _capacity_m3;
89   double _unusable_m3;
90 };
91
92 class TankPropertiesList : std::vector<SGSharedPtr<TankProperties> > {
93 public:
94   TankPropertiesList( SGPropertyNode_ptr rootNode );
95
96   double getTotalContent_lbs() const;
97   double getTotalContent_kg() const;
98   double getTotalContent_gal_us() const;
99   double getTotalContent_gal_imp() const;
100   double getTotalContent_m3() const;
101   double getTotalContent_norm() const;
102
103   void unbind();
104   
105 private:
106   simgear::TiedPropertyList _tiedProperties;
107 };
108
109 #endif // __TANK_PROPERTIES_HXX