]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/LaRCsim.cxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / FDM / LaRCsim.cxx
index 1ef2fbb68f3d124196591f946c8e5deec2c79d2a..ea8959ec086f90eeae2bfcc3f95fa9c9e048bb0f 100644 (file)
 //
 // $Id$
 
+#include <math.h>
+#include <string.h>            // strcmp()
 
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
+#include <simgear/scene/model/location.hxx>
+#include <simgear/scene/model/placement.hxx>
 
-#include <Scenery/scenery.hxx>
-
-#include <Main/fg_props.hxx>
 #include <Aircraft/aircraft.hxx>
 #include <Controls/controls.hxx>
 #include <FDM/flight.hxx>
 #include <FDM/LaRCsim/ls_cockpit.h>
 #include <FDM/LaRCsim/ls_generic.h>
 #include <FDM/LaRCsim/ls_interface.h>
+#include <FDM/LaRCsim/ls_constants.h>
 #include <FDM/LaRCsimIC.hxx>
+#include <FDM/UIUCModel/uiuc_aircraft.h>
+#include <Main/fg_props.hxx>
+#include <Model/acmodel.hxx>
 
 #include "IO360.hxx"
 #include "LaRCsim.hxx"
 
+
 FGLaRCsim::FGLaRCsim( double dt ) {
-    set_delta_t( dt );
+//     set_delta_t( dt );
 
     speed_up = fgGetNode("/sim/speed-up", true);
-    aircraft = fgGetNode("/sim/aircraft", true);
-    
-    ls_toplevel_init( 0.0, (char *)(aircraft->getStringValue().c_str()) );
+    aero = fgGetNode("/sim/aero", true);
+    uiuc_type = fgGetNode("/sim/uiuc-type", true);
+
+    ls_toplevel_init( 0.0, (char *)(aero->getStringValue()) );
 
     lsic=new LaRCsimIC; //this needs to be brought up after LaRCsim is
-    copy_to_LaRCsim(); // initialize all of LaRCsim's vars
-
-    //this should go away someday -- formerly done in fg_init.cxx
-    Mass = 8.547270E+01;
-    I_xx = 1.048000E+03;
-    I_yy = 3.000000E+03;
-    I_zz = 3.530000E+03;
-    I_xz = 0.000000E+00;
-    
-    ls_set_model_dt( get_delta_t() );
+    if ( !strcmp(aero->getStringValue(), "c172") ) {
+        copy_to_LaRCsim(); // initialize all of LaRCsim's vars
+
+        //this should go away someday -- formerly done in fg_init.cxx
+        Mass = 8.547270E+01;
+        I_xx = 1.048000E+03;
+        I_yy = 3.000000E+03;
+        I_zz = 3.530000E+03;
+        I_xz = 0.000000E+00;
+    }
+
+    ls_set_model_dt(dt);
     
-               // Initialize our little engine that hopefully might
-    eng.init( get_delta_t() );
+    // Initialize our little engine that hopefully might
+    eng.init(dt);
     // dcl - in passing dt to init rather than update I am assuming
     // that the LaRCsim dt is fixed at one value (yes it is 120hz CLO)
-
-    // update the engines interface
-    FGEngInterface e;
-    add_engine( e );
-
-    // Fill the fuel tanks
-    // Hardwired to C172 full tanks for now - need to fix this sometime
-    // Also note that this is the max quantity - the usable quantity
-    // is slightly less
-    set_Tank1Fuel(28.0);
-    set_Tank2Fuel(28.0);  
-
-
 }
 
 FGLaRCsim::~FGLaRCsim(void) {
-    if(lsic != NULL) {
-       delete lsic;
+    if ( lsic != NULL ) {
+        delete lsic;
+        lsic = NULL;
     }
-}    
+}
 
 // Initialize the LaRCsim flight model, dt is the time increment for
 // each subsequent iteration through the EOM
 void FGLaRCsim::init() {
-
-               // Explicitly call the superclass's
-                               // init method first.
-    FGInterface::init();
+   //do init common to all FDM's
+   common_init();
 }
 
 
 // Run an iteration of the EOM (equations of motion)
-bool FGLaRCsim::update( int multiloop ) {
+void FGLaRCsim::update( double dt ) {
 
-    if ( aircraft->getStringValue() == "c172" ) {
-       // set control inputs
-       // cout << "V_calibrated_kts = " << V_calibrated_kts << '\n';
+    if (is_suspended())
+      return;
+
+    int multiloop = _calc_multiloop(dt);
+
+    // if flying c172-larcsim, do the following
+    if ( !strcmp(aero->getStringValue(), "c172") ) {
+        // set control inputs
+        // cout << "V_calibrated_kts = " << V_calibrated_kts << '\n';
        eng.set_IAS( V_calibrated_kts );
-       eng.set_Throttle_Lever_Pos( controls.get_throttle( 0 ) * 100.0 );
+       eng.set_Throttle_Lever_Pos( globals->get_controls()->get_throttle( 0 )
+                                   * 100.0 );
        eng.set_Propeller_Lever_Pos( 100 );
-        eng.set_Mixture_Lever_Pos( controls.get_mixture( 0 ) * 100.0 );
+        eng.set_Mixture_Lever_Pos( globals->get_controls()->get_mixture( 0 )
+                                  * 100.0 );
+       eng.set_Magneto_Switch_Pos( globals->get_controls()->get_magnetos(0) );
+       eng.setStarterFlag( globals->get_controls()->get_starter(0) );
        eng.set_p_amb( Static_pressure );
        eng.set_T_amb( Static_temperature );
 
        // update engine model
        eng.update();
 
+       // Fake control-surface positions
+       fgSetDouble("/surface-positions/flap-pos-norm",
+                   fgGetDouble("/controls/flight/flaps"));
+                               // FIXME: ignoring trim
+       fgSetDouble("/surface-positions/elevator-pos-norm",
+                   fgGetDouble("/controls/flight/elevator"));
+                               // FIXME: ignoring trim
+       fgSetDouble("/surface-positions/left-aileron-pos-norm",
+                   fgGetDouble("/controls/flight/aileron"));
+                               // FIXME: ignoring trim
+       fgSetDouble("/surface-positions/right-aileron-pos-norm",
+                   -1 * fgGetDouble("/controls/flight/aileron"));
+                               // FIXME: ignoring trim
+       fgSetDouble("/surface-positions/rudder-pos-norm",
+                   fgGetDouble("/controls/flight/rudder"));
+
        // copy engine state values onto "bus"
-       FGEngInterface *e = get_engine( 0 );
-       e->set_Throttle( controls.get_throttle( 0 ) * 100.0 );
-       e->set_Mixture( 80 );
-       e->set_Prop_Advance( 100 );
-       e->set_RPM( eng.get_RPM() );
-       e->set_Manifold_Pressure( eng.get_Manifold_Pressure() );
-       e->set_MaxHP( eng.get_MaxHP() );
-       e->set_Percentage_Power( eng.get_Percentage_Power() );
-       e->set_EGT( eng.get_EGT() );
-       e->set_CHT( eng.get_CHT() );
-       e->set_prop_thrust( eng.get_prop_thrust_SI() );
-       e->set_Fuel_Flow( eng.get_fuel_flow_gals_hr() );
-
-        //Assume we are using both tanks equally for now
-       reduce_Tank1Fuel( (eng.get_fuel_flow_gals_hr() / (2 * 3600))
-                         * get_delta_t() );
-       reduce_Tank2Fuel( (eng.get_fuel_flow_gals_hr() / (2 * 3600))
-                         * get_delta_t() ); 
-
-#if 0
-       SG_LOG( SG_FLIGHT, SG_INFO, "Throttle = "
-               << controls.get_throttle( 0 ) * 100.0);
-       SG_LOG( SG_FLIGHT, SG_INFO, " Mixture = " << 80);
-       SG_LOG( SG_FLIGHT, SG_INFO, " RPM = " << eng.get_RPM());
-       SG_LOG( SG_FLIGHT, SG_INFO, " MP = " << eng.get_Manifold_Pressure());
-       SG_LOG( SG_FLIGHT, SG_INFO, " HP = "
-               << ( eng.get_MaxHP() * eng.get_Percentage_Power()/ 100.0) );
-       SG_LOG( SG_FLIGHT, SG_INFO, " EGT = " << eng.get_EGT());
-       SG_LOG( SG_FLIGHT, SG_INFO, " Thrust (N) "
-               << eng.get_prop_thrust_SI());   // Thrust in Newtons
-       SG_LOG( SG_FLIGHT, SG_INFO, '\n');
-#endif
-        F_X_engine = eng.get_prop_thrust_lbs();
+       fgSetDouble("/engines/engine/rpm", eng.get_RPM());
+       fgSetDouble("/engines/engine/mp-osi", eng.get_Manifold_Pressure());
+       fgSetDouble("/engines/engine/max-hp", eng.get_MaxHP());
+       fgSetDouble("/engines/engine/power-pct", eng.get_Percentage_Power());
+       fgSetDouble("/engines/engine/egt-degf", eng.get_EGT());
+       fgSetDouble("/engines/engine/cht-degf", eng.get_CHT());
+       fgSetDouble("/engines/engine/prop-thrust", eng.get_prop_thrust_SI());
+       fgSetDouble("/engines/engine/fuel-flow-gph",
+                   eng.get_fuel_flow_gals_hr());
+       fgSetDouble("/engines/engine/oil-temperature-degf",
+                   eng.get_oil_temp());
+       fgSetDouble("/engines/engine/running", eng.getRunningFlag());
+       fgSetDouble("/engines/engine/cranking", eng.getCrankingFlag());
+
+       static const SGPropertyNode *fuel_freeze
+           = fgGetNode("/sim/freeze/fuel");
+
+       if ( ! fuel_freeze->getBoolValue() ) {
+           //Assume we are using both tanks equally for now
+           fgSetDouble("/consumables/fuel/tank[0]/level-gal_us",
+                       fgGetDouble("/consumables/fuel/tank[0]/level-gal_us")
+                       - (eng.get_fuel_flow_gals_hr() / (2 * 3600))
+                       * dt);
+           fgSetDouble("/consumables/fuel/tank[1]/level-gal_us",
+                       fgGetDouble("/consumables/fuel/tank[1]/level-gal_us")
+                       - (eng.get_fuel_flow_gals_hr() / (2 * 3600))
+                       * dt);
+       }
+
+       F_X_engine = eng.get_prop_thrust_lbs();
        // cout << "F_X_engine = " << F_X_engine << '\n';
+       // end c172 if block
+
+       Flap_handle = 30.0 * globals->get_controls()->get_flaps();
     }
+    // done with c172-larcsim if-block
 
     double save_alt = 0.0;
 
@@ -155,29 +177,25 @@ bool FGLaRCsim::update( int multiloop ) {
     }
 
     // copy control positions into the LaRCsim structure
-    Lat_control = controls.get_aileron() /
-       speed_up->getIntValue();
-    Long_control = controls.get_elevator();
-    Long_trim = controls.get_elevator_trim();
-    Rudder_pedal = controls.get_rudder() /
-        speed_up->getIntValue();
-    Flap_handle = 30.0 * controls.get_flaps();
-
-    if ( aircraft->getStringValue() == "c172" ) {
-       Use_External_Engine = 1;
+    Lat_control = globals->get_controls()->get_aileron() / speed_up->getIntValue();
+    Long_control = globals->get_controls()->get_elevator();
+    Long_trim = globals->get_controls()->get_elevator_trim();
+    Rudder_pedal = globals->get_controls()->get_rudder() / speed_up->getIntValue();
+
+    if ( !strcmp(aero->getStringValue(), "c172") ) {
+        Use_External_Engine = 1;
     } else {
-       Use_External_Engine = 0;
+        Use_External_Engine = 0;
     }
 
-    Throttle_pct = controls.get_throttle( 0 ) * 1.0;
+    Throttle_pct = globals->get_controls()->get_throttle( 0 ) * 1.0;
 
-    Brake_pct[0] = controls.get_brake( 1 );
-    Brake_pct[1] = controls.get_brake( 0 );
+    Brake_pct[0] = globals->get_controls()->get_brake( 1 );
+    Brake_pct[1] = globals->get_controls()->get_brake( 0 );
 
     // Inform LaRCsim of the local terrain altitude
     // Runway_altitude = get_Runway_altitude();
-    Runway_altitude = scenery.cur_elev * SG_METER_TO_FEET;
-
+    Runway_altitude = getACModel()->get3DModel()->getSGLocation()->get_cur_elev_m() * SG_METER_TO_FEET;
     // Weather
     /* V_north_airmass = get_V_north_airmass();
        V_east_airmass =  get_V_east_airmass();
@@ -191,6 +209,119 @@ bool FGLaRCsim::update( int multiloop ) {
     // printf("Altitude = %.2f\n", Altitude * 0.3048);
     // printf("Radius to Vehicle = %.2f\n", Radius_to_vehicle * 0.3048);
 
+    // for engine functions (sounds and instruments)
+    // drive the rpm gauge
+    fgSetDouble("/engines/engine/rpm", (globals->get_controls()->get_throttle( 0 ) * 100.0 * 25 ));
+    // manifold air pressure, which drives the sound (see *sound.xml file)
+    fgSetDouble("/engines/engine/mp-osi", (globals->get_controls()->get_throttle( 0 ) * 100.0 ));
+    // make the engine cranking and running sounds when fgfs starts up
+    fgSetDouble("/engines/engine/cranking", 1);
+    fgSetDouble("/engines/engine/running", 1);
+
+    // if flying uiuc, set some properties and over-ride some previous ones
+    if ( !strcmp(aero->getStringValue(), "uiuc")) {
+
+      // surface positions
+      fgSetDouble("/surface-positions/rudder-pos-norm",             fgGetDouble("/controls/flight/rudder"));
+      fgSetDouble("/surface-positions/elevator-pos-norm",           fgGetDouble("/controls/flight/elevator")); // FIXME: ignoring trim
+      fgSetDouble("/surface-positions/right-aileron-pos-norm", -1 * fgGetDouble("/controls/flight/aileron")); // FIXME: ignoring trim
+      fgSetDouble("/surface-positions/left-aileron-pos-norm",       fgGetDouble("/controls/flight/aileron")); // FIXME: ignoring trim
+
+      Flap_handle = flap_max * globals->get_controls()->get_flaps();
+
+      // flaps with transition occuring in uiuc_aerodeflections.cpp
+      if (use_flaps) {
+      fgSetDouble("/surface-positions/flight/flap-pos-norm",               flap_pos_pct);
+      }
+
+      // spoilers with transition occurring in uiuc_aerodeflections.cpp
+      if(use_spoilers) {
+       Spoiler_handle = spoiler_max * fgGetDouble("/controls/spoilers");
+      }
+      // gear with transition occurring here in LaRCsim.cxx
+      if (use_gear) {
+       if(fgGetBool("/controls/gear-down")) {
+         Gear_handle = 1.0;
+       }
+       else {
+         Gear_handle = 0.;
+       }
+       // commanded gear is 0 or 1
+       gear_cmd_norm = Gear_handle;
+       // amount gear moves per time step [relative to 1]
+       gear_increment_per_timestep = gear_rate * dt; 
+       // determine gear position with respect to gear command
+       if (gear_pos_norm < gear_cmd_norm) {
+         gear_pos_norm += gear_increment_per_timestep;
+         if (gear_pos_norm > gear_cmd_norm) 
+           gear_pos_norm = gear_cmd_norm;
+       } else if (gear_pos_norm > gear_cmd_norm) {
+         gear_pos_norm -= gear_increment_per_timestep;
+         if (gear_pos_norm < gear_cmd_norm)
+           gear_pos_norm = gear_cmd_norm;
+       } 
+       // set the gear position
+       fgSetDouble("/gear/gear[0]/position-norm", gear_pos_norm);
+       fgSetDouble("/gear/gear[1]/position-norm", gear_pos_norm);
+       fgSetDouble("/gear/gear[2]/position-norm", gear_pos_norm);
+      }
+
+
+      // engine functions (sounds and instruments)
+      // drive the rpm gauge
+      fgSetDouble("/engines/engine/rpm", (globals->get_controls()->get_throttle( 0 ) * 100.0 * 25 ));
+      // manifold air pressure
+      fgSetDouble("/engines/engine/mp-osi", (globals->get_controls()->get_throttle( 0 ) * 100.0 ));
+      // make the engine cranking and running sounds when fgfs starts up
+      fgSetDouble("/engines/engine/cranking", 1);
+      fgSetDouble("/engines/engine/running", 1);
+      if ( !strcmp(uiuc_type->getStringValue(), "uiuc-prop")) {
+       // uiuc prop driven airplane, e.g. Wright Flyer
+      }
+      else if ( !strcmp(uiuc_type->getStringValue(), "uiuc-jet")) {
+       // uiuc jet aircraft, e.g. a4d
+       fgSetDouble("/engines/engine/n1", (75 + (globals->get_controls()->get_throttle( 0 ) * 100.0 )/400));
+       fgSetDouble("/engines/engine/prop-thrust", (4000 + F_X_engine/2));
+      }
+      else if ( !strcmp(uiuc_type->getStringValue(), "uiuc-sailplane")) {
+       // uiuc sailplane, e.g. asw20
+       fgSetDouble("/engines/engine/cranking", 0);
+       // set the wind speed for use in setting wind sound level
+       fgSetDouble("/velocities/V_rel_wind_kts", (V_rel_wind * 1.274));
+      }
+      else if ( !strcmp(uiuc_type->getStringValue(), "uiuc-hangglider")) {
+       // uiuc sailplane, e.g. asw20
+       fgSetDouble("/engines/engine/cranking", 0);
+      }
+      else if ( !strcmp(uiuc_type->getStringValue(), "uiuc-ornithopter")) {
+       // mechanical flapping wings
+       // flapping wings (using seahawk for now)
+       fgSetDouble("/canopy/position-norm", 0);
+       fgSetDouble("/wing-phase/position-norm", sin(flapper_phi - 3 * LS_PI / 2));
+       //      fgSetDouble("/wing-phase/position-norm", fgGetDouble("/controls/rudder"));
+       fgSetDouble("/wing-phase/position-deg", flapper_phi*RAD_TO_DEG);
+       fgSetDouble("/wing-phase/position-one", 1);
+       fgSetDouble("/thorax/volume", 0);
+       fgSetDouble("/thorax/rpm",    0);
+       //      fgSetDouble("/wing-phase/position-norm", ((1+cos(flapper_phi - LS_PI/2))/2 -.36 ));
+       //      fgSetDouble("/thorax/volume", ((1+sin(2*(flapper_phi+LS_PI)))/2));
+       //      fgSetDouble("/thorax/rpm",    ((1+sin(2*(flapper_phi+LS_PI)))/2));
+      }
+    }
+
+
+    // add Gamma_horiz_deg to properties, mss 021213
+    if (use_gamma_horiz_on_speed) {
+      if (V_rel_wind > gamma_horiz_on_speed) {
+       fgSetDouble("/orientation/Gamma_horiz_deg", (Gamma_horiz_rad * RAD_TO_DEG));
+      }
+      else {
+       fgSetDouble("/orientation/Gamma_horiz_deg",  fgGetDouble("/orientation/heading-deg"));
+      }
+    }
+    else {
+      fgSetDouble("/orientation/Gamma_horiz_deg",  fgGetDouble("/orientation/heading-deg"));
+    }
     ls_update(multiloop);
 
     // printf("%d FG_Altitude = %.2f\n", i, FG_Altitude * 0.3048);
@@ -205,8 +336,6 @@ bool FGLaRCsim::update( int multiloop ) {
     if ( save_alt < -9000.0 ) {
        set_Altitude( save_alt );
     }
-
-    return true;
 }
 
 
@@ -413,7 +542,7 @@ bool FGLaRCsim::copy_from_LaRCsim() {
     _set_Accels_Body( U_dot_body, V_dot_body, W_dot_body );
     _set_Accels_CG_Body( A_X_cg, A_Y_cg, A_Z_cg );
     _set_Accels_Pilot_Body( A_X_pilot, A_Y_pilot, A_Z_pilot );
-    // set_Accels_CG_Body_N( N_X_cg, N_Y_cg, N_Z_cg );
+    _set_Accels_CG_Body_N( N_X_cg, N_Y_cg, -N_Z_cg );
     // set_Accels_Pilot_Body_N( N_X_pilot, N_Y_pilot, N_Z_pilot );
     // set_Accels_Omega( P_dot_body, Q_dot_body, R_dot_body );
 
@@ -466,7 +595,7 @@ bool FGLaRCsim::copy_from_LaRCsim() {
     _set_Geodetic_Position( Latitude, tmp_lon, Altitude );
     _set_Euler_Angles( Phi, Theta, Psi );
 
-    _set_Altitude_AGL( Altitude-Runway_altitude );
+    _set_Altitude_AGL( Altitude - Runway_altitude );
 
     // Miscellaneous quantities
     _set_T_Local_to_Body(T_local_to_body_m);
@@ -534,6 +663,28 @@ bool FGLaRCsim::copy_from_LaRCsim() {
 
     _set_Climb_Rate( -1 * V_down );
     // cout << "climb rate = " << -V_down * 60 << endl;
+
+    if ( !strcmp(aero->getStringValue(), "uiuc") ) {
+       if (pilot_elev_no) {
+           globals->get_controls()->set_elevator(Long_control);
+           globals->get_controls()->set_elevator_trim(Long_trim);
+           //      controls.set_elevator(Long_control);
+           //      controls.set_elevator_trim(Long_trim);
+        }
+       if (pilot_ail_no) {
+            globals->get_controls()->set_aileron(Lat_control);
+            //   controls.set_aileron(Lat_control);
+        }
+       if (pilot_rud_no) {
+            globals->get_controls()->set_rudder(Rudder_pedal);
+            //   controls.set_rudder(Rudder_pedal);
+        }
+       if (pilot_throttle_no) {
+            globals->get_controls()->set_throttle(0,Throttle_pct);
+            //   controls.set_throttle(0,Throttle_pct);
+        }
+    }
+
     return true;
 }
 
@@ -549,26 +700,12 @@ void FGLaRCsim::set_ls(void) {
     Latitude=lsic->GetLatitudeGDRadIC();
     Longitude=lsic->GetLongitudeRadIC();
     Runway_altitude=lsic->GetRunwayAltitudeFtIC();
-    V_north_airmass = lsic->GetVnorthAirmassFpsIC();
-    V_east_airmass = lsic->GetVeastAirmassFpsIC();
-    V_down_airmass = lsic->GetVdownAirmassFpsIC();
+    V_north_airmass = lsic->GetVnorthAirmassFpsIC() * -1;
+    V_east_airmass = lsic->GetVeastAirmassFpsIC() * -1;
+    V_down_airmass = lsic->GetVdownAirmassFpsIC() * -1;
     ls_loop(0.0,-1);
     copy_from_LaRCsim();
-    SG_LOG( SG_FLIGHT, SG_INFO, "  FGLaRCsim::set_ls(): "  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     Phi: " <<  Phi  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     Theta: " <<  Theta  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     Psi: " <<  Psi  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     V_north: " <<  V_north  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     V_east: " <<  V_east  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     V_down: " <<  V_down  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     Altitude: " <<  Altitude  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     Latitude: " <<  Latitude  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     Longitude: " <<  Longitude  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     Runway_altitude: " <<  Runway_altitude  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     V_north_airmass: " <<  V_north_airmass  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     V_east_airmass: " <<  V_east_airmass  );
-    SG_LOG( SG_FLIGHT, SG_INFO, "     V_down_airmass: " <<  V_down_airmass  );
-}  
+}
 
 void FGLaRCsim::snap_shot(void) {
     lsic->SetLatitudeGDRadIC( get_Latitude() );
@@ -592,7 +729,7 @@ void FGLaRCsim::set_Latitude(double lat) {
     lsic->SetLatitudeGDRadIC(lat);
     set_ls();
     copy_from_LaRCsim(); //update the bus
-}  
+}
 
 void FGLaRCsim::set_Longitude(double lon) {
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Longitude: " << lon  );
@@ -600,7 +737,7 @@ void FGLaRCsim::set_Longitude(double lon) {
     lsic->SetLongitudeRadIC(lon);
     set_ls();
     copy_from_LaRCsim(); //update the bus
-}  
+}
 
 void FGLaRCsim::set_Altitude(double alt) {
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Altitude: " << alt  );
@@ -617,7 +754,7 @@ void FGLaRCsim::set_V_calibrated_kts(double vc) {
     lsic->SetVcalibratedKtsIC(vc);
     set_ls();
     copy_from_LaRCsim(); //update the bus
-}  
+}
 
 void FGLaRCsim::set_Mach_number(double mach) {
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Mach_number: " << mach  );
@@ -625,7 +762,7 @@ void FGLaRCsim::set_Mach_number(double mach) {
     lsic->SetMachIC(mach);
     set_ls();
     copy_from_LaRCsim(); //update the bus
-}  
+}
 
 void FGLaRCsim::set_Velocities_Local( double north, double east, double down ){
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Velocities_local: " 
@@ -634,7 +771,7 @@ void FGLaRCsim::set_Velocities_Local( double north, double east, double down ){
     lsic->SetVNEDFpsIC(north, east, down);
     set_ls();
     copy_from_LaRCsim(); //update the bus
-}  
+}
 
 void FGLaRCsim::set_Velocities_Wind_Body( double u, double v, double w){
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Velocities_Wind_Body: " 
@@ -643,7 +780,7 @@ void FGLaRCsim::set_Velocities_Wind_Body( double u, double v, double w){
     lsic->SetUVWFpsIC(u,v,w);
     set_ls();
     copy_from_LaRCsim(); //update the bus
-} 
+}
 
 //Euler angles 
 void FGLaRCsim::set_Euler_Angles( double phi, double theta, double psi ) {
@@ -655,8 +792,8 @@ void FGLaRCsim::set_Euler_Angles( double phi, double theta, double psi ) {
     lsic->SetRollAngleRadIC(phi);
     lsic->SetHeadingRadIC(psi);
     set_ls();
-    copy_from_LaRCsim(); //update the bus 
-}  
+    copy_from_LaRCsim(); //update the bus
+}
 
 //Flight Path
 void FGLaRCsim::set_Climb_Rate( double roc) {
@@ -664,24 +801,16 @@ void FGLaRCsim::set_Climb_Rate( double roc) {
     snap_shot();
     lsic->SetClimbRateFpsIC(roc);
     set_ls();
-    copy_from_LaRCsim(); //update the bus 
-}  
+    copy_from_LaRCsim(); //update the bus
+}
 
 void FGLaRCsim::set_Gamma_vert_rad( double gamma) {
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Gamma_vert_rad: " << gamma  );
     snap_shot();
     lsic->SetFlightPathAngleRadIC(gamma);
     set_ls();
-    copy_from_LaRCsim(); //update the bus  
-}  
-
-void FGLaRCsim::set_Runway_altitude(double ralt) {
-    SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Runway_altitude: " << ralt  );
-    snap_shot();
-    lsic->SetRunwayAltitudeFtIC(ralt);
-    set_ls();
-    copy_from_LaRCsim(); //update the bus 
-} 
+    copy_from_LaRCsim(); //update the bus
+}
 
 void FGLaRCsim::set_AltitudeAGL(double altagl) {
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_AltitudeAGL: " << altagl  );
@@ -691,6 +820,7 @@ void FGLaRCsim::set_AltitudeAGL(double altagl) {
     copy_from_LaRCsim();
 }
 
+/*  getting a namespace conflict...
 void FGLaRCsim::set_Velocities_Local_Airmass (double wnorth, 
                                              double weast, 
                                              double wdown ) {
@@ -700,7 +830,8 @@ void FGLaRCsim::set_Velocities_Local_Airmass (double wnorth,
     lsic->SetVNEDAirmassFpsIC( wnorth, weast, wdown );
     set_ls();
     copy_from_LaRCsim();
-}     
+}
+*/
 
 void FGLaRCsim::set_Static_pressure(double p) { 
     SG_LOG( SG_FLIGHT, SG_INFO, 
@@ -717,7 +848,7 @@ void FGLaRCsim::set_Static_temperature(double T) {
 
 }
 
-void FGLaRCsim::set_Density(double rho) { 
+void FGLaRCsim::set_Density(double rho) {
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Density: " << rho  );
     SG_LOG( SG_FLIGHT, SG_INFO, 
            "LaRCsim does not support externally supplied atmospheric data" );