| 1 | // vacuum.hxx - a vacuum pump connected to the aircraft engine. |
| 2 | // Written by David Megginson, started 2002. |
| 3 | // |
| 4 | // This file is in the Public Domain and comes with no warranty. |
| 5 | |
| 6 | |
| 7 | #ifndef __SYSTEMS_VACUUM_HXX |
| 8 | #define __SYSTEMS_VACUUM_HXX 1 |
| 9 | |
| 10 | #ifndef __cplusplus |
| 11 | # error This library requires C++ |
| 12 | #endif |
| 13 | |
| 14 | #include <simgear/math/sg_types.hxx> |
| 15 | #include <simgear/props/props.hxx> |
| 16 | #include <simgear/structure/subsystem_mgr.hxx> |
| 17 | |
| 18 | |
| 19 | /** |
| 20 | * Model a vacuum-pump system. |
| 21 | * |
| 22 | * Multiple pumps (i.e. for a multiengine aircraft) can be specified. |
| 23 | * |
| 24 | * Input properties: |
| 25 | * |
| 26 | * "rpm1" |
| 27 | * "rpm2" |
| 28 | * "..." |
| 29 | * /environment/pressure-inhg |
| 30 | * /systems/"name"/serviceable |
| 31 | * |
| 32 | * Output properties: |
| 33 | * |
| 34 | * /systems/"name"/suction-inhg |
| 35 | */ |
| 36 | class VacuumSystem : public SGSubsystem |
| 37 | { |
| 38 | public: |
| 39 | VacuumSystem( SGPropertyNode *node ); |
| 40 | VacuumSystem( int i ); |
| 41 | virtual ~VacuumSystem (); |
| 42 | |
| 43 | // Subsystem API. |
| 44 | void bind() override; |
| 45 | void init() override; |
| 46 | void reinit() override; |
| 47 | void unbind() override; |
| 48 | void update(double dt) override; |
| 49 | |
| 50 | // Subsystem identification. |
| 51 | static const char* staticSubsystemClassId() { return "vacuum"; } |
| 52 | |
| 53 | private: |
| 54 | std::string _name; |
| 55 | int _num; |
| 56 | string_list _rpms; |
| 57 | double _scale; |
| 58 | SGPropertyNode_ptr _serviceable_node; |
| 59 | std::vector<SGPropertyNode_ptr> _rpm_nodes; |
| 60 | SGPropertyNode_ptr _pressure_node; |
| 61 | SGPropertyNode_ptr _suction_node; |
| 62 | }; |
| 63 | |
| 64 | #endif // __SYSTEMS_VACUUM_HXX |