From ba101991882e8138be6472daffbdad9863b992cc Mon Sep 17 00:00:00 2001 From: frohlich Date: Fri, 9 Nov 2007 05:39:13 +0000 Subject: [PATCH] Move some values exclusively used by LaRCsim to LaRCsim --- src/FDM/LaRCsim/LaRCsim.cxx | 2 ++ src/FDM/LaRCsim/LaRCsim.hxx | 21 ++++++++++++++++----- src/FDM/flight.cxx | 6 ------ src/FDM/flight.hxx | 25 ------------------------- 4 files changed, 18 insertions(+), 36 deletions(-) diff --git a/src/FDM/LaRCsim/LaRCsim.cxx b/src/FDM/LaRCsim/LaRCsim.cxx index f1da8e847..719d90daa 100644 --- a/src/FDM/LaRCsim/LaRCsim.cxx +++ b/src/FDM/LaRCsim/LaRCsim.cxx @@ -50,6 +50,8 @@ FGLaRCsim::FGLaRCsim( double dt ) { + mass=i_xx=i_yy=i_zz=i_xz=0; + // set_delta_t( dt ); speed_up = fgGetNode("/sim/speed-up", true); diff --git a/src/FDM/LaRCsim/LaRCsim.hxx b/src/FDM/LaRCsim/LaRCsim.hxx index 6870d479c..9759f6c2a 100644 --- a/src/FDM/LaRCsim/LaRCsim.hxx +++ b/src/FDM/LaRCsim/LaRCsim.hxx @@ -44,6 +44,7 @@ private: SGPropertyNode_ptr speed_up; SGPropertyNode_ptr aero; SGPropertyNode_ptr uiuc_type; + double mass, i_xx, i_yy, i_zz, i_xz; public: @@ -86,11 +87,21 @@ public: void set_Static_temperature(double T); void set_Density(double rho); -/* - void set_Velocities_Local_Airmass (double wnorth, - double weast, - double wdown ); -*/ + // Inertias + double get_Mass() const { return mass; } + double get_I_xx() const { return i_xx; } + double get_I_yy() const { return i_yy; } + double get_I_zz() const { return i_zz; } + double get_I_xz() const { return i_xz; } + + void _set_Inertias( double m, double xx, double yy, double zz, double xz) + { + mass = m; + i_xx = xx; + i_yy = yy; + i_zz = zz; + i_xz = xz; + } }; diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index 637649b97..f1b88d365 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -130,7 +130,6 @@ FGInterface::_setup () geocentric_position_v = SGGeoc::fromCart(cartesian_position_v); euler_angles_v = SGVec3d::zeros(); - mass=i_xx=i_yy=i_zz=i_xz=0; nlf=0; v_rel_wind=v_true_kts=0; v_ground_speed=v_equiv_kts=0; @@ -621,11 +620,6 @@ void FGInterface::_busdump(void) { SG_LOG(SG_FLIGHT,SG_INFO,"geodetic_position_v: " << geodetic_position_v); SG_LOG(SG_FLIGHT,SG_INFO,"euler_angles_v: " << euler_angles_v); - SG_LOG(SG_FLIGHT,SG_INFO,"mass: " << mass ); - SG_LOG(SG_FLIGHT,SG_INFO,"i_xx: " << i_xx ); - SG_LOG(SG_FLIGHT,SG_INFO,"i_yy: " << i_yy ); - SG_LOG(SG_FLIGHT,SG_INFO,"i_zz: " << i_zz ); - SG_LOG(SG_FLIGHT,SG_INFO,"i_xz: " << i_xz ); SG_LOG(SG_FLIGHT,SG_INFO,"nlf: " << nlf ); SG_LOG(SG_FLIGHT,SG_INFO,"v_rel_wind: " << v_rel_wind ); SG_LOG(SG_FLIGHT,SG_INFO,"v_true_kts: " << v_true_kts ); diff --git a/src/FDM/flight.hxx b/src/FDM/flight.hxx index 4a47eeac3..23eb90250 100644 --- a/src/FDM/flight.hxx +++ b/src/FDM/flight.hxx @@ -40,12 +40,6 @@ `FGInterface::get_Psi ()' `FGInterface::get_V_equiv_kts ()' - `FGInterface::get_Mass ()' - `FGInterface::get_I_xx ()' - `FGInterface::get_I_yy ()' - `FGInterface::get_I_zz ()' - `FGInterface::get_I_xz ()' - `FGInterface::get_V_north ()' `FGInterface::get_V_east ()' `FGInterface::get_V_down ()' @@ -146,9 +140,6 @@ private: SGGeoc geocentric_position_v; SGVec3d euler_angles_v; - // Inertias - double mass, i_xx, i_yy, i_zz, i_xz; - // Normal Load Factor double nlf; @@ -199,15 +190,6 @@ public: void _updateGeocentricPosition( double lat_geoc, double lon, double alt ); void _update_ground_elev_at_pos( void ); - inline void _set_Inertias( double m, double xx, double yy, - double zz, double xz) - { - mass = m; - i_xx = xx; - i_yy = yy; - i_zz = zz; - i_xz = xz; - } inline void _set_CG_Position( double dx, double dy, double dz ) { d_cg_rp_body_v[0] = dx; d_cg_rp_body_v[1] = dy; @@ -450,13 +432,6 @@ public: // ========== Mass properties and geometry values ========== - // Inertias - inline double get_Mass() const { return mass; } - inline double get_I_xx() const { return i_xx; } - inline double get_I_yy() const { return i_yy; } - inline double get_I_zz() const { return i_zz; } - inline double get_I_xz() const { return i_xz; } - // CG position w.r.t. ref. point inline double get_Dx_cg() const { return d_cg_rp_body_v[0]; } inline double get_Dy_cg() const { return d_cg_rp_body_v[1]; } -- 2.39.5