]> git.mxchange.org Git - flightgear.git/commitdiff
Fixes compiler warning related to this gcc message: This file includes at least...
authormselig <mselig>
Fri, 25 Jul 2003 17:53:53 +0000 (17:53 +0000)
committermselig <mselig>
Fri, 25 Jul 2003 17:53:53 +0000 (17:53 +0000)
26 files changed:
src/FDM/UIUCModel/uiuc_1DdataFileReader.cpp
src/FDM/UIUCModel/uiuc_1DdataFileReader.h
src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp
src/FDM/UIUCModel/uiuc_2DdataFileReader.cpp
src/FDM/UIUCModel/uiuc_2DdataFileReader.h
src/FDM/UIUCModel/uiuc_coef_roll.cpp
src/FDM/UIUCModel/uiuc_engine.cpp
src/FDM/UIUCModel/uiuc_gear.cpp
src/FDM/UIUCModel/uiuc_menu_CD.cpp
src/FDM/UIUCModel/uiuc_menu_CL.cpp
src/FDM/UIUCModel/uiuc_menu_CY.cpp
src/FDM/UIUCModel/uiuc_menu_Cm.cpp
src/FDM/UIUCModel/uiuc_menu_Cn.cpp
src/FDM/UIUCModel/uiuc_menu_Croll.cpp
src/FDM/UIUCModel/uiuc_menu_controlSurface.cpp
src/FDM/UIUCModel/uiuc_menu_engine.cpp
src/FDM/UIUCModel/uiuc_menu_fog.cpp
src/FDM/UIUCModel/uiuc_menu_functions.cpp
src/FDM/UIUCModel/uiuc_menu_functions.h
src/FDM/UIUCModel/uiuc_menu_gear.cpp
src/FDM/UIUCModel/uiuc_menu_geometry.cpp
src/FDM/UIUCModel/uiuc_menu_ice.cpp
src/FDM/UIUCModel/uiuc_menu_init.cpp
src/FDM/UIUCModel/uiuc_menu_mass.cpp
src/FDM/UIUCModel/uiuc_menu_misc.cpp
src/FDM/UIUCModel/uiuc_wrapper.cpp

index c8267a9d4c18450fc4d02f0caf9af2a975d84553..f4c41e5b0239d5e16ffc14834c65ceec8e0ff687 100644 (file)
 ----------------------------------------------------------------------
 
  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         <jscott@mail.com>
+               Robert Deters      <rdeters@uiuc.edu>
 
 ----------------------------------------------------------------------
 
@@ -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;
index d934895f1bfb7229469d3e4bcd33d271b0f231e8..ba936320f10bdbb73dfa1bbec162b7b53d820f8e 100644 (file)
@@ -3,13 +3,14 @@
 
 #include <simgear/compiler.h>
 
-#include STL_STRSTREAM
+//#include STL_STRSTREAM
+#include <sstream>
 
 #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[], 
index 598dab8828ad4058e6bcc9aaa42d4b6705d0a399..fdcdfb9a31d25bee712438e36d24b4a44a561a68 100644 (file)
 ----------------------------------------------------------------------
 
  HISTORY:      02/03/2000   initial release
+               09/01/2002   (RD) added second interpolation routine
+                            for integer case
 
 ----------------------------------------------------------------------
 
  AUTHOR(S):    Jeff Scott         <jscott@mail.com>
+               Robert Deters      <rdeters@uiuc.edu>
 
 ----------------------------------------------------------------------
 
index 1d6fda805f624a97adcccc012f0df807b29b17b4..6b1dcb25ebb9e2237b88e0300c80de4495ae6ff7 100644 (file)
@@ -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;
index c7ab77ae228406d729512e9f8d9880d3316cc371..ba44df811064ae3116d3020c9808e958ecffa36e 100644 (file)
@@ -3,12 +3,13 @@
 
 #include <simgear/compiler.h>
 
-#include STL_STRSTREAM
+//#include STL_STRSTREAM
+#include <sstream>
 
 #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], 
index 7c44031dfc3f05ee802adb38e84a2735aca32bf3..ecda56b684d2aaf66e71c2cf546e21ae0e2dd386 100644 (file)
@@ -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;
index 3bf5c9c993e945113044fa3c47d2634c81874adf..f36b9f85580ab11996afd975ee7138e775c915b2 100644 (file)
@@ -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));
index 4d4a6b6f2ef891c2239738f7c25b87ee3e441cb2..9edc77fe973e57973663a3ae7b4db33817fd899b 100644 (file)
 **********************************************************************/
 
 #include <simgear/compiler.h>
+#include <simgear/misc/sg_path.hxx>
+#include <Aircraft/aircraft.hxx>
+#include <Main/fg_props.hxx>
 
 #include "uiuc_gear.h"
 
+
+
 SG_USING_STD(cerr);
 
 
@@ -218,143 +223,168 @@ void uiuc_gear()
   
   for (i=0;i<MAX_GEAR;i++)         /* Loop for each wheel */
     {
-                               // Execute only if the gear has been defined
-      if (!gear_model[i])
-       continue;
-      
-      /* printf("%s:\n",gear_strings[i]); */
-      
-      
-      
-      /*========================================*/
-      /* Calculate wheel position w.r.t. runway */
-      /*========================================*/
-      
-      
-      /* printf("\thgcg: %g, theta: %g,phi: %g\n",D_cg_above_rwy,Theta*RAD_TO_DEG,Phi*RAD_TO_DEG); */
-      
-      
-      /* First calculate wheel location w.r.t. cg in body (X-Y-Z) axes... */
-      
-      sub3( D_gear_v[i], D_cg_rp_body_v, d_wheel_cg_body_v );
-      
-      /* then converting to local (North-East-Down) axes... */
-      
-      multtrans3x3by3( T_local_to_body_m,  d_wheel_cg_body_v, d_wheel_cg_local_v );
-      
-      
-      /* Runway axes correction - third element is Altitude, not (-)Z... */
-      
-      d_wheel_cg_local_v[2] = -d_wheel_cg_local_v[2]; /* since altitude = -Z */
-      
-      /* 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 );
-      
-      /* remove Runway axes correction so right hand rule applies */
-      
-      d_wheel_cg_local_v[2] = -d_wheel_cg_local_v[2]; /* now Z positive down */
-      
-      /*============================*/
-      /* Calculate wheel velocities */
-      /*============================*/
-      
-      /* contribution due to angular rates */
-      
-      cross3( Omega_body_v, d_wheel_cg_body_v, temp3a );
-      
-      /* transform into local axes */
-      
-      multtrans3x3by3( T_local_to_body_m, temp3a,v_wheel_cg_local_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;
-      if( HEIGHT_AGL_WHEEL < 0. ) 
-       /*the wheel is underground -- which implies ground contact 
-         so calculate reaction forces */ 
+      // Execute only if the gear has been defined
+      if (!gear_model[i]) 
+       {
+         // do nothing
+         continue;
+       }       
+      else
        {
-         /*===========================================*/
-         /* Calculate forces & moments for this wheel */
-         /*===========================================*/
          
-         /* Add any anticipation, or frame lead/prediction, here... */
+         /*========================================*/
+         /* Calculate wheel position w.r.t. runway */
+         /*========================================*/
          
-                               /* no lead used at present */
+         /* printf("\thgcg: %g, theta: %g,phi: %g\n",D_cg_above_rwy,Theta*RAD_TO_DEG,Phi*RAD_TO_DEG); */
          
-         /* Calculate sideward and forward velocities of the wheel 
-            in the runway plane                                        */
+         /* First calculate wheel location w.r.t. cg in body (X-Y-Z) axes... */
          
-         cos_wheel_hdg_angle = cos(caster_angle_rad[i] + Psi);
-         sin_wheel_hdg_angle = sin(caster_angle_rad[i] + Psi);
+         sub3( D_gear_v[i], D_cg_rp_body_v, d_wheel_cg_body_v );
          
-         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;
+         /* then converting to local (North-East-Down) axes... */
          
+         multtrans3x3by3( T_local_to_body_m,  d_wheel_cg_body_v, d_wheel_cg_local_v );
          
-         /* Calculate normal load force (simple spring constant) */
          
-         reaction_normal_force = 0.;
+         /* Runway axes correction - third element is Altitude, not (-)Z... */
          
-         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); */
+         d_wheel_cg_local_v[2] = -d_wheel_cg_local_v[2]; /* since altitude = -Z */
          
-         if (reaction_normal_force > 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 );   
+             
+           }     
        }
       
       
index 40479c1188aae78298ca8ed00cb4b732a9ab5821..9508367d773648c31043d74d1abaa054b01035bc 100644 (file)
@@ -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;
index 772f099910d151573fe412bd8b94faea982c8c05..3c7120b1bfdeb7927795e8c03ca0f26796b7246c 100644 (file)
@@ -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;
index 7a5b9f5fea2c68cd403496d0948ca7a9123912d9..002d14f5240391743c53e0f419c777dd7c758a2e 100644 (file)
@@ -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;
index ff4f10e6baf10ae2ce6b153d6a0f827fe03a7636..b60d87108e814eff34116986d44ac2558948963a 100644 (file)
@@ -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;
index bca871c89c45965befea7aa0aabfa75c1c4ed652..414c43e10efbf2de11699310476c4f8808fff4ad 100644 (file)
@@ -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;
index 39dfccf4cc86cd69a773a435f943cc55adb131ee..e3006c4a5288ab34ff5c4a9f5bcc5794d5f44921 100644 (file)
@@ -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;
index 626178a0de3fa8f75b5b3461e7ae4e6c50532ac0..5b8208f317a2eb16a2f828f45058f3ffecc57585 100644 (file)
@@ -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])
       {
index 38367f38cb9df3e9916be35183316399e6a29cca..29d64829575b18c8e74aebd3ba991adb00c23aea 100644 (file)
@@ -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])
       {
index 578227e1e83f2d116f384096e353d0d64c0c3a2c..d9c19ee16db9c2c3bdf3e3696d30774102d7e933 100644 (file)
@@ -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])
       {
index 0ea5ae55de91fa5038e70abbd8e227052ec479a0..a3b585955fb270c5a38d41d2684a140fe85d2714 100644 (file)
@@ -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      <rdeters@uiuc.edu>
+               Michael Selig      <m-selig@uiuc.edu>
+
+----------------------------------------------------------------------
+
+ 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);
 }
 
index 93096aa162997bf213d693c485f8560e51c8e87c..048ebf9911197ab79f2238bf19902585660c8978 100644 (file)
@@ -7,9 +7,10 @@
 
 #include <string>
 #include STL_IOSTREAM
-#include STL_STRSTREAM
+//#include STL_STRSTREAM
+#include <sstream>
 
-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);
index 5dbcb9ed5cfe25ae07136d6fb746d0ca2afec5b8..28ad7481ce6313a4651abb9a3268b04cac4dc31c 100644 (file)
@@ -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])
       {
index 70d4c89f5b42eb9885ec3719ce49898cf565a503..09d8100d9ce66e03cb34e831f9ca8aa904369e59 100644 (file)
@@ -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])
       {
index 4f7029829b3f39f2ce216fc534f4f91abf84ef99..be5aaa6db3cb3593b36e476b08e7e5a2b56e58a0 100644 (file)
@@ -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;
 
index 40d678975b25d7f354826a20d08055071730e6f0..10cb0ea61d04058d671af0f35187e054ddaa2213 100644 (file)
@@ -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])
index 3a35f07aa11284a4e17a272b4f25a74b27791ef7..e6592f5a4ae031207446e4e0f3279849e2b43d3e 100644 (file)
@@ -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])
       {
index 20ff545838c7238abc1abba556e898d4be45adb4..c3f67e274576ea995a98e7d20a51c43b22f4851c 100644 (file)
@@ -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])
     {
index a91c62904b8f445096d1cc93e8ec9a73af1f1c06..74aae2460d7f68f647637108547d1131168d8ba2 100644 (file)
@@ -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)