diff --git a/src/Autopilot/auto_gui.cxx b/src/Autopilot/auto_gui.cxx index 51ae12e75..56943208a 100644 --- a/src/Autopilot/auto_gui.cxx +++ b/src/Autopilot/auto_gui.cxx @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include diff --git a/src/Autopilot/newauto.cxx b/src/Autopilot/newauto.cxx index e43ae568a..6a99e0570 100644 --- a/src/Autopilot/newauto.cxx +++ b/src/Autopilot/newauto.cxx @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include diff --git a/src/Cockpit/radiostack.cxx b/src/Cockpit/radiostack.cxx index 46931cf66..c4f049234 100644 --- a/src/Cockpit/radiostack.cxx +++ b/src/Cockpit/radiostack.cxx @@ -72,7 +72,7 @@ FGRadioStack::~FGRadioStack() { 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; diff --git a/src/FDM/Balloon.cxx b/src/FDM/Balloon.cxx index 44afb4f4e..6a89a73c2 100644 --- a/src/FDM/Balloon.cxx +++ b/src/FDM/Balloon.cxx @@ -47,7 +47,7 @@ HISTORY #include #include -#include +#include #include #include @@ -181,9 +181,9 @@ int FGBalloonSim::copy_from_BalloonSim() { 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 diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index 5f3a77b2f..1f112907d 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -326,9 +326,9 @@ int FGJSBsim::copy_from_JSBsim() { 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 diff --git a/src/FDM/MagicCarpet.cxx b/src/FDM/MagicCarpet.cxx index 31a428aa2..708046b4d 100644 --- a/src/FDM/MagicCarpet.cxx +++ b/src/FDM/MagicCarpet.cxx @@ -21,7 +21,7 @@ // $Id$ -#include +#include #include #include @@ -79,7 +79,7 @@ int FGMagicCarpet::update( int multiloop ) { // << 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 diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index e444ed383..93a6c27ea 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include
@@ -127,7 +127,7 @@ void fgFDMForceAltitude(int model, double alt_meters) { 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 ); diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 4280059f2..42181b0a2 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -49,9 +49,9 @@ #include #include -#include #include #include +#include #include #include @@ -445,7 +445,7 @@ bool fgInitSubsystems( void ) { /* 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 ); @@ -481,7 +481,7 @@ bool fgInitSubsystems( void ) { 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() + @@ -758,7 +758,7 @@ void fgReInitSubsystems( void ) 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() + diff --git a/src/Main/fg_io.cxx b/src/Main/fg_io.cxx index 71687c779..b3304d651 100644 --- a/src/Main/fg_io.cxx +++ b/src/Main/fg_io.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,9 @@ static FGProtocol *parse_port_config( const string& config ) } 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; diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 1af678e3c..7f09e45f9 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -66,7 +66,6 @@ #include // for VERSION #include -#include #include #include #include diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 8571b1ca0..631dac808 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -829,6 +829,8 @@ int fgOPTIONS::parse_option( const string& arg ) { 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 ) { diff --git a/src/Main/views.cxx b/src/Main/views.cxx index 92450c635..23db806d4 100644 --- a/src/Main/views.cxx +++ b/src/Main/views.cxx @@ -213,7 +213,7 @@ void FGView::UpdateViewMath( const FGInterface& f ) { 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 @@ -225,7 +225,7 @@ void FGView::UpdateViewMath( const FGInterface& f ) { 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; @@ -286,7 +286,7 @@ void FGView::UpdateViewMath( const FGInterface& f ) { // 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); diff --git a/src/Navaids/fixlist.cxx b/src/Navaids/fixlist.cxx index b03d99241..935886cbd 100644 --- a/src/Navaids/fixlist.cxx +++ b/src/Navaids/fixlist.cxx @@ -23,7 +23,7 @@ #include #include -#include +#include #include "fixlist.hxx" diff --git a/src/Navaids/ils.hxx b/src/Navaids/ils.hxx index 21b202138..6eedeb1c7 100644 --- a/src/Navaids/ils.hxx +++ b/src/Navaids/ils.hxx @@ -26,7 +26,7 @@ #include -#include +#include #include #ifdef FG_HAVE_STD_INCLUDES @@ -136,7 +136,7 @@ operator >> ( istream& in, FGILS& i ) 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(); @@ -147,7 +147,7 @@ operator >> ( istream& in, FGILS& i ) 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(); @@ -160,7 +160,7 @@ operator >> ( istream& in, FGILS& i ) 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(); diff --git a/src/Navaids/ilslist.cxx b/src/Navaids/ilslist.cxx index 2b27f22e7..3bed2ed94 100644 --- a/src/Navaids/ilslist.cxx +++ b/src/Navaids/ilslist.cxx @@ -23,7 +23,7 @@ #include #include -#include +#include #include "ilslist.hxx" @@ -117,7 +117,7 @@ bool FGILSList::query( double lon, double lat, double elev, double freq, 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 ) { diff --git a/src/Navaids/nav.hxx b/src/Navaids/nav.hxx index 6f38b4ae8..57a0c00a9 100644 --- a/src/Navaids/nav.hxx +++ b/src/Navaids/nav.hxx @@ -26,7 +26,7 @@ #include -#include +#include #include #ifdef FG_HAVE_STD_INCLUDES @@ -102,7 +102,7 @@ operator >> ( istream& in, FGNav& n ) // 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(); diff --git a/src/Navaids/navlist.cxx b/src/Navaids/navlist.cxx index 75f15ee90..abf7e104c 100644 --- a/src/Navaids/navlist.cxx +++ b/src/Navaids/navlist.cxx @@ -23,7 +23,7 @@ #include #include -#include +#include #include "navlist.hxx" @@ -119,7 +119,7 @@ bool FGNavList::query( double lon, double lat, double elev, double freq, 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 ) { diff --git a/src/Network/garmin.cxx b/src/Network/garmin.cxx index 5fdeb81d5..ca00dd414 100644 --- a/src/Network/garmin.cxx +++ b/src/Network/garmin.cxx @@ -22,7 +22,7 @@ #include -#include +#include #include #include @@ -269,7 +269,7 @@ bool FGGarmin::parse_message() { 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, diff --git a/src/Network/native.cxx b/src/Network/native.cxx index 83682604f..07da1e73c 100644 --- a/src/Network/native.cxx +++ b/src/Network/native.cxx @@ -22,7 +22,6 @@ #include -#include #include #include "native.hxx" diff --git a/src/Network/nmea.cxx b/src/Network/nmea.cxx index 7f9b47184..6467c2854 100644 --- a/src/Network/nmea.cxx +++ b/src/Network/nmea.cxx @@ -22,7 +22,7 @@ #include -#include +#include #include #include @@ -274,7 +274,7 @@ bool FGNMEA::parse_message() { 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, diff --git a/src/Network/props.cxx b/src/Network/props.cxx index aaa4d159c..25c304fd5 100644 --- a/src/Network/props.cxx +++ b/src/Network/props.cxx @@ -60,6 +60,7 @@ bool FGProps::open() { bool FGProps::process_command( const char *cmd ) { + cout << "processing command = " << cmd << endl; string_list tokens; tokens.clear(); @@ -76,6 +77,8 @@ bool FGProps::process_command( const char *cmd ) { if ( command == "ls" ) { } + + return true; } @@ -83,11 +86,17 @@ bool FGProps::process_command( const char *cmd ) { 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; diff --git a/src/Network/pve.cxx b/src/Network/pve.cxx index d52f1a6be..f8defdf1a 100644 --- a/src/Network/pve.cxx +++ b/src/Network/pve.cxx @@ -22,8 +22,9 @@ #include // sprintf() + +#include #include -#include #include #include diff --git a/src/Network/ray.cxx b/src/Network/ray.cxx index 1d471972d..4f8d1c473 100644 --- a/src/Network/ray.cxx +++ b/src/Network/ray.cxx @@ -24,7 +24,6 @@ #include #include #include -#include #include diff --git a/src/Network/rul.cxx b/src/Network/rul.cxx index c9554956b..73f5c4541 100644 --- a/src/Network/rul.cxx +++ b/src/Network/rul.cxx @@ -24,9 +24,9 @@ #include // sprintf() +#include #include #include -#include #include diff --git a/src/Objects/obj.cxx b/src/Objects/obj.cxx index 8db9e1e82..74c7e2f99 100644 --- a/src/Objects/obj.cxx +++ b/src/Objects/obj.cxx @@ -46,10 +46,10 @@ #include #include -#include #include #include #include +#include #include #include #include @@ -107,7 +107,7 @@ static Point3D local_calc_tex_coords(const Point3D& node, const Point3D& ref) { 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; @@ -165,7 +165,7 @@ ssgBranch *fgGenTile( const string& path, FGTileEntry *t) { 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;; @@ -186,7 +186,7 @@ ssgBranch *fgGenTile( const string& path, FGTileEntry *t) { 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; diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 77f6c745e..6a9e1fd62 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -34,9 +34,9 @@ #include #include -#include #include #include +#include #include // #include @@ -177,9 +177,9 @@ FGTileMgr::current_elev_ssg( const Point3D& abs_view_pos, 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; @@ -464,7 +464,7 @@ int FGTileMgr::update( double lon, double lat ) { 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(); diff --git a/src/Time/light.cxx b/src/Time/light.cxx index 05cd0370b..ce92e9d42 100644 --- a/src/Time/light.cxx +++ b/src/Time/light.cxx @@ -50,7 +50,6 @@ FG_USING_STD(string); #include #include -#include #include #include #include diff --git a/src/Time/moonpos.cxx b/src/Time/moonpos.cxx index e3b30b34d..62274e915 100644 --- a/src/Time/moonpos.cxx +++ b/src/Time/moonpos.cxx @@ -54,9 +54,9 @@ #include #include #include -#include #include #include +#include #include #include
@@ -350,10 +350,10 @@ void fgUpdateMoonPos( void ) { // 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, diff --git a/src/Time/sunpos.cxx b/src/Time/sunpos.cxx index f79390957..0d5ca7066 100644 --- a/src/Time/sunpos.cxx +++ b/src/Time/sunpos.cxx @@ -56,9 +56,9 @@ #include #include #include -#include #include #include +#include #include #include
@@ -67,7 +67,7 @@ #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 *); @@ -258,10 +258,10 @@ void fgUpdateSunPos( void ) { 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,