#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
-#include "External.hxx"
#include "flight.hxx"
-#include "JSBSim.hxx"
-#include "LaRCsim.hxx"
-#include "Balloon.h"
// base_fdm_state is the internal state that is updated in integer
SG_LOG( SG_FLIGHT, SG_INFO,
"...initializing ground elevation to " << ground_elev_ft
<< "ft..." );
- SG_LOG( SG_FLIGHT, SG_INFO, "common_init(): set ground elevation "
- << ground_elev_ft );
- base_fdm_state.set_Runway_altitude( ground_elev_ft );
- set_Runway_altitude( ground_elev_ft );
// Set sea-level radius
SG_LOG( SG_FLIGHT, SG_INFO, "...initializing sea-level radius..." );
* SGD_DEGREES_TO_RADIANS,
fgGetDouble("/position/altitude-ft") * SG_FEET_TO_METER,
&sea_level_radius_meters, &lat_geoc );
- set_Sea_level_radius( sea_level_radius_meters * SG_METER_TO_FEET );
+ _set_Sea_level_radius( sea_level_radius_meters * SG_METER_TO_FEET );
// Set initial velocities
SG_LOG( SG_FLIGHT, SG_INFO, "...initializing velocities..." );
// Climb and slip (read-only)
fgTie("/velocities/vertical-speed-fps", this,
- &FGInterface::get_Climb_Rate); // read-only
+ &FGInterface::get_Climb_Rate,
+ &FGInterface::set_Climb_Rate );
+ fgTie("/velocities/glideslope", this,
+ &FGInterface::get_Gamma_vert_rad,
+ &FGInterface::set_Gamma_vert_rad );
fgTie("/velocities/side-slip-rad", this,
&FGInterface::get_Beta); // read-only
+ fgTie("/velocities/side-slip-deg", this,
+ &FGInterface::get_Beta_deg); // read-only
+ fgTie("/velocities/alpha-deg", this,
+ &FGInterface::get_Alpha_deg); // read-only
+ fgTie("/accelerations/nlf", this,
+ &FGInterface::get_Nlf); // read-only
}
fgUntie("/velocities/vBody-fps");
fgUntie("/velocities/wBody-fps");
fgUntie("/velocities/vertical-speed-fps");
+ fgUntie("/velocities/glideslope");
fgUntie("/velocities/side-slip-rad");
+ fgUntie("/velocities/side-slip-deg");
+ fgUntie("/velocities/alpha-deg");
+ fgUntie("/accelerations/nlf");
+
}
/**
void
FGInterface::update (int dt)
{
- cout << "dummy update() ... SHOULDN'T BE CALLED!" << endl;
+ SG_LOG(SG_FLIGHT, SG_ALERT, "dummy update() ... SHOULDN'T BE CALLED!");
}
// -dw- metrowerks complains about ambiguous access, not critical
// to keep this ;)
#ifndef __MWERKS__
- cout << "extrapolating FDM by dt = " << dt << endl;
+ SG_LOG(SG_FLIGHT, SG_INFO, "extrapolating FDM by dt = " << dt);
#endif
double lat = geodetic_position_v[0] + geocentric_rates_v[0] * dt;
geocentric_position_v[2] = radius;
}
-
-// Set the altitude (force)
-void fgFDMForceAltitude(const string &model, double alt_meters) {
- SG_LOG(SG_FLIGHT,SG_INFO, "fgFDMForceAltitude: " << alt_meters );
-
- double sea_level_radius_meters;
- double lat_geoc;
-
- // Set the FG variables first
- sgGeodToGeoc( base_fdm_state.get_Latitude(), alt_meters,
- &sea_level_radius_meters, &lat_geoc);
-
- base_fdm_state.set_Altitude( alt_meters * SG_METER_TO_FEET );
- base_fdm_state.set_Sea_level_radius( sea_level_radius_meters *
- SG_METER_TO_FEET );
-
- cur_fdm_state->set_Altitude( alt_meters * SG_METER_TO_FEET );
- cur_fdm_state->set_Sea_level_radius( sea_level_radius_meters *
- SG_METER_TO_FEET );
-
- // additional work needed for some flight models
- if ( model == "larcsim" ) {
- ls_ForceAltitude( base_fdm_state.get_Altitude() );
- }
-}
-
-
// Positions
void FGInterface::set_Latitude(double lat) {
geodetic_position_v[0] = lat;
gamma_vert_rad = gamma;
}
-// Earth
-void FGInterface::set_Sea_level_radius(double slr) {
- sea_level_radius = slr;
-}
-
-void FGInterface::set_Runway_altitude(double ralt) {
- runway_altitude = ralt;
-}
-
void FGInterface::set_Static_pressure(double p) { static_pressure = p; }
void FGInterface::set_Static_temperature(double T) { static_temperature = T; }
void FGInterface::set_Density(double rho) { density = rho; }