Debian Codegraph @

src/Environment/ridge_lift.hxx

raw symbols SCIP
1 // simulates ridge lift
2 //
3 // Written by Patrice Poly
4 // Copyright (C) 2009 Patrice Poly - [email protected]
5 //
6 //
7 // Entirely based on the paper :
8 // http://carrier.csi.cam.ac.uk/forsterlewis/soaring/sim/fsx/dev/sim_probe/sim_probe_paper.html
9 // by Ian Forster-Lewis, University of Cambridge, 26th December 2007
10 //
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License as
14 // published by the Free Software Foundation; either version 2 of the
15 // License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26
27
28 #pragma once
29
30 #include <string>
31
32 #include <simgear/props/tiedpropertylist.hxx>
33
34 class FGRidgeLift : public SGSubsystem
35 {
36 public:
37 FGRidgeLift();
38 ~FGRidgeLift();
39
40 // Subsystem API.
41 void bind() override;
42 void init() override;
43 void unbind() override;
44 void update(double dt) override;
45
46 // Subsystem identification.
47 static const char* staticSubsystemClassId() { return "ridgelift"; }
48
49 inline double getStrength() const { return strength; };
50
51 inline double get_probe_elev_m( int index ) const { return probe_elev_m[index]; };
52 inline double get_probe_lat_deg( int index ) const { return probe_lat_deg[index]; };
53 inline double get_probe_lon_deg( int index ) const { return probe_lon_deg[index]; };
54 inline double get_slope( int index ) const { return slope[index]; };
55
56 private:
57 static const double dist_probe_m[5];
58
59 double strength;
60 double timer;
61
62 double probe_lat_deg[5];
63 double probe_lon_deg[5];
64 double probe_elev_m[5];
65
66 double slope[4];
67
68 double lift_factor;
69
70 SGPropertyNode_ptr _enabled_node;
71 SGPropertyNode_ptr _ridge_lift_fps_node;
72
73 SGPropertyNode_ptr _surface_wind_from_deg_node;
74 SGPropertyNode_ptr _surface_wind_speed_node;
75
76 SGPropertyNode_ptr _user_altitude_agl_ft_node;
77 SGPropertyNode_ptr _user_longitude_node;
78 SGPropertyNode_ptr _user_latitude_node;
79 SGPropertyNode_ptr _ground_elev_node;
80
81 simgear::TiedPropertyList _tiedProperties;
82 };