Debian Codegraph @

src/FDM/flightProperties.hxx

raw symbols SCIP
1 // flightProperties.hxx -- expose FDM properties via helper methods
2 //
3 // Written by James Turner, started June 2010.
4 //
5 // Copyright (C) 2010 Curtis L. Olson - http://www.flightgear.org/~curt
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 // $Id$
22
23 #ifndef FG_FLIGHT_PROPERTIES_HXX
24 #define FG_FLIGHT_PROPERTIES_HXX
25
26 #include <cstring>
27 #include <cmath>
28
29 #include <simgear/math/SGMathFwd.hxx> // for SGVec3d
30 #include <simgear/math/SGMisc.hxx>
31
32 // forward decls
33 class SGPropertyNode;
34 class SGGeoc;
35 class SGGeod;
36
37 /**
38 * Encapsulate the FDM properties in some getter/setter helpers.
39 * This class intentionally mimics portions of
40 * @FGInterface, to permit easy migration of code outside the FDMs,
41 * to use properties instead of global variables.
42 */
43 class FlightProperties
44 {
45 public:
46 FlightProperties(SGPropertyNode* aRoot = NULL);
47 ~FlightProperties();
48
49 double get_V_north() const;
50 double get_V_east() const;
51 double get_V_down() const;
52 double get_uBody () const;
53 double get_vBody () const;
54 double get_wBody () const;
55
56 double get_A_X_pilot() const;
57 double get_A_Y_pilot() const;
58 double get_A_Z_pilot() const;
59
60 double get_P_body() const;
61 double get_Q_body() const;
62 double get_R_body() const;
63
64 SGGeod getPosition() const;
65
66 double get_Latitude() const;
67 double get_Longitude() const;
68 double get_Altitude() const;
69
70 double get_Altitude_AGL(void) const;
71 double get_Track(void) const;
72
73 double get_Latitude_deg () const;
74 double get_Longitude_deg () const;
75
76 double get_Phi_deg() const;
77 double get_Theta_deg() const;
78 double get_Psi_deg() const;
79
80 double get_Phi() const { return SGMiscd::deg2rad(get_Phi_deg()); }
81 double get_Theta() const { return SGMiscd::deg2rad(get_Theta_deg()); }
82 double get_Psi() const { return SGMiscd::deg2rad(get_Psi_deg()); }
83
84 double get_Phi_dot() const;
85 double get_Theta_dot() const;
86 double get_Psi_dot() const;
87 double get_Alpha() const;
88 double get_Beta() const;
89
90 double get_Phi_dot_degps() const;
91 double get_Theta_dot_degps() const;
92 double get_Psi_dot_degps() const;
93
94 double get_V_ground_speed() const; // in feet/s
95 double get_V_equiv_kts() const;
96 double get_V_calibrated_kts() const;
97 double get_Climb_Rate() const;
98 double get_Runway_altitude_m() const;
99
100 double get_Total_temperature() const;
101 double get_Total_pressure() const;
102 double get_Dynamic_pressure() const;
103
104 void set_Longitude(double l); // radians
105 void set_Latitude(double l); // radians
106 void set_Altitude(double ft); // feet
107
108 void set_Euler_Angles(double phi, double theta, double psi);
109 void set_Euler_Rates(double x, double y, double z);
110
111 void set_Alpha(double a);
112 void set_Beta(double b);
113
114 void set_Altitude_AGL(double ft);
115
116 void set_V_calibrated_kts(double kts);
117 void set_Climb_Rate(double fps);
118
119 void set_Velocities_Local(double x, double y, double z);
120 void set_Velocities_Body(double x, double y, double z);
121 void set_Accels_Pilot_Body(double x, double y, double z);
122 private:
123 SGPropertyNode* _root;
124 };
125
126 #endif // of FG_FLIGHT_PROPERTIES_HXX