]> git.mxchange.org Git - flightgear.git/blob - src/FDM/flightProperties.hxx
c34efa60675dcf6701c87e52ff6371dc8854599e
[flightgear.git] / src / FDM / flightProperties.hxx
1 #ifndef FG_FLIGHT_PROPERTIES_HXX
2 #define FG_FLIGHT_PROPERTIES_HXX
3
4 #ifdef HAVE_CONFIG_H
5 #  include <config.h>
6 #endif
7
8 #include <memory>
9 #include <simgear/math/SGMathFwd.hxx> // for SGVec3d 
10 #include <simgear/math/SGMisc.hxx>
11
12 // forward decls
13 class SGPropertyNode;
14 class SGGeoc;
15 class SGGeod;
16
17 /**
18  * Encapsulate the FDM properties in some getter/setter helpers.
19  * This class intentionally mimics portions of
20  * @FGInterface, to permit easy migration of code outside the FDMs,
21  * to use properties instead of global variables.
22  */
23 class FlightProperties
24 {
25 public:
26   FlightProperties(SGPropertyNode* aRoot = NULL);
27   ~FlightProperties();
28
29   double get_V_north() const;
30   double get_V_east() const;
31   double get_V_down() const;
32   double get_uBody () const;
33   double get_vBody () const;
34   double get_wBody () const;
35   
36   double get_A_X_pilot() const;
37   double get_A_Y_pilot() const;
38   double get_A_Z_pilot() const;
39   
40   double get_P_body() const;
41   double get_Q_body() const;
42   double get_R_body() const;
43     
44   SGGeod getPosition() const;
45
46   double get_Latitude() const;
47   double get_Longitude() const;
48   double get_Altitude() const;
49   
50   double get_Altitude_AGL(void) const;
51   double get_Track(void) const;
52
53   double get_Latitude_deg () const;
54   double get_Longitude_deg () const;
55   
56   double get_Phi_deg() const;
57   double get_Theta_deg() const;
58   double get_Psi_deg() const;
59   
60   double get_Phi() const { return SGMiscd::deg2rad(get_Phi_deg()); }
61   double get_Theta() const { return SGMiscd::deg2rad(get_Theta_deg()); }
62   double get_Psi() const { return SGMiscd::deg2rad(get_Psi_deg()); }
63
64   double get_Phi_dot() const;
65   double get_Theta_dot() const;
66   double get_Psi_dot() const;
67   double get_Alpha() const;
68   double get_Beta() const;
69   
70   double get_Phi_dot_degps() const;
71   double get_Theta_dot_degps() const;
72   double get_Psi_dot_degps() const;
73   
74   double get_V_ground_speed() const; // in feet/s
75   double get_V_equiv_kts() const;
76   double get_V_calibrated_kts() const;
77   double get_Climb_Rate() const;
78   double get_Runway_altitude_m() const;
79   
80   double get_Total_temperature() const;
81   double get_Total_pressure() const;
82   double get_Dynamic_pressure() const;
83   
84   void set_Longitude(double l); // radians
85   void set_Latitude(double l); // radians
86   void set_Altitude(double ft); // feet
87     
88   void set_Euler_Angles(double phi, double theta, double psi);
89   void set_Euler_Rates(double x, double y, double z);
90   
91   void set_Alpha(double a);
92   void set_Beta(double b);
93   
94   void set_Altitude_AGL(double ft);
95   
96   void set_V_calibrated_kts(double kts);
97   void set_Climb_Rate(double fps);
98   
99   void set_Velocities_Local(double x, double y, double z);
100   void set_Velocities_Wind_Body(double x, double y, double z);
101   void set_Accels_Pilot_Body(double x, double y, double z);
102 private:
103   SGPropertyNode* _root;
104 };
105
106 #endif // of FG_FLIGHT_PROPERTIES_HXX