#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/fgpath.hxx>
#include <Airports/simple.hxx>
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <Cockpit/radiostack.hxx>
#include <Controls/controls.hxx>
void FGRadioStack::update( double lon, double lat, double elev ) {
need_update = false;
- Point3D aircraft = fgGeodToCart( Point3D( lon, lat, elev ) );
+ Point3D aircraft = sgGeodToCart( Point3D( lon, lat, elev ) );
Point3D station;
double az1, az2, s;
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/fgpath.hxx>
#include <Aircraft/aircraft.hxx>
double alt = temp[2] * METER_TO_FEET;
double lat_geod, tmp_alt, sl_radius1, sl_radius2, tmp_lat_geoc;
- fgGeocToGeod( lat_geoc, EQUATORIAL_RADIUS_M + alt * FEET_TO_METER,
+ sgGeocToGeod( lat_geoc, EQUATORIAL_RADIUS_M + alt * FEET_TO_METER,
&lat_geod, &tmp_alt, &sl_radius1 );
- fgGeodToGeoc( lat_geod, alt * FEET_TO_METER, &sl_radius2, &tmp_lat_geoc );
+ sgGeodToGeoc( lat_geod, alt * FEET_TO_METER, &sl_radius2, &tmp_lat_geoc );
FG_LOG( FG_FLIGHT, FG_DEBUG, "lon = " << lon << " lat_geod = " << lat_geod
<< " lat_geoc = " << lat_geoc
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/fgpath.hxx>
#include <Scenery/scenery.hxx>
double alt = FDMExec.GetPosition()->Geth();
double lat_geod, tmp_alt, sl_radius1, sl_radius2, tmp_lat_geoc;
- fgGeocToGeod( lat_geoc, EQUATORIAL_RADIUS_M + alt * FEET_TO_METER,
+ sgGeocToGeod( lat_geoc, EQUATORIAL_RADIUS_M + alt * FEET_TO_METER,
&lat_geod, &tmp_alt, &sl_radius1 );
- fgGeodToGeoc( lat_geod, alt * FEET_TO_METER, &sl_radius2, &tmp_lat_geoc );
+ sgGeodToGeoc( lat_geod, alt * FEET_TO_METER, &sl_radius2, &tmp_lat_geoc );
FG_LOG( FG_FLIGHT, FG_DEBUG, "lon = " << lon << " lat_geod = " << lat_geod
<< " lat_geoc = " << lat_geoc
// $Id$
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
// << endl;
double sl_radius, lat_geoc;
- fgGeodToGeoc( get_Latitude(), get_Altitude(), &sl_radius, &lat_geoc );
+ sgGeodToGeoc( get_Latitude(), get_Altitude(), &sl_radius, &lat_geoc );
// update altitude
double real_climb_rate = -controls.get_elevator() * 5000; // feet/sec
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <FDM/LaRCsim/ls_interface.h>
#include <Main/options.hxx>
double lat_geoc;
// Set the FG variables first
- fgGeodToGeoc( base_fdm_state.get_Latitude(), alt_meters,
+ sgGeodToGeoc( base_fdm_state.get_Latitude(), alt_meters,
&sea_level_radius_meters, &lat_geoc);
base_fdm_state.set_Altitude( alt_meters * METER_TO_FEET );
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/fgpath.hxx>
#include <simgear/timing/sg_time.hxx>
/*
geod_pos = Point3D( cur_fdm_state->get_Longitude(), cur_fdm_state->get_Latitude(), 0.0);
- tmp_abs_view_pos = fgGeodToCart(geod_pos);
+ tmp_abs_view_pos = sgGeodToCart(geod_pos);
FG_LOG( FG_GENERAL, FG_DEBUG,
"Initial abs_view_pos = " << tmp_abs_view_pos );
double sea_level_radius_meters;
double lat_geoc;
// Set the FG variables first
- fgGeodToGeoc( cur_fdm_state->get_Latitude(), cur_fdm_state->get_Altitude(),
+ sgGeodToGeoc( cur_fdm_state->get_Latitude(), cur_fdm_state->get_Altitude(),
&sea_level_radius_meters, &lat_geoc);
cur_fdm_state->set_Geocentric_Position( lat_geoc, cur_fdm_state->get_Longitude(),
cur_fdm_state->get_Altitude() +
double sea_level_radius_meters;
double lat_geoc;
// Set the FG variables first
- fgGeodToGeoc( cur_fdm_state->get_Latitude(), cur_fdm_state->get_Altitude(),
+ sgGeodToGeoc( cur_fdm_state->get_Latitude(), cur_fdm_state->get_Altitude(),
&sea_level_radius_meters, &lat_geoc);
cur_fdm_state->set_Geocentric_Position( lat_geoc, cur_fdm_state->get_Longitude(),
cur_fdm_state->get_Altitude() +
#include <Network/native.hxx>
#include <Network/garmin.hxx>
#include <Network/nmea.hxx>
+#include <Network/props.hxx>
#include <Network/pve.hxx>
#include <Network/ray.hxx>
#include <Network/rul.hxx>
} else if ( protocol == "nmea" ) {
FGNMEA *nmea = new FGNMEA;
io = nmea;
+ } else if ( protocol == "props" ) {
+ FGProps *props = new FGProps;
+ io = props;
} else if ( protocol == "pve" ) {
FGPVE *pve = new FGPVE;
io = pve;
#include <simgear/constants.h> // for VERSION
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <simgear/math/polar3d.hxx>
#include <simgear/math/fg_random.h>
#include <simgear/misc/fgpath.hxx>
parse_channel( "garmin", arg.substr(9) );
} else if ( arg.find( "--nmea=" ) != string::npos ) {
parse_channel( "nmea", arg.substr(7) );
+ } else if ( arg.find( "--props=" ) != string::npos ) {
+ parse_channel( "props", arg.substr(8) );
} else if ( arg.find( "--pve=" ) != string::npos ) {
parse_channel( "pve", arg.substr(6) );
} else if ( arg.find( "--ray=" ) != string::npos ) {
f.get_Lat_geocentric(),
f.get_Sea_level_radius() * FEET_TO_METER );
- cur_zero_elev = fgPolarToCart3d(p) - scenery.center;
+ cur_zero_elev = sgPolarToCart3d(p) - scenery.center;
// calculate view position in current FG view coordinate system
// p.lon & p.lat are already defined earlier, p.radius was set to
p.setz( p.radius() + scenery.cur_elev + 0.5 * METER_TO_FEET );
}
- abs_view_pos = fgPolarToCart3d(p);
+ abs_view_pos = sgPolarToCart3d(p);
view_pos = abs_view_pos - scenery.center;
// Alternative method to Derive local up vector based on
// *geodetic* coordinates
- // alt_up = fgPolarToCart(FG_Longitude, FG_Latitude, 1.0);
+ // alt_up = sgPolarToCart(FG_Longitude, FG_Latitude, 1.0);
// printf( " Alt Up = (%.4f, %.4f, %.4f)\n",
// alt_up.x, alt_up.y, alt_up.z);
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/fgstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include "fixlist.hxx"
#include <simgear/compiler.h>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/fgstream.hxx>
#ifdef FG_HAVE_STD_INCLUDES
Point3D geod, cart;
geod = Point3D( i.loclon * DEG_TO_RAD, i.loclat * DEG_TO_RAD, i.gselev );
- cart = fgGeodToCart( geod );
+ cart = sgGeodToCart( geod );
i.x = cart.x();
i.y = cart.y();
i.z = cart.z();
i.has_gs = true;
geod = Point3D( i.gslon * DEG_TO_RAD, i.gslat * DEG_TO_RAD, i.gselev );
- cart = fgGeodToCart( geod );
+ cart = sgGeodToCart( geod );
i.gs_x = cart.x();
i.gs_y = cart.y();
i.gs_z = cart.z();
i.has_dme = true;
geod = Point3D( i.dmelon * DEG_TO_RAD, i.dmelat * DEG_TO_RAD, i.gselev);
- cart = fgGeodToCart( geod );
+ cart = sgGeodToCart( geod );
i.dme_x = cart.x();
i.dme_y = cart.y();
i.dme_z = cart.z();
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/fgstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include "ilslist.hxx"
ils_list_iterator last = stations.end();
// double az1, az2, s;
- Point3D aircraft = fgGeodToCart( Point3D(lon, lat, elev) );
+ Point3D aircraft = sgGeodToCart( Point3D(lon, lat, elev) );
Point3D station;
double d;
for ( ; current != last ; ++current ) {
#include <simgear/compiler.h>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/fgstream.hxx>
#ifdef FG_HAVE_STD_INCLUDES
// generate cartesian coordinates
Point3D geod( n.lon * DEG_TO_RAD, n.lat * DEG_TO_RAD, n.elev );
- Point3D cart = fgGeodToCart( geod );
+ Point3D cart = sgGeodToCart( geod );
n.x = cart.x();
n.y = cart.y();
n.z = cart.z();
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/fgstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include "navlist.hxx"
nav_list_iterator last = stations.end();
// double az1, az2, s;
- Point3D aircraft = fgGeodToCart( Point3D(lon, lat, elev) );
+ Point3D aircraft = sgGeodToCart( Point3D(lon, lat, elev) );
Point3D station;
double d;
for ( ; current != last ; ++current ) {
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/io/iochannel.hxx>
#include <FDM/flight.hxx>
FG_LOG( FG_IO, FG_INFO, " lon = " << lon );
double sl_radius, lat_geoc;
- fgGeodToGeoc( cur_fdm_state->get_Latitude(),
+ sgGeodToGeoc( cur_fdm_state->get_Latitude(),
cur_fdm_state->get_Altitude(),
&sl_radius, &lat_geoc );
cur_fdm_state->set_Geocentric_Position( lat_geoc,
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <simgear/io/iochannel.hxx>
#include "native.hxx"
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/io/iochannel.hxx>
#include <FDM/flight.hxx>
FG_LOG( FG_IO, FG_INFO, " lon = " << lon );
double sl_radius, lat_geoc;
- fgGeodToGeoc( cur_fdm_state->get_Latitude(),
+ sgGeodToGeoc( cur_fdm_state->get_Latitude(),
cur_fdm_state->get_Altitude(),
&sl_radius, &lat_geoc );
cur_fdm_state->set_Geocentric_Position( lat_geoc,
bool FGProps::process_command( const char *cmd ) {
+ cout << "processing command = " << cmd << endl;
string_list tokens;
tokens.clear();
if ( command == "ls" ) {
}
+
+ return true;
}
bool FGProps::process() {
SGIOChannel *io = get_io_channel();
+ cout << "processing incoming props command" << endl;
+
if ( get_direction() == SG_IO_BI ) {
+ cout << " (bi directional)" << endl;
while ( io->read( buf, max_cmd_len ) > 0 ) {
FG_LOG( FG_IO, FG_ALERT, "Success reading data." );
process_command( buf );
}
+ } else {
+ FG_LOG( FG_IO, FG_ALERT,
+ "in or out direction not supported for FGProps." );
}
return true;
#include <stdio.h> // sprintf()
+
+#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <simgear/io/iochannel.hxx>
#include <FDM/flight.hxx>
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/io/iochannel.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <FDM/flight.hxx>
#include <stdio.h> // sprintf()
+#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/io/iochannel.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <FDM/flight.hxx>
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <simgear/math/fg_random.h>
#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/fgstream.hxx>
#include <simgear/misc/stopwatch.hxx>
#include <simgear/misc/texcoord.hxx>
node[1] + ref.y(),
node[2] + ref.z() );
- pp = fgCartToPolar3d(cp);
+ pp = sgCartToPolar3d(cp);
// tmplon = pp.lon() * RAD_TO_DEG;
// tmplat = pp.lat() * RAD_TO_DEG;
double height = b.get_height();
double width = b.get_width();
- Point3D center = fgGeodToCart(Point3D(clon*DEG_TO_RAD,clat*DEG_TO_RAD,0.0));
+ Point3D center = sgGeodToCart(Point3D(clon*DEG_TO_RAD,clat*DEG_TO_RAD,0.0));
t->center = center;
// cout << "center = " << center << endl;;
Point3D cart[4], rel[4];
t->nodes.clear();
for ( i = 0; i < 4; ++i ) {
- cart[i] = fgGeodToCart(rad[i]);
+ cart[i] = sgGeodToCart(rad[i]);
rel[i] = cart[i] - center;
t->nodes.push_back( rel[i] );
// cout << "corner " << i << " = " << cart[i] << endl;
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/vector.hxx>
// #include <Aircraft/aircraft.hxx>
int hitcount = hit_list.num_hits();
for ( int i = 0; i < hitcount; ++i ) {
- geoc = fgCartToPolar3d( scenery.center + hit_list.get_point(i) );
+ geoc = sgCartToPolar3d( scenery.center + hit_list.get_point(i) );
double lat_geod, alt, sea_level_r;
- fgGeocToGeod(geoc.lat(), geoc.radius(), &lat_geod,
+ sgGeocToGeod(geoc.lat(), geoc.radius(), &lat_geod,
&alt, &sea_level_r);
if ( alt > result && alt < 10000 ) {
result = alt;
Point3D geod_pos = Point3D( longitude * DEG_TO_RAD,
latitude * DEG_TO_RAD,
0.0);
- Point3D tmp_abs_view_pos = fgGeodToCart( geod_pos );
+ Point3D tmp_abs_view_pos = sgGeodToCart( geod_pos );
scenery.center = tmp_abs_view_pos;
// cout << "abs_view_pos = " << tmp_abs_view_pos << endl;
prep_ssg_nodes();
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <simgear/math/interpolater.hxx>
#include <simgear/math/polar3d.hxx>
#include <simgear/misc/fgpath.hxx>
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/ephemeris/ephemeris.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/vector.hxx>
#include <Main/globals.hxx>
// fgMoonPosition(t->cur_time, &l->moon_lon, &moon_gd_lat);
fgMoonPositionGST(t->getGst(), &l->moon_lon, &moon_gd_lat);
- fgGeodToGeoc(moon_gd_lat, 0.0, &sl_radius, &l->moon_gc_lat);
+ sgGeodToGeoc(moon_gd_lat, 0.0, &sl_radius, &l->moon_gc_lat);
p = Point3D( l->moon_lon, l->moon_gc_lat, sl_radius );
- l->fg_moonpos = fgPolarToCart3d(p);
+ l->fg_moonpos = sgPolarToCart3d(p);
FG_LOG( FG_EVENT, FG_INFO, " t->cur_time = " << t->get_cur_time() );
FG_LOG( FG_EVENT, FG_INFO,
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/ephemeris/ephemeris.hxx>
-#include <simgear/math/fg_geodesy.hxx>
#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
+#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/vector.hxx>
#include <Main/globals.hxx>
#include "sunpos.hxx"
-#undef E
+// #undef E // should no longer be needed
#define MeanObliquity (23.440592*(FG_2PI/360))
static void ecliptic_to_equatorial(double, double, double *, double *);
fgSunPositionGST(t->getGst(), &l->sun_lon, &sun_gd_lat);
- fgGeodToGeoc(sun_gd_lat, 0.0, &sl_radius, &l->sun_gc_lat);
+ sgGeodToGeoc(sun_gd_lat, 0.0, &sl_radius, &l->sun_gc_lat);
p = Point3D( l->sun_lon, l->sun_gc_lat, sl_radius );
- l->fg_sunpos = fgPolarToCart3d(p);
+ l->fg_sunpos = sgPolarToCart3d(p);
FG_LOG( FG_EVENT, FG_INFO, " t->cur_time = " << t->get_cur_time() );
FG_LOG( FG_EVENT, FG_INFO,