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