From 6ae39d57faf34b5ea3c5309ec4a76870ba5d322b Mon Sep 17 00:00:00 2001 From: mselig Date: Fri, 25 Jul 2003 17:53:53 +0000 Subject: [PATCH] Fixes compiler warning related to this gcc message: This file includes at least one deprecated or antiquated header. --- src/FDM/UIUCModel/uiuc_1DdataFileReader.cpp | 14 +- src/FDM/UIUCModel/uiuc_1DdataFileReader.h | 5 +- src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp | 3 + src/FDM/UIUCModel/uiuc_2DdataFileReader.cpp | 7 +- src/FDM/UIUCModel/uiuc_2DdataFileReader.h | 5 +- src/FDM/UIUCModel/uiuc_coef_roll.cpp | 6 + src/FDM/UIUCModel/uiuc_engine.cpp | 10 + src/FDM/UIUCModel/uiuc_gear.cpp | 260 ++++++++++-------- src/FDM/UIUCModel/uiuc_menu_CD.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_CL.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_CY.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_Cm.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_Cn.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_Croll.cpp | 19 +- .../UIUCModel/uiuc_menu_controlSurface.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_engine.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_fog.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_functions.cpp | 70 ++++- src/FDM/UIUCModel/uiuc_menu_functions.h | 5 +- src/FDM/UIUCModel/uiuc_menu_gear.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_geometry.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_ice.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_init.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_mass.cpp | 19 +- src/FDM/UIUCModel/uiuc_menu_misc.cpp | 19 +- src/FDM/UIUCModel/uiuc_wrapper.cpp | 24 +- 26 files changed, 442 insertions(+), 252 deletions(-) diff --git a/src/FDM/UIUCModel/uiuc_1DdataFileReader.cpp b/src/FDM/UIUCModel/uiuc_1DdataFileReader.cpp index c8267a9d4..f4c41e5b0 100644 --- a/src/FDM/UIUCModel/uiuc_1DdataFileReader.cpp +++ b/src/FDM/UIUCModel/uiuc_1DdataFileReader.cpp @@ -18,10 +18,16 @@ ---------------------------------------------------------------------- HISTORY: 02/15/2000 initial release + 09/01/2002 (RD) added second data file reader for + integer case + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- AUTHOR(S): Jeff Scott + Robert Deters ---------------------------------------------------------------------- @@ -92,8 +98,8 @@ uiuc_1DdataFileReader( string file_name, linetoken1 = matrix -> getToken(*command_line, 1); // gettoken(string,tokenNo); linetoken2 = matrix -> getToken(*command_line, 2); // 2 represents token No 2 - istrstream token1(linetoken1.c_str()); - istrstream token2(linetoken2.c_str()); + istringstream token1(linetoken1.c_str()); + istringstream token2(linetoken2.c_str()); token1 >> token_value1; token2 >> token_value2; @@ -136,8 +142,8 @@ uiuc_1DdataFileReader( string file_name, linetoken1 = matrix -> getToken(*command_line, 1); // gettoken(string,tokenNo); linetoken2 = matrix -> getToken(*command_line, 2); // 2 represents token No 2 - istrstream token1(linetoken1.c_str()); - istrstream token2(linetoken2.c_str()); + istringstream token1(linetoken1.c_str()); + istringstream token2(linetoken2.c_str()); token1 >> token_value1; token2 >> token_value2; diff --git a/src/FDM/UIUCModel/uiuc_1DdataFileReader.h b/src/FDM/UIUCModel/uiuc_1DdataFileReader.h index d934895f1..ba936320f 100644 --- a/src/FDM/UIUCModel/uiuc_1DdataFileReader.h +++ b/src/FDM/UIUCModel/uiuc_1DdataFileReader.h @@ -3,13 +3,14 @@ #include -#include STL_STRSTREAM +//#include STL_STRSTREAM +#include #include "uiuc_parsefile.h" #include "uiuc_aircraft.h" #include "uiuc_warnings_errors.h" -SG_USING_STD(istrstream); +//SG_USING_STD(istrstream); int uiuc_1DdataFileReader( string file_name, double x[], diff --git a/src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp b/src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp index 598dab882..fdcdfb9a3 100644 --- a/src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp +++ b/src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp @@ -23,10 +23,13 @@ ---------------------------------------------------------------------- HISTORY: 02/03/2000 initial release + 09/01/2002 (RD) added second interpolation routine + for integer case ---------------------------------------------------------------------- AUTHOR(S): Jeff Scott + Robert Deters ---------------------------------------------------------------------- diff --git a/src/FDM/UIUCModel/uiuc_2DdataFileReader.cpp b/src/FDM/UIUCModel/uiuc_2DdataFileReader.cpp index 1d6fda805..6b1dcb25e 100644 --- a/src/FDM/UIUCModel/uiuc_2DdataFileReader.cpp +++ b/src/FDM/UIUCModel/uiuc_2DdataFileReader.cpp @@ -20,6 +20,9 @@ HISTORY: 02/29/2000 initial release 10/25/2001 (RD) Modified so that it recognizes a blank line + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -101,8 +104,8 @@ void uiuc_2DdataFileReader( string file_name, linetoken1 = matrix -> getToken(*command_line, 1); // gettoken(string,tokenNo); linetoken2 = matrix -> getToken(*command_line, 2); // 2 represents token No 2 - istrstream token1(linetoken1.c_str()); - istrstream token2(linetoken2.c_str()); + istringstream token1(linetoken1.c_str()); + istringstream token2(linetoken2.c_str()); //reset token_value1 and token_value2 for first if statement token_value1 = -999; diff --git a/src/FDM/UIUCModel/uiuc_2DdataFileReader.h b/src/FDM/UIUCModel/uiuc_2DdataFileReader.h index c7ab77ae2..ba44df811 100644 --- a/src/FDM/UIUCModel/uiuc_2DdataFileReader.h +++ b/src/FDM/UIUCModel/uiuc_2DdataFileReader.h @@ -3,12 +3,13 @@ #include -#include STL_STRSTREAM +//#include STL_STRSTREAM +#include #include "uiuc_parsefile.h" #include "uiuc_aircraft.h" -SG_USING_STD(istrstream); +//SG_USING_STD(istrstream); void uiuc_2DdataFileReader( string file_name, double x[100][100], diff --git a/src/FDM/UIUCModel/uiuc_coef_roll.cpp b/src/FDM/UIUCModel/uiuc_coef_roll.cpp index 7c44031df..ecda56b68 100644 --- a/src/FDM/UIUCModel/uiuc_coef_roll.cpp +++ b/src/FDM/UIUCModel/uiuc_coef_roll.cpp @@ -143,6 +143,12 @@ void uiuc_coef_roll() /* Cl_p must be mulitplied by b/2U (see Roskam Control book, Part 1, pg. 147) */ Cl_p_save = Cl_p * P_body * b_2U; +// if (Cl_p_save > 0.1) { +// Cl_p_save = 0.1; +// } +// if (Cl_p_save < -0.1) { +// Cl_p_save = -0.1; +// } if (eta_q_Cl_p_fac) { Cl += Cl_p_save * eta_q_Cl_p_fac; diff --git a/src/FDM/UIUCModel/uiuc_engine.cpp b/src/FDM/UIUCModel/uiuc_engine.cpp index 3bf5c9c99..f36b9f855 100644 --- a/src/FDM/UIUCModel/uiuc_engine.cpp +++ b/src/FDM/UIUCModel/uiuc_engine.cpp @@ -122,6 +122,11 @@ void uiuc_engine() case simpleSingle_flag: { F_X_engine = Throttle[3] * simpleSingleMaxThrust; + F_Y_engine = 0.0; + F_Z_engine = 0.0; + M_l_engine = 0.0; + M_m_engine = 0.0; + M_n_engine = 0.0; break; } case simpleSingleModel_flag: @@ -129,6 +134,11 @@ void uiuc_engine() /* simple model based on Hepperle's equation * exponent dtdvvt was computed in uiuc_menu.cpp */ F_X_engine = Throttle[3] * t_v0 * (1 - pow((V_rel_wind/v_t0),dtdvvt)); + F_Y_engine = 0.0; + F_Z_engine = 0.0; + M_l_engine = 0.0; + M_m_engine = 0.0; + M_n_engine = 0.0; if (b_slipstreamEffects) { tc = F_X_engine/(Dynamic_pressure * LS_PI * propDia * propDia / 4); w_induced = 0.5 * V_rel_wind * (-1 + pow((1+tc),.5)); diff --git a/src/FDM/UIUCModel/uiuc_gear.cpp b/src/FDM/UIUCModel/uiuc_gear.cpp index 4d4a6b6f2..9edc77fe9 100644 --- a/src/FDM/UIUCModel/uiuc_gear.cpp +++ b/src/FDM/UIUCModel/uiuc_gear.cpp @@ -63,9 +63,14 @@ **********************************************************************/ #include +#include +#include +#include
#include "uiuc_gear.h" + + SG_USING_STD(cerr); @@ -218,143 +223,168 @@ void uiuc_gear() for (i=0;i 0.) reaction_normal_force = 0.; - /* to prevent damping component from swamping spring component */ + /* Add wheel offset to cg location in local axes */ + add3( d_wheel_cg_local_v, D_cg_rwy_local_v, d_wheel_rwy_local_v ); - /* Calculate friction coefficients */ + /* remove Runway axes correction so right hand rule applies */ - if(it_rolls[i]) - { - forward_mu = (max_brake_mu[i] - muGear[i])*percent_brake[i] + muGear[i]; - abs_v_wheel_sideward = sqrt(v_wheel_sideward*v_wheel_sideward); - sideward_mu = sliding_mu[i]; - if (abs_v_wheel_sideward < skid_v) - sideward_mu = (abs_v_wheel_sideward - bkout_v)*beta_mu; - if (abs_v_wheel_sideward < bkout_v) sideward_mu = 0.; - } - else - { - forward_mu=sliding_mu[i]; - sideward_mu=sliding_mu[i]; - } + d_wheel_cg_local_v[2] = -d_wheel_cg_local_v[2]; /* now Z positive down */ - /* Calculate foreward and sideward reaction forces */ + /*============================*/ + /* Calculate wheel velocities */ + /*============================*/ - forward_wheel_force = forward_mu*reaction_normal_force; - sideward_wheel_force = sideward_mu*reaction_normal_force; - if(v_wheel_forward < 0.) forward_wheel_force = -forward_wheel_force; - if(v_wheel_sideward < 0.) sideward_wheel_force = -sideward_wheel_force; - /* printf("\tFfwdgear: %g Fsidegear: %g\n",forward_wheel_force,sideward_wheel_force); - */ - /* Rotate into local (N-E-D) axes */ + /* contribution due to angular rates */ - f_wheel_local_v[0] = forward_wheel_force*cos_wheel_hdg_angle - - sideward_wheel_force*sin_wheel_hdg_angle; - f_wheel_local_v[1] = forward_wheel_force*sin_wheel_hdg_angle - + sideward_wheel_force*cos_wheel_hdg_angle; - f_wheel_local_v[2] = reaction_normal_force; + cross3( Omega_body_v, d_wheel_cg_body_v, temp3a ); - /* Convert reaction force from local (N-E-D) axes to body (X-Y-Z) */ - mult3x3by3( T_local_to_body_m, f_wheel_local_v, tempF ); + /* transform into local axes */ - /* Calculate moments from force and offsets in body axes */ + multtrans3x3by3( T_local_to_body_m, temp3a,v_wheel_cg_local_v ); - cross3( d_wheel_cg_body_v, tempF, tempM ); - - /* Sum forces and moments across all wheels */ - - add3( tempF, F_gear_v, F_gear_v ); - add3( tempM, M_gear_v, M_gear_v ); + /* plus contribution due to cg velocities */ + add3( v_wheel_cg_local_v, V_local_rel_ground_v, v_wheel_local_v ); + clear3(f_wheel_local_v); + reaction_normal_force=0; + static const SGPropertyNode * gear_wow + = fgGetNode("/gear/gear[0]/wow", false); + static const SGPropertyNode * gear_wow1 + = fgGetNode("/gear/gear[1]/wow", false); + static const SGPropertyNode * gear_wow2 + = fgGetNode("/gear/gear[2]/wow", false); + fgSetBool("/gear/gear[0]/wow", false); + fgSetBool("/gear/gear[1]/wow", false); + fgSetBool("/gear/gear[2]/wow", false); + if( HEIGHT_AGL_WHEEL < 0. ) + /*the wheel is underground -- which implies ground contact + so calculate reaction forces */ + { + //set the property - weight on wheels + // if (i==0) + // { + // fgSetBool("/gear/gear[0]/wow", true); + // } + // if (i==1) + // { + // fgSetBool("/gear/gear[1]/wow", true); + // } + // if (i==2) + // { + // fgSetBool("/gear/gear[2]/wow", true); + // } + + /*===========================================*/ + /* Calculate forces & moments for this wheel */ + /*===========================================*/ + + /* Add any anticipation, or frame lead/prediction, here... */ + + /* no lead used at present */ + + /* Calculate sideward and forward velocities of the wheel + in the runway plane */ + + cos_wheel_hdg_angle = cos(caster_angle_rad[i] + Psi); + sin_wheel_hdg_angle = sin(caster_angle_rad[i] + Psi); + + v_wheel_forward = v_wheel_local_v[0]*cos_wheel_hdg_angle + + v_wheel_local_v[1]*sin_wheel_hdg_angle; + v_wheel_sideward = v_wheel_local_v[1]*cos_wheel_hdg_angle + - v_wheel_local_v[0]*sin_wheel_hdg_angle; + + + /* Calculate normal load force (simple spring constant) */ + + reaction_normal_force = 0.; + + reaction_normal_force = kgear[i]*d_wheel_rwy_local_v[2] + - v_wheel_local_v[2]*cgear[i]; + /* printf("\treaction_normal_force: %g\n",reaction_normal_force); */ + + if (reaction_normal_force > 0.) reaction_normal_force = 0.; + /* to prevent damping component from swamping spring component */ + + + /* Calculate friction coefficients */ + + if(it_rolls[i]) + { + forward_mu = (max_brake_mu[i] - muGear[i])*percent_brake[i] + muGear[i]; + abs_v_wheel_sideward = sqrt(v_wheel_sideward*v_wheel_sideward); + sideward_mu = sliding_mu[i]; + if (abs_v_wheel_sideward < skid_v) + sideward_mu = (abs_v_wheel_sideward - bkout_v)*beta_mu; + if (abs_v_wheel_sideward < bkout_v) sideward_mu = 0.; + } + else + { + forward_mu=sliding_mu[i]; + sideward_mu=sliding_mu[i]; + } + + /* Calculate foreward and sideward reaction forces */ + + forward_wheel_force = forward_mu*reaction_normal_force; + sideward_wheel_force = sideward_mu*reaction_normal_force; + if(v_wheel_forward < 0.) forward_wheel_force = -forward_wheel_force; + if(v_wheel_sideward < 0.) sideward_wheel_force = -sideward_wheel_force; + /* printf("\tFfwdgear: %g Fsidegear: %g\n",forward_wheel_force,sideward_wheel_force); + */ + /* Rotate into local (N-E-D) axes */ + + f_wheel_local_v[0] = forward_wheel_force*cos_wheel_hdg_angle + - sideward_wheel_force*sin_wheel_hdg_angle; + f_wheel_local_v[1] = forward_wheel_force*sin_wheel_hdg_angle + + sideward_wheel_force*cos_wheel_hdg_angle; + f_wheel_local_v[2] = reaction_normal_force; + + /* Convert reaction force from local (N-E-D) axes to body (X-Y-Z) */ + mult3x3by3( T_local_to_body_m, f_wheel_local_v, tempF ); + + /* Calculate moments from force and offsets in body axes */ + + cross3( d_wheel_cg_body_v, tempF, tempM ); + + /* Sum forces and moments across all wheels */ + if (tempF) { + fgSetBool("/gear/gear[1]/wow", true); + } + + add3( tempF, F_gear_v, F_gear_v ); + add3( tempM, M_gear_v, M_gear_v ); + + } } diff --git a/src/FDM/UIUCModel/uiuc_menu_CD.cpp b/src/FDM/UIUCModel/uiuc_menu_CD.cpp index 40479c118..9508367d7 100644 --- a/src/FDM/UIUCModel/uiuc_menu_CD.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_CD.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -103,14 +106,14 @@ void parse_CD( const string& linetoken2, const string& linetoken3, double datafile_zArray[100][100]; double convert_f; int datafile_nxArray[100], datafile_ny; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); static bool CXfabetaf_first = true; static bool CXfadef_first = true; diff --git a/src/FDM/UIUCModel/uiuc_menu_CL.cpp b/src/FDM/UIUCModel/uiuc_menu_CL.cpp index 772f09991..3c7120b1b 100644 --- a/src/FDM/UIUCModel/uiuc_menu_CL.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_CL.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -103,14 +106,14 @@ void parse_CL( const string& linetoken2, const string& linetoken3, double datafile_zArray[100][100]; double convert_f; int datafile_nxArray[100], datafile_ny; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); static bool CZfabetaf_first = true; static bool CZfadef_first = true; diff --git a/src/FDM/UIUCModel/uiuc_menu_CY.cpp b/src/FDM/UIUCModel/uiuc_menu_CY.cpp index 7a5b9f5fe..002d14f52 100644 --- a/src/FDM/UIUCModel/uiuc_menu_CY.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_CY.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -103,14 +106,14 @@ void parse_CY( const string& linetoken2, const string& linetoken3, double datafile_zArray[100][100]; double convert_f; int datafile_nxArray[100], datafile_ny; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); static bool CYfabetaf_first = true; static bool CYfadaf_first = true; diff --git a/src/FDM/UIUCModel/uiuc_menu_Cm.cpp b/src/FDM/UIUCModel/uiuc_menu_Cm.cpp index ff4f10e6b..b60d87108 100644 --- a/src/FDM/UIUCModel/uiuc_menu_Cm.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_Cm.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -103,14 +106,14 @@ void parse_Cm( const string& linetoken2, const string& linetoken3, double datafile_zArray[100][100]; double convert_f; int datafile_nxArray[100], datafile_ny; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); static bool Cmfabetaf_first = true; static bool Cmfadef_first = true; diff --git a/src/FDM/UIUCModel/uiuc_menu_Cn.cpp b/src/FDM/UIUCModel/uiuc_menu_Cn.cpp index bca871c89..414c43e10 100644 --- a/src/FDM/UIUCModel/uiuc_menu_Cn.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_Cn.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -103,14 +106,14 @@ void parse_Cn( const string& linetoken2, const string& linetoken3, double datafile_zArray[100][100]; double convert_f; int datafile_nxArray[100], datafile_ny; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); static bool Cnfabetaf_first = true; static bool Cnfadaf_first = true; diff --git a/src/FDM/UIUCModel/uiuc_menu_Croll.cpp b/src/FDM/UIUCModel/uiuc_menu_Croll.cpp index 39dfccf4c..e3006c4a5 100644 --- a/src/FDM/UIUCModel/uiuc_menu_Croll.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_Croll.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -103,14 +106,14 @@ void parse_Cl( const string& linetoken2, const string& linetoken3, double datafile_zArray[100][100]; double convert_f; int datafile_nxArray[100], datafile_ny; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); static bool Clfabetaf_first = true; static bool Clfadaf_first = true; diff --git a/src/FDM/UIUCModel/uiuc_menu_controlSurface.cpp b/src/FDM/UIUCModel/uiuc_menu_controlSurface.cpp index 626178a0d..5b8208f31 100644 --- a/src/FDM/UIUCModel/uiuc_menu_controlSurface.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_controlSurface.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -99,14 +102,14 @@ void parse_controlSurface( const string& linetoken2, const string& linetoken3, LIST command_line ) { double token_value; int token_value_convert1, token_value_convert2; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); switch(controlSurface_map[linetoken2]) { diff --git a/src/FDM/UIUCModel/uiuc_menu_engine.cpp b/src/FDM/UIUCModel/uiuc_menu_engine.cpp index 38367f38c..29d648295 100644 --- a/src/FDM/UIUCModel/uiuc_menu_engine.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_engine.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -98,14 +101,14 @@ void parse_engine( const string& linetoken2, const string& linetoken3, LIST command_line ) { double token_value; int token_value_convert1, token_value_convert2; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); switch(engine_map[linetoken2]) { diff --git a/src/FDM/UIUCModel/uiuc_menu_fog.cpp b/src/FDM/UIUCModel/uiuc_menu_fog.cpp index 578227e1e..d9c19ee16 100644 --- a/src/FDM/UIUCModel/uiuc_menu_fog.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_fog.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -98,14 +101,14 @@ void parse_fog( const string& linetoken2, const string& linetoken3, LIST command_line ) { double token_value; int token_value_convert1; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); switch(fog_map[linetoken2]) { diff --git a/src/FDM/UIUCModel/uiuc_menu_functions.cpp b/src/FDM/UIUCModel/uiuc_menu_functions.cpp index 0ea5ae55d..a3b585955 100644 --- a/src/FDM/UIUCModel/uiuc_menu_functions.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_functions.cpp @@ -1,10 +1,78 @@ +/********************************************************************** + + FILENAME: uiuc_menu_functions.cpp + +---------------------------------------------------------------------- + + DESCRIPTION: provides common functions used by different menu + routines + +---------------------------------------------------------------------- + + STATUS: alpha version + +---------------------------------------------------------------------- + + REFERENCES: + +---------------------------------------------------------------------- + + HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header + +---------------------------------------------------------------------- + + AUTHOR(S): Robert Deters + Michael Selig + +---------------------------------------------------------------------- + + VARIABLES: + +---------------------------------------------------------------------- + + INPUTS: n/a + +---------------------------------------------------------------------- + + OUTPUTS: n/a + +---------------------------------------------------------------------- + + CALLED BY: uiuc_menu_XX() + +---------------------------------------------------------------------- + + CALLS TO: + + ---------------------------------------------------------------------- + + COPYRIGHT: (C) 2003 by Michael Selig + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA or view http://www.gnu.org/copyleft/gpl.html. + +**********************************************************************/ #include "uiuc_menu_functions.h" bool check_float( const string &token) { float value; - istrstream stream(token.c_str()); + istringstream stream(token.c_str()); return (stream >> value); } diff --git a/src/FDM/UIUCModel/uiuc_menu_functions.h b/src/FDM/UIUCModel/uiuc_menu_functions.h index 93096aa16..048ebf991 100644 --- a/src/FDM/UIUCModel/uiuc_menu_functions.h +++ b/src/FDM/UIUCModel/uiuc_menu_functions.h @@ -7,9 +7,10 @@ #include #include STL_IOSTREAM -#include STL_STRSTREAM +//#include STL_STRSTREAM +#include -SG_USING_STD(istrstream); +//SG_USING_STD(istrstream); void d_2_to_3( double array2D[100][100], double array3D[][100][100], int index3D); void d_1_to_2( double array1D[100], double array2D[][100], int index2D); diff --git a/src/FDM/UIUCModel/uiuc_menu_gear.cpp b/src/FDM/UIUCModel/uiuc_menu_gear.cpp index 5dbcb9ed5..28ad7481c 100644 --- a/src/FDM/UIUCModel/uiuc_menu_gear.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_gear.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -97,14 +100,14 @@ void parse_gear( const string& linetoken2, const string& linetoken3, const string& linetoken10, const string& aircraft_directory, LIST command_line ) { double token_value; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); switch(gear_map[linetoken2]) { diff --git a/src/FDM/UIUCModel/uiuc_menu_geometry.cpp b/src/FDM/UIUCModel/uiuc_menu_geometry.cpp index 70d4c89f5..09d8100d9 100644 --- a/src/FDM/UIUCModel/uiuc_menu_geometry.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_geometry.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -97,14 +100,14 @@ void parse_geometry( const string& linetoken2, const string& linetoken3, const string& linetoken10, const string& aircraft_directory, LIST command_line ) { double token_value; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); switch(geometry_map[linetoken2]) { diff --git a/src/FDM/UIUCModel/uiuc_menu_ice.cpp b/src/FDM/UIUCModel/uiuc_menu_ice.cpp index 4f7029829..be5aaa6db 100644 --- a/src/FDM/UIUCModel/uiuc_menu_ice.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_ice.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -101,14 +104,14 @@ void parse_ice( const string& linetoken2, const string& linetoken3, double datafile_xArray[100][100], datafile_yArray[100]; double datafile_zArray[100][100]; int datafile_nxArray[100], datafile_ny; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); static bool tactilefadef_first = true; diff --git a/src/FDM/UIUCModel/uiuc_menu_init.cpp b/src/FDM/UIUCModel/uiuc_menu_init.cpp index 40d678975..10cb0ea61 100644 --- a/src/FDM/UIUCModel/uiuc_menu_init.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_init.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -97,14 +100,14 @@ void parse_init( const string& linetoken2, const string& linetoken3, const string& linetoken10, const string& aircraft_directory, LIST command_line ) { double token_value; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); int token_value_recordRate; switch(init_map[linetoken2]) diff --git a/src/FDM/UIUCModel/uiuc_menu_mass.cpp b/src/FDM/UIUCModel/uiuc_menu_mass.cpp index 3a35f07aa..e6592f5a4 100644 --- a/src/FDM/UIUCModel/uiuc_menu_mass.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_mass.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -97,14 +100,14 @@ void parse_mass( const string& linetoken2, const string& linetoken3, const string& linetoken10, const string& aircraft_directory, LIST command_line ) { double token_value; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); switch(mass_map[linetoken2]) { diff --git a/src/FDM/UIUCModel/uiuc_menu_misc.cpp b/src/FDM/UIUCModel/uiuc_menu_misc.cpp index 20ff54583..c3f67e274 100644 --- a/src/FDM/UIUCModel/uiuc_menu_misc.cpp +++ b/src/FDM/UIUCModel/uiuc_menu_misc.cpp @@ -18,6 +18,9 @@ ---------------------------------------------------------------------- HISTORY: 04/04/2003 initial release + 06/30/2003 (RD) replaced istrstream with istringstream + to get rid of the annoying warning about + using the strstream header ---------------------------------------------------------------------- @@ -97,14 +100,14 @@ void parse_misc( const string& linetoken2, const string& linetoken3, const string& linetoken10, const string& aircraft_directory, LIST command_line ) { double token_value; - istrstream token3(linetoken3.c_str()); - istrstream token4(linetoken4.c_str()); - istrstream token5(linetoken5.c_str()); - istrstream token6(linetoken6.c_str()); - istrstream token7(linetoken7.c_str()); - istrstream token8(linetoken8.c_str()); - istrstream token9(linetoken9.c_str()); - istrstream token10(linetoken10.c_str()); + istringstream token3(linetoken3.c_str()); + istringstream token4(linetoken4.c_str()); + istringstream token5(linetoken5.c_str()); + istringstream token6(linetoken6.c_str()); + istringstream token7(linetoken7.c_str()); + istringstream token8(linetoken8.c_str()); + istringstream token9(linetoken9.c_str()); + istringstream token10(linetoken10.c_str()); switch(misc_map[linetoken2]) { diff --git a/src/FDM/UIUCModel/uiuc_wrapper.cpp b/src/FDM/UIUCModel/uiuc_wrapper.cpp index a91c62904..74aae2460 100644 --- a/src/FDM/UIUCModel/uiuc_wrapper.cpp +++ b/src/FDM/UIUCModel/uiuc_wrapper.cpp @@ -134,9 +134,11 @@ AIRCRAFTDIR *aircraftdir_ = new AIRCRAFTDIR; void uiuc_initial_init () { - // This function called from both ls_step and ls_model(uiuc model side). - // Apply brute force initializations, which override ls_step and ls_aux values - // for the first time step. + // This function is called from uiuc_init_2_wrapper (uiuc_aero.c in LaRCsim) + // which is called from ls_step and ls_model. + // Apply brute force initializations, which override unwanted changes + // performed by LaRCsim. + // Used during initialization (while Simtime=0). if (P_body_init_true) P_body = P_body_init; if (Q_body_init_true) @@ -161,7 +163,7 @@ void uiuc_initial_init () void uiuc_defaults_inits () { - // set defaults and initialize (called from ls_step.c at Simtime=0) + // set defaults and initialize (called once from uiuc_init_2_wrapper) //fog inits fog_field = 0; @@ -276,7 +278,15 @@ void uiuc_defaults_inits () flapper_model = false; ignore_unknown_keywords = false; pilot_throttle_no = false; + Dx_cg = 0.0; + Dy_cg = 0.0; + Dz_cg = 0.0; + + // Calculates the local velocity (V_north, V_east, V_down) from the body + // velocities. + // Called from uiuc_local_vel_init which is called from ls_step. + // Used during initialization (while Simtime=0) } void uiuc_vel_init () @@ -302,6 +312,8 @@ void uiuc_vel_init () V_east = V_east_rel_ground + OMEGA_EARTH*Sea_level_radius*cos(Lat_geocentric); } + // Initializes the UIUC aircraft model. + // Called once from uiuc_init_2_wrapper } void uiuc_init_aeromodel () @@ -367,6 +379,10 @@ void uiuc_force_moment(double dt) if (I_zz_appMass_ratio) M_n_aero += -(I_zz_appMass_ratio * I_zz) * R_dot_body; + // adding in apparent mass in body axis X direction + // F_X_aero += -(0.05 * Mass) * U_dot_body; + + if (Mass_appMass) F_Z_aero += -Mass_appMass * W_dot_body; if (I_xx_appMass) -- 2.39.5