From: curt Date: Sat, 24 Mar 2001 06:03:11 +0000 (+0000) Subject: SG-ified logstream. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=182fd42b4017fa54d680508c092ea1b216398a00;p=flightgear.git SG-ified logstream. --- diff --git a/src/Aircraft/aircraft.cxx b/src/Aircraft/aircraft.cxx index 2de2265ee..f39731ebc 100644 --- a/src/Aircraft/aircraft.cxx +++ b/src/Aircraft/aircraft.cxx @@ -35,7 +35,7 @@ fgAIRCRAFT current_aircraft; // Initialize an Aircraft structure void fgAircraftInit( void ) { - FG_LOG( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure" ); + SG_LOG( SG_AIRCRAFT, SG_INFO, "Initializing Aircraft structure" ); current_aircraft.fdm_state = cur_fdm_state; current_aircraft.controls = &controls; @@ -48,7 +48,7 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a) { f = a->fdm_state; - FG_LOG( FG_FLIGHT, FG_DEBUG, + SG_LOG( SG_FLIGHT, SG_DEBUG, "Pos = (" << (f->get_Longitude() * 3600.0 * SGD_RADIANS_TO_DEGREES) << "," << (f->get_Latitude() * 3600.0 * SGD_RADIANS_TO_DEGREES) << "," @@ -58,7 +58,7 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a) { << f->get_Theta() << "," << f->get_Psi() << ")" ); - FG_LOG( FG_FLIGHT, FG_DEBUG, + SG_LOG( SG_FLIGHT, SG_DEBUG, "Kts = " << f->get_V_equiv_kts() << " Elev = " << controls.get_elevator() << " Aileron = " << controls.get_aileron() diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index 31d3ad304..4810410f4 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -55,7 +55,7 @@ FGRunways::FGRunways( const string& file ) { storage = new c4_Storage( file.c_str(), false ); if ( !storage->Strategy().IsValid() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << file ); + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file ); exit(-1); } @@ -175,7 +175,7 @@ int FGRunwaysUtil::load( const string& file ) { fg_gzifstream in( file ); if ( !in.is_open() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << file ); + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file ); exit(-1); } diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 381b4fc83..7db6a2787 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -55,7 +55,7 @@ FGAirports::FGAirports( const string& file ) { storage = new c4_Storage( file.c_str(), false ); if ( !storage->Strategy().IsValid() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << file ); + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file ); exit(-1); } @@ -119,7 +119,7 @@ int FGAirportsUtil::load( const string& file ) { fg_gzifstream in( file ); if ( !in.is_open() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << file ); + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file ); exit(-1); } diff --git a/src/Autopilot/auto_gui.cxx b/src/Autopilot/auto_gui.cxx index e06793de8..24e238b53 100644 --- a/src/Autopilot/auto_gui.cxx +++ b/src/Autopilot/auto_gui.cxx @@ -609,7 +609,7 @@ void TgtAptDialog_OK (puObject *) double t1, t2; if ( fgFindAirportID( TgtAptId, &a ) ) { - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Adding waypoint (airport) = " << TgtAptId ); sprintf( NewTgtAirportId, "%s", TgtAptId.c_str() ); @@ -620,7 +620,7 @@ void TgtAptDialog_OK (puObject *) } else if ( current_fixlist->query( TgtAptId, 0.0, 0.0, 0.0, &f, &t1, &t2 ) ) { - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Adding waypoint (fix) = " << TgtAptId ); sprintf( NewTgtAirportId, "%s", TgtAptId.c_str() ); @@ -675,10 +675,10 @@ void ClearRoute(puObject *cb) void NewTgtAirportInit(void) { - FG_LOG( FG_AUTOPILOT, FG_INFO, " enter NewTgtAirportInit()" ); + SG_LOG( SG_AUTOPILOT, SG_INFO, " enter NewTgtAirportInit()" ); // fgAPset_tgt_airport_id( fgGetString("/sim/startup/airport-id") ); sprintf( NewTgtAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() ); - FG_LOG( FG_AUTOPILOT, FG_INFO, " NewTgtAirportId " << NewTgtAirportId ); + SG_LOG( SG_AUTOPILOT, SG_INFO, " NewTgtAirportId " << NewTgtAirportId ); // printf(" NewTgtAirportId %s\n", NewTgtAirportId); int len = 150 - puGetStringWidth( puGetDefaultLabelFont(), NewTgtAirportLabel ) / 2; diff --git a/src/Autopilot/newauto.cxx b/src/Autopilot/newauto.cxx index a6dcab397..b0a41c728 100644 --- a/src/Autopilot/newauto.cxx +++ b/src/Autopilot/newauto.cxx @@ -214,7 +214,7 @@ void FGAutopilot::update_old_control_values() { // Initialize autopilot subsystem void FGAutopilot::init() { - FG_LOG( FG_AUTOPILOT, FG_INFO, "Init AutoPilot Subsystem" ); + SG_LOG( SG_AUTOPILOT, SG_INFO, "Init AutoPilot Subsystem" ); heading_hold = false ; // turn the heading hold off altitude_hold = false ; // turn the altitude hold off @@ -522,7 +522,7 @@ int FGAutopilot::run() { // figure out how far off we are from desired heading // Now it is time to deterime how far we should be rolled. - FG_LOG( FG_AUTOPILOT, FG_DEBUG, "RelHeading: " << RelHeading ); + SG_LOG( SG_AUTOPILOT, SG_DEBUG, "RelHeading: " << RelHeading ); // Check if we are further from heading than the roll out point @@ -551,7 +551,7 @@ int FGAutopilot::run() { // Compare Target roll to Current Roll, Generate Rel Roll - FG_LOG( FG_COCKPIT, FG_BULK, "TargetRoll: " << TargetRoll ); + SG_LOG( SG_COCKPIT, SG_BULK, "TargetRoll: " << TargetRoll ); RelRoll = NormalizeDegrees( TargetRoll - FGBFI::getRoll() ); @@ -813,7 +813,7 @@ void FGAutopilot::set_HeadingMode( fgAutoHeadingMode mode ) { MakeTargetAltitudeStr( TargetAltitude * SG_METER_TO_FEET ); } - FG_LOG( FG_COCKPIT, FG_INFO, " set_HeadingMode: ( " + SG_LOG( SG_COCKPIT, SG_INFO, " set_HeadingMode: ( " << get_TargetLatitude() << " " << get_TargetLongitude() << " ) " ); @@ -858,7 +858,7 @@ void FGAutopilot::set_AltitudeMode( fgAutoAltitudeMode mode ) { } update_old_control_values(); - FG_LOG( FG_COCKPIT, FG_INFO, " set_AltitudeMode():" ); + SG_LOG( SG_COCKPIT, SG_INFO, " set_AltitudeMode():" ); } @@ -1036,6 +1036,6 @@ void FGAutopilot::set_AutoThrottleEnabled( bool value ) { } update_old_control_values(); - FG_LOG( FG_COCKPIT, FG_INFO, " fgAPSetAutoThrottle: (" + SG_LOG( SG_COCKPIT, SG_INFO, " fgAPSetAutoThrottle: (" << auto_throttle << ") " << TargetSpeed ); } diff --git a/src/Cockpit/cockpit.cxx b/src/Cockpit/cockpit.cxx index dccccdad5..b0b6651b1 100644 --- a/src/Cockpit/cockpit.cxx +++ b/src/Cockpit/cockpit.cxx @@ -672,7 +672,7 @@ char *coord_format_latlon(double latitude, double longitude) bool fgCockpitInit( fgAIRCRAFT *cur_aircraft ) { - FG_LOG( FG_COCKPIT, FG_INFO, "Initializing cockpit subsystem" ); + SG_LOG( SG_COCKPIT, SG_INFO, "Initializing cockpit subsystem" ); // cockpit->code = 1; /* It will be aircraft dependent */ // cockpit->status = 0; @@ -692,7 +692,7 @@ bool fgCockpitInit( fgAIRCRAFT *cur_aircraft ) // Have to set the LatLon display type fgLatLonFormat = toDM; - FG_LOG( FG_COCKPIT, FG_INFO, + SG_LOG( SG_COCKPIT, SG_INFO, " Code " << ac_cockpit->code() << " Status " << ac_cockpit->status() ); @@ -701,7 +701,7 @@ bool fgCockpitInit( fgAIRCRAFT *cur_aircraft ) void fgCockpitUpdate( void ) { - FG_LOG( FG_COCKPIT, FG_DEBUG, + SG_LOG( SG_COCKPIT, SG_DEBUG, "Cockpit: code " << ac_cockpit->code() << " status " << ac_cockpit->status() ); diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index 2ef0a1620..203714f3c 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -292,7 +292,7 @@ readLadder(const SGPropertyNode * node) waypoint = node->getBoolValue("enable_waypoint_marker",false); working = node->getBoolValue("working"); - FG_LOG(FG_INPUT, FG_INFO, "Done reading instrument " << name); + SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name); p = (instr_item *) new HudLadder( name, x, y, @@ -343,7 +343,7 @@ readCard(const SGPropertyNode * node) working = node->getBoolValue("working"); - FG_LOG(FG_INPUT, FG_INFO, "Done reading instrument " << name); + SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name); if(type=="guage") @@ -439,7 +439,7 @@ readLabel(const SGPropertyNode * node) working = node->getBoolValue("working"); - FG_LOG(FG_INPUT, FG_INFO, "Done reading instrument " << name); + SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name); if(justi==0) @@ -580,7 +580,7 @@ readTBI(const SGPropertyNode * node) gap_width = node->getIntValue("gap_width"); working = node->getBoolValue("working"); - FG_LOG(FG_INPUT, FG_INFO, "Done reading instrument " << name); + SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name); p = (instr_item *) new fgTBI_instr( x, @@ -663,19 +663,19 @@ int readHud( istream &input ) if (!readProperties(input, &root)) { - FG_LOG(FG_INPUT, FG_ALERT, "Malformed property list for hud."); + SG_LOG(SG_INPUT, SG_ALERT, "Malformed property list for hud."); return 0; } - FG_LOG(FG_INPUT, FG_INFO, "Read properties for " << + SG_LOG(SG_INPUT, SG_INFO, "Read properties for " << root.getStringValue("name")); HUD_deque.erase( HUD_deque.begin(), HUD_deque.end()); // empty the HUD deque - FG_LOG(FG_INPUT, FG_INFO, "Reading Hud instruments"); + SG_LOG(SG_INPUT, SG_INFO, "Reading Hud instruments"); const SGPropertyNode * instrument_group = root.getChild("instruments"); int nInstruments = instrument_group->nChildren(); @@ -687,7 +687,7 @@ int readHud( istream &input ) FGPath path( globals->get_fg_root() ); path.append(node->getStringValue("path")); - FG_LOG(FG_INPUT, FG_INFO, "Reading Instrument " + SG_LOG(SG_INPUT, SG_INFO, "Reading Instrument " << node->getName() << " from " << path.str()); @@ -710,7 +710,7 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ) HUD_style = 1; - FG_LOG( FG_COCKPIT, FG_INFO, "Initializing current aircraft HUD" ); + SG_LOG( SG_COCKPIT, SG_INFO, "Initializing current aircraft HUD" ); string hud_path = fgGetString("/sim/hud/path", "Huds/Default/default.xml"); @@ -720,7 +720,7 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ) ifstream input(path.c_str()); if (!input.good()) { - FG_LOG(FG_INPUT, FG_ALERT, + SG_LOG(SG_INPUT, SG_ALERT, "Cannot read Hud configuration from " << path.str()); } else @@ -741,7 +741,7 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ ) HUD_style = 2; - FG_LOG( FG_COCKPIT, FG_INFO, "Initializing current aircraft HUD" ); + SG_LOG( SG_COCKPIT, SG_INFO, "Initializing current aircraft HUD" ); FGPath path(globals->get_fg_root()); path.append("Huds/Minimal/default.xml"); @@ -749,7 +749,7 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ ) ifstream input(path.c_str()); if (!input.good()) { - FG_LOG(FG_INPUT, FG_ALERT, + SG_LOG(SG_INPUT, SG_ALERT, "Cannot read Hud configuration from " << path.str()); } else { @@ -1077,7 +1077,7 @@ void fgUpdateHUD( void ) { pHUDInstr = *current; if( pHUDInstr->enabled()) { - // fgPrintf( FG_COCKPIT, FG_DEBUG, "HUD Code %d Status %d\n", + // fgPrintf( SG_COCKPIT, SG_DEBUG, "HUD Code %d Status %d\n", // hud->code, hud->status ); pHUDInstr->draw(); diff --git a/src/Cockpit/hud_labl.cxx b/src/Cockpit/hud_labl.cxx index d92f55ceb..cf1d97779 100644 --- a/src/Cockpit/hud_labl.cxx +++ b/src/Cockpit/hud_labl.cxx @@ -138,10 +138,10 @@ draw( void ) // Required method in base class #ifdef DEBUGHUD - fgPrintf( FG_COCKPIT, FG_DEBUG, format_buffer ); - fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" ); - fgPrintf( FG_COCKPIT, FG_DEBUG, label_buffer ); - fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" ); + fgPrintf( SG_COCKPIT, SG_DEBUG, format_buffer ); + fgPrintf( SG_COCKPIT, SG_DEBUG, "\n" ); + fgPrintf( SG_COCKPIT, SG_DEBUG, label_buffer ); + fgPrintf( SG_COCKPIT, SG_DEBUG, "\n" ); #endif // lenstr = strlen( label_buffer ); diff --git a/src/Cockpit/hud_lat.cxx b/src/Cockpit/hud_lat.cxx index bd53eb254..4d57a6deb 100644 --- a/src/Cockpit/hud_lat.cxx +++ b/src/Cockpit/hud_lat.cxx @@ -119,10 +119,10 @@ draw( void ) // Required method in base class } #ifdef DEBUGHUD - fgPrintf( FG_COCKPIT, FG_DEBUG, format_buffer ); - fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" ); - fgPrintf( FG_COCKPIT, FG_DEBUG, label_buffer ); - fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" ); + fgPrintf( SG_COCKPIT, SG_DEBUG, format_buffer ); + fgPrintf( SG_COCKPIT, SG_DEBUG, "\n" ); + fgPrintf( SG_COCKPIT, SG_DEBUG, label_buffer ); + fgPrintf( SG_COCKPIT, SG_DEBUG, "\n" ); #endif lenstr = getStringWidth(label_buffer); diff --git a/src/Cockpit/hud_lon.cxx b/src/Cockpit/hud_lon.cxx index 4eb5a5171..869d91819 100644 --- a/src/Cockpit/hud_lon.cxx +++ b/src/Cockpit/hud_lon.cxx @@ -121,10 +121,10 @@ draw( void ) // Required method in base class } #ifdef DEBUGHUD - fgPrintf( FG_COCKPIT, FG_DEBUG, format_buffer ); - fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" ); - fgPrintf( FG_COCKPIT, FG_DEBUG, label_buffer ); - fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" ); + fgPrintf( SG_COCKPIT, SG_DEBUG, format_buffer ); + fgPrintf( SG_COCKPIT, SG_DEBUG, "\n" ); + fgPrintf( SG_COCKPIT, SG_DEBUG, label_buffer ); + fgPrintf( SG_COCKPIT, SG_DEBUG, "\n" ); #endif lenstr = getStringWidth(label_buffer); diff --git a/src/Cockpit/panel_io.cxx b/src/Cockpit/panel_io.cxx index 1f63b31f1..a0a598694 100644 --- a/src/Cockpit/panel_io.cxx +++ b/src/Cockpit/panel_io.cxx @@ -223,7 +223,7 @@ readTexture (const SGPropertyNode * node) node->getFloatValue("y1"), node->getFloatValue("x2", 1.0), node->getFloatValue("y2", 1.0)); - FG_LOG(FG_INPUT, FG_INFO, "Read texture " << node->getName()); + SG_LOG(SG_INPUT, SG_INFO, "Read texture " << node->getName()); return texture; } @@ -268,7 +268,7 @@ readAction (const SGPropertyNode * node, float hscale, float vscale) int h = int(node->getIntValue("h") * vscale); if (type == "") { - FG_LOG(FG_INPUT, FG_ALERT, + SG_LOG(SG_INPUT, SG_ALERT, "No type supplied for action " << name << " assuming \"adjust\""); type = "adjust"; } @@ -282,7 +282,7 @@ readAction (const SGPropertyNode * node, float hscale, float vscale) float max = node->getFloatValue("max", 0.0); bool wrap = node->getBoolValue("wrap", false); if (min == max) - FG_LOG(FG_INPUT, FG_ALERT, "Action " << node->getName() + SG_LOG(SG_INPUT, SG_ALERT, "Action " << node->getName() << " has same min and max value"); action = new FGAdjustAction(button, x, y, w, h, value, increment, min, max, wrap); @@ -306,7 +306,7 @@ readAction (const SGPropertyNode * node, float hscale, float vscale) // Unrecognized type else { - FG_LOG(FG_INPUT, FG_ALERT, "Unrecognized action type " << type); + SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized action type " << type); return 0; } @@ -350,7 +350,7 @@ readTransformation (const SGPropertyNode * node, float hscale, float vscale) SGValue * value = 0; if (type == "") { - FG_LOG(FG_INPUT, FG_ALERT, + SG_LOG(SG_INPUT, SG_ALERT, "No type supplied for transformation " << name << " assuming \"rotation\""); type = "rotation"; @@ -390,12 +390,12 @@ readTransformation (const SGPropertyNode * node, float hscale, float vscale) } else { - FG_LOG(FG_INPUT, FG_ALERT, "Unrecognized transformation type " << type); + SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized transformation type " << type); delete t; return 0; } - FG_LOG(FG_INPUT, FG_INFO, "Read transformation " << name); + SG_LOG(SG_INPUT, SG_INFO, "Read transformation " << name); return t; } @@ -426,7 +426,7 @@ readTextChunk (const SGPropertyNode * node) // Default to literal text. if (type == "") { - FG_LOG(FG_INPUT, FG_INFO, "No type provided for text chunk " << name + SG_LOG(SG_INPUT, SG_INFO, "No type provided for text chunk " << name << " assuming \"literal\""); type = "literal"; } @@ -455,7 +455,7 @@ readTextChunk (const SGPropertyNode * node) // Unknown type. else { - FG_LOG(FG_INPUT, FG_ALERT, "Unrecognized type " << type + SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized type " << type << " for text chunk " << name); return 0; } @@ -500,7 +500,7 @@ readLayer (const SGPropertyNode * node, float hscale, float vscale) if (type == "") { - FG_LOG(FG_INPUT, FG_ALERT, + SG_LOG(SG_INPUT, SG_ALERT, "No type supplied for layer " << name << " assuming \"texture\""); type = "texture"; @@ -566,13 +566,13 @@ readLayer (const SGPropertyNode * node, float hscale, float vscale) } else if (layerclass == "") { - FG_LOG(FG_INPUT, FG_ALERT, "No class provided for built-in layer " + SG_LOG(SG_INPUT, SG_ALERT, "No class provided for built-in layer " << name); return 0; } else { - FG_LOG(FG_INPUT, FG_ALERT, "Unknown built-in layer class " + SG_LOG(SG_INPUT, SG_ALERT, "Unknown built-in layer class " << layerclass); return 0; } @@ -580,7 +580,7 @@ readLayer (const SGPropertyNode * node, float hscale, float vscale) // An unknown type. else { - FG_LOG(FG_INPUT, FG_ALERT, "Unrecognized layer type " << type); + SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized layer type " << type); delete layer; return 0; } @@ -602,7 +602,7 @@ readLayer (const SGPropertyNode * node, float hscale, float vscale) } } - FG_LOG(FG_INPUT, FG_INFO, "Read layer " << name); + SG_LOG(SG_INPUT, SG_INFO, "Read layer " << name); return layer; } @@ -637,7 +637,7 @@ readInstrument (const SGPropertyNode * node, int x, int y, h = real_h; } - FG_LOG(FG_INPUT, FG_INFO, "Reading instrument " << name); + SG_LOG(SG_INPUT, SG_INFO, "Reading instrument " << name); FGLayeredInstrument * instrument = new FGLayeredInstrument(x, y, w, h); @@ -676,7 +676,7 @@ readInstrument (const SGPropertyNode * node, int x, int y, } } - FG_LOG(FG_INPUT, FG_INFO, "Done reading instrument " << name); + SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name); return instrument; } @@ -701,10 +701,10 @@ fgReadPanel (istream &input) // Read the property list from disk. // if (!readProperties(input, &root)) { - FG_LOG(FG_INPUT, FG_ALERT, "Malformed property list for panel."); + SG_LOG(SG_INPUT, SG_ALERT, "Malformed property list for panel."); return 0; } - FG_LOG(FG_INPUT, FG_INFO, "Read properties for panel " << + SG_LOG(SG_INPUT, SG_INFO, "Read properties for panel " << root.getStringValue("name")); // @@ -747,13 +747,13 @@ fgReadPanel (istream &input) if (bgTexture == "") bgTexture = "FOO"; panel->setBackground(FGTextureManager::createTexture(bgTexture.c_str())); - FG_LOG(FG_INPUT, FG_INFO, "Set background texture to " << bgTexture); + SG_LOG(SG_INPUT, SG_INFO, "Set background texture to " << bgTexture); // // Create each instrument. // - FG_LOG(FG_INPUT, FG_INFO, "Reading panel instruments"); + SG_LOG(SG_INPUT, SG_INFO, "Reading panel instruments"); const SGPropertyNode * instrument_group = root.getChild("instruments"); if (instrument_group != 0) { int nInstruments = instrument_group->nChildren(); @@ -763,7 +763,7 @@ fgReadPanel (istream &input) FGPath path( globals->get_fg_root() ); path.append(node->getStringValue("path")); - FG_LOG(FG_INPUT, FG_INFO, "Reading instrument " + SG_LOG(SG_INPUT, SG_INFO, "Reading instrument " << node->getName() << " from " << path.str()); @@ -774,7 +774,7 @@ fgReadPanel (istream &input) int h = node->getIntValue("h", -1); if (x == -1 || y == -1) { - FG_LOG(FG_INPUT, FG_ALERT, "x and y positions must be specified and >0"); + SG_LOG(SG_INPUT, SG_ALERT, "x and y positions must be specified and >0"); delete panel; return 0; } @@ -795,7 +795,7 @@ fgReadPanel (istream &input) panel->addInstrument(instrument); } } - FG_LOG(FG_INPUT, FG_INFO, "Done reading panel instruments"); + SG_LOG(SG_INPUT, SG_INFO, "Done reading panel instruments"); // @@ -819,7 +819,7 @@ fgReadPanel (const string &relative_path) path.append(relative_path); ifstream input(path.c_str()); if (!input.good()) { - FG_LOG(FG_INPUT, FG_ALERT, + SG_LOG(SG_INPUT, SG_ALERT, "Cannot read panel configuration from " << path.str()); } else { panel = fgReadPanel(input); diff --git a/src/FDM/ADA.cxx b/src/FDM/ADA.cxx index a83daf24a..fd4ea9da8 100644 --- a/src/FDM/ADA.cxx +++ b/src/FDM/ADA.cxx @@ -225,7 +225,7 @@ bool FGADA::copy_from_FGADA() { _set_Omega_Body( P_body, Q_body, R_body ); _set_Geocentric_Rates( Latitude_dot, Longitude_dot, Radius_dot ); - // FG_LOG( FG_FLIGHT, FG_DEBUG, "lon = " << Longitude + // SG_LOG( SG_FLIGHT, SG_DEBUG, "lon = " << Longitude // << " lat_geoc = " << Lat_geocentric << " lat_geod = " << Latitude // << " alt = " << Altitude << " sl_radius = " << Sea_level_radius // << " radius_to_vehicle = " << Radius_to_vehicle ); diff --git a/src/FDM/Balloon.cxx b/src/FDM/Balloon.cxx index 71ee91c7e..af5ffc7a0 100644 --- a/src/FDM/Balloon.cxx +++ b/src/FDM/Balloon.cxx @@ -77,9 +77,9 @@ FGBalloonSim::~FGBalloonSim() { void FGBalloonSim::init() { sgVec3 temp; - FG_LOG( FG_FLIGHT, FG_INFO, "Starting initializing BalloonSim" ); + SG_LOG( SG_FLIGHT, SG_INFO, "Starting initializing BalloonSim" ); - FG_LOG( FG_FLIGHT, FG_INFO, " created a balloon" ); + SG_LOG( SG_FLIGHT, SG_INFO, " created a balloon" ); //set position sgSetVec3( temp, @@ -102,7 +102,7 @@ void FGBalloonSim::init() { fgGetDouble("/velocities/wBody") ); current_balloon.setVelocity( temp ); - FG_LOG( FG_FLIGHT, FG_INFO, "Finished initializing BalloonSim" ); + SG_LOG( SG_FLIGHT, SG_INFO, "Finished initializing BalloonSim" ); } @@ -146,7 +146,7 @@ bool FGBalloonSim::update( int multiloop ) { /*sgVec3 temp, temp2; current_balloon.getPosition( temp ); current_balloon.getVelocity( temp2 ); - FG_LOG( FG_FLIGHT, FG_INFO, "T: " << current_balloon.getTemperature() << + SG_LOG( SG_FLIGHT, SG_INFO, "T: " << current_balloon.getTemperature() << " alt: " << temp[2] << " gr_alt: " << get_Runway_altitude() << " burner: " << controls.get_elevator() << diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index b5db5ca36..22359cdec 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -77,7 +77,7 @@ FGJSBsim::FGJSBsim( double dt ) { engine_path.str(), fgGetString("/sim/aircraft") ); int Neng=fdmex->GetAircraft()->GetNumEngines(); - FG_LOG(FG_FLIGHT,FG_INFO, "Neng: " << Neng ); + SG_LOG(SG_FLIGHT,SG_INFO, "Neng: " << Neng ); for(int i=0;iget_fg_root() ); @@ -117,9 +117,9 @@ void FGJSBsim::init() { fgGetString("/sim/aircraft") ); if (result) { - FG_LOG( FG_FLIGHT, FG_INFO, " loaded aircraft " << fgGetString("/sim/aircraft") ); + SG_LOG( SG_FLIGHT, SG_INFO, " loaded aircraft " << fgGetString("/sim/aircraft") ); } else { - FG_LOG( FG_FLIGHT, FG_INFO, " aircraft " + SG_LOG( SG_FLIGHT, SG_INFO, " aircraft " << fgGetString("/sim/aircraft") << " does not exist" ); exit(-1); @@ -128,67 +128,67 @@ void FGJSBsim::init() { fdmex->GetAtmosphere()->UseInternal(); - FG_LOG( FG_FLIGHT, FG_INFO, " Initializing JSBSim with:" ); + SG_LOG( SG_FLIGHT, SG_INFO, " Initializing JSBSim with:" ); switch(fgic->GetSpeedSet()) { case setned: - FG_LOG(FG_FLIGHT,FG_INFO, " Vn,Ve,Vd= " + SG_LOG(SG_FLIGHT,SG_INFO, " Vn,Ve,Vd= " << fdmex->GetPosition()->GetVn() << ", " << fdmex->GetPosition()->GetVe() << ", " << fdmex->GetPosition()->GetVd() << " ft/s"); break; case setuvw: - FG_LOG(FG_FLIGHT,FG_INFO, " U,V,W= " + SG_LOG(SG_FLIGHT,SG_INFO, " U,V,W= " << fdmex->GetTranslation()->GetUVW()(1) << ", " << fdmex->GetTranslation()->GetUVW()(2) << ", " << fdmex->GetTranslation()->GetUVW()(3) << " ft/s"); break; case setmach: - FG_LOG(FG_FLIGHT,FG_INFO, " Mach: " + SG_LOG(SG_FLIGHT,SG_INFO, " Mach: " << fdmex->GetTranslation()->GetMach() ); break; case setvc: default: - FG_LOG(FG_FLIGHT,FG_INFO, " Indicated Airspeed: " + SG_LOG(SG_FLIGHT,SG_INFO, " Indicated Airspeed: " << fdmex->GetAuxiliary()->GetVcalibratedKTS() << " knots" ); } - FG_LOG( FG_FLIGHT, FG_INFO, " Bank Angle: " + SG_LOG( SG_FLIGHT, SG_INFO, " Bank Angle: " << fdmex->GetRotation()->Getphi()*RADTODEG << " deg"); - FG_LOG( FG_FLIGHT, FG_INFO, " Pitch Angle: " + SG_LOG( SG_FLIGHT, SG_INFO, " Pitch Angle: " << fdmex->GetRotation()->Gettht()*RADTODEG << " deg" ); - FG_LOG( FG_FLIGHT, FG_INFO, " True Heading: " + SG_LOG( SG_FLIGHT, SG_INFO, " True Heading: " << fdmex->GetRotation()->Getpsi()*RADTODEG << " deg" ); - FG_LOG( FG_FLIGHT, FG_INFO, " Latitude: " + SG_LOG( SG_FLIGHT, SG_INFO, " Latitude: " << fdmex->GetPosition()->GetLatitude() << " deg" ); - FG_LOG( FG_FLIGHT, FG_INFO, " Longitude: " + SG_LOG( SG_FLIGHT, SG_INFO, " Longitude: " << fdmex->GetPosition()->GetLongitude() << " deg" ); // for debug only - /* FG_LOG( FG_FLIGHT, FG_DEBUG, " FGJSBSim::get_Altitude(): " << get_Altitude() ); - FG_LOG( FG_FLIGHT, FG_DEBUG, " FGJSBSim::get_Sea_level_radius(): " << get_Sea_level_radius() ); - FG_LOG( FG_FLIGHT, FG_DEBUG, " scenery.cur_radius*SG_METER_TO_FEET: " + /* SG_LOG( SG_FLIGHT, SG_DEBUG, " FGJSBSim::get_Altitude(): " << get_Altitude() ); + SG_LOG( SG_FLIGHT, SG_DEBUG, " FGJSBSim::get_Sea_level_radius(): " << get_Sea_level_radius() ); + SG_LOG( SG_FLIGHT, SG_DEBUG, " scenery.cur_radius*SG_METER_TO_FEET: " << scenery.cur_radius*SG_METER_TO_FEET ); - FG_LOG( FG_FLIGHT, FG_DEBUG, " Calculated Terrain ASL: " << endl + SG_LOG( SG_FLIGHT, SG_DEBUG, " Calculated Terrain ASL: " << endl << " " << "scenery.cur_radius*SG_METER_TO_FEET -get_Sea_level_radius()= " << scenery.cur_radius*SG_METER_TO_FEET - get_Sea_level_radius() ); - FG_LOG( FG_FLIGHT, FG_DEBUG, " Calculated Aircraft AGL: " << endl + SG_LOG( SG_FLIGHT, SG_DEBUG, " Calculated Aircraft AGL: " << endl << " " << "get_Altitude() + get_Sea_level_radius() - scenery.cur_radius*SG_METER_TO_FEET= " << get_Altitude() + get_Sea_level_radius()- scenery.cur_radius*SG_METER_TO_FEET ); - FG_LOG( FG_FLIGHT, FG_DEBUG, " fgGetDouble("/position/altitude"): " + SG_LOG( SG_FLIGHT, SG_DEBUG, " fgGetDouble("/position/altitude"): " << fgGetDouble("/position/altitude") ); - FG_LOG( FG_FLIGHT, FG_DEBUG, " FGBFI::getAltitude(): " + SG_LOG( SG_FLIGHT, SG_DEBUG, " FGBFI::getAltitude(): " << FGBFI::getAltitude() ); */ - FG_LOG( FG_FLIGHT, FG_INFO, " loaded initial conditions" ); + SG_LOG( SG_FLIGHT, SG_INFO, " loaded initial conditions" ); - FG_LOG( FG_FLIGHT, FG_INFO, " set dt" ); + SG_LOG( SG_FLIGHT, SG_INFO, " set dt" ); - FG_LOG( FG_FLIGHT, FG_INFO, "Finished initializing JSBSim" ); + SG_LOG( SG_FLIGHT, SG_INFO, "Finished initializing JSBSim" ); } /******************************************************************************/ @@ -232,7 +232,7 @@ bool FGJSBsim::update( int multiloop ) { controls.set_aileron(fdmex->GetFCS()->GetDaCmd()); controls.set_rudder(fdmex->GetFCS()->GetDrCmd()); - FG_LOG( FG_FLIGHT, FG_INFO, " Trim complete" ); + SG_LOG( SG_FLIGHT, SG_INFO, " Trim complete" ); } for( i=0; iSetLongitudeRadIC(lon); @@ -443,7 +443,7 @@ void FGJSBsim::set_Longitude(double lon) { void FGJSBsim::set_Altitude(double alt) { double sea_level_radius_meters,lat_geoc; - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Altitude: " << alt ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Altitude: " << alt ); snap_shot(); sgGeodToGeoc( get_Latitude(), alt , &sea_level_radius_meters, &lat_geoc); @@ -457,7 +457,7 @@ void FGJSBsim::set_Altitude(double alt) { } void FGJSBsim::set_V_calibrated_kts(double vc) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_V_calibrated_kts: " << vc ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_V_calibrated_kts: " << vc ); snap_shot(); fgic->SetVcalibratedKtsIC(vc); @@ -467,7 +467,7 @@ void FGJSBsim::set_V_calibrated_kts(double vc) { } void FGJSBsim::set_Mach_number(double mach) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Mach_number: " << mach ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Mach_number: " << mach ); snap_shot(); fgic->SetMachIC(mach); @@ -477,7 +477,7 @@ void FGJSBsim::set_Mach_number(double mach) { } void FGJSBsim::set_Velocities_Local( double north, double east, double down ){ - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Velocities_Local: " + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Local: " << north << ", " << east << ", " << down ); snap_shot(); @@ -490,7 +490,7 @@ void FGJSBsim::set_Velocities_Local( double north, double east, double down ){ } void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w){ - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Velocities_Wind_Body: " + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Wind_Body: " << u << ", " << v << ", " << w ); snap_shot(); @@ -504,7 +504,7 @@ void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w){ //Euler angles void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Euler_Angles: " + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Euler_Angles: " << phi << ", " << theta << ", " << psi ); snap_shot(); @@ -518,7 +518,7 @@ void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) { //Flight Path void FGJSBsim::set_Climb_Rate( double roc) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Climb_Rate: " << roc ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Climb_Rate: " << roc ); snap_shot(); fgic->SetClimbRateFpsIC(roc); @@ -528,7 +528,7 @@ void FGJSBsim::set_Climb_Rate( double roc) { } void FGJSBsim::set_Gamma_vert_rad( double gamma) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Gamma_vert_rad: " << gamma ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Gamma_vert_rad: " << gamma ); snap_shot(); fgic->SetFlightPathAngleRadIC(gamma); @@ -539,7 +539,7 @@ void FGJSBsim::set_Gamma_vert_rad( double gamma) { //Earth void FGJSBsim::set_Sea_level_radius(double slr) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Sea_level_radius: " << slr ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Sea_level_radius: " << slr ); snap_shot(); fgic->SetSeaLevelRadiusFtIC(slr); @@ -549,7 +549,7 @@ void FGJSBsim::set_Sea_level_radius(double slr) { } void FGJSBsim::set_Runway_altitude(double ralt) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Runway_altitude: " << ralt ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Runway_altitude: " << ralt ); snap_shot(); _set_Runway_altitude( ralt ); @@ -560,7 +560,7 @@ void FGJSBsim::set_Runway_altitude(double ralt) { } void FGJSBsim::set_Static_pressure(double p) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Static_pressure: " << p ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Static_pressure: " << p ); snap_shot(); fdmex->GetAtmosphere()->SetExPressure(p); @@ -569,7 +569,7 @@ void FGJSBsim::set_Static_pressure(double p) { } void FGJSBsim::set_Static_temperature(double T) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Static_temperature: " << T ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Static_temperature: " << T ); snap_shot(); fdmex->GetAtmosphere()->SetExTemperature(T); @@ -579,7 +579,7 @@ void FGJSBsim::set_Static_temperature(double T) { void FGJSBsim::set_Density(double rho) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Density: " << rho ); + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Density: " << rho ); snap_shot(); fdmex->GetAtmosphere()->SetExDensity(rho); @@ -591,7 +591,7 @@ void FGJSBsim::set_Density(double rho) { void FGJSBsim::set_Velocities_Local_Airmass (double wnorth, double weast, double wdown ) { - FG_LOG(FG_FLIGHT,FG_INFO, "FGJSBsim::set_Velocities_Local_Airmass: " + SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Local_Airmass: " << wnorth << ", " << weast << ", " << wdown ); snap_shot(); diff --git a/src/FDM/LaRCsim.cxx b/src/FDM/LaRCsim.cxx index 75c36be0c..e8a08d1ff 100644 --- a/src/FDM/LaRCsim.cxx +++ b/src/FDM/LaRCsim.cxx @@ -86,7 +86,7 @@ void FGLaRCsim::init() { set_Tank1Fuel(28.0); set_Tank2Fuel(28.0); - // FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::init()" ); + // SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::init()" ); double save_alt = 0.0; @@ -101,7 +101,7 @@ void FGLaRCsim::init() { // actual LaRCsim top level init // ls_toplevel_init( dt, (char *)fgGetString("/sim/aircraft").c_str() ); - FG_LOG( FG_FLIGHT, FG_INFO, "FG pos = " << + SG_LOG( SG_FLIGHT, SG_INFO, "FG pos = " << get_Latitude() ); // translate LaRCsim back to FG structure @@ -151,17 +151,17 @@ bool FGLaRCsim::update( int multiloop ) { * get_delta_t() ); #if 0 - FG_LOG( FG_FLIGHT, FG_INFO, "Throttle = " + SG_LOG( SG_FLIGHT, SG_INFO, "Throttle = " << controls.get_throttle( 0 ) * 100.0); - FG_LOG( FG_FLIGHT, FG_INFO, " Mixture = " << 80); - FG_LOG( FG_FLIGHT, FG_INFO, " RPM = " << eng.get_RPM()); - FG_LOG( FG_FLIGHT, FG_INFO, " MP = " << eng.get_Manifold_Pressure()); - FG_LOG( FG_FLIGHT, FG_INFO, " HP = " + 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) ); - FG_LOG( FG_FLIGHT, FG_INFO, " EGT = " << eng.get_EGT()); - FG_LOG( FG_FLIGHT, FG_INFO, " Thrust (N) " + 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 - FG_LOG( FG_FLIGHT, FG_INFO, '\n'); + SG_LOG( SG_FLIGHT, SG_INFO, '\n'); #endif F_X_engine = eng.get_prop_thrust_lbs(); // cout << "F_X_engine = " << F_X_engine << '\n'; @@ -468,7 +468,7 @@ bool FGLaRCsim::copy_from_LaRCsim() { _set_Mach_number( Mach_number ); - FG_LOG( FG_FLIGHT, FG_DEBUG, "lon = " << Longitude + SG_LOG( SG_FLIGHT, SG_DEBUG, "lon = " << Longitude << " lat_geoc = " << Lat_geocentric << " lat_geod = " << Latitude << " alt = " << Altitude << " sl_radius = " << Sea_level_radius << " radius_to_vehicle = " << Radius_to_vehicle ); @@ -575,20 +575,20 @@ void FGLaRCsim::set_ls(void) { V_down_airmass = lsic->GetVdownAirmassFpsIC(); ls_loop(0.0,-1); copy_from_LaRCsim(); - FG_LOG( FG_FLIGHT, FG_INFO, " FGLaRCsim::set_ls(): " ); - FG_LOG( FG_FLIGHT, FG_INFO, " Phi: " << Phi ); - FG_LOG( FG_FLIGHT, FG_INFO, " Theta: " << Theta ); - FG_LOG( FG_FLIGHT, FG_INFO, " Psi: " << Psi ); - FG_LOG( FG_FLIGHT, FG_INFO, " V_north: " << V_north ); - FG_LOG( FG_FLIGHT, FG_INFO, " V_east: " << V_east ); - FG_LOG( FG_FLIGHT, FG_INFO, " V_down: " << V_down ); - FG_LOG( FG_FLIGHT, FG_INFO, " Altitude: " << Altitude ); - FG_LOG( FG_FLIGHT, FG_INFO, " Latitude: " << Latitude ); - FG_LOG( FG_FLIGHT, FG_INFO, " Longitude: " << Longitude ); - FG_LOG( FG_FLIGHT, FG_INFO, " Runway_altitude: " << Runway_altitude ); - FG_LOG( FG_FLIGHT, FG_INFO, " V_north_airmass: " << V_north_airmass ); - FG_LOG( FG_FLIGHT, FG_INFO, " V_east_airmass: " << V_east_airmass ); - FG_LOG( FG_FLIGHT, FG_INFO, " V_down_airmass: " << V_down_airmass ); + 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) { @@ -608,7 +608,7 @@ void FGLaRCsim::snap_shot(void) { //Positions void FGLaRCsim::set_Latitude(double lat) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Latitude: " << lat ); + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Latitude: " << lat ); snap_shot(); lsic->SetLatitudeGDRadIC(lat); set_ls(); @@ -616,7 +616,7 @@ void FGLaRCsim::set_Latitude(double lat) { } void FGLaRCsim::set_Longitude(double lon) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Longitude: " << lon ); + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Longitude: " << lon ); snap_shot(); lsic->SetLongitudeRadIC(lon); set_ls(); @@ -624,7 +624,7 @@ void FGLaRCsim::set_Longitude(double lon) { } void FGLaRCsim::set_Altitude(double alt) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Altitude: " << alt ); + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Altitude: " << alt ); snap_shot(); lsic->SetAltitudeFtIC(alt); set_ls(); @@ -632,7 +632,7 @@ void FGLaRCsim::set_Altitude(double alt) { } void FGLaRCsim::set_V_calibrated_kts(double vc) { - FG_LOG( FG_FLIGHT, FG_INFO, + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_V_calibrated_kts: " << vc ); snap_shot(); lsic->SetVcalibratedKtsIC(vc); @@ -641,7 +641,7 @@ void FGLaRCsim::set_V_calibrated_kts(double vc) { } void FGLaRCsim::set_Mach_number(double mach) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Mach_number: " << mach ); + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Mach_number: " << mach ); snap_shot(); lsic->SetMachIC(mach); set_ls(); @@ -649,7 +649,7 @@ void FGLaRCsim::set_Mach_number(double mach) { } void FGLaRCsim::set_Velocities_Local( double north, double east, double down ){ - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Velocities_local: " + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Velocities_local: " << north << " " << east << " " << down ); snap_shot(); lsic->SetVNEDFpsIC(north, east, down); @@ -658,7 +658,7 @@ void FGLaRCsim::set_Velocities_Local( double north, double east, double down ){ } void FGLaRCsim::set_Velocities_Wind_Body( double u, double v, double w){ - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Velocities_Wind_Body: " + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Velocities_Wind_Body: " << u << " " << v << " " << w ); snap_shot(); lsic->SetUVWFpsIC(u,v,w); @@ -668,7 +668,7 @@ void FGLaRCsim::set_Velocities_Wind_Body( double u, double v, double w){ //Euler angles void FGLaRCsim::set_Euler_Angles( double phi, double theta, double psi ) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Euler_angles: " + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Euler_angles: " << phi << " " << theta << " " << psi ); snap_shot(); @@ -681,7 +681,7 @@ void FGLaRCsim::set_Euler_Angles( double phi, double theta, double psi ) { //Flight Path void FGLaRCsim::set_Climb_Rate( double roc) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Climb_rate: " << roc ); + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Climb_rate: " << roc ); snap_shot(); lsic->SetClimbRateFpsIC(roc); set_ls(); @@ -689,7 +689,7 @@ void FGLaRCsim::set_Climb_Rate( double roc) { } void FGLaRCsim::set_Gamma_vert_rad( double gamma) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Gamma_vert_rad: " << gamma ); + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Gamma_vert_rad: " << gamma ); snap_shot(); lsic->SetFlightPathAngleRadIC(gamma); set_ls(); @@ -697,7 +697,7 @@ void FGLaRCsim::set_Gamma_vert_rad( double gamma) { } void FGLaRCsim::set_Runway_altitude(double ralt) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Runway_altitude: " << ralt ); + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Runway_altitude: " << ralt ); snap_shot(); lsic->SetRunwayAltitudeFtIC(ralt); set_ls(); @@ -705,7 +705,7 @@ void FGLaRCsim::set_Runway_altitude(double ralt) { } void FGLaRCsim::set_AltitudeAGL(double altagl) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_AltitudeAGL: " << altagl ); + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_AltitudeAGL: " << altagl ); snap_shot(); lsic->SetAltitudeAGLFtIC(altagl); set_ls(); @@ -715,7 +715,7 @@ void FGLaRCsim::set_AltitudeAGL(double altagl) { void FGLaRCsim::set_Velocities_Local_Airmass (double wnorth, double weast, double wdown ) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Velocities_Local_Airmass: " + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Velocities_Local_Airmass: " << wnorth << " " << weast << " " << wdown ); snap_shot(); lsic->SetVNEDAirmassFpsIC( wnorth, weast, wdown ); @@ -724,23 +724,23 @@ void FGLaRCsim::set_Velocities_Local_Airmass (double wnorth, } void FGLaRCsim::set_Static_pressure(double p) { - FG_LOG( FG_FLIGHT, FG_INFO, + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Static_pressure: " << p ); - FG_LOG( FG_FLIGHT, FG_INFO, + SG_LOG( SG_FLIGHT, SG_INFO, "LaRCsim does not support externally supplied atmospheric data" ); } void FGLaRCsim::set_Static_temperature(double T) { - FG_LOG( FG_FLIGHT, FG_INFO, + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Static_temperature: " << T ); - FG_LOG( FG_FLIGHT, FG_INFO, + SG_LOG( SG_FLIGHT, SG_INFO, "LaRCsim does not support externally supplied atmospheric data" ); } void FGLaRCsim::set_Density(double rho) { - FG_LOG( FG_FLIGHT, FG_INFO, "FGLaRCsim::set_Density: " << rho ); - FG_LOG( FG_FLIGHT, FG_INFO, + SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Density: " << rho ); + SG_LOG( SG_FLIGHT, SG_INFO, "LaRCsim does not support externally supplied atmospheric data" ); } diff --git a/src/FDM/LaRCsim/ls_aux.c b/src/FDM/LaRCsim/ls_aux.c index 226eea64f..03cb6d699 100644 --- a/src/FDM/LaRCsim/ls_aux.c +++ b/src/FDM/LaRCsim/ls_aux.c @@ -47,6 +47,9 @@ $Header$ $Log$ +Revision 1.3 2001/03/24 05:03:12 curt +SG-ified logstream. + Revision 1.2 2000/10/23 22:34:54 curt I tested: LaRCsim c172 on-ground and in-air starts, reset: all work @@ -85,7 +88,7 @@ src/FDM/flight.hxx -- that small set is declared virtual, the default implementation provided preserves the old behavior -- all of the vector data members are now initialized. --- added busdump() method -- FG_LOG's all the bus data when called, +-- added busdump() method -- SG_LOG's all the bus data when called, useful for diagnostics. src/FDM/ADA.cxx diff --git a/src/FDM/LaRCsim/ls_geodesy.c b/src/FDM/LaRCsim/ls_geodesy.c index 4d8fde96c..f167a2465 100644 --- a/src/FDM/LaRCsim/ls_geodesy.c +++ b/src/FDM/LaRCsim/ls_geodesy.c @@ -40,6 +40,9 @@ $Header$ $Log$ +Revision 1.3 2001/03/24 05:03:12 curt +SG-ified logstream. + Revision 1.2 2000/10/23 22:34:54 curt I tested: LaRCsim c172 on-ground and in-air starts, reset: all work @@ -78,7 +81,7 @@ src/FDM/flight.hxx -- that small set is declared virtual, the default implementation provided preserves the old behavior -- all of the vector data members are now initialized. --- added busdump() method -- FG_LOG's all the bus data when called, +-- added busdump() method -- SG_LOG's all the bus data when called, useful for diagnostics. src/FDM/ADA.cxx diff --git a/src/FDM/LaRCsim/ls_interface.c b/src/FDM/LaRCsim/ls_interface.c index 4f735a77d..ed2594474 100644 --- a/src/FDM/LaRCsim/ls_interface.c +++ b/src/FDM/LaRCsim/ls_interface.c @@ -578,6 +578,9 @@ int ls_ForceAltitude(double alt_feet) { /* Flight Gear Modification Log * * $Log$ + * Revision 1.4 2001/03/24 05:03:12 curt + * SG-ified logstream. + * * Revision 1.3 2000/10/23 22:34:54 curt * I tested: * LaRCsim c172 on-ground and in-air starts, reset: all work @@ -616,7 +619,7 @@ int ls_ForceAltitude(double alt_feet) { * -- that small set is declared virtual, the default implementation * provided preserves the old behavior * -- all of the vector data members are now initialized. - * -- added busdump() method -- FG_LOG's all the bus data when called, + * -- added busdump() method -- SG_LOG's all the bus data when called, * useful for diagnostics. * * src/FDM/ADA.cxx diff --git a/src/FDM/LaRCsim/ls_interface.h b/src/FDM/LaRCsim/ls_interface.h index 4bb496e88..2996c0d0a 100644 --- a/src/FDM/LaRCsim/ls_interface.h +++ b/src/FDM/LaRCsim/ls_interface.h @@ -66,6 +66,9 @@ int ls_ForceAltitude(double alt_feet); // $Log$ +// Revision 1.5 2001/03/24 05:03:12 curt +// SG-ified logstream. +// // Revision 1.4 2000/10/23 22:34:54 curt // I tested: // LaRCsim c172 on-ground and in-air starts, reset: all work @@ -104,7 +107,7 @@ int ls_ForceAltitude(double alt_feet); // -- that small set is declared virtual, the default implementation // provided preserves the old behavior // -- all of the vector data members are now initialized. -// -- added busdump() method -- FG_LOG's all the bus data when called, +// -- added busdump() method -- SG_LOG's all the bus data when called, // useful for diagnostics. // // src/FDM/ADA.cxx diff --git a/src/FDM/LaRCsim/ls_step.c b/src/FDM/LaRCsim/ls_step.c index 79502fe02..053199ab2 100644 --- a/src/FDM/LaRCsim/ls_step.c +++ b/src/FDM/LaRCsim/ls_step.c @@ -50,6 +50,9 @@ $Header$ $Log$ +Revision 1.4 2001/03/24 05:03:12 curt +SG-ified logstream. + Revision 1.3 2000/10/23 22:34:55 curt I tested: LaRCsim c172 on-ground and in-air starts, reset: all work @@ -88,7 +91,7 @@ src/FDM/flight.hxx -- that small set is declared virtual, the default implementation provided preserves the old behavior -- all of the vector data members are now initialized. --- added busdump() method -- FG_LOG's all the bus data when called, +-- added busdump() method -- SG_LOG's all the bus data when called, useful for diagnostics. src/FDM/ADA.cxx diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index c04f1e96c..22ee59ef6 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -276,7 +276,7 @@ void FGInterface::_updatePosition( double lat_geoc, double lon, double alt ) { &lat_geod, &tmp_alt, &sl_radius1 ); sgGeodToGeoc( lat_geod, alt * SG_FEET_TO_METER, &sl_radius2, &tmp_lat_geoc ); - FG_LOG( FG_FLIGHT, FG_DEBUG, "lon = " << lon + SG_LOG( SG_FLIGHT, SG_DEBUG, "lon = " << lon << " lat_geod = " << lat_geod << " lat_geoc = " << lat_geoc << " alt = " << alt @@ -374,7 +374,7 @@ void fgFDMForceAltitude(const string &model, double alt_meters) { // Set the local ground elevation void fgFDMSetGroundElevation(const string &model, double ground_meters) { - FG_LOG( FG_FLIGHT,FG_INFO, "fgFDMSetGroundElevation: " + SG_LOG( SG_FLIGHT,SG_INFO, "fgFDMSetGroundElevation: " << ground_meters*SG_METER_TO_FEET ); base_fdm_state.set_Runway_altitude( ground_meters * SG_METER_TO_FEET ); cur_fdm_state->set_Runway_altitude( ground_meters * SG_METER_TO_FEET ); @@ -465,105 +465,105 @@ void FGInterface::set_Velocities_Local_Airmass (double wnorth, void FGInterface::_busdump(void) { - FG_LOG(FG_FLIGHT,FG_INFO,"d_pilot_rp_body_v[3]: " << d_pilot_rp_body_v[0] << ", " << d_pilot_rp_body_v[1] << ", " << d_pilot_rp_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"d_cg_rp_body_v[3]: " << d_cg_rp_body_v[0] << ", " << d_cg_rp_body_v[1] << ", " << d_cg_rp_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"f_body_total_v[3]: " << f_body_total_v[0] << ", " << f_body_total_v[1] << ", " << f_body_total_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"f_local_total_v[3]: " << f_local_total_v[0] << ", " << f_local_total_v[1] << ", " << f_local_total_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"f_aero_v[3]: " << f_aero_v[0] << ", " << f_aero_v[1] << ", " << f_aero_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"f_engine_v[3]: " << f_engine_v[0] << ", " << f_engine_v[1] << ", " << f_engine_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"f_gear_v[3]: " << f_gear_v[0] << ", " << f_gear_v[1] << ", " << f_gear_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"m_total_rp_v[3]: " << m_total_rp_v[0] << ", " << m_total_rp_v[1] << ", " << m_total_rp_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"m_total_cg_v[3]: " << m_total_cg_v[0] << ", " << m_total_cg_v[1] << ", " << m_total_cg_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"m_aero_v[3]: " << m_aero_v[0] << ", " << m_aero_v[1] << ", " << m_aero_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"m_engine_v[3]: " << m_engine_v[0] << ", " << m_engine_v[1] << ", " << m_engine_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"m_gear_v[3]: " << m_gear_v[0] << ", " << m_gear_v[1] << ", " << m_gear_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"v_dot_local_v[3]: " << v_dot_local_v[0] << ", " << v_dot_local_v[1] << ", " << v_dot_local_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"v_dot_body_v[3]: " << v_dot_body_v[0] << ", " << v_dot_body_v[1] << ", " << v_dot_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"a_cg_body_v[3]: " << a_cg_body_v[0] << ", " << a_cg_body_v[1] << ", " << a_cg_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"a_pilot_body_v[3]: " << a_pilot_body_v[0] << ", " << a_pilot_body_v[1] << ", " << a_pilot_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"n_cg_body_v[3]: " << n_cg_body_v[0] << ", " << n_cg_body_v[1] << ", " << n_cg_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"n_pilot_body_v[3]: " << n_pilot_body_v[0] << ", " << n_pilot_body_v[1] << ", " << n_pilot_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"omega_dot_body_v[3]: " << omega_dot_body_v[0] << ", " << omega_dot_body_v[1] << ", " << omega_dot_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"v_local_v[3]: " << v_local_v[0] << ", " << v_local_v[1] << ", " << v_local_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"v_local_rel_ground_v[3]: " << v_local_rel_ground_v[0] << ", " << v_local_rel_ground_v[1] << ", " << v_local_rel_ground_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"v_local_airmass_v[3]: " << v_local_airmass_v[0] << ", " << v_local_airmass_v[1] << ", " << v_local_airmass_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"v_local_rel_airmass_v[3]: " << v_local_rel_airmass_v[0] << ", " << v_local_rel_airmass_v[1] << ", " << v_local_rel_airmass_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"v_local_gust_v[3]: " << v_local_gust_v[0] << ", " << v_local_gust_v[1] << ", " << v_local_gust_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"v_wind_body_v[3]: " << v_wind_body_v[0] << ", " << v_wind_body_v[1] << ", " << v_wind_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"omega_body_v[3]: " << omega_body_v[0] << ", " << omega_body_v[1] << ", " << omega_body_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"omega_local_v[3]: " << omega_local_v[0] << ", " << omega_local_v[1] << ", " << omega_local_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"omega_total_v[3]: " << omega_total_v[0] << ", " << omega_total_v[1] << ", " << omega_total_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"euler_rates_v[3]: " << euler_rates_v[0] << ", " << euler_rates_v[1] << ", " << euler_rates_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"geocentric_rates_v[3]: " << geocentric_rates_v[0] << ", " << geocentric_rates_v[1] << ", " << geocentric_rates_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"geocentric_position_v[3]: " << geocentric_position_v[0] << ", " << geocentric_position_v[1] << ", " << geocentric_position_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"geodetic_position_v[3]: " << geodetic_position_v[0] << ", " << geodetic_position_v[1] << ", " << geodetic_position_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"euler_angles_v[3]: " << euler_angles_v[0] << ", " << euler_angles_v[1] << ", " << euler_angles_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"d_cg_rwy_local_v[3]: " << d_cg_rwy_local_v[0] << ", " << d_cg_rwy_local_v[1] << ", " << d_cg_rwy_local_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"d_cg_rwy_rwy_v[3]: " << d_cg_rwy_rwy_v[0] << ", " << d_cg_rwy_rwy_v[1] << ", " << d_cg_rwy_rwy_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"d_pilot_rwy_local_v[3]: " << d_pilot_rwy_local_v[0] << ", " << d_pilot_rwy_local_v[1] << ", " << d_pilot_rwy_local_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"d_pilot_rwy_rwy_v[3]: " << d_pilot_rwy_rwy_v[0] << ", " << d_pilot_rwy_rwy_v[1] << ", " << d_pilot_rwy_rwy_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"d_pilot_rp_body_v[3]: " << d_pilot_rp_body_v[0] << ", " << d_pilot_rp_body_v[1] << ", " << d_pilot_rp_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"d_cg_rp_body_v[3]: " << d_cg_rp_body_v[0] << ", " << d_cg_rp_body_v[1] << ", " << d_cg_rp_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"f_body_total_v[3]: " << f_body_total_v[0] << ", " << f_body_total_v[1] << ", " << f_body_total_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"f_local_total_v[3]: " << f_local_total_v[0] << ", " << f_local_total_v[1] << ", " << f_local_total_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"f_aero_v[3]: " << f_aero_v[0] << ", " << f_aero_v[1] << ", " << f_aero_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"f_engine_v[3]: " << f_engine_v[0] << ", " << f_engine_v[1] << ", " << f_engine_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"f_gear_v[3]: " << f_gear_v[0] << ", " << f_gear_v[1] << ", " << f_gear_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"m_total_rp_v[3]: " << m_total_rp_v[0] << ", " << m_total_rp_v[1] << ", " << m_total_rp_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"m_total_cg_v[3]: " << m_total_cg_v[0] << ", " << m_total_cg_v[1] << ", " << m_total_cg_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"m_aero_v[3]: " << m_aero_v[0] << ", " << m_aero_v[1] << ", " << m_aero_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"m_engine_v[3]: " << m_engine_v[0] << ", " << m_engine_v[1] << ", " << m_engine_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"m_gear_v[3]: " << m_gear_v[0] << ", " << m_gear_v[1] << ", " << m_gear_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"v_dot_local_v[3]: " << v_dot_local_v[0] << ", " << v_dot_local_v[1] << ", " << v_dot_local_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"v_dot_body_v[3]: " << v_dot_body_v[0] << ", " << v_dot_body_v[1] << ", " << v_dot_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"a_cg_body_v[3]: " << a_cg_body_v[0] << ", " << a_cg_body_v[1] << ", " << a_cg_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"a_pilot_body_v[3]: " << a_pilot_body_v[0] << ", " << a_pilot_body_v[1] << ", " << a_pilot_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"n_cg_body_v[3]: " << n_cg_body_v[0] << ", " << n_cg_body_v[1] << ", " << n_cg_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"n_pilot_body_v[3]: " << n_pilot_body_v[0] << ", " << n_pilot_body_v[1] << ", " << n_pilot_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"omega_dot_body_v[3]: " << omega_dot_body_v[0] << ", " << omega_dot_body_v[1] << ", " << omega_dot_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"v_local_v[3]: " << v_local_v[0] << ", " << v_local_v[1] << ", " << v_local_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"v_local_rel_ground_v[3]: " << v_local_rel_ground_v[0] << ", " << v_local_rel_ground_v[1] << ", " << v_local_rel_ground_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"v_local_airmass_v[3]: " << v_local_airmass_v[0] << ", " << v_local_airmass_v[1] << ", " << v_local_airmass_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"v_local_rel_airmass_v[3]: " << v_local_rel_airmass_v[0] << ", " << v_local_rel_airmass_v[1] << ", " << v_local_rel_airmass_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"v_local_gust_v[3]: " << v_local_gust_v[0] << ", " << v_local_gust_v[1] << ", " << v_local_gust_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"v_wind_body_v[3]: " << v_wind_body_v[0] << ", " << v_wind_body_v[1] << ", " << v_wind_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"omega_body_v[3]: " << omega_body_v[0] << ", " << omega_body_v[1] << ", " << omega_body_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"omega_local_v[3]: " << omega_local_v[0] << ", " << omega_local_v[1] << ", " << omega_local_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"omega_total_v[3]: " << omega_total_v[0] << ", " << omega_total_v[1] << ", " << omega_total_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"euler_rates_v[3]: " << euler_rates_v[0] << ", " << euler_rates_v[1] << ", " << euler_rates_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"geocentric_rates_v[3]: " << geocentric_rates_v[0] << ", " << geocentric_rates_v[1] << ", " << geocentric_rates_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"geocentric_position_v[3]: " << geocentric_position_v[0] << ", " << geocentric_position_v[1] << ", " << geocentric_position_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"geodetic_position_v[3]: " << geodetic_position_v[0] << ", " << geodetic_position_v[1] << ", " << geodetic_position_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"euler_angles_v[3]: " << euler_angles_v[0] << ", " << euler_angles_v[1] << ", " << euler_angles_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"d_cg_rwy_local_v[3]: " << d_cg_rwy_local_v[0] << ", " << d_cg_rwy_local_v[1] << ", " << d_cg_rwy_local_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"d_cg_rwy_rwy_v[3]: " << d_cg_rwy_rwy_v[0] << ", " << d_cg_rwy_rwy_v[1] << ", " << d_cg_rwy_rwy_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"d_pilot_rwy_local_v[3]: " << d_pilot_rwy_local_v[0] << ", " << d_pilot_rwy_local_v[1] << ", " << d_pilot_rwy_local_v[2]); + SG_LOG(SG_FLIGHT,SG_INFO,"d_pilot_rwy_rwy_v[3]: " << d_pilot_rwy_rwy_v[0] << ", " << d_pilot_rwy_rwy_v[1] << ", " << d_pilot_rwy_rwy_v[2]); - FG_LOG(FG_FLIGHT,FG_INFO,"t_local_to_body_m[0][3]: " << t_local_to_body_m[0][0] << ", " << t_local_to_body_m[0][1] << ", " << t_local_to_body_m[0][2]); - FG_LOG(FG_FLIGHT,FG_INFO,"t_local_to_body_m[1][3]: " << t_local_to_body_m[1][0] << ", " << t_local_to_body_m[1][1] << ", " << t_local_to_body_m[1][2]); - FG_LOG(FG_FLIGHT,FG_INFO,"t_local_to_body_m[2][3]: " << t_local_to_body_m[2][0] << ", " << t_local_to_body_m[2][1] << ", " << t_local_to_body_m[2][2]); - - FG_LOG(FG_FLIGHT,FG_INFO,"mass: " << mass ); - FG_LOG(FG_FLIGHT,FG_INFO,"i_xx: " << i_xx ); - FG_LOG(FG_FLIGHT,FG_INFO,"i_yy: " << i_yy ); - FG_LOG(FG_FLIGHT,FG_INFO,"i_zz: " << i_zz ); - FG_LOG(FG_FLIGHT,FG_INFO,"i_xz: " << i_xz ); - FG_LOG(FG_FLIGHT,FG_INFO,"nlf: " << nlf ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_rel_wind: " << v_rel_wind ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_true_kts: " << v_true_kts ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_rel_ground: " << v_rel_ground ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_inertial: " << v_inertial ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_ground_speed: " << v_ground_speed ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_equiv: " << v_equiv ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_equiv_kts: " << v_equiv_kts ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_calibrated: " << v_calibrated ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_calibrated_kts: " << v_calibrated_kts ); - FG_LOG(FG_FLIGHT,FG_INFO,"gravity: " << gravity ); - FG_LOG(FG_FLIGHT,FG_INFO,"centrifugal_relief: " << centrifugal_relief ); - FG_LOG(FG_FLIGHT,FG_INFO,"alpha: " << alpha ); - FG_LOG(FG_FLIGHT,FG_INFO,"beta: " << beta ); - FG_LOG(FG_FLIGHT,FG_INFO,"alpha_dot: " << alpha_dot ); - FG_LOG(FG_FLIGHT,FG_INFO,"beta_dot: " << beta_dot ); - FG_LOG(FG_FLIGHT,FG_INFO,"cos_alpha: " << cos_alpha ); - FG_LOG(FG_FLIGHT,FG_INFO,"sin_alpha: " << sin_alpha ); - FG_LOG(FG_FLIGHT,FG_INFO,"cos_beta: " << cos_beta ); - FG_LOG(FG_FLIGHT,FG_INFO,"sin_beta: " << sin_beta ); - FG_LOG(FG_FLIGHT,FG_INFO,"cos_phi: " << cos_phi ); - FG_LOG(FG_FLIGHT,FG_INFO,"sin_phi: " << sin_phi ); - FG_LOG(FG_FLIGHT,FG_INFO,"cos_theta: " << cos_theta ); - FG_LOG(FG_FLIGHT,FG_INFO,"sin_theta: " << sin_theta ); - FG_LOG(FG_FLIGHT,FG_INFO,"cos_psi: " << cos_psi ); - FG_LOG(FG_FLIGHT,FG_INFO,"sin_psi: " << sin_psi ); - FG_LOG(FG_FLIGHT,FG_INFO,"gamma_vert_rad: " << gamma_vert_rad ); - FG_LOG(FG_FLIGHT,FG_INFO,"gamma_horiz_rad: " << gamma_horiz_rad ); - FG_LOG(FG_FLIGHT,FG_INFO,"sigma: " << sigma ); - FG_LOG(FG_FLIGHT,FG_INFO,"density: " << density ); - FG_LOG(FG_FLIGHT,FG_INFO,"v_sound: " << v_sound ); - FG_LOG(FG_FLIGHT,FG_INFO,"mach_number: " << mach_number ); - FG_LOG(FG_FLIGHT,FG_INFO,"static_pressure: " << static_pressure ); - FG_LOG(FG_FLIGHT,FG_INFO,"total_pressure: " << total_pressure ); - FG_LOG(FG_FLIGHT,FG_INFO,"impact_pressure: " << impact_pressure ); - FG_LOG(FG_FLIGHT,FG_INFO,"dynamic_pressure: " << dynamic_pressure ); - FG_LOG(FG_FLIGHT,FG_INFO,"static_temperature: " << static_temperature ); - FG_LOG(FG_FLIGHT,FG_INFO,"total_temperature: " << total_temperature ); - FG_LOG(FG_FLIGHT,FG_INFO,"sea_level_radius: " << sea_level_radius ); - FG_LOG(FG_FLIGHT,FG_INFO,"earth_position_angle: " << earth_position_angle ); - FG_LOG(FG_FLIGHT,FG_INFO,"runway_altitude: " << runway_altitude ); - FG_LOG(FG_FLIGHT,FG_INFO,"runway_latitude: " << runway_latitude ); - FG_LOG(FG_FLIGHT,FG_INFO,"runway_longitude: " << runway_longitude ); - FG_LOG(FG_FLIGHT,FG_INFO,"runway_heading: " << runway_heading ); - FG_LOG(FG_FLIGHT,FG_INFO,"radius_to_rwy: " << radius_to_rwy ); - FG_LOG(FG_FLIGHT,FG_INFO,"climb_rate: " << climb_rate ); - FG_LOG(FG_FLIGHT,FG_INFO,"sin_lat_geocentric: " << sin_lat_geocentric ); - FG_LOG(FG_FLIGHT,FG_INFO,"cos_lat_geocentric: " << cos_lat_geocentric ); - FG_LOG(FG_FLIGHT,FG_INFO,"sin_longitude: " << sin_longitude ); - FG_LOG(FG_FLIGHT,FG_INFO,"cos_longitude: " << cos_longitude ); - FG_LOG(FG_FLIGHT,FG_INFO,"sin_latitude: " << sin_latitude ); - FG_LOG(FG_FLIGHT,FG_INFO,"cos_latitude: " << cos_latitude ); - FG_LOG(FG_FLIGHT,FG_INFO,"altitude_agl: " << altitude_agl ); + SG_LOG(SG_FLIGHT,SG_INFO,"t_local_to_body_m[0][3]: " << t_local_to_body_m[0][0] << ", " << t_local_to_body_m[0][1] << ", " << t_local_to_body_m[0][2]); + SG_LOG(SG_FLIGHT,SG_INFO,"t_local_to_body_m[1][3]: " << t_local_to_body_m[1][0] << ", " << t_local_to_body_m[1][1] << ", " << t_local_to_body_m[1][2]); + SG_LOG(SG_FLIGHT,SG_INFO,"t_local_to_body_m[2][3]: " << t_local_to_body_m[2][0] << ", " << t_local_to_body_m[2][1] << ", " << t_local_to_body_m[2][2]); + + SG_LOG(SG_FLIGHT,SG_INFO,"mass: " << mass ); + SG_LOG(SG_FLIGHT,SG_INFO,"i_xx: " << i_xx ); + SG_LOG(SG_FLIGHT,SG_INFO,"i_yy: " << i_yy ); + SG_LOG(SG_FLIGHT,SG_INFO,"i_zz: " << i_zz ); + SG_LOG(SG_FLIGHT,SG_INFO,"i_xz: " << i_xz ); + SG_LOG(SG_FLIGHT,SG_INFO,"nlf: " << nlf ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_rel_wind: " << v_rel_wind ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_true_kts: " << v_true_kts ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_rel_ground: " << v_rel_ground ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_inertial: " << v_inertial ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_ground_speed: " << v_ground_speed ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_equiv: " << v_equiv ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_equiv_kts: " << v_equiv_kts ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_calibrated: " << v_calibrated ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_calibrated_kts: " << v_calibrated_kts ); + SG_LOG(SG_FLIGHT,SG_INFO,"gravity: " << gravity ); + SG_LOG(SG_FLIGHT,SG_INFO,"centrifugal_relief: " << centrifugal_relief ); + SG_LOG(SG_FLIGHT,SG_INFO,"alpha: " << alpha ); + SG_LOG(SG_FLIGHT,SG_INFO,"beta: " << beta ); + SG_LOG(SG_FLIGHT,SG_INFO,"alpha_dot: " << alpha_dot ); + SG_LOG(SG_FLIGHT,SG_INFO,"beta_dot: " << beta_dot ); + SG_LOG(SG_FLIGHT,SG_INFO,"cos_alpha: " << cos_alpha ); + SG_LOG(SG_FLIGHT,SG_INFO,"sin_alpha: " << sin_alpha ); + SG_LOG(SG_FLIGHT,SG_INFO,"cos_beta: " << cos_beta ); + SG_LOG(SG_FLIGHT,SG_INFO,"sin_beta: " << sin_beta ); + SG_LOG(SG_FLIGHT,SG_INFO,"cos_phi: " << cos_phi ); + SG_LOG(SG_FLIGHT,SG_INFO,"sin_phi: " << sin_phi ); + SG_LOG(SG_FLIGHT,SG_INFO,"cos_theta: " << cos_theta ); + SG_LOG(SG_FLIGHT,SG_INFO,"sin_theta: " << sin_theta ); + SG_LOG(SG_FLIGHT,SG_INFO,"cos_psi: " << cos_psi ); + SG_LOG(SG_FLIGHT,SG_INFO,"sin_psi: " << sin_psi ); + SG_LOG(SG_FLIGHT,SG_INFO,"gamma_vert_rad: " << gamma_vert_rad ); + SG_LOG(SG_FLIGHT,SG_INFO,"gamma_horiz_rad: " << gamma_horiz_rad ); + SG_LOG(SG_FLIGHT,SG_INFO,"sigma: " << sigma ); + SG_LOG(SG_FLIGHT,SG_INFO,"density: " << density ); + SG_LOG(SG_FLIGHT,SG_INFO,"v_sound: " << v_sound ); + SG_LOG(SG_FLIGHT,SG_INFO,"mach_number: " << mach_number ); + SG_LOG(SG_FLIGHT,SG_INFO,"static_pressure: " << static_pressure ); + SG_LOG(SG_FLIGHT,SG_INFO,"total_pressure: " << total_pressure ); + SG_LOG(SG_FLIGHT,SG_INFO,"impact_pressure: " << impact_pressure ); + SG_LOG(SG_FLIGHT,SG_INFO,"dynamic_pressure: " << dynamic_pressure ); + SG_LOG(SG_FLIGHT,SG_INFO,"static_temperature: " << static_temperature ); + SG_LOG(SG_FLIGHT,SG_INFO,"total_temperature: " << total_temperature ); + SG_LOG(SG_FLIGHT,SG_INFO,"sea_level_radius: " << sea_level_radius ); + SG_LOG(SG_FLIGHT,SG_INFO,"earth_position_angle: " << earth_position_angle ); + SG_LOG(SG_FLIGHT,SG_INFO,"runway_altitude: " << runway_altitude ); + SG_LOG(SG_FLIGHT,SG_INFO,"runway_latitude: " << runway_latitude ); + SG_LOG(SG_FLIGHT,SG_INFO,"runway_longitude: " << runway_longitude ); + SG_LOG(SG_FLIGHT,SG_INFO,"runway_heading: " << runway_heading ); + SG_LOG(SG_FLIGHT,SG_INFO,"radius_to_rwy: " << radius_to_rwy ); + SG_LOG(SG_FLIGHT,SG_INFO,"climb_rate: " << climb_rate ); + SG_LOG(SG_FLIGHT,SG_INFO,"sin_lat_geocentric: " << sin_lat_geocentric ); + SG_LOG(SG_FLIGHT,SG_INFO,"cos_lat_geocentric: " << cos_lat_geocentric ); + SG_LOG(SG_FLIGHT,SG_INFO,"sin_longitude: " << sin_longitude ); + SG_LOG(SG_FLIGHT,SG_INFO,"cos_longitude: " << cos_longitude ); + SG_LOG(SG_FLIGHT,SG_INFO,"sin_latitude: " << sin_latitude ); + SG_LOG(SG_FLIGHT,SG_INFO,"cos_latitude: " << cos_latitude ); + SG_LOG(SG_FLIGHT,SG_INFO,"altitude_agl: " << altitude_agl ); } diff --git a/src/GUI/apt_dlg.cxx b/src/GUI/apt_dlg.cxx index 9b6f24bf2..7f8f81fb6 100644 --- a/src/GUI/apt_dlg.cxx +++ b/src/GUI/apt_dlg.cxx @@ -72,7 +72,7 @@ void AptDialog_OK (puObject *) if ( AptId.length() ) { // set initial position from airport id - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Attempting to set starting position from airport code " << AptId ); diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 149420a16..7d1a37852 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -209,10 +209,10 @@ void SaveDialogOk(puObject*) { if (output.good() && fgSaveFlight(output)) { output.close(); mkDialog("Saved flight"); - FG_LOG(FG_INPUT, FG_INFO, "Saved flight"); + SG_LOG(SG_INPUT, SG_INFO, "Saved flight"); } else { mkDialog("Cannot save flight"); - FG_LOG(FG_INPUT, FG_ALERT, "Cannot save flight"); + SG_LOG(SG_INPUT, SG_ALERT, "Cannot save flight"); } } @@ -268,10 +268,10 @@ void LoadDialogOk(puObject *) { if (input.good() && fgLoadFlight(input)) { input.close(); mkDialog("Loaded flight"); - FG_LOG(FG_INPUT, FG_INFO, "Restored flight"); + SG_LOG(SG_INPUT, SG_INFO, "Restored flight"); } else { mkDialog("Failed to load flight"); - FG_LOG(FG_INPUT, FG_ALERT, "Cannot load flight"); + SG_LOG(SG_INPUT, SG_ALERT, "Cannot load flight"); } } @@ -328,7 +328,7 @@ void hideMenuCb (puObject *cb) void goodBye(puObject *) { - // FG_LOG( FG_INPUT, FG_ALERT, + // SG_LOG( SG_INPUT, SG_ALERT, // "Program exiting normally at user request." ); cout << "Program exiting normally at user request." << endl; diff --git a/src/GUI/mouse.cxx b/src/GUI/mouse.cxx index b868c1242..1ade9e00e 100644 --- a/src/GUI/mouse.cxx +++ b/src/GUI/mouse.cxx @@ -492,7 +492,7 @@ void guiMouseFunc(int button, int updown, int x, int y) y = _mY - (int)(offset * elevator_sensitivity); glutSetCursor(GLUT_CURSOR_CROSSHAIR); - FG_LOG( FG_INPUT, FG_INFO, "Mouse in yoke mode" ); + SG_LOG( SG_INPUT, SG_INFO, "Mouse in yoke mode" ); break; case MOUSE_YOKE: @@ -504,7 +504,7 @@ void guiMouseFunc(int button, int updown, int x, int y) Quat0(); build_rotmatrix(GuiQuat_mat, curGuiQuat); glutSetCursor(GLUT_CURSOR_LEFT_RIGHT); - FG_LOG( FG_INPUT, FG_INFO, "Mouse in view mode" ); + SG_LOG( SG_INPUT, SG_INFO, "Mouse in view mode" ); break; case MOUSE_VIEW: @@ -524,7 +524,7 @@ void guiMouseFunc(int button, int updown, int x, int y) if(!gui_menu_on) TurnCursorOff(); - FG_LOG( FG_INPUT, FG_INFO, "Mouse in pointer mode" ); + SG_LOG( SG_INPUT, SG_INFO, "Mouse in pointer mode" ); break; } glutWarpPointer( x, y ); diff --git a/src/Joystick/joystick.cxx b/src/Joystick/joystick.cxx index 303fcb6e6..36404f6c6 100644 --- a/src/Joystick/joystick.cxx +++ b/src/Joystick/joystick.cxx @@ -165,13 +165,13 @@ fgJoystickInit() { bool seen_joystick = false; - FG_LOG(FG_INPUT, FG_INFO, "Initializing joysticks"); + SG_LOG(SG_INPUT, SG_INFO, "Initializing joysticks"); for (int i = 0; i < MAX_JOYSTICKS; i++) { jsJoystick * js = new jsJoystick(i); joysticks[i].js = js; if (js->notWorking()) { - FG_LOG(FG_INPUT, FG_INFO, "Joystick " << i << " not found"); + SG_LOG(SG_INPUT, SG_INFO, "Joystick " << i << " not found"); continue; } #ifdef WIN32 @@ -188,7 +188,7 @@ fgJoystickInit() joysticks[i].naxes = naxes; joysticks[i].nbuttons = nbuttons; - FG_LOG(FG_INPUT, FG_INFO, "Initializing joystick " << i); + SG_LOG(SG_INPUT, SG_INFO, "Initializing joystick " << i); seen_joystick = true; // Set up range arrays @@ -217,19 +217,19 @@ fgJoystickInit() base += jsNames[i]; base += '/'; base += axisNames[j]; - FG_LOG(FG_INPUT, FG_INFO, " Axis " << j << ':'); + SG_LOG(SG_INPUT, SG_INFO, " Axis " << j << ':'); // Control property string name = base; name += "/control"; SGValue * value = fgGetValue(name); if (value == 0) { - FG_LOG(FG_INPUT, FG_INFO, " no control defined"); + SG_LOG(SG_INPUT, SG_INFO, " no control defined"); continue; } const string &control = value->getStringValue(); a.value = fgGetValue(control, true); - FG_LOG(FG_INPUT, FG_INFO, " using control " << control); + SG_LOG(SG_INPUT, SG_INFO, " using control " << control); // Dead band name = base; @@ -237,7 +237,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) js->setDeadBand(j, value->getDoubleValue()); - FG_LOG(FG_INPUT, FG_INFO, " dead-band is " << js->getDeadBand(j)); + SG_LOG(SG_INPUT, SG_INFO, " dead-band is " << js->getDeadBand(j)); // Offset name = base; @@ -245,7 +245,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) a.offset = value->getDoubleValue(); - FG_LOG(FG_INPUT, FG_INFO, " offset is " << a.offset); + SG_LOG(SG_INPUT, SG_INFO, " offset is " << a.offset); // Factor @@ -254,7 +254,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) a.factor = value->getDoubleValue(); - FG_LOG(FG_INPUT, FG_INFO, " factor is " << a.factor); + SG_LOG(SG_INPUT, SG_INFO, " factor is " << a.factor); // Tolerance @@ -263,7 +263,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) a.tolerance = value->getDoubleValue(); - FG_LOG(FG_INPUT, FG_INFO, " tolerance is " << a.tolerance); + SG_LOG(SG_INPUT, SG_INFO, " tolerance is " << a.tolerance); // Saturation @@ -272,7 +272,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) js->setSaturation(j, value->getDoubleValue()); - FG_LOG(FG_INPUT, FG_INFO, " saturation is " << js->getSaturation(j)); + SG_LOG(SG_INPUT, SG_INFO, " saturation is " << js->getSaturation(j)); // Minimum range name = base; @@ -280,7 +280,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) minRange[j] = value->getDoubleValue(); - FG_LOG(FG_INPUT, FG_INFO, " min-range is " << minRange[j]); + SG_LOG(SG_INPUT, SG_INFO, " min-range is " << minRange[j]); // Maximum range name = base; @@ -288,7 +288,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) maxRange[j] = value->getDoubleValue(); - FG_LOG(FG_INPUT, FG_INFO, " max-range is " << maxRange[j]); + SG_LOG(SG_INPUT, SG_INFO, " max-range is " << maxRange[j]); // Center name = base; @@ -296,7 +296,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) center[j] = value->getDoubleValue(); - FG_LOG(FG_INPUT, FG_INFO, " center is " << center[j]); + SG_LOG(SG_INPUT, SG_INFO, " center is " << center[j]); // Capture name = base; @@ -311,11 +311,11 @@ fgJoystickInit() a.capture->captured = false; a.capture->name = control; a.capture->value = fgGetValue(trimname); - FG_LOG(FG_INPUT, FG_INFO, " capture is " + SG_LOG(SG_INPUT, SG_INFO, " capture is " << value->getDoubleValue() ); } else { a.capture = NULL; - FG_LOG(FG_INPUT, FG_INFO, " capture is " + SG_LOG(SG_INPUT, SG_INFO, " capture is " << "unsupported by FDM" ); } } @@ -332,7 +332,7 @@ fgJoystickInit() base += jsNames[i]; base += '/'; base += buttonNames[j]; - FG_LOG(FG_INPUT, FG_INFO, " Button " << j << ':'); + SG_LOG(SG_INPUT, SG_INFO, " Button " << j << ':'); // Control property string name = base; @@ -340,12 +340,12 @@ fgJoystickInit() cout << "Trying name " << name << endl; SGValue * value = fgGetValue(name); if (value == 0) { - FG_LOG(FG_INPUT, FG_INFO, " no control defined"); + SG_LOG(SG_INPUT, SG_INFO, " no control defined"); continue; } const string &control = value->getStringValue(); b.value = fgGetValue(control, true); - FG_LOG(FG_INPUT, FG_INFO, " using control " << control); + SG_LOG(SG_INPUT, SG_INFO, " using control " << control); // Step name = base; @@ -353,7 +353,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) b.step = value->getDoubleValue(); - FG_LOG(FG_INPUT, FG_INFO, " step is " << b.step); + SG_LOG(SG_INPUT, SG_INFO, " step is " << b.step); // Type name = base; @@ -372,12 +372,12 @@ fgJoystickInit() b.action = button::ADJUST; b.isRepeatable = true; } else { - FG_LOG(FG_INPUT, FG_ALERT, " unknown action " << action); + SG_LOG(SG_INPUT, SG_ALERT, " unknown action " << action); action = "adjust"; b.action = button::ADJUST; b.isRepeatable = true; } - FG_LOG(FG_INPUT, FG_INFO, " action is " << action); + SG_LOG(SG_INPUT, SG_INFO, " action is " << action); // Repeatability. name = base; @@ -385,7 +385,7 @@ fgJoystickInit() value = fgGetValue(name); if (value != 0) b.isRepeatable = value->getBoolValue(); - FG_LOG(FG_INPUT, FG_INFO, (b.isRepeatable ? + SG_LOG(SG_INPUT, SG_INFO, (b.isRepeatable ? " repeatable" : " not repeatable")); } @@ -402,9 +402,9 @@ fgJoystickInit() trimmed = fgGetValue("/fdm/trim/trimmed"); if (seen_joystick) - FG_LOG(FG_INPUT, FG_INFO, "Done initializing joysticks"); + SG_LOG(SG_INPUT, SG_INFO, "Done initializing joysticks"); else - FG_LOG(FG_INPUT, FG_ALERT, "No joysticks detected"); + SG_LOG(SG_INPUT, SG_ALERT, "No joysticks detected"); return seen_joystick; } @@ -442,7 +442,7 @@ fgJoystickRead() // joystick. When a trim succeeds, the above // is true for one frame only. a.capture->captured = false; - FG_LOG( FG_GENERAL, FG_INFO, "Successful trim, capture is " << + SG_LOG( SG_GENERAL, SG_INFO, "Successful trim, capture is " << "enabled on " << a.capture->name ); } @@ -458,12 +458,12 @@ fgJoystickRead() if ( a.capture && !a.capture->captured ) { diff = js_val - a.capture->value->getDoubleValue(); - FG_LOG( FG_GENERAL, FG_INFO, a.capture->name + SG_LOG( SG_GENERAL, SG_INFO, a.capture->name << " capture: " << diff ); if ( fabs( diff ) < a.capture->tolerance ) { flag = a.value->setDoubleValue( js_val ); a.capture->captured = true; - FG_LOG(FG_GENERAL,FG_INFO, a.capture->name + SG_LOG(SG_GENERAL,SG_INFO, a.capture->name << " captured." ); } } else { @@ -472,7 +472,7 @@ fgJoystickRead() } if (!flag) - FG_LOG(FG_INPUT, FG_ALERT, "Failed to set value for joystick " + SG_LOG(SG_INPUT, SG_ALERT, "Failed to set value for joystick " << i << ", axis " << j); } @@ -541,7 +541,7 @@ fgJoystickRead() b.lastState = 0; } if (!flag) - FG_LOG(FG_INPUT, FG_ALERT, "Failed to set value for " + SG_LOG(SG_INPUT, SG_ALERT, "Failed to set value for " << jsNames[i] << ' ' << buttonNames[j]); } } diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index 588104813..c4cc0a113 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -83,7 +83,7 @@ reinit () // that's going to get clobbered // when we reinit the subsystems. - FG_LOG(FG_GENERAL, FG_INFO, "Starting BFI reinit"); + SG_LOG(SG_GENERAL, SG_INFO, "Starting BFI reinit"); // TODO: add more AP stuff bool apHeadingLock = FGBFI::getAPHeadingLock(); @@ -114,7 +114,7 @@ reinit () _needReinit = false; - FG_LOG(FG_GENERAL, FG_INFO, "Ending BFI reinit"); + SG_LOG(SG_GENERAL, SG_INFO, "Ending BFI reinit"); } // BEGIN: kludge @@ -175,7 +175,7 @@ _set_view_from_axes () void FGBFI::init () { - FG_LOG(FG_GENERAL, FG_INFO, "Starting BFI init"); + SG_LOG(SG_GENERAL, SG_INFO, "Starting BFI init"); // Simulation fgTie("/sim/aircraft-dir", getAircraftDir, setAircraftDir); @@ -219,7 +219,7 @@ FGBFI::init () _needReinit = false; - FG_LOG(FG_GENERAL, FG_INFO, "Ending BFI init"); + SG_LOG(SG_GENERAL, SG_INFO, "Ending BFI init"); } @@ -310,7 +310,7 @@ FGBFI::setDateString (string date_string) // if the save file has been edited // by hand. if (ret != 6) { - FG_LOG(FG_INPUT, FG_ALERT, "Date/time string " << date_string + SG_LOG(SG_INPUT, SG_ALERT, "Date/time string " << date_string << " not in YYYY-MM-DDTHH:MM:SS format; skipped"); return; } diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 1d6af8f5d..c303be144 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -167,7 +167,7 @@ bool fgInitFGRoot ( int argc, char **argv ) { #endif } - FG_LOG(FG_INPUT, FG_INFO, "fg_root = " << root ); + SG_LOG(SG_INPUT, SG_INFO, "fg_root = " << root ); globals->set_fg_root(root); return true; @@ -183,12 +183,12 @@ bool fgInitConfig ( int argc, char **argv ) { // Read global preferences from $FG_ROOT/preferences.xml FGPath props_path(globals->get_fg_root()); props_path.append("preferences.xml"); - FG_LOG(FG_INPUT, FG_INFO, "Reading global preferences"); + SG_LOG(SG_INPUT, SG_INFO, "Reading global preferences"); if (!readProperties(props_path.str(), globals->get_props())) { - FG_LOG(FG_INPUT, FG_ALERT, "Failed to read global preferences from " + SG_LOG(SG_INPUT, SG_ALERT, "Failed to read global preferences from " << props_path.str()); } else { - FG_LOG(FG_INPUT, FG_INFO, "Finished Reading global preferences"); + SG_LOG(SG_INPUT, SG_INFO, "Finished Reading global preferences"); } // Attempt to locate and parse the various config files in order @@ -240,10 +240,10 @@ bool fgFindAirportID( const string& id, FGAirport *a ) { path.append( "simple.mk4" ); FGAirports airports( path.c_str() ); - FG_LOG( FG_GENERAL, FG_INFO, "Searching for airport code = " << id ); + SG_LOG( SG_GENERAL, SG_INFO, "Searching for airport code = " << id ); if ( ! airports.search( id, a ) ) { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Failed to find " << id << " in " << path.str() ); return false; } @@ -251,7 +251,7 @@ bool fgFindAirportID( const string& id, FGAirport *a ) { return false; } - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Position for " << id << " is (" << a->longitude << ", " << a->latitude << ")" ); @@ -265,13 +265,13 @@ bool fgSetPosFromAirportID( const string& id ) { FGAirport a; // double lon, lat; - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Attempting to set starting position from airport code " << id ); if ( fgFindAirportID( id, &a ) ) { fgSetDouble("/position/longitude", a.longitude ); fgSetDouble("/position/latitude", a.latitude ); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Position for " << id << " is (" << a.longitude << ", " << a.latitude << ")" ); @@ -298,7 +298,7 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) { path.append( "runways.mk4" ); FGRunways runways( path.c_str() ); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Attempting to set starting position from runway code " << id << " heading " << tgt_hdg ); @@ -313,7 +313,7 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) { // airports.dump_gdbm( outpath.c_str() ); if ( ! runways.search( id, &r ) ) { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Failed to find " << id << " in database." ); return false; } @@ -327,7 +327,7 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) { while ( diff < -180.0 ) { diff += 360.0; } while ( diff > 180.0 ) { diff -= 360.0; } diff = fabs(diff); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Runway " << r.rwy_no << " heading = " << r.heading << " diff = " << diff ); if ( diff < min_diff ) { @@ -341,7 +341,7 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) { while ( diff < -180.0 ) { diff += 360.0; } while ( diff > 180.0 ) { diff -= 360.0; } diff = fabs(diff); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Runway -" << r.rwy_no << " heading = " << r.heading + 180.0 << " diff = " << diff ); @@ -354,7 +354,7 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) { runways.next( &r ); } - FG_LOG( FG_GENERAL, FG_INFO, "closest runway = " << found_r.rwy_no + SG_LOG( SG_GENERAL, SG_INFO, "closest runway = " << found_r.rwy_no << " + " << found_dir ); } else { @@ -368,7 +368,7 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) { double azimuth = found_r.heading + found_dir + 180.0; while ( azimuth >= 360.0 ) { azimuth -= 360.0; } - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "runway = " << found_r.lon << ", " << found_r.lat << " length = " << found_r.length * SG_FEET_TO_METER * 0.5 << " heading = " << azimuth ); @@ -394,7 +394,7 @@ bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) { fgSetDouble("/position/latitude", lat2 ); fgSetDouble("/orientation/heading", heading ); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Position for " << id << " is (" << lon2 << ", " << lat2 << ") new heading is " @@ -413,9 +413,9 @@ bool fgInitPosition( void ) { f->set_Longitude( fgGetDouble("/position/longitude") * SGD_DEGREES_TO_RADIANS ); f->set_Latitude( fgGetDouble("/position/latitude") * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "scenery.cur_elev = " << scenery.cur_elev ); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "/position/altitude = " << fgGetDouble("/position/altitude") ); // if we requested on ground startups @@ -431,12 +431,12 @@ bool fgInitPosition( void ) { (scenery.cur_elev + 1) * METERS_TO_FEET ); } - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "starting altitude is = " << fgGetDouble("/position/altitude") ); f->set_Altitude( fgGetDouble("/position/altitude") ); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Initial position is: (" << (f->get_Longitude() * SGD_RADIANS_TO_DEGREES) << ", " << (f->get_Latitude() * SGD_RADIANS_TO_DEGREES) << ", " @@ -454,18 +454,18 @@ bool fgInitGeneral( void ) { char *mesa_win_state; #endif - FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" ); - FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" ); + SG_LOG( SG_GENERAL, SG_INFO, "General Initialization" ); + SG_LOG( SG_GENERAL, SG_INFO, "======= ==============" ); root = globals->get_fg_root(); if ( ! root.length() ) { // No root path set? Then bail ... - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot continue without environment variable FG_ROOT" << "being defined." ); exit(-1); } - FG_LOG( FG_GENERAL, FG_INFO, "FG_ROOT = " << '"' << root << '"' << endl ); + SG_LOG( SG_GENERAL, SG_INFO, "FG_ROOT = " << '"' << root << '"' << endl ); #if defined(FX) && defined(XMESA) // initialize full screen flag @@ -513,7 +513,7 @@ fgVelocityInit( void ) fgGetDouble("/velocities/speed-east"), fgGetDouble("/velocities/speed-down")); } else { - FG_LOG(FG_GENERAL, FG_ALERT, + SG_LOG(SG_GENERAL, SG_ALERT, "Unrecognized value for /sim/startup/speed-set: " << speedset); current_aircraft.fdm_state->set_V_calibrated_kts(0.0); } @@ -527,15 +527,15 @@ fgVelocityInit( void ) bool fgInitSubsystems( void ) { fgLIGHT *l = &cur_light_params; - FG_LOG( FG_GENERAL, FG_INFO, "Initialize Subsystems"); - FG_LOG( FG_GENERAL, FG_INFO, "========== =========="); + SG_LOG( SG_GENERAL, SG_INFO, "Initialize Subsystems"); + SG_LOG( SG_GENERAL, SG_INFO, "========== =========="); // Initialize the material property lib FGPath mpath( globals->get_fg_root() ); mpath.append( "materials" ); if ( material_lib.load( mpath.str() ) ) { } else { - FG_LOG( FG_GENERAL, FG_ALERT, "Error loading material lib!" ); + SG_LOG( SG_GENERAL, SG_ALERT, "Error loading material lib!" ); exit(-1); } @@ -543,7 +543,7 @@ bool fgInitSubsystems( void ) { if ( fgSceneryInit() ) { // Material lib initialized ok. } else { - FG_LOG( FG_GENERAL, FG_ALERT, "Error in Scenery initialization!" ); + SG_LOG( SG_GENERAL, SG_ALERT, "Error in Scenery initialization!" ); exit(-1); } @@ -552,11 +552,11 @@ bool fgInitSubsystems( void ) { global_tile_mgr.update( fgGetDouble("/position/longitude"), fgGetDouble("/position/latitude") ); } else { - FG_LOG( FG_GENERAL, FG_ALERT, "Error in Tile Manager initialization!" ); + SG_LOG( SG_GENERAL, SG_ALERT, "Error in Tile Manager initialization!" ); exit(-1); } - FG_LOG( FG_GENERAL, FG_DEBUG, + SG_LOG( SG_GENERAL, SG_DEBUG, "Current terrain elevation after tile mgr init " << scenery.cur_elev ); @@ -578,7 +578,7 @@ bool fgInitSubsystems( void ) { } else if (model == "external") { cur_fdm_state = new FGExternal( dt ); } else { - FG_LOG(FG_GENERAL, FG_ALERT, + SG_LOG(SG_GENERAL, SG_ALERT, "Unrecognized flight model '" << model << ", can't init aircraft"); exit(-1); @@ -607,9 +607,9 @@ bool fgInitSubsystems( void ) { // now handled inside of the fgTileMgrUpdate() // Reset our altitude if we are below ground - FG_LOG( FG_GENERAL, FG_DEBUG, "Current altitude = " + SG_LOG( SG_GENERAL, SG_DEBUG, "Current altitude = " << cur_fdm_state->get_Altitude() ); - FG_LOG( FG_GENERAL, FG_DEBUG, "Current runway altitude = " << + SG_LOG( SG_GENERAL, SG_DEBUG, "Current runway altitude = " << cur_fdm_state->get_Runway_altitude() ); if ( cur_fdm_state->get_Altitude() < cur_fdm_state->get_Runway_altitude() + @@ -618,7 +618,7 @@ bool fgInitSubsystems( void ) { 3.758099 ); } - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Updated position (after elevation adj): (" << (cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES) << ", " << (cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES) << ", " @@ -679,7 +679,7 @@ bool fgInitSubsystems( void ) { // set current view to 0 (first) which is our main pilot view globals->set_current_view( pilot_view ); - FG_LOG( FG_GENERAL, FG_DEBUG, " abs_view_pos = " + SG_LOG( SG_GENERAL, SG_DEBUG, " abs_view_pos = " << globals->get_current_view()->get_abs_view_pos()); // fgUpdateSunPos() needs a few position and view parameters set @@ -707,7 +707,7 @@ bool fgInitSubsystems( void ) { // Initialize the weather modeling subsystem #ifndef FG_OLD_WEATHER // Initialize the WeatherDatabase - FG_LOG(FG_GENERAL, FG_INFO, "Creating LocalWeatherDatabase"); + SG_LOG(SG_GENERAL, SG_INFO, "Creating LocalWeatherDatabase"); sgVec3 position; sgSetVec3( position, current_aircraft.fdm_state->get_Latitude(), current_aircraft.fdm_state->get_Longitude(), @@ -734,15 +734,15 @@ bool fgInitSubsystems( void ) { #endif // Initialize vor/ndb/ils/fix list management and query systems - FG_LOG(FG_GENERAL, FG_INFO, "Loading Navaids"); + SG_LOG(SG_GENERAL, SG_INFO, "Loading Navaids"); - FG_LOG(FG_GENERAL, FG_INFO, " VOR/NDB"); + SG_LOG(SG_GENERAL, SG_INFO, " VOR/NDB"); current_navlist = new FGNavList; FGPath p_nav( globals->get_fg_root() ); p_nav.append( "Navaids/default.nav" ); current_navlist->init( p_nav ); - FG_LOG(FG_GENERAL, FG_INFO, " ILS and Marker Beacons"); + SG_LOG(SG_GENERAL, SG_INFO, " ILS and Marker Beacons"); current_beacons = new FGMarkerBeacons; current_beacons->init(); current_ilslist = new FGILSList; @@ -750,7 +750,7 @@ bool fgInitSubsystems( void ) { p_ils.append( "Navaids/default.ils" ); current_ilslist->init( p_ils ); - FG_LOG(FG_GENERAL, FG_INFO, " Fixes"); + SG_LOG(SG_GENERAL, SG_INFO, " Fixes"); current_fixlist = new FGFixList; FGPath p_fix( globals->get_fg_root() ); p_fix.append( "Navaids/default.fix" ); @@ -765,7 +765,7 @@ bool fgInitSubsystems( void ) { if( fgCockpitInit( ¤t_aircraft )) { // Cockpit initialized ok. } else { - FG_LOG( FG_GENERAL, FG_ALERT, "Error in Cockpit initialization!" ); + SG_LOG( SG_GENERAL, SG_ALERT, "Error in Cockpit initialization!" ); exit(-1); } @@ -777,7 +777,7 @@ bool fgInitSubsystems( void ) { // if ( cur_fdm_state->init( 1.0 / fgGetInt("/sim/model-hz") ) ) { // // fdm init successful // } else { -// FG_LOG( FG_GENERAL, FG_ALERT, "FDM init() failed! Cannot continue." ); +// SG_LOG( SG_GENERAL, SG_ALERT, "FDM init() failed! Cannot continue." ); // exit(-1); // } @@ -792,7 +792,7 @@ bool fgInitSubsystems( void ) { 3.758099 ); } - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Updated position (after elevation adj): (" << (cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES) << ", " << (cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES) << ", " @@ -802,7 +802,7 @@ bool fgInitSubsystems( void ) { // Joystick support if ( ! fgJoystickInit() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Error in Joystick initialization!" ); + SG_LOG( SG_GENERAL, SG_ALERT, "Error in Joystick initialization!" ); } // Autopilot init @@ -825,10 +825,10 @@ bool fgInitSubsystems( void ) { "Panels/Default/default.xml"); current_panel = fgReadPanel(panel_path); if (current_panel == 0) { - FG_LOG( FG_INPUT, FG_ALERT, + SG_LOG( SG_INPUT, SG_ALERT, "Error reading new panel from " << panel_path ); } else { - FG_LOG( FG_INPUT, FG_INFO, "Loaded new panel from " << panel_path ); + SG_LOG( SG_INPUT, SG_INFO, "Loaded new panel from " << panel_path ); current_panel->init(); current_panel->bind(); } @@ -839,7 +839,7 @@ bool fgInitSubsystems( void ) { controls.init(); controls.bind(); - FG_LOG( FG_GENERAL, FG_INFO, endl); + SG_LOG( SG_GENERAL, SG_INFO, endl); // Save the initial state for future // reference. @@ -851,7 +851,7 @@ bool fgInitSubsystems( void ) { void fgReInitSubsystems( void ) { - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "/position/altitude = " << fgGetDouble("/position/altitude") ); bool freeze = globals->get_freeze(); @@ -860,7 +860,7 @@ void fgReInitSubsystems( void ) // Initialize the Scenery Management subsystem if ( ! fgSceneryInit() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Error in Scenery initialization!" ); + SG_LOG( SG_GENERAL, SG_ALERT, "Error in Scenery initialization!" ); exit(-1); } @@ -869,7 +869,7 @@ void fgReInitSubsystems( void ) global_tile_mgr.update( fgGetDouble("/position/longitude"), fgGetDouble("/position/latitude") ); } else { - FG_LOG( FG_GENERAL, FG_ALERT, "Error in Tile Manager initialization!" ); + SG_LOG( SG_GENERAL, SG_ALERT, "Error in Tile Manager initialization!" ); exit(-1); } @@ -880,9 +880,9 @@ void fgReInitSubsystems( void ) fgInitPosition(); // Reset our altitude if we are below ground - FG_LOG( FG_GENERAL, FG_DEBUG, "Current altitude = " + SG_LOG( SG_GENERAL, SG_DEBUG, "Current altitude = " << cur_fdm_state->get_Altitude() ); - FG_LOG( FG_GENERAL, FG_DEBUG, "Current runway altitude = " + SG_LOG( SG_GENERAL, SG_DEBUG, "Current runway altitude = " << cur_fdm_state->get_Runway_altitude() ); if ( cur_fdm_state->get_Altitude() < @@ -930,7 +930,7 @@ void fgReInitSubsystems( void ) // set current view to 0 (first) which is our main pilot view globals->set_current_view( pilot_view ); - FG_LOG( FG_GENERAL, FG_DEBUG, " abs_view_pos = " + SG_LOG( SG_GENERAL, SG_DEBUG, " abs_view_pos = " << globals->get_current_view()->get_abs_view_pos()); cur_fdm_state->init(); diff --git a/src/Main/fg_io.cxx b/src/Main/fg_io.cxx index 6c9e5e8cb..4a75a78fb 100644 --- a/src/Main/fg_io.cxx +++ b/src/Main/fg_io.cxx @@ -60,7 +60,7 @@ static FGProtocol *parse_port_config( const string& config ) begin = 0; - FG_LOG( FG_IO, FG_INFO, "Parse I/O channel request: " << config ); + SG_LOG( SG_IO, SG_INFO, "Parse I/O channel request: " << config ); // determine protocol end = config.find(",", begin); @@ -70,7 +70,7 @@ static FGProtocol *parse_port_config( const string& config ) string protocol = config.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " protocol = " << protocol ); + SG_LOG( SG_IO, SG_INFO, " protocol = " << protocol ); FGProtocol *io; if ( protocol == "atlas" ) { @@ -112,7 +112,7 @@ static FGProtocol *parse_port_config( const string& config ) string medium = config.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " medium = " << medium ); + SG_LOG( SG_IO, SG_INFO, " medium = " << medium ); // determine direction end = config.find(",", begin); @@ -123,7 +123,7 @@ static FGProtocol *parse_port_config( const string& config ) string direction = config.substr(begin, end - begin); begin = end + 1; io->set_direction( direction ); - FG_LOG( FG_IO, FG_INFO, " direction = " << direction ); + SG_LOG( SG_IO, SG_INFO, " direction = " << direction ); // determine hertz end = config.find(",", begin); @@ -135,7 +135,7 @@ static FGProtocol *parse_port_config( const string& config ) begin = end + 1; double hertz = atof( hertz_str.c_str() ); io->set_hz( hertz ); - FG_LOG( FG_IO, FG_INFO, " hertz = " << hertz ); + SG_LOG( SG_IO, SG_INFO, " hertz = " << hertz ); if ( medium == "serial" ) { // device name @@ -146,18 +146,18 @@ static FGProtocol *parse_port_config( const string& config ) string device = config.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " device = " << device ); + SG_LOG( SG_IO, SG_INFO, " device = " << device ); // baud string baud = config.substr(begin); - FG_LOG( FG_IO, FG_INFO, " baud = " << baud ); + SG_LOG( SG_IO, SG_INFO, " baud = " << baud ); SGSerial *ch = new SGSerial( device, baud ); io->set_io_channel( ch ); } else if ( medium == "file" ) { // file name string file = config.substr(begin); - FG_LOG( FG_IO, FG_INFO, " file name = " << file ); + SG_LOG( SG_IO, SG_INFO, " file name = " << file ); SGFile *ch = new SGFile( file ); io->set_io_channel( ch ); @@ -170,7 +170,7 @@ static FGProtocol *parse_port_config( const string& config ) string hostname = config.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " hostname = " << hostname ); + SG_LOG( SG_IO, SG_INFO, " hostname = " << hostname ); // port string end = config.find(",", begin); @@ -180,11 +180,11 @@ static FGProtocol *parse_port_config( const string& config ) string port = config.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " port string = " << port ); + SG_LOG( SG_IO, SG_INFO, " port string = " << port ); // socket style string style_str = config.substr(begin); - FG_LOG( FG_IO, FG_INFO, " style string = " << style_str ); + SG_LOG( SG_IO, SG_INFO, " style string = " << style_str ); SGSocket *ch = new SGSocket( hostname, port, style_str ); io->set_io_channel( ch ); @@ -197,7 +197,7 @@ static FGProtocol *parse_port_config( const string& config ) // step through the port config streams (from fgOPTIONS) and setup // serial port channels for each void fgIOInit() { - // FG_LOG( FG_IO, FG_INFO, "I/O Channel initialization, " << + // SG_LOG( SG_IO, SG_INFO, "I/O Channel initialization, " << // globals->get_channel_options_list()->size() << " requests." ); FGProtocol *p; @@ -215,11 +215,11 @@ void fgIOInit() { p->open(); global_io_list.push_back( p ); if ( !p->is_enabled() ) { - FG_LOG( FG_IO, FG_ALERT, "I/O Channel config failed." ); + SG_LOG( SG_IO, SG_ALERT, "I/O Channel config failed." ); exit(-1); } } else { - FG_LOG( FG_IO, FG_INFO, "I/O Channel parse failed." ); + SG_LOG( SG_IO, SG_INFO, "I/O Channel parse failed." ); } } } diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index 30c337e9a..713c5178a 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -52,7 +52,7 @@ fgLoadFlight (istream &input) // new initial state. globals->saveInitialState(); } else { - FG_LOG(FG_INPUT, FG_ALERT, "Error restoring flight; aborted"); + SG_LOG(SG_INPUT, SG_ALERT, "Error restoring flight; aborted"); return false; } } diff --git a/src/Main/fg_props.hxx b/src/Main/fg_props.hxx index be9e68788..0b52d0c94 100644 --- a/src/Main/fg_props.hxx +++ b/src/Main/fg_props.hxx @@ -95,7 +95,7 @@ inline void fgUntie (const string &name) { if (!globals->get_props()->untie(name)) - FG_LOG(FG_GENERAL, FG_WARN, "Failed to untie property " << name); + SG_LOG(SG_GENERAL, SG_WARN, "Failed to untie property " << name); } @@ -105,7 +105,7 @@ fgTie (const string &name, bool *pointer, bool useDefault = true) { if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), useDefault)) - FG_LOG(FG_GENERAL, FG_WARN, + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } @@ -114,7 +114,7 @@ fgTie (const string &name, int *pointer, bool useDefault = true) { if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), useDefault)) - FG_LOG(FG_GENERAL, FG_WARN, + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } @@ -123,7 +123,7 @@ fgTie (const string &name, float *pointer, bool useDefault = true) { if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), useDefault)) - FG_LOG(FG_GENERAL, FG_WARN, + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } @@ -132,7 +132,7 @@ fgTie (const string &name, double *pointer, bool useDefault = true) { if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), useDefault)) - FG_LOG(FG_GENERAL, FG_WARN, + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } @@ -141,7 +141,7 @@ fgTie (const string &name, string *pointer, bool useDefault = true) { if (!globals->get_props()->tie(name, SGRawValuePointer(pointer), useDefault)) - FG_LOG(FG_GENERAL, FG_WARN, + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to a pointer"); } @@ -152,7 +152,7 @@ fgTie (const string &name, V (*getter)(), void (*setter)(V) = 0, { if (!globals->get_props()->tie(name, SGRawValueFunctions(getter, setter), useDefault)) - FG_LOG(FG_GENERAL, FG_WARN, + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to functions"); } @@ -166,7 +166,7 @@ fgTie (const string &name, int index, V (*getter)(int), getter, setter), useDefault)) - FG_LOG(FG_GENERAL, FG_WARN, + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to indexed functions"); } @@ -178,7 +178,7 @@ fgTie (const string &name, T * obj, V (T::*getter)() const, if (!globals->get_props()->tie(name, SGRawValueMethods(*obj, getter, setter), useDefault)) - FG_LOG(FG_GENERAL, FG_WARN, + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to object methods"); } @@ -194,7 +194,7 @@ fgTie (const string &name, T * obj, int index, getter, setter), useDefault)) - FG_LOG(FG_GENERAL, FG_WARN, + SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << name << " to indexed object methods"); } diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 312dc0b81..b271b2d7b 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -59,7 +59,7 @@ FGGlobals::saveInitialState () delete initial_state; initial_state = new SGPropertyNode(); if (!copyProperties(props, initial_state)) - FG_LOG(FG_GENERAL, FG_ALERT, "Error saving initial state"); + SG_LOG(SG_GENERAL, SG_ALERT, "Error saving initial state"); } @@ -68,12 +68,12 @@ void FGGlobals::restoreInitialState () { if (initial_state == 0) { - FG_LOG(FG_GENERAL, FG_ALERT, "No initial state available to restore!!!"); + SG_LOG(SG_GENERAL, SG_ALERT, "No initial state available to restore!!!"); } else if (!copyProperties(initial_state, props)) { - FG_LOG(FG_GENERAL, FG_INFO, + SG_LOG(SG_GENERAL, SG_INFO, "Some errors restoring initial state (probably just read-only props)"); } else { - FG_LOG(FG_GENERAL, FG_INFO, "Initial state restored successfully"); + SG_LOG(SG_GENERAL, SG_INFO, "Initial state restored successfully"); } } diff --git a/src/Main/keyboard.cxx b/src/Main/keyboard.cxx index 97783590c..9031d8482 100644 --- a/src/Main/keyboard.cxx +++ b/src/Main/keyboard.cxx @@ -85,13 +85,13 @@ void GLUTkey(unsigned char k, int x, int y) { FGInterface *f = current_aircraft.fdm_state; FGViewer *v = globals->get_current_view(); - FG_LOG( FG_INPUT, FG_DEBUG, "Key hit = " << k ); + SG_LOG( SG_INPUT, SG_DEBUG, "Key hit = " << k ); if ( puKeyboard(k, PU_DOWN) ) { return; } if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) { - FG_LOG( FG_INPUT, FG_DEBUG, " SHIFTED" ); + SG_LOG( SG_INPUT, SG_DEBUG, " SHIFTED" ); switch (k) { case 1: // Ctrl-A key current_autopilot->set_AltitudeMode( @@ -237,7 +237,7 @@ void GLUTkey(unsigned char k, int x, int y) { return; } } else { - FG_LOG( FG_INPUT, FG_DEBUG, "" ); + SG_LOG( SG_INPUT, SG_DEBUG, "" ); switch (k) { case 50: // numeric keypad 2 if ( current_autopilot->get_AltitudeEnabled() ) { @@ -300,12 +300,12 @@ void GLUTkey(unsigned char k, int x, int y) { return; case 91: // [ key controls.move_flaps(-0.34); - FG_LOG( FG_INPUT, FG_INFO, + SG_LOG( SG_INPUT, SG_INFO, "Set flaps to " << controls.get_flaps() ); return; case 93: // ] key controls.move_flaps(0.34); - FG_LOG( FG_INPUT, FG_INFO, + SG_LOG( SG_INPUT, SG_INFO, "Set flaps to " << controls.get_flaps() ); return; case 97: // a key @@ -356,16 +356,16 @@ void GLUTkey(unsigned char k, int x, int y) { tile_path.append( p.gen_index_str() ); // printf position and attitude information - FG_LOG( FG_INPUT, FG_INFO, + SG_LOG( SG_INPUT, SG_INFO, "Lon = " << f->get_Longitude() * SGD_RADIANS_TO_DEGREES << " Lat = " << f->get_Latitude() * SGD_RADIANS_TO_DEGREES << " Altitude = " << f->get_Altitude() * SG_FEET_TO_METER ); - FG_LOG( FG_INPUT, FG_INFO, + SG_LOG( SG_INPUT, SG_INFO, "Heading = " << f->get_Psi() * SGD_RADIANS_TO_DEGREES << " Roll = " << f->get_Phi() * SGD_RADIANS_TO_DEGREES << " Pitch = " << f->get_Theta() * SGD_RADIANS_TO_DEGREES ); - FG_LOG( FG_INPUT, FG_INFO, tile_path.c_str()); + SG_LOG( SG_INPUT, SG_INFO, tile_path.c_str()); } return; case 116: // t key @@ -403,7 +403,7 @@ void GLUTkey(unsigned char k, int x, int y) { // if( fg_DebugOutput ) { // fclose( fg_DebugOutput ); // } - FG_LOG( FG_INPUT, FG_ALERT, + SG_LOG( SG_INPUT, SG_ALERT, "Program exit requested." ); ConfirmExitDialog(); return; @@ -416,35 +416,35 @@ void GLUTkey(unsigned char k, int x, int y) { void GLUTspecialkey(int k, int x, int y) { FGViewer *v = globals->get_current_view(); - FG_LOG( FG_INPUT, FG_DEBUG, "Special key hit = " << k ); + SG_LOG( SG_INPUT, SG_DEBUG, "Special key hit = " << k ); if ( puKeyboard(k + PU_KEY_GLUT_SPECIAL_OFFSET, PU_DOWN) ) { return; } if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) { - FG_LOG( FG_INPUT, FG_DEBUG, " SHIFTED" ); + SG_LOG( SG_INPUT, SG_DEBUG, " SHIFTED" ); switch (k) { case GLUT_KEY_F1: { ifstream input("fgfs.sav"); if (input.good() && fgLoadFlight(input)) { input.close(); - FG_LOG(FG_INPUT, FG_INFO, "Restored flight from fgfs.sav"); + SG_LOG(SG_INPUT, SG_INFO, "Restored flight from fgfs.sav"); } else { - FG_LOG(FG_INPUT, FG_ALERT, "Cannot load flight from fgfs.sav"); + SG_LOG(SG_INPUT, SG_ALERT, "Cannot load flight from fgfs.sav"); } return; } case GLUT_KEY_F2: { - FG_LOG(FG_INPUT, FG_INFO, "Saving flight"); + SG_LOG(SG_INPUT, SG_INFO, "Saving flight"); cerr << "Opening output stream" << endl; ofstream output("fgfs.sav"); cerr << "output stream opened" << endl; if (output.good() && fgSaveFlight(output)) { output.close(); - FG_LOG(FG_INPUT, FG_INFO, "Saved flight to fgfs.sav"); + SG_LOG(SG_INPUT, SG_INFO, "Saved flight to fgfs.sav"); } else { - FG_LOG(FG_INPUT, FG_ALERT, "Cannot save flight to fgfs.sav"); + SG_LOG(SG_INPUT, SG_ALERT, "Cannot save flight to fgfs.sav"); } return; } @@ -453,11 +453,11 @@ void GLUTspecialkey(int k, int x, int y) { fgGetString("/sim/panel/path", "Panels/Default/default.xml"); FGPanel * new_panel = fgReadPanel(panel_path); if (new_panel == 0) { - FG_LOG(FG_INPUT, FG_ALERT, + SG_LOG(SG_INPUT, SG_ALERT, "Error reading new panel from " << panel_path); return; } - FG_LOG(FG_INPUT, FG_INFO, "Loaded new panel from " << panel_path); + SG_LOG(SG_INPUT, SG_INFO, "Loaded new panel from " << panel_path); current_panel->unbind(); delete current_panel; current_panel = new_panel; @@ -466,13 +466,13 @@ void GLUTspecialkey(int k, int x, int y) { case GLUT_KEY_F4: { FGPath props_path(globals->get_fg_root()); props_path.append("preferences.xml"); - FG_LOG(FG_INPUT, FG_INFO, "Rereading global preferences"); + SG_LOG(SG_INPUT, SG_INFO, "Rereading global preferences"); if (!readProperties(props_path.str(), globals->get_props())) { - FG_LOG(FG_INPUT, FG_ALERT, + SG_LOG(SG_INPUT, SG_ALERT, "Failed to reread global preferences from " << props_path.str()); } else { - FG_LOG(FG_INPUT, FG_INFO, "Finished Reading global preferences"); + SG_LOG(SG_INPUT, SG_INFO, "Finished Reading global preferences"); } return; } @@ -522,12 +522,12 @@ void GLUTspecialkey(int k, int x, int y) { return; } } else { - FG_LOG( FG_INPUT, FG_DEBUG, "" ); + SG_LOG( SG_INPUT, SG_DEBUG, "" ); switch (k) { case GLUT_KEY_F2: // F2 Reload Tile Cache... { bool freeze = globals->get_freeze(); - FG_LOG(FG_INPUT, FG_INFO, "ReIniting TileCache"); + SG_LOG(SG_INPUT, SG_INFO, "ReIniting TileCache"); if ( !freeze ) globals->set_freeze( true ); BusyCursor(0); @@ -537,7 +537,7 @@ void GLUTspecialkey(int k, int x, int y) { cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES, cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES ); } else { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Error in Tile Manager initialization!" ); exit(-1); } @@ -566,22 +566,22 @@ void GLUTspecialkey(int k, int x, int y) { const string &fog = fgGetString("/sim/rendering/fog"); if (fog == "disabled") { fgSetString("/sim/rendering/fog", "fastest"); - FG_LOG(FG_INPUT, FG_INFO, "Fog enabled, hint=fastest"); + SG_LOG(SG_INPUT, SG_INFO, "Fog enabled, hint=fastest"); } else if (fog == "fastest") { fgSetString("/sim/rendering/fog", "nicest"); - FG_LOG(FG_INPUT, FG_INFO, "Fog enabled, hint=nicest"); + SG_LOG(SG_INPUT, SG_INFO, "Fog enabled, hint=nicest"); } else if (fog == "nicest") { fgSetString("/sim/rendering/fog", "disabled"); - FG_LOG(FG_INPUT, FG_INFO, "Fog disabled"); + SG_LOG(SG_INPUT, SG_INFO, "Fog disabled"); } else { fgSetString("/sim/rendering/fog", "disabled"); - FG_LOG(FG_INPUT, FG_ALERT, "Unrecognized fog type " + SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized fog type " << fog << ", changed to 'disabled'"); } return; } case GLUT_KEY_F9: // F9 toggles textures on and off... - FG_LOG( FG_INPUT, FG_INFO, "Toggling texture" ); + SG_LOG( SG_INPUT, SG_INFO, "Toggling texture" ); if ( fgGetBool("/sim/rendering/textures")) { fgSetBool("/sim/rendering/textures", false); material_lib.set_step( 1 ); @@ -591,15 +591,15 @@ void GLUTspecialkey(int k, int x, int y) { } return; case GLUT_KEY_F10: // F10 toggles menu on and off... - FG_LOG(FG_INPUT, FG_INFO, "Invoking call back function"); + SG_LOG(SG_INPUT, SG_INFO, "Invoking call back function"); guiToggleMenu(); return; case GLUT_KEY_F11: // F11 Altitude Dialog. - FG_LOG(FG_INPUT, FG_INFO, "Invoking Altitude call back function"); + SG_LOG(SG_INPUT, SG_INFO, "Invoking Altitude call back function"); NewAltitude( NULL ); return; case GLUT_KEY_F12: // F12 Heading Dialog... - FG_LOG(FG_INPUT, FG_INFO, "Invoking Heading call back function"); + SG_LOG(SG_INPUT, SG_INFO, "Invoking Heading call back function"); NewHeading( NULL ); return; case GLUT_KEY_UP: diff --git a/src/Main/main.cxx b/src/Main/main.cxx index dffaf41b2..b363ed314 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -590,7 +590,7 @@ void fgRenderFrame( void ) { double agl = current_aircraft.fdm_state->get_Altitude() * SG_FEET_TO_METER - scenery.cur_elev; - // FG_LOG( FG_ALL, FG_INFO, "visibility is " + // SG_LOG( SG_ALL, SG_INFO, "visibility is " // << current_weather.get_visibility() ); if ( agl > 10.0 ) { @@ -875,8 +875,8 @@ static void fgMainLoop( void ) { SGTime *t = globals->get_time_params(); - FG_LOG( FG_ALL, FG_DEBUG, "Running Main Loop"); - FG_LOG( FG_ALL, FG_DEBUG, "======= ==== ===="); + SG_LOG( SG_ALL, SG_DEBUG, "Running Main Loop"); + SG_LOG( SG_ALL, SG_DEBUG, "======= ==== ===="); #ifdef FG_NETWORK_OLK if ( fgGetBool("/sim/networking/network-olk") ) { @@ -923,7 +923,7 @@ static void fgMainLoop( void ) { fgFDMForceAltitude( fgGetString("/sim/flight-model"), scenery.cur_elev + alt_adjust_m ); - FG_LOG( FG_ALL, FG_DEBUG, + SG_LOG( SG_ALL, SG_DEBUG, "<*> resetting altitude to " << cur_fdm_state->get_Altitude() * SG_FEET_TO_METER << " meters" ); @@ -956,7 +956,7 @@ static void fgMainLoop( void ) { // Get elapsed time (in usec) for this past frame elapsed = fgGetTimeInterval(); - FG_LOG( FG_ALL, FG_DEBUG, + SG_LOG( SG_ALL, SG_DEBUG, "Elapsed time interval is = " << elapsed << ", previous remainder is = " << remainder ); @@ -982,7 +982,7 @@ static void fgMainLoop( void ) { #else if ( (t->get_cur_time() != last_time) && (last_time > 0) ) { general.set_frame_rate( frames ); - FG_LOG( FG_ALL, FG_DEBUG, + SG_LOG( SG_ALL, SG_DEBUG, "--> Frame rate is = " << general.get_frame_rate() ); frames = 0; } @@ -999,7 +999,7 @@ static void fgMainLoop( void ) { fgGetInt("/sim/model-hz")); remainder = elapsed - ( (global_multi_loop*1000000) / fgGetInt("/sim/model-hz") ); - FG_LOG( FG_ALL, FG_DEBUG, + SG_LOG( SG_ALL, SG_DEBUG, "Model iterations needed = " << global_multi_loop << ", new remainder = " << remainder ); @@ -1014,7 +1014,7 @@ static void fgMainLoop( void ) { if ( global_multi_loop > 0 ) { fgUpdateTimeDepCalcs(); } else { - FG_LOG( FG_ALL, FG_DEBUG, + SG_LOG( SG_ALL, SG_DEBUG, "Elapsed time is zero ... we're zinging" ); } @@ -1088,7 +1088,7 @@ static void fgMainLoop( void ) { // redraw display fgRenderFrame(); - FG_LOG( FG_ALL, FG_DEBUG, "" ); + SG_LOG( SG_ALL, SG_DEBUG, "" ); } @@ -1121,7 +1121,7 @@ static void fgIdleFunction ( void ) { string command = "(touch " + lockfile + "; mpg123 " + mp3file.str() + "> /dev/null 2>&1; /bin/rm " + lockfile + ") &"; - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Starting intro music: " << mp3file.str() ); system ( command.c_str() ); } @@ -1145,7 +1145,7 @@ static void fgIdleFunction ( void ) { // a subsystem to flightgear, its initialization call should // located in this routine. if( !fgInitSubsystems()) { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Subsystem initializations failed ..." ); exit(-1); } @@ -1169,14 +1169,14 @@ static void fgIdleFunction ( void ) { string lockfile = "/tmp/mpg123.running"; struct stat stat_buf; - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Waiting for mpg123 player to finish ..." ); while ( stat(lockfile.c_str(), &stat_buf) == 0 ) { // file exist, wait ... sleep(1); - FG_LOG( FG_GENERAL, FG_INFO, "."); + SG_LOG( SG_GENERAL, SG_INFO, "."); } - FG_LOG( FG_GENERAL, FG_INFO, ""); + SG_LOG( SG_GENERAL, SG_INFO, ""); } #endif // WIN32 @@ -1187,7 +1187,7 @@ static void fgIdleFunction ( void ) { "Sounds/wasp.wav") ); globals->get_soundmgr()->add( s1, "engine loop" ); globals->get_soundmgr()->play_looped( "engine loop" ); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Rate = " << s1->get_sample()->getRate() << " Bps = " << s1->get_sample()->getBps() << " Stereo = " << s1->get_sample()->getStereo() ); @@ -1271,7 +1271,7 @@ int fgGlutInit( int *argc, char **argv ) { // Define Display Parameters glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); - FG_LOG( FG_GENERAL, FG_INFO, "Opening a window: " << + SG_LOG( SG_GENERAL, SG_INFO, "Opening a window: " << fgGetInt("/sim/startup/xsize") << "x" << fgGetInt("/sim/startup/ysize") ); @@ -1292,7 +1292,7 @@ int fgGlutInit( int *argc, char **argv ) { fgGetInt("/sim/startup/ysize"), fgGetInt("/sim/rendering/bits-per-pixel")); - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "game mode params = " << game_mode_str ); glutGameModeString( game_mode_str ); glutEnterGameMode(); @@ -1305,16 +1305,16 @@ int fgGlutInit( int *argc, char **argv ) { general.set_glVendor( (char *)glGetString ( GL_VENDOR ) ); general.set_glRenderer( (char *)glGetString ( GL_RENDERER ) ); general.set_glVersion( (char *)glGetString ( GL_VERSION ) ); - FG_LOG( FG_GENERAL, FG_INFO, general.get_glRenderer() ); + SG_LOG( SG_GENERAL, SG_INFO, general.get_glRenderer() ); GLint tmp; glGetIntegerv( GL_MAX_TEXTURE_SIZE, &tmp ); general.set_glMaxTexSize( tmp ); - FG_LOG ( FG_GENERAL, FG_INFO, "Max texture size = " << tmp ); + SG_LOG ( SG_GENERAL, SG_INFO, "Max texture size = " << tmp ); glGetIntegerv( GL_DEPTH_BITS, &tmp ); general.set_glDepthBits( tmp ); - FG_LOG ( FG_GENERAL, FG_INFO, "Depth buffer bits = " << tmp ); + SG_LOG ( SG_GENERAL, SG_INFO, "Depth buffer bits = " << tmp ); return 1; } @@ -1359,7 +1359,7 @@ int main( int argc, char **argv ) { #endif // set default log levels - fglog().setLogLevels( FG_ALL, FG_INFO ); + sglog().setLogLevels( SG_ALL, SG_INFO ); string version; #ifdef FLIGHTGEAR_VERSION @@ -1367,7 +1367,7 @@ int main( int argc, char **argv ) { #else version = "unknown version"; #endif - FG_LOG( FG_GENERAL, FG_INFO, "FlightGear: Version " + SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: Version " << version << endl ); // Allocate global data structures. This needs to happen before @@ -1412,19 +1412,19 @@ int main( int argc, char **argv ) { // Load the configuration parameters if ( !fgInitConfig(argc, argv) ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Config option parsing failed ..." ); + SG_LOG( SG_GENERAL, SG_ALERT, "Config option parsing failed ..." ); exit(-1); } // Initialize the Window/Graphics environment. if( !fgGlutInit(&argc, argv) ) { - FG_LOG( FG_GENERAL, FG_ALERT, "GLUT initialization failed ..." ); + SG_LOG( SG_GENERAL, SG_ALERT, "GLUT initialization failed ..." ); exit(-1); } // Initialize the various GLUT Event Handlers. if( !fgGlutInitEvents() ) { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "GLUT event handler initialization failed ..." ); exit(-1); } @@ -1477,12 +1477,12 @@ int main( int argc, char **argv ) { globals->set_warp( offset - (aircraftLocalTime - systemLocalTime) - cur_time ); } else { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Unsupported offset type " << offset_type ); exit( -1 ); } - FG_LOG( FG_GENERAL, FG_INFO, "After time init, warp = " + SG_LOG( SG_GENERAL, SG_INFO, "After time init, warp = " << globals->get_warp() ); globals->set_warp_delta( 0 ); @@ -1493,7 +1493,7 @@ int main( int argc, char **argv ) { // Do some quick general initializations if( !fgInitGeneral()) { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "General initializations failed ..." ); exit(-1); } @@ -1592,7 +1592,7 @@ int main( int argc, char **argv ) { acmodel_proprpms[acmodel_npropsettings][1] = prop_high; acmodel_npropsettings++; - FG_LOG( FG_GENERAL, FG_INFO, "PROPELLER SETTING " << prop_low << + SG_LOG( SG_GENERAL, SG_INFO, "PROPELLER SETTING " << prop_low << " " << prop_high ); } } @@ -1665,7 +1665,7 @@ void fgLoadDCS(void) { tile_path.append( "Objects.txt" ); fg_gzifstream in( tile_path.str() ); if ( ! in.is_open() ) { - FG_LOG( FG_TERRAIN, FG_ALERT, "Cannot open file: " << tile_path.str() ); + SG_LOG( SG_TERRAIN, SG_ALERT, "Cannot open file: " << tile_path.str() ); } FGPath modelpath( globals->get_fg_root() ); @@ -1713,7 +1713,7 @@ void fgLoadDCS(void) { ship_sel->addKid( ship_pos[objc] ); // add transform node to selector } else - FG_LOG( FG_TERRAIN, FG_ALERT, "Cannot open file: " << obj_filename ); + SG_LOG( SG_TERRAIN, SG_ALERT, "Cannot open file: " << obj_filename ); if (in.eof()) break; objc++; diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 8ec77dfad..399ba6207 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -723,11 +723,11 @@ parse_option (const string& arg) } if ( !geometry_ok ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry ); - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Unknown geometry: " << geometry ); + SG_LOG( SG_GENERAL, SG_ALERT, "Setting geometry to " << xsize << 'x' << ysize << '\n'); } else { - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Setting geometry to " << xsize << 'x' << ysize << '\n'); fgSetInt("/sim/startup/xsize", xsize); fgSetInt("/sim/startup/ysize", ysize); @@ -741,7 +741,7 @@ parse_option (const string& arg) } else if ( bits_per_pix == "32" ) { fgSetInt("/sim/rendering/bits-per-pixel", 32); } else { - FG_LOG(FG_GENERAL, FG_ALERT, "Unsupported bpp " << bits_per_pix); + SG_LOG(SG_GENERAL, SG_ALERT, "Unsupported bpp " << bits_per_pix); } } else if ( arg == "--units-feet" ) { fgSetString("/sim/startup/units", "feet"); @@ -806,13 +806,13 @@ parse_option (const string& arg) string assign = arg.substr(7); int pos = assign.find('='); if (pos == arg.npos || pos == 0) { - FG_LOG(FG_GENERAL, FG_ALERT, "Bad property assignment: " << arg); + SG_LOG(SG_GENERAL, SG_ALERT, "Bad property assignment: " << arg); return FG_OPTIONS_ERROR; } string name = assign.substr(0, pos); string value = assign.substr(pos + 1); fgSetString(name.c_str(), value); - // FG_LOG(FG_GENERAL, FG_INFO, "Setting default value of property " + // SG_LOG(SG_GENERAL, SG_INFO, "Setting default value of property " // << name << " to \"" << value << '"'); // $$$ begin - added VS Renganathan, 14 Oct 2K // for multi-window outside window imagery @@ -843,12 +843,12 @@ parse_option (const string& arg) string val = arg.substr(7); int pos = val.find('@'); if (pos == string::npos) { - FG_LOG(FG_GENERAL, FG_ALERT, "bad wind value " << val); + SG_LOG(SG_GENERAL, SG_ALERT, "bad wind value " << val); return FG_OPTIONS_ERROR; } double dir = atof(val.substr(0,pos).c_str()); double speed = atof(val.substr(pos+1).c_str()); - FG_LOG(FG_GENERAL, FG_INFO, "WIND: " << dir << '@' << + SG_LOG(SG_GENERAL, SG_INFO, "WIND: " << dir << '@' << speed << " knots" << endl); // convert to fps speed *= SG_NM_TO_METER * SG_METER_TO_FEET * (1.0/3600); @@ -867,12 +867,12 @@ parse_option (const string& arg) } else if ( arg.find( "--config=" ) == 0 ) { string file = arg.substr(9); if (!readProperties(file, globals->get_props())) { - FG_LOG(FG_IO, FG_ALERT, + SG_LOG(SG_IO, SG_ALERT, "--config: failed to read properties from " << file); return FG_OPTIONS_ERROR; } } else { - FG_LOG( FG_GENERAL, FG_ALERT, "Unknown option '" << arg << "'" ); + SG_LOG( SG_GENERAL, SG_ALERT, "Unknown option '" << arg << "'" ); return FG_OPTIONS_ERROR; } @@ -887,10 +887,10 @@ fgScanForRoot (int argc, char **argv) { int i = 1; - FG_LOG(FG_GENERAL, FG_INFO, "Scanning for root: command line"); + SG_LOG(SG_GENERAL, SG_INFO, "Scanning for root: command line"); while ( i < argc ) { - FG_LOG( FG_GENERAL, FG_DEBUG, "argv[" << i << "] = " << argv[i] ); + SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] ); string arg = argv[i]; if ( arg.find( "--fg-root=" ) == 0 ) { @@ -912,7 +912,7 @@ fgScanForRoot (const string& path) if ( !in.is_open() ) return ""; - FG_LOG( FG_GENERAL, FG_INFO, "Scanning for root: " << path ); + SG_LOG( SG_GENERAL, SG_INFO, "Scanning for root: " << path ); in >> skipcomment; #ifndef __MWERKS__ @@ -949,10 +949,10 @@ fgParseOptions (int argc, char **argv) { int i = 1; int result; - FG_LOG(FG_GENERAL, FG_INFO, "Processing command line arguments"); + SG_LOG(SG_GENERAL, SG_INFO, "Processing command line arguments"); while ( i < argc ) { - FG_LOG( FG_GENERAL, FG_DEBUG, "argv[" << i << "] = " << argv[i] ); + SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] ); result = parse_option(argv[i]); if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) { @@ -972,7 +972,7 @@ fgParseOptions (const string& path) { if ( !in.is_open() ) return; - FG_LOG( FG_GENERAL, FG_INFO, "Processing config file: " << path ); + SG_LOG( SG_GENERAL, SG_INFO, "Processing config file: " << path ); in >> skipcomment; #ifndef __MWERKS__ @@ -993,7 +993,7 @@ fgParseOptions (const string& path) { #endif if ( parse_option( line ) == FG_OPTIONS_ERROR ) { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Config file parse error: " << path << " '" << line << "'" ); fgUsage(); diff --git a/src/Main/splash.cxx b/src/Main/splash.cxx index 21ddc0e80..01beffb68 100644 --- a/src/Main/splash.cxx +++ b/src/Main/splash.cxx @@ -58,7 +58,7 @@ static GLubyte *splash_texbuf; void fgSplashInit ( void ) { int width, height; - FG_LOG( FG_GENERAL, FG_INFO, "Initializing splash screen" ); + SG_LOG( SG_GENERAL, SG_INFO, "Initializing splash screen" ); #ifdef GL_VERSION_1_1 xglGenTextures(1, &splash_texid); xglBindTexture(GL_TEXTURE_2D, splash_texid); @@ -93,7 +93,7 @@ void fgSplashInit ( void ) { if ( (splash_texbuf = read_rgb_texture(fg_tpath.c_str(), &width, &height)) == NULL ) { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Error in loading splash screen texture " << tpath.str() ); exit(-1); } diff --git a/src/Main/viewer.cxx b/src/Main/viewer.cxx index 707d38014..04f326d7c 100644 --- a/src/Main/viewer.cxx +++ b/src/Main/viewer.cxx @@ -42,7 +42,7 @@ fov(55.0) // Update the view parameters void FGViewer::update() { - FG_LOG( FG_VIEW, FG_ALERT, "Shouldn't ever see this" ); + SG_LOG( SG_VIEW, SG_ALERT, "Shouldn't ever see this" ); exit(-1); } diff --git a/src/Main/viewer_lookat.cxx b/src/Main/viewer_lookat.cxx index b2fc0dfdc..06986973a 100644 --- a/src/Main/viewer_lookat.cxx +++ b/src/Main/viewer_lookat.cxx @@ -133,21 +133,21 @@ void FGViewerLookAt::update() { sgSetVec3( view_pos, vp ); sgAddVec3( view_pos, pilot_offset ); - FG_LOG( FG_VIEW, FG_DEBUG, "sea level radius = " << sea_level_radius ); - FG_LOG( FG_VIEW, FG_DEBUG, "Polar view pos = " << p ); - FG_LOG( FG_VIEW, FG_DEBUG, "Absolute view pos = " + SG_LOG( SG_VIEW, SG_DEBUG, "sea level radius = " << sea_level_radius ); + SG_LOG( SG_VIEW, SG_DEBUG, "Polar view pos = " << p ); + SG_LOG( SG_VIEW, SG_DEBUG, "Absolute view pos = " << abs_view_pos[0] << "," << abs_view_pos[1] << "," << abs_view_pos[2] ); - FG_LOG( FG_VIEW, FG_DEBUG, "Relative view pos = " + SG_LOG( SG_VIEW, SG_DEBUG, "Relative view pos = " << view_pos[0] << "," << view_pos[1] << "," << view_pos[2] ); - FG_LOG( FG_VIEW, FG_DEBUG, "pilot offset = " + SG_LOG( SG_VIEW, SG_DEBUG, "pilot offset = " << pilot_offset[0] << "," << pilot_offset[1] << "," << pilot_offset[2] ); - FG_LOG( FG_VIEW, FG_DEBUG, "view forward = " + SG_LOG( SG_VIEW, SG_DEBUG, "view forward = " << view_forward[0] << "," << view_forward[1] << "," << view_forward[2] ); - FG_LOG( FG_VIEW, FG_DEBUG, "view up = " + SG_LOG( SG_VIEW, SG_DEBUG, "view up = " << view_up[0] << "," << view_up[1] << "," << view_up[2] ); diff --git a/src/Main/viewer_rph.cxx b/src/Main/viewer_rph.cxx index a66a20ce2..d8ab4c23c 100644 --- a/src/Main/viewer_rph.cxx +++ b/src/Main/viewer_rph.cxx @@ -184,13 +184,13 @@ void FGViewerRPH::update() { sgdSubVec3( vp, abs_view_pos, sc ); sgSetVec3( view_pos, vp ); - FG_LOG( FG_VIEW, FG_DEBUG, "sea level radius = " << sea_level_radius ); - FG_LOG( FG_VIEW, FG_DEBUG, "Polar view pos = " << p ); - FG_LOG( FG_VIEW, FG_DEBUG, "Absolute view pos = " + SG_LOG( SG_VIEW, SG_DEBUG, "sea level radius = " << sea_level_radius ); + SG_LOG( SG_VIEW, SG_DEBUG, "Polar view pos = " << p ); + SG_LOG( SG_VIEW, SG_DEBUG, "Absolute view pos = " << abs_view_pos[0] << "," << abs_view_pos[1] << "," << abs_view_pos[2] ); - FG_LOG( FG_VIEW, FG_DEBUG, "(RPH) Relative view pos = " + SG_LOG( SG_VIEW, SG_DEBUG, "(RPH) Relative view pos = " << view_pos[0] << "," << view_pos[1] << "," << view_pos[2] ); // code to calculate LOCAL matrix calculated from Phi, Theta, and @@ -276,7 +276,7 @@ void FGViewerRPH::update() { // cout << "VIEW_OFFSET matrix" << endl; // print_sgMat4( VIEW_OFFSET ); sgXformVec3( view_forward, forward, VIEW_OFFSET ); - FG_LOG( FG_VIEW, FG_DEBUG, "(RPH) view forward = " + SG_LOG( SG_VIEW, SG_DEBUG, "(RPH) view forward = " << view_forward[0] << "," << view_forward[1] << "," << view_forward[2] ); diff --git a/src/Navaids/fixlist.cxx b/src/Navaids/fixlist.cxx index 935886cbd..bb7c643df 100644 --- a/src/Navaids/fixlist.cxx +++ b/src/Navaids/fixlist.cxx @@ -49,7 +49,7 @@ bool FGFixList::init( FGPath path ) { fg_gzifstream in( path.str() ); if ( !in.is_open() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path.str() ); + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() ); exit(-1); } diff --git a/src/Navaids/ilslist.cxx b/src/Navaids/ilslist.cxx index a30c61898..b4d243493 100644 --- a/src/Navaids/ilslist.cxx +++ b/src/Navaids/ilslist.cxx @@ -50,7 +50,7 @@ bool FGILSList::init( FGPath path ) { fg_gzifstream in( path.str() ); if ( !in.is_open() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path.str() ); + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() ); exit(-1); } diff --git a/src/Navaids/navlist.cxx b/src/Navaids/navlist.cxx index dbbbb76e2..0b0b26f93 100644 --- a/src/Navaids/navlist.cxx +++ b/src/Navaids/navlist.cxx @@ -49,7 +49,7 @@ bool FGNavList::init( FGPath path ) { fg_gzifstream in( path.str() ); if ( !in.is_open() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path.str() ); + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() ); exit(-1); } diff --git a/src/Network/atlas.cxx b/src/Network/atlas.cxx index f4f135910..ea75d22b1 100644 --- a/src/Network/atlas.cxx +++ b/src/Network/atlas.cxx @@ -133,9 +133,9 @@ bool FGAtlas::gen_message() { current_radiostack->get_adf_freq() ); sprintf( patla_sum, "%02X", calc_atlas_cksum(patla) ); - FG_LOG( FG_IO, FG_DEBUG, rmc ); - FG_LOG( FG_IO, FG_DEBUG, gga ); - FG_LOG( FG_IO, FG_DEBUG, patla ); + SG_LOG( SG_IO, SG_DEBUG, rmc ); + SG_LOG( SG_IO, SG_DEBUG, gga ); + SG_LOG( SG_IO, SG_DEBUG, patla ); string atlas_sentence; @@ -176,11 +176,11 @@ bool FGAtlas::gen_message() { // $GPGGA,163227,3321.173,N,11039.855,W,1,,,3333,F,,,,*0F bool FGAtlas::parse_message() { - FG_LOG( FG_IO, FG_INFO, "parse atlas message" ); + SG_LOG( SG_IO, SG_INFO, "parse atlas message" ); string msg = buf; msg = msg.substr( 0, length ); - FG_LOG( FG_IO, FG_INFO, "entire message = " << msg ); + SG_LOG( SG_IO, SG_INFO, "entire message = " << msg ); string::size_type begin_line, end_line, begin, end; begin_line = begin = 0; @@ -190,12 +190,12 @@ bool FGAtlas::parse_message() { while ( end_line != string::npos ) { string line = msg.substr(begin_line, end_line - begin_line); begin_line = end_line + 1; - FG_LOG( FG_IO, FG_INFO, " input line = " << line ); + SG_LOG( SG_IO, SG_INFO, " input line = " << line ); // leading character string start = msg.substr(begin, 1); ++begin; - FG_LOG( FG_IO, FG_INFO, " start = " << start ); + SG_LOG( SG_IO, SG_INFO, " start = " << start ); // sentence end = msg.find(",", begin); @@ -205,7 +205,7 @@ bool FGAtlas::parse_message() { string sentence = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " sentence = " << sentence ); + SG_LOG( SG_IO, SG_INFO, " sentence = " << sentence ); double lon_deg, lon_min, lat_deg, lat_min; double lon, lat, speed, heading, altitude; @@ -219,7 +219,7 @@ bool FGAtlas::parse_message() { string utc = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " utc = " << utc ); + SG_LOG( SG_IO, SG_INFO, " utc = " << utc ); // junk end = msg.find(",", begin); @@ -229,7 +229,7 @@ bool FGAtlas::parse_message() { string junk = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " junk = " << junk ); + SG_LOG( SG_IO, SG_INFO, " junk = " << junk ); // lat val end = msg.find(",", begin); @@ -258,7 +258,7 @@ bool FGAtlas::parse_message() { } cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lat = " << lat ); + SG_LOG( SG_IO, SG_INFO, " lat = " << lat ); // lon val end = msg.find(",", begin); @@ -287,7 +287,7 @@ bool FGAtlas::parse_message() { } cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lon = " << lon ); + SG_LOG( SG_IO, SG_INFO, " lon = " << lon ); #if 0 double sl_radius, lat_geoc; @@ -310,7 +310,7 @@ bool FGAtlas::parse_message() { speed = atof( speed_str.c_str() ); cur_fdm_state->set_V_calibrated_kts( speed ); // cur_fdm_state->set_V_ground_speed( speed ); - FG_LOG( FG_IO, FG_INFO, " speed = " << speed ); + SG_LOG( SG_IO, SG_INFO, " speed = " << speed ); // heading end = msg.find(",", begin); @@ -324,7 +324,7 @@ bool FGAtlas::parse_message() { cur_fdm_state->set_Euler_Angles( cur_fdm_state->get_Phi(), cur_fdm_state->get_Theta(), heading * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " heading = " << heading ); + SG_LOG( SG_IO, SG_INFO, " heading = " << heading ); } else if ( sentence == "GPGGA" ) { // time end = msg.find(",", begin); @@ -334,7 +334,7 @@ bool FGAtlas::parse_message() { string utc = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " utc = " << utc ); + SG_LOG( SG_IO, SG_INFO, " utc = " << utc ); // lat val end = msg.find(",", begin); @@ -363,7 +363,7 @@ bool FGAtlas::parse_message() { } // cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lat = " << lat ); + SG_LOG( SG_IO, SG_INFO, " lat = " << lat ); // lon val end = msg.find(",", begin); @@ -392,7 +392,7 @@ bool FGAtlas::parse_message() { } // cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lon = " << lon ); + SG_LOG( SG_IO, SG_INFO, " lon = " << lon ); // junk end = msg.find(",", begin); @@ -402,7 +402,7 @@ bool FGAtlas::parse_message() { string junk = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " junk = " << junk ); + SG_LOG( SG_IO, SG_INFO, " junk = " << junk ); // junk end = msg.find(",", begin); @@ -412,7 +412,7 @@ bool FGAtlas::parse_message() { junk = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " junk = " << junk ); + SG_LOG( SG_IO, SG_INFO, " junk = " << junk ); // junk end = msg.find(",", begin); @@ -422,7 +422,7 @@ bool FGAtlas::parse_message() { junk = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " junk = " << junk ); + SG_LOG( SG_IO, SG_INFO, " junk = " << junk ); // altitude end = msg.find(",", begin); @@ -449,7 +449,7 @@ bool FGAtlas::parse_message() { cur_fdm_state->set_Altitude( altitude ); - FG_LOG( FG_IO, FG_INFO, " altitude = " << altitude ); + SG_LOG( SG_IO, SG_INFO, " altitude = " << altitude ); } else if ( sentence == "PATLA" ) { // nav1 freq @@ -460,7 +460,7 @@ bool FGAtlas::parse_message() { string nav1_freq = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " nav1_freq = " << nav1_freq ); + SG_LOG( SG_IO, SG_INFO, " nav1_freq = " << nav1_freq ); // nav1 selected radial end = msg.find(",", begin); @@ -470,7 +470,7 @@ bool FGAtlas::parse_message() { string nav1_rad = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " nav1_rad = " << nav1_rad ); + SG_LOG( SG_IO, SG_INFO, " nav1_rad = " << nav1_rad ); // nav2 freq end = msg.find(",", begin); @@ -480,7 +480,7 @@ bool FGAtlas::parse_message() { string nav2_freq = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " nav2_freq = " << nav2_freq ); + SG_LOG( SG_IO, SG_INFO, " nav2_freq = " << nav2_freq ); // nav2 selected radial end = msg.find(",", begin); @@ -490,7 +490,7 @@ bool FGAtlas::parse_message() { string nav2_rad = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " nav2_rad = " << nav2_rad ); + SG_LOG( SG_IO, SG_INFO, " nav2_rad = " << nav2_rad ); // adf freq end = msg.find("*", begin); @@ -500,7 +500,7 @@ bool FGAtlas::parse_message() { string adf_freq = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " adf_freq = " << adf_freq ); + SG_LOG( SG_IO, SG_INFO, " adf_freq = " << adf_freq ); } // printf("%.8f %.8f\n", lon, lat); @@ -516,7 +516,7 @@ bool FGAtlas::parse_message() { // open hailing frequencies bool FGAtlas::open() { if ( is_enabled() ) { - FG_LOG( FG_IO, FG_ALERT, "This shouldn't happen, but the channel " + SG_LOG( SG_IO, SG_ALERT, "This shouldn't happen, but the channel " << "is already in use, ignoring" ); return false; } @@ -524,7 +524,7 @@ bool FGAtlas::open() { SGIOChannel *io = get_io_channel(); if ( ! io->open( get_direction() ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error opening channel communication layer." ); + SG_LOG( SG_IO, SG_ALERT, "Error opening channel communication layer." ); return false; } @@ -541,20 +541,20 @@ bool FGAtlas::process() { if ( get_direction() == SG_IO_OUT ) { gen_message(); if ( ! io->write( buf, length ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error writing data." ); + SG_LOG( SG_IO, SG_ALERT, "Error writing data." ); return false; } } else if ( get_direction() == SG_IO_IN ) { if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { parse_message(); } else { - FG_LOG( FG_IO, FG_ALERT, "Error reading data." ); + SG_LOG( SG_IO, SG_ALERT, "Error reading data." ); return false; } if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { parse_message(); } else { - FG_LOG( FG_IO, FG_ALERT, "Error reading data." ); + SG_LOG( SG_IO, SG_ALERT, "Error reading data." ); return false; } } diff --git a/src/Network/garmin.cxx b/src/Network/garmin.cxx index f45f3226f..5d53876a1 100644 --- a/src/Network/garmin.cxx +++ b/src/Network/garmin.cxx @@ -125,8 +125,8 @@ bool FGGarmin::gen_message() { sprintf( rmz, "PGRMZ,%s,f,3", altitude_ft ); sprintf( rmz_sum, "%02X", calc_nmea_cksum(rmz) ); - FG_LOG( FG_IO, FG_DEBUG, rmc ); - FG_LOG( FG_IO, FG_DEBUG, rmz ); + SG_LOG( SG_IO, SG_DEBUG, rmc ); + SG_LOG( SG_IO, SG_DEBUG, rmz ); string garmin_sentence; @@ -155,11 +155,11 @@ bool FGGarmin::gen_message() { // parse Garmin message bool FGGarmin::parse_message() { - FG_LOG( FG_IO, FG_INFO, "parse garmin message" ); + SG_LOG( SG_IO, SG_INFO, "parse garmin message" ); string msg = buf; msg = msg.substr( 0, length ); - FG_LOG( FG_IO, FG_INFO, "entire message = " << msg ); + SG_LOG( SG_IO, SG_INFO, "entire message = " << msg ); string::size_type begin_line, end_line, begin, end; begin_line = begin = 0; @@ -169,12 +169,12 @@ bool FGGarmin::parse_message() { while ( end_line != string::npos ) { string line = msg.substr(begin_line, end_line - begin_line); begin_line = end_line + 1; - FG_LOG( FG_IO, FG_INFO, " input line = " << line ); + SG_LOG( SG_IO, SG_INFO, " input line = " << line ); // leading character string start = msg.substr(begin, 1); ++begin; - FG_LOG( FG_IO, FG_INFO, " start = " << start ); + SG_LOG( SG_IO, SG_INFO, " start = " << start ); // sentence end = msg.find(",", begin); @@ -184,7 +184,7 @@ bool FGGarmin::parse_message() { string sentence = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " sentence = " << sentence ); + SG_LOG( SG_IO, SG_INFO, " sentence = " << sentence ); double lon_deg, lon_min, lat_deg, lat_min; double lon, lat, speed, heading, altitude; @@ -198,7 +198,7 @@ bool FGGarmin::parse_message() { string utc = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " utc = " << utc ); + SG_LOG( SG_IO, SG_INFO, " utc = " << utc ); // junk end = msg.find(",", begin); @@ -208,7 +208,7 @@ bool FGGarmin::parse_message() { string junk = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " junk = " << junk ); + SG_LOG( SG_IO, SG_INFO, " junk = " << junk ); // lat val end = msg.find(",", begin); @@ -237,7 +237,7 @@ bool FGGarmin::parse_message() { } cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lat = " << lat ); + SG_LOG( SG_IO, SG_INFO, " lat = " << lat ); // lon val end = msg.find(",", begin); @@ -266,7 +266,7 @@ bool FGGarmin::parse_message() { } cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lon = " << lon ); + SG_LOG( SG_IO, SG_INFO, " lon = " << lon ); #if 0 double sl_radius, lat_geoc; @@ -289,7 +289,7 @@ bool FGGarmin::parse_message() { speed = atof( speed_str.c_str() ); cur_fdm_state->set_V_calibrated_kts( speed ); // cur_fdm_state->set_V_ground_speed( speed ); - FG_LOG( FG_IO, FG_INFO, " speed = " << speed ); + SG_LOG( SG_IO, SG_INFO, " speed = " << speed ); // heading end = msg.find(",", begin); @@ -303,7 +303,7 @@ bool FGGarmin::parse_message() { cur_fdm_state->set_Euler_Angles( cur_fdm_state->get_Phi(), cur_fdm_state->get_Theta(), heading * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " heading = " << heading ); + SG_LOG( SG_IO, SG_INFO, " heading = " << heading ); } else if ( sentence == "PGRMZ" ) { // altitude end = msg.find(",", begin); @@ -330,7 +330,7 @@ bool FGGarmin::parse_message() { cur_fdm_state->set_Altitude( altitude ); - FG_LOG( FG_IO, FG_INFO, " altitude = " << altitude ); + SG_LOG( SG_IO, SG_INFO, " altitude = " << altitude ); } @@ -347,7 +347,7 @@ bool FGGarmin::parse_message() { // open hailing frequencies bool FGGarmin::open() { if ( is_enabled() ) { - FG_LOG( FG_IO, FG_ALERT, "This shouldn't happen, but the channel " + SG_LOG( SG_IO, SG_ALERT, "This shouldn't happen, but the channel " << "is already in use, ignoring" ); return false; } @@ -355,7 +355,7 @@ bool FGGarmin::open() { SGIOChannel *io = get_io_channel(); if ( ! io->open( get_direction() ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error opening channel communication layer." ); + SG_LOG( SG_IO, SG_ALERT, "Error opening channel communication layer." ); return false; } @@ -372,30 +372,30 @@ bool FGGarmin::process() { if ( get_direction() == SG_IO_OUT ) { gen_message(); if ( ! io->write( buf, length ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error writing data." ); + SG_LOG( SG_IO, SG_ALERT, "Error writing data." ); return false; } } else if ( get_direction() == SG_IO_IN ) { if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { - FG_LOG( FG_IO, FG_ALERT, "Success reading data." ); + SG_LOG( SG_IO, SG_ALERT, "Success reading data." ); if ( parse_message() ) { - FG_LOG( FG_IO, FG_ALERT, "Success parsing data." ); + SG_LOG( SG_IO, SG_ALERT, "Success parsing data." ); } else { - FG_LOG( FG_IO, FG_ALERT, "Error parsing data." ); + SG_LOG( SG_IO, SG_ALERT, "Error parsing data." ); } } else { - FG_LOG( FG_IO, FG_ALERT, "Error reading data." ); + SG_LOG( SG_IO, SG_ALERT, "Error reading data." ); return false; } if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { - FG_LOG( FG_IO, FG_ALERT, "Success reading data." ); + SG_LOG( SG_IO, SG_ALERT, "Success reading data." ); if ( parse_message() ) { - FG_LOG( FG_IO, FG_ALERT, "Success parsing data." ); + SG_LOG( SG_IO, SG_ALERT, "Success parsing data." ); } else { - FG_LOG( FG_IO, FG_ALERT, "Error parsing data." ); + SG_LOG( SG_IO, SG_ALERT, "Error parsing data." ); } } else { - FG_LOG( FG_IO, FG_ALERT, "Error reading data." ); + SG_LOG( SG_IO, SG_ALERT, "Error reading data." ); return false; } } diff --git a/src/Network/joyclient.cxx b/src/Network/joyclient.cxx index 4805d639c..419c8a417 100644 --- a/src/Network/joyclient.cxx +++ b/src/Network/joyclient.cxx @@ -39,7 +39,7 @@ FGJoyClient::~FGJoyClient() { // open hailing frequencies bool FGJoyClient::open() { if ( is_enabled() ) { - FG_LOG( FG_IO, FG_ALERT, "This shouldn't happen, but the channel " + SG_LOG( SG_IO, SG_ALERT, "This shouldn't happen, but the channel " << "is already in use, ignoring" ); return false; } @@ -47,7 +47,7 @@ bool FGJoyClient::open() { SGIOChannel *io = get_io_channel(); if ( ! io->open( get_direction() ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error opening channel communication layer." ); + SG_LOG( SG_IO, SG_ALERT, "Error opening channel communication layer." ); return false; } @@ -63,16 +63,16 @@ bool FGJoyClient::process() { int length = sizeof(int[2]); if ( get_direction() == SG_IO_OUT ) { - FG_LOG( FG_IO, FG_ALERT, "joyclient protocol is read only" ); + SG_LOG( SG_IO, SG_ALERT, "joyclient protocol is read only" ); return false; } else if ( get_direction() == SG_IO_IN ) { - FG_LOG( FG_IO, FG_DEBUG, "Searching for data." ); + SG_LOG( SG_IO, SG_DEBUG, "Searching for data." ); if ( io->get_type() == sgFileType ) { if ( io->read( (char *)(& buf), length ) == length ) { - FG_LOG( FG_IO, FG_DEBUG, "Success reading data." ); + SG_LOG( SG_IO, SG_DEBUG, "Success reading data." ); int *msg; msg = (int *)buf; - FG_LOG( FG_IO, FG_DEBUG, "X = " << msg[0] << " Y = " + SG_LOG( SG_IO, SG_DEBUG, "X = " << msg[0] << " Y = " << msg[1] ); double aileron = ((double)msg[0] / 2048.0) - 1.0; double elevator = ((double)msg[1] / 2048.0) - 1.0; @@ -87,10 +87,10 @@ bool FGJoyClient::process() { } } else { while ( io->read( (char *)(& buf), length ) == length ) { - FG_LOG( FG_IO, FG_DEBUG, "Success reading data." ); + SG_LOG( SG_IO, SG_DEBUG, "Success reading data." ); int *msg; msg = (int *)buf; - FG_LOG( FG_IO, FG_DEBUG, "X = " << msg[0] << " Y = " + SG_LOG( SG_IO, SG_DEBUG, "X = " << msg[0] << " Y = " << msg[1] ); double aileron = ((double)msg[0] / 2048.0) - 1.0; double elevator = ((double)msg[1] / 2048.0) - 1.0; diff --git a/src/Network/native.cxx b/src/Network/native.cxx index e673f6438..c2e94190e 100644 --- a/src/Network/native.cxx +++ b/src/Network/native.cxx @@ -37,7 +37,7 @@ FGNative::~FGNative() { // open hailing frequencies bool FGNative::open() { if ( is_enabled() ) { - FG_LOG( FG_IO, FG_ALERT, "This shouldn't happen, but the channel " + SG_LOG( SG_IO, SG_ALERT, "This shouldn't happen, but the channel " << "is already in use, ignoring" ); return false; } @@ -45,7 +45,7 @@ bool FGNative::open() { SGIOChannel *io = get_io_channel(); if ( ! io->open( get_direction() ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error opening channel communication layer." ); + SG_LOG( SG_IO, SG_ALERT, "Error opening channel communication layer." ); return false; } @@ -64,18 +64,18 @@ bool FGNative::process() { // cout << "size of cur_fdm_state = " << length << endl; buf = *cur_fdm_state; if ( ! io->write( (char *)(& buf), length ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error writing data." ); + SG_LOG( SG_IO, SG_ALERT, "Error writing data." ); return false; } } else if ( get_direction() == SG_IO_IN ) { if ( io->get_type() == sgFileType ) { if ( io->read( (char *)(& buf), length ) == length ) { - FG_LOG( FG_IO, FG_DEBUG, "Success reading data." ); + SG_LOG( SG_IO, SG_DEBUG, "Success reading data." ); *cur_fdm_state = buf; } } else { while ( io->read( (char *)(& buf), length ) == length ) { - FG_LOG( FG_IO, FG_DEBUG, "Success reading data." ); + SG_LOG( SG_IO, SG_DEBUG, "Success reading data." ); *cur_fdm_state = buf; } } diff --git a/src/Network/nmea.cxx b/src/Network/nmea.cxx index 61634bc1e..d33578a4a 100644 --- a/src/Network/nmea.cxx +++ b/src/Network/nmea.cxx @@ -125,8 +125,8 @@ bool FGNMEA::gen_message() { sprintf( gga_sum, "%02X", calc_nmea_cksum(gga) ); - FG_LOG( FG_IO, FG_DEBUG, rmc ); - FG_LOG( FG_IO, FG_DEBUG, gga ); + SG_LOG( SG_IO, SG_DEBUG, rmc ); + SG_LOG( SG_IO, SG_DEBUG, gga ); string nmea_sentence; @@ -160,11 +160,11 @@ bool FGNMEA::gen_message() { // $GPGGA,163227,3321.173,N,11039.855,W,1,,,3333,F,,,,*0F bool FGNMEA::parse_message() { - FG_LOG( FG_IO, FG_INFO, "parse nmea message" ); + SG_LOG( SG_IO, SG_INFO, "parse nmea message" ); string msg = buf; msg = msg.substr( 0, length ); - FG_LOG( FG_IO, FG_INFO, "entire message = " << msg ); + SG_LOG( SG_IO, SG_INFO, "entire message = " << msg ); string::size_type begin_line, end_line, begin, end; begin_line = begin = 0; @@ -174,12 +174,12 @@ bool FGNMEA::parse_message() { while ( end_line != string::npos ) { string line = msg.substr(begin_line, end_line - begin_line); begin_line = end_line + 1; - FG_LOG( FG_IO, FG_INFO, " input line = " << line ); + SG_LOG( SG_IO, SG_INFO, " input line = " << line ); // leading character string start = msg.substr(begin, 1); ++begin; - FG_LOG( FG_IO, FG_INFO, " start = " << start ); + SG_LOG( SG_IO, SG_INFO, " start = " << start ); // sentence end = msg.find(",", begin); @@ -189,7 +189,7 @@ bool FGNMEA::parse_message() { string sentence = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " sentence = " << sentence ); + SG_LOG( SG_IO, SG_INFO, " sentence = " << sentence ); double lon_deg, lon_min, lat_deg, lat_min; double lon, lat, speed, heading, altitude; @@ -203,7 +203,7 @@ bool FGNMEA::parse_message() { string utc = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " utc = " << utc ); + SG_LOG( SG_IO, SG_INFO, " utc = " << utc ); // junk end = msg.find(",", begin); @@ -213,7 +213,7 @@ bool FGNMEA::parse_message() { string junk = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " junk = " << junk ); + SG_LOG( SG_IO, SG_INFO, " junk = " << junk ); // lat val end = msg.find(",", begin); @@ -242,7 +242,7 @@ bool FGNMEA::parse_message() { } cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lat = " << lat ); + SG_LOG( SG_IO, SG_INFO, " lat = " << lat ); // lon val end = msg.find(",", begin); @@ -271,7 +271,7 @@ bool FGNMEA::parse_message() { } cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lon = " << lon ); + SG_LOG( SG_IO, SG_INFO, " lon = " << lon ); #if 0 double sl_radius, lat_geoc; @@ -294,7 +294,7 @@ bool FGNMEA::parse_message() { speed = atof( speed_str.c_str() ); cur_fdm_state->set_V_calibrated_kts( speed ); // cur_fdm_state->set_V_ground_speed( speed ); - FG_LOG( FG_IO, FG_INFO, " speed = " << speed ); + SG_LOG( SG_IO, SG_INFO, " speed = " << speed ); // heading end = msg.find(",", begin); @@ -308,7 +308,7 @@ bool FGNMEA::parse_message() { cur_fdm_state->set_Euler_Angles( cur_fdm_state->get_Phi(), cur_fdm_state->get_Theta(), heading * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " heading = " << heading ); + SG_LOG( SG_IO, SG_INFO, " heading = " << heading ); } else if ( sentence == "GPGGA" ) { // time end = msg.find(",", begin); @@ -318,7 +318,7 @@ bool FGNMEA::parse_message() { string utc = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " utc = " << utc ); + SG_LOG( SG_IO, SG_INFO, " utc = " << utc ); // lat val end = msg.find(",", begin); @@ -347,7 +347,7 @@ bool FGNMEA::parse_message() { } // cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lat = " << lat ); + SG_LOG( SG_IO, SG_INFO, " lat = " << lat ); // lon val end = msg.find(",", begin); @@ -376,7 +376,7 @@ bool FGNMEA::parse_message() { } // cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS ); - FG_LOG( FG_IO, FG_INFO, " lon = " << lon ); + SG_LOG( SG_IO, SG_INFO, " lon = " << lon ); // junk end = msg.find(",", begin); @@ -386,7 +386,7 @@ bool FGNMEA::parse_message() { string junk = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " junk = " << junk ); + SG_LOG( SG_IO, SG_INFO, " junk = " << junk ); // junk end = msg.find(",", begin); @@ -396,7 +396,7 @@ bool FGNMEA::parse_message() { junk = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " junk = " << junk ); + SG_LOG( SG_IO, SG_INFO, " junk = " << junk ); // junk end = msg.find(",", begin); @@ -406,7 +406,7 @@ bool FGNMEA::parse_message() { junk = msg.substr(begin, end - begin); begin = end + 1; - FG_LOG( FG_IO, FG_INFO, " junk = " << junk ); + SG_LOG( SG_IO, SG_INFO, " junk = " << junk ); // altitude end = msg.find(",", begin); @@ -433,7 +433,7 @@ bool FGNMEA::parse_message() { cur_fdm_state->set_Altitude( altitude ); - FG_LOG( FG_IO, FG_INFO, " altitude = " << altitude ); + SG_LOG( SG_IO, SG_INFO, " altitude = " << altitude ); } @@ -450,7 +450,7 @@ bool FGNMEA::parse_message() { // open hailing frequencies bool FGNMEA::open() { if ( is_enabled() ) { - FG_LOG( FG_IO, FG_ALERT, "This shouldn't happen, but the channel " + SG_LOG( SG_IO, SG_ALERT, "This shouldn't happen, but the channel " << "is already in use, ignoring" ); return false; } @@ -458,7 +458,7 @@ bool FGNMEA::open() { SGIOChannel *io = get_io_channel(); if ( ! io->open( get_direction() ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error opening channel communication layer." ); + SG_LOG( SG_IO, SG_ALERT, "Error opening channel communication layer." ); return false; } @@ -475,20 +475,20 @@ bool FGNMEA::process() { if ( get_direction() == SG_IO_OUT ) { gen_message(); if ( ! io->write( buf, length ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error writing data." ); + SG_LOG( SG_IO, SG_ALERT, "Error writing data." ); return false; } } else if ( get_direction() == SG_IO_IN ) { if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { parse_message(); } else { - FG_LOG( FG_IO, FG_ALERT, "Error reading data." ); + SG_LOG( SG_IO, SG_ALERT, "Error reading data." ); return false; } if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { parse_message(); } else { - FG_LOG( FG_IO, FG_ALERT, "Error reading data." ); + SG_LOG( SG_IO, SG_ALERT, "Error reading data." ); return false; } } diff --git a/src/Network/props.cxx b/src/Network/props.cxx index 1a42c8d62..482ea18dd 100644 --- a/src/Network/props.cxx +++ b/src/Network/props.cxx @@ -50,7 +50,7 @@ bool FGProps::open() { path = "/"; if ( is_enabled() ) { - FG_LOG( FG_IO, FG_ALERT, "This shouldn't happen, but the channel " + SG_LOG( SG_IO, SG_ALERT, "This shouldn't happen, but the channel " << "is already in use, ignoring" ); return false; } @@ -58,12 +58,12 @@ bool FGProps::open() { SGIOChannel *io = get_io_channel(); if ( ! io->open( get_direction() ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error opening channel communication layer." ); + SG_LOG( SG_IO, SG_ALERT, "Error opening channel communication layer." ); return false; } set_enabled( true ); - FG_LOG( FG_IO, FG_INFO, "Opening properties channel communication layer." ); + SG_LOG( SG_IO, SG_INFO, "Opening properties channel communication layer." ); return true; } @@ -236,11 +236,11 @@ bool FGProps::process() { if ( get_direction() == SG_IO_BI ) { // cout << " (bi directional)" << endl; while ( io->readline( buf, max_cmd_len ) > 0 ) { - FG_LOG( FG_IO, FG_ALERT, "Success reading data." ); + SG_LOG( SG_IO, SG_ALERT, "Success reading data." ); process_command( buf ); } } else { - FG_LOG( FG_IO, FG_ALERT, + SG_LOG( SG_IO, SG_ALERT, "in or out direction not supported for FGProps." ); } diff --git a/src/Network/protocol.cxx b/src/Network/protocol.cxx index b6918f98f..ea1e66678 100644 --- a/src/Network/protocol.cxx +++ b/src/Network/protocol.cxx @@ -42,7 +42,7 @@ FGProtocol::~FGProtocol() { // standard I/O channel open routine bool FGProtocol::open() { if ( is_enabled() ) { - FG_LOG( FG_IO, FG_ALERT, "This shouldn't happen, but the channel " + SG_LOG( SG_IO, SG_ALERT, "This shouldn't happen, but the channel " << "is already in use, ignoring" ); return false; } @@ -50,7 +50,7 @@ bool FGProtocol::open() { SGIOChannel *io = get_io_channel(); if ( ! io->open( get_direction() ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error opening channel communication layer." ); + SG_LOG( SG_IO, SG_ALERT, "Error opening channel communication layer." ); return false; } @@ -62,14 +62,14 @@ bool FGProtocol::open() { // dummy process routine bool FGProtocol::process() { - FG_LOG( FG_IO, FG_INFO, "dummy FGProtocol::process()" ); + SG_LOG( SG_IO, SG_INFO, "dummy FGProtocol::process()" ); return false; } // dummy close routine bool FGProtocol::close() { - FG_LOG( FG_IO, FG_INFO, "dummy FGProtocol::close()" ); + SG_LOG( SG_IO, SG_INFO, "dummy FGProtocol::close()" ); return false; } @@ -90,7 +90,7 @@ bool FGProtocol::gen_message() { // dummy close routine bool FGProtocol::parse_message() { - FG_LOG( FG_IO, FG_INFO, "dummy FGProtocol::close()" ); + SG_LOG( SG_IO, SG_INFO, "dummy FGProtocol::close()" ); return false; } diff --git a/src/Network/pve.cxx b/src/Network/pve.cxx index 6ccc9300a..d162f348e 100644 --- a/src/Network/pve.cxx +++ b/src/Network/pve.cxx @@ -94,7 +94,7 @@ bool FGPVE::gen_message() { // printf( "p [ %u %u ] [ %u %u ] [ %u %u ]\n", // roll_b1, roll_b2, pitch_b1, pitch_b2, heave_b1, heave_b2 ); - FG_LOG( FG_IO, FG_INFO, "roll=" << roll << " pitch=" << pitch << + SG_LOG( SG_IO, SG_INFO, "roll=" << roll << " pitch=" << pitch << " heave=" << heave ); return true; @@ -103,7 +103,7 @@ bool FGPVE::gen_message() { // parse RUL message bool FGPVE::parse_message() { - FG_LOG( FG_IO, FG_ALERT, "PVE input not supported" ); + SG_LOG( SG_IO, SG_ALERT, "PVE input not supported" ); return false; } @@ -116,11 +116,11 @@ bool FGPVE::process() { if ( get_direction() == SG_IO_OUT ) { gen_message(); if ( ! io->write( buf, length ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error writing data." ); + SG_LOG( SG_IO, SG_ALERT, "Error writing data." ); return false; } } else if ( get_direction() == SG_IO_IN ) { - FG_LOG( FG_IO, FG_ALERT, "in direction not supported for RUL." ); + SG_LOG( SG_IO, SG_ALERT, "in direction not supported for RUL." ); return false; } diff --git a/src/Network/ray.cxx b/src/Network/ray.cxx index ece2b67fc..e93dc3fc2 100644 --- a/src/Network/ray.cxx +++ b/src/Network/ray.cxx @@ -196,7 +196,7 @@ bool FGRAY::gen_message() { // parse RUL message bool FGRAY::parse_message() { - FG_LOG( FG_IO, FG_ALERT, "RAY input not supported" ); + SG_LOG( SG_IO, SG_ALERT, "RAY input not supported" ); return false; } @@ -209,11 +209,11 @@ bool FGRAY::process() { if ( get_direction() == SG_IO_OUT ) { gen_message(); if ( ! io->write( buf, length ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error writing data." ); + SG_LOG( SG_IO, SG_ALERT, "Error writing data." ); return false; } } else if ( get_direction() == SG_IO_IN ) { - FG_LOG( FG_IO, FG_ALERT, "in direction not supported for RAY." ); + SG_LOG( SG_IO, SG_ALERT, "in direction not supported for RAY." ); return false; } diff --git a/src/Network/rul.cxx b/src/Network/rul.cxx index 815f11503..9040a8c4f 100644 --- a/src/Network/rul.cxx +++ b/src/Network/rul.cxx @@ -86,7 +86,7 @@ bool FGRUL::gen_message() { sprintf( buf, "p%c%c\n", roll, pitch); length = 4; - FG_LOG( FG_IO, FG_INFO, "p " << roll << " " << pitch ); + SG_LOG( SG_IO, SG_INFO, "p " << roll << " " << pitch ); return true; } @@ -94,7 +94,7 @@ bool FGRUL::gen_message() { // parse RUL message bool FGRUL::parse_message() { - FG_LOG( FG_IO, FG_ALERT, "RUL input not supported" ); + SG_LOG( SG_IO, SG_ALERT, "RUL input not supported" ); return false; } @@ -107,11 +107,11 @@ bool FGRUL::process() { if ( get_direction() == SG_IO_OUT ) { gen_message(); if ( ! io->write( buf, length ) ) { - FG_LOG( FG_IO, FG_ALERT, "Error writing data." ); + SG_LOG( SG_IO, SG_ALERT, "Error writing data." ); return false; } } else if ( get_direction() == SG_IO_IN ) { - FG_LOG( FG_IO, FG_ALERT, "in direction not supported for RUL." ); + SG_LOG( SG_IO, SG_ALERT, "in direction not supported for RUL." ); return false; } diff --git a/src/Objects/matlib.cxx b/src/Objects/matlib.cxx index 7c231d14d..dcd2dd6c8 100644 --- a/src/Objects/matlib.cxx +++ b/src/Objects/matlib.cxx @@ -92,7 +92,7 @@ bool FGMaterialLib::load( const string& mpath ) { fg_gzifstream in( mpath ); if ( ! in.is_open() ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << mpath ); + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << mpath ); exit(-1); } @@ -117,7 +117,7 @@ bool FGMaterialLib::load( const string& mpath ) { if ( material_name == "alias" ) { string src_mat, dst_mat; in >> dst_mat >> src_mat; - FG_LOG( FG_GENERAL, FG_INFO, " Material alias: " << dst_mat << + SG_LOG( SG_GENERAL, SG_INFO, " Material alias: " << dst_mat << " mapped to " << src_mat ); FGNewMat m = matlib[src_mat]; matlib[dst_mat] = m; @@ -140,7 +140,7 @@ bool FGMaterialLib::load( const string& mpath ) { tex_path.append( "Textures" ); } - FG_LOG( FG_TERRAIN, FG_INFO, " Loading material " + SG_LOG( SG_TERRAIN, SG_INFO, " Loading material " << material_name << " (" << tex_path.c_str() << ")"); GLenum shade_model = GL_SMOOTH; @@ -203,7 +203,7 @@ bool FGMaterialLib::add_item ( const string &mat_name, const string &full_path ) FGNewMat m( mat_name, tex_name ); - FG_LOG( FG_TERRAIN, FG_INFO, " Loading material " + SG_LOG( SG_TERRAIN, SG_INFO, " Loading material " << mat_name << " (" << tex_path << ")"); #if EXTRA_DEBUG @@ -232,7 +232,7 @@ bool FGMaterialLib::add_item ( const string &mat_name, ssgSimpleState *state ) FGNewMat m( mat_name ); m.set_ssg_state( state ); - FG_LOG( FG_TERRAIN, FG_INFO, " Loading material given a premade " + SG_LOG( SG_TERRAIN, SG_INFO, " Loading material given a premade " << "ssgSimpleState = " << mat_name ); #if EXTRA_DEBUG @@ -269,7 +269,7 @@ void FGMaterialLib::set_step ( int step ) // container::iterator it = begin(); for ( material_map_iterator it = begin(); it != end(); it++ ) { const string &key = it->first; - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Updating material " << key << " to step " << step ); FGNewMat &slot = it->second; slot.get_state()->selectStep(step); diff --git a/src/Objects/newmat.cxx b/src/Objects/newmat.cxx index 4e1fcc75b..a484a2022 100644 --- a/src/Objects/newmat.cxx +++ b/src/Objects/newmat.cxx @@ -177,19 +177,19 @@ void FGNewMat::set_ssg_state( ssgSimpleState *s ) { void FGNewMat::dump_info () { - FG_LOG( FG_TERRAIN, FG_INFO, "{" << endl << " texture = " + SG_LOG( SG_TERRAIN, SG_INFO, "{" << endl << " texture = " << texture_name ); - FG_LOG( FG_TERRAIN, FG_INFO, " xsize = " << xsize ); - FG_LOG( FG_TERRAIN, FG_INFO, " ysize = " << ysize ); - FG_LOG( FG_TERRAIN, FG_INFO, " ambient = " << ambient[0] << " " + SG_LOG( SG_TERRAIN, SG_INFO, " xsize = " << xsize ); + SG_LOG( SG_TERRAIN, SG_INFO, " ysize = " << ysize ); + SG_LOG( SG_TERRAIN, SG_INFO, " ambient = " << ambient[0] << " " << ambient[1] <<" "<< ambient[2] <<" "<< ambient[3] ); - FG_LOG( FG_TERRAIN, FG_INFO, " diffuse = " << diffuse[0] << " " + SG_LOG( SG_TERRAIN, SG_INFO, " diffuse = " << diffuse[0] << " " << diffuse[1] << " " << diffuse[2] << " " << diffuse[3] ); - FG_LOG( FG_TERRAIN, FG_INFO, " specular = " << specular[0] << " " + SG_LOG( SG_TERRAIN, SG_INFO, " specular = " << specular[0] << " " << specular[1] << " " << specular[2] << " " << specular[3]); - FG_LOG( FG_TERRAIN, FG_INFO, " emission = " << emission[0] << " " + SG_LOG( SG_TERRAIN, SG_INFO, " emission = " << emission[0] << " " << emission[1] << " " << emission[2] << " " << emission[3]); - FG_LOG( FG_TERRAIN, FG_INFO, " alpha = " << alpha << endl <<"}" ); + SG_LOG( SG_TERRAIN, SG_INFO, " alpha = " << alpha << endl <<"}" ); } @@ -237,7 +237,7 @@ operator >> ( istream& in, FGNewMat& m ) } else if ( token == "no" ) { m.alpha = 0; } else { - FG_LOG( FG_TERRAIN, FG_INFO, "Bad alpha value " << token ); + SG_LOG( SG_TERRAIN, SG_INFO, "Bad alpha value " << token ); } } else if ( token == "light-coverage" ) { in >> token >> m.light_coverage; diff --git a/src/Objects/obj.cxx b/src/Objects/obj.cxx index 9f12377f7..aa1575f0b 100644 --- a/src/Objects/obj.cxx +++ b/src/Objects/obj.cxx @@ -131,7 +131,7 @@ ssgBranch *fgGenTile( const string& path, FGTileEntry *t) { // set ssgState state = newmat->get_state(); } else { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Ack! unknown usemtl name = " << "Ocean" << " in " << path ); } @@ -377,8 +377,8 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, // Attempt to open "path.gz" or "path" fg_gzifstream in( path ); if ( ! in.is_open() ) { - FG_LOG( FG_TERRAIN, FG_DEBUG, "Cannot open file: " << path ); - FG_LOG( FG_TERRAIN, FG_DEBUG, "default to ocean tile: " << path ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "Cannot open file: " << path ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "default to ocean tile: " << path ); return NULL; } @@ -431,7 +431,7 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, in >> scenery_version; // cout << "scenery_version = " << scenery_version << endl; if ( scenery_version > 0.4 ) { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "\nYou are attempting to load a tile format that\n" << "is newer than this version of flightgear can\n" << "handle. You should upgrade your copy of\n" @@ -466,7 +466,7 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, if ( ! shared_done ) { // sanity check if ( (int)nodes.size() != vncount ) { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Tile has mismatched nodes = " << nodes.size() << " and normals = " << vncount << " : " << path ); @@ -519,14 +519,14 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, file += material; cout << "current file = " << file << endl; if ( ! material_lib.add_item( file ) ) { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Ack! unknown usemtl name = " << material << " in " << path ); } else { // locate our newly created material newmat = material_lib.find( material ); if ( newmat == NULL ) { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Ack! bad on the fly materia create = " << material << " in " << path ); } @@ -566,7 +566,7 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, >> normals[vncount][2]; vncount++; } else { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Read too many vertex normals in " << path << " ... dying :-(" ); exit(-1); @@ -578,7 +578,7 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, >> tex_coords[vtcount][1]; vtcount++; } else { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Read too many vertex texture coords in " << path << " ... dying :-(" ); @@ -596,14 +596,14 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, t->ncount++; } } else { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Read too many nodes in " << path << " ... dying :-("); exit(-1); } } else if ( (token == "tf") || (token == "ts") || (token == "f") ) { // triangle fan, strip, or individual face - // FG_LOG( FG_TERRAIN, FG_INFO, "new fan or strip"); + // SG_LOG( SG_TERRAIN, SG_INFO, "new fan or strip"); fan_vertices.clear(); fan_tex_coords.clear(); @@ -757,7 +757,7 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, if ( is_base ) { if ( coverage > 0.0 ) { if ( coverage < 10000.0 ) { - FG_LOG(FG_INPUT, FG_ALERT, "Light coverage is " + SG_LOG(SG_INPUT, SG_ALERT, "Light coverage is " << coverage << ", pushing up to 10000"); coverage = 10000; } @@ -765,7 +765,7 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, } } } else { - FG_LOG( FG_TERRAIN, FG_WARN, "Unknown token in " + SG_LOG( SG_TERRAIN, SG_WARN, "Unknown token in " << path << " = " << token ); } @@ -784,7 +784,7 @@ static ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t, } stopwatch.stop(); - FG_LOG( FG_TERRAIN, FG_DEBUG, + SG_LOG( SG_TERRAIN, SG_DEBUG, "Loaded " << path << " in " << stopwatch.elapsedSeconds() << " seconds" ); @@ -815,14 +815,14 @@ static ssgLeaf *gen_leaf( const string& path, file += material; cout << "current file = " << file << endl; if ( ! material_lib.add_item( file ) ) { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Ack! unknown usemtl name = " << material << " in " << path ); } else { // locate our newly created material newmat = material_lib.find( material ); if ( newmat == NULL ) { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Ack! bad on the fly materia create = " << material << " in " << path ); } @@ -889,7 +889,7 @@ static ssgLeaf *gen_leaf( const string& path, if ( calc_lights ) { if ( coverage > 0.0 ) { if ( coverage < 10000.0 ) { - FG_LOG(FG_INPUT, FG_ALERT, "Light coverage is " + SG_LOG(SG_INPUT, SG_ALERT, "Light coverage is " << coverage << ", pushing up to 10000"); coverage = 10000; } diff --git a/src/Scenery/newcache.cxx b/src/Scenery/newcache.cxx index c0e64720d..c9916a9bb 100644 --- a/src/Scenery/newcache.cxx +++ b/src/Scenery/newcache.cxx @@ -75,7 +75,7 @@ FGNewCache::~FGNewCache( void ) { // Free a tile cache entry void FGNewCache::entry_free( long cache_index ) { - FG_LOG( FG_TERRAIN, FG_INFO, "FREEING CACHE ENTRY = " << cache_index ); + SG_LOG( SG_TERRAIN, SG_INFO, "FREEING CACHE ENTRY = " << cache_index ); FGTileEntry *e = tile_cache[cache_index]; e->free_tile(); delete( e ); @@ -85,14 +85,14 @@ void FGNewCache::entry_free( long cache_index ) { // Initialize the tile cache subsystem void FGNewCache::init( void ) { - FG_LOG( FG_TERRAIN, FG_INFO, "Initializing the tile cache." ); + SG_LOG( SG_TERRAIN, SG_INFO, "Initializing the tile cache." ); // expand cache if needed. For best results ... i.e. to avoid // tile load problems and blank areas: max_cache_size = 50; // a random number to start with - FG_LOG( FG_TERRAIN, FG_INFO, " max cache size = " + SG_LOG( SG_TERRAIN, SG_INFO, " max cache size = " << max_cache_size ); - FG_LOG( FG_TERRAIN, FG_INFO, " current cache size = " + SG_LOG( SG_TERRAIN, SG_INFO, " current cache size = " << tile_cache.size() ); tile_map_iterator current = tile_cache.begin(); @@ -100,7 +100,7 @@ void FGNewCache::init( void ) { for ( ; current != end; ++current ) { long index = current->first; - FG_LOG( FG_TERRAIN, FG_DEBUG, "clearing " << index ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "clearing " << index ); FGTileEntry *e = current->second; e->tile_bucket.make_bad(); entry_free(index); @@ -109,7 +109,7 @@ void FGNewCache::init( void ) { // and ... just in case we missed something ... terrain->removeAllKids(); - FG_LOG( FG_TERRAIN, FG_INFO, " done with init()" ); + SG_LOG( SG_TERRAIN, SG_INFO, " done with init()" ); } @@ -192,7 +192,7 @@ static ssgLeaf *gen_lights( ssgVertexArray *lights, int inc, float bright ) { // Fill in a tile cache entry with real data for the specified bucket void FGNewCache::fill_in( const SGBucket& b ) { - FG_LOG( FG_TERRAIN, FG_INFO, "FILL IN CACHE ENTRY = " << b.gen_index() ); + SG_LOG( SG_TERRAIN, SG_INFO, "FILL IN CACHE ENTRY = " << b.gen_index() ); // clear out a distant entry in the cache if needed. make_space(); @@ -207,7 +207,7 @@ void FGNewCache::fill_in( const SGBucket& b ) { // update the contents e->center = Point3D( 0.0 ); if ( e->vec3_ptrs.size() || e->vec2_ptrs.size() || e->index_ptrs.size() ) { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Attempting to overwrite existing or" << " not properly freed leaf data." ); exit(-1); @@ -239,13 +239,13 @@ void FGNewCache::fill_in( const SGBucket& b ) { } // load custom objects - FG_LOG( FG_TERRAIN, FG_DEBUG, "CUSTOM OBJECTS" ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "CUSTOM OBJECTS" ); FGPath index_path = tile_path; index_path.append( b.gen_index_str() ); index_path.concat( ".ind" ); - FG_LOG( FG_TERRAIN, FG_DEBUG, "Looking in " << index_path.str() ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "Looking in " << index_path.str() ); fg_gzifstream in( index_path.str() ); @@ -260,7 +260,7 @@ void FGNewCache::fill_in( const SGBucket& b ) { #else in >> skipws; #endif - FG_LOG( FG_TERRAIN, FG_DEBUG, "token = " << token + SG_LOG( SG_TERRAIN, SG_DEBUG, "token = " << token << " name = " << name ); FGPath custom_path = tile_path; @@ -288,7 +288,7 @@ void FGNewCache::fill_in( const SGBucket& b ) { e->lights_range = NULL; /* uncomment this section for testing ground lights */ if ( light_pts->getNum() ) { - FG_LOG( FG_TERRAIN, FG_DEBUG, "generating lights" ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "generating lights" ); e->lights_transform = new ssgTransform; e->lights_range = new ssgRangeSelector; e->lights_brightness = new ssgSelector; @@ -314,11 +314,11 @@ void FGNewCache::fill_in( const SGBucket& b ) { // Ensure at least one entry is free in the cache void FGNewCache::make_space() { - FG_LOG( FG_TERRAIN, FG_INFO, "Make space in cache" ); + SG_LOG( SG_TERRAIN, SG_INFO, "Make space in cache" ); - FG_LOG( FG_TERRAIN, FG_DEBUG, "cache entries = " << tile_cache.size() ); - FG_LOG( FG_TERRAIN, FG_INFO, "max size = " << max_cache_size ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "cache entries = " << tile_cache.size() ); + SG_LOG( SG_TERRAIN, SG_INFO, "max size = " << max_cache_size ); if ( (int)tile_cache.size() < max_cache_size ) { // space in the cache, return @@ -343,18 +343,18 @@ void FGNewCache::make_space() { sgdCopyVec3( abs_view_pos, globals->get_current_view()->get_abs_view_pos() ); - FG_LOG( FG_TERRAIN, FG_DEBUG, "DIST Abs view pos = " + SG_LOG( SG_TERRAIN, SG_DEBUG, "DIST Abs view pos = " << abs_view_pos[0] << "," << abs_view_pos[1] << "," << abs_view_pos[2] ); - FG_LOG( FG_TERRAIN, FG_DEBUG, + SG_LOG( SG_TERRAIN, SG_DEBUG, " ref point = " << e->center ); sgdVec3 center; sgdSetVec3( center, e->center.x(), e->center.y(), e->center.z() ); dist = sgdDistanceVec3( center, abs_view_pos ); - FG_LOG( FG_TERRAIN, FG_DEBUG, " distance = " << dist ); + SG_LOG( SG_TERRAIN, SG_DEBUG, " distance = " << dist ); if ( dist > max_dist ) { max_dist = dist; @@ -367,11 +367,11 @@ void FGNewCache::make_space() { // index. if ( max_index >= 0 ) { - FG_LOG( FG_TERRAIN, FG_DEBUG, " max_dist = " << max_dist ); - FG_LOG( FG_TERRAIN, FG_DEBUG, " index = " << max_index ); + SG_LOG( SG_TERRAIN, SG_DEBUG, " max_dist = " << max_dist ); + SG_LOG( SG_TERRAIN, SG_DEBUG, " index = " << max_index ); entry_free( max_index ); } else { - FG_LOG( FG_TERRAIN, FG_ALERT, "WHOOPS!!! Dying in next_avail()" ); + SG_LOG( SG_TERRAIN, SG_ALERT, "WHOOPS!!! Dying in next_avail()" ); exit( -1 ); } } diff --git a/src/Scenery/scenery.cxx b/src/Scenery/scenery.cxx index cb21b6af0..4eea0869b 100644 --- a/src/Scenery/scenery.cxx +++ b/src/Scenery/scenery.cxx @@ -46,7 +46,7 @@ struct fgSCENERY scenery; // Initialize the Scenery Management system int fgSceneryInit( void ) { - FG_LOG( FG_TERRAIN, FG_INFO, "Initializing scenery subsystem" ); + SG_LOG( SG_TERRAIN, SG_INFO, "Initializing scenery subsystem" ); scenery.center = Point3D(0.0); scenery.cur_elev = -9999; diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx index d60c9578a..32be88ab4 100644 --- a/src/Scenery/tileentry.cxx +++ b/src/Scenery/tileentry.cxx @@ -82,15 +82,15 @@ static void my_remove_branch( ssgBranch * branch ) { // ssg as well as the whole ssg branch void FGTileEntry::free_tile() { int i; - FG_LOG( FG_TERRAIN, FG_DEBUG, + SG_LOG( SG_TERRAIN, SG_DEBUG, "FREEING TILE = (" << tile_bucket << ")" ); - FG_LOG( FG_TERRAIN, FG_DEBUG, + SG_LOG( SG_TERRAIN, SG_DEBUG, " deleting " << nodes.size() << " nodes" ); nodes.clear(); // delete the ssg structures - FG_LOG( FG_TERRAIN, FG_DEBUG, + SG_LOG( SG_TERRAIN, SG_DEBUG, " deleting (leaf data) vertex, normal, and " << " texture coordinate arrays" ); @@ -127,12 +127,12 @@ void FGTileEntry::free_tile() { parent->removeKid( terra_transform ); terra_transform = NULL; } else { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "parent pointer is NULL! Dying" ); exit(-1); } } else { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Parent count is zero for an ssg tile! Dying" ); exit(-1); } @@ -147,12 +147,12 @@ void FGTileEntry::free_tile() { parent->removeKid( lights_transform ); lights_transform = NULL; } else { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "parent pointer is NULL! Dying" ); exit(-1); } } else { - FG_LOG( FG_TERRAIN, FG_ALERT, + SG_LOG( SG_TERRAIN, SG_ALERT, "Parent count is zero for an ssg light tile! Dying" ); exit(-1); } diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 46ddbaca9..3b1f4315e 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -84,14 +84,14 @@ FGTileMgr::~FGTileMgr() { // Initialize the Tile Manager subsystem int FGTileMgr::init() { - FG_LOG( FG_TERRAIN, FG_INFO, "Initializing Tile Manager subsystem." ); + SG_LOG( SG_TERRAIN, SG_INFO, "Initializing Tile Manager subsystem." ); if ( state != Start ) { - FG_LOG( FG_TERRAIN, FG_INFO, + SG_LOG( SG_TERRAIN, SG_INFO, "... Reinitializing." ); destroy_queue(); } else { - FG_LOG( FG_TERRAIN, FG_INFO, + SG_LOG( SG_TERRAIN, SG_INFO, "... First time through." ); global_tile_cache.init(); } @@ -128,12 +128,12 @@ void FGTileMgr::load_tile( const SGBucket& b ) { FGTileEntry *t = global_tile_cache.get_tile( b ); if ( t == NULL ) { - FG_LOG( FG_TERRAIN, FG_DEBUG, "Loading tile " << b ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "Loading tile " << b ); global_tile_cache.fill_in( b ); t = global_tile_cache.get_tile( b ); t->prep_ssg_node( scenery.center, vis); } else { - FG_LOG( FG_TERRAIN, FG_DEBUG, "Tile already in cache " << b ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "Tile already in cache " << b ); } } @@ -195,7 +195,7 @@ bool FGTileMgr::current_elev_ssg( sgdVec3 abs_view_pos, double *terrain_elev ) { // cout << "NED: " << tmp[0] << " " << tmp[1] << " " << tmp[2] << endl; return true; } else { - FG_LOG( FG_TERRAIN, FG_INFO, "no terrain intersection" ); + SG_LOG( SG_TERRAIN, SG_INFO, "no terrain intersection" ); *terrain_elev = 0.0; float *up = globals->get_current_view()->get_world_up(); sgdSetVec3(scenery.cur_normal, up[0], up[1], up[2]); @@ -269,7 +269,7 @@ void FGTileMgr::initialize_queue() // First time through or we have teleported, initialize the // system and load all relavant tiles - FG_LOG( FG_TERRAIN, FG_INFO, "Updating Tile list for " << current_bucket ); + SG_LOG( SG_TERRAIN, SG_INFO, "Updating Tile list for " << current_bucket ); cout << "tile cache size = " << global_tile_cache.get_size() << endl; int i; @@ -289,7 +289,7 @@ void FGTileMgr::initialize_queue() // have something to see in our first frame. for ( i = 0; i < 9; ++i ) { if ( load_queue.size() ) { - FG_LOG( FG_TERRAIN, FG_DEBUG, + SG_LOG( SG_TERRAIN, SG_DEBUG, "Load queue not empty, loading a tile" ); SGBucket pending = load_queue.front(); @@ -313,7 +313,7 @@ void FGTileMgr::destroy_queue() { // chunks. If the chunk isn't already in the cache, then read it from // disk. int FGTileMgr::update( double lon, double lat ) { - FG_LOG( FG_TERRAIN, FG_DEBUG, "FGTileMgr::update()" ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "FGTileMgr::update()" ); // FGInterface *f = current_aircraft.fdm_state; @@ -322,17 +322,17 @@ int FGTileMgr::update( double lon, double lat ) { // latitude = f->get_Latitude() * SGD_RADIANS_TO_DEGREES; longitude = lon; latitude = lat; - // FG_LOG( FG_TERRAIN, FG_DEBUG, "lon "<< lonlat[LON] << + // SG_LOG( SG_TERRAIN, SG_DEBUG, "lon "<< lonlat[LON] << // " lat " << lonlat[LAT] ); current_bucket.set_bucket( longitude, latitude ); - // FG_LOG( FG_TERRAIN, FG_DEBUG, "Updating Tile list for " << current_bucket ); + // SG_LOG( SG_TERRAIN, SG_DEBUG, "Updating Tile list for " << current_bucket ); if ( global_tile_cache.exists( current_bucket ) ) { current_tile = global_tile_cache.get_tile( current_bucket ); scenery.next_center = current_tile->center; } else { - FG_LOG( FG_TERRAIN, FG_WARN, "Tile not found (Ok if initializing)" ); + SG_LOG( SG_TERRAIN, SG_WARN, "Tile not found (Ok if initializing)" ); } if ( state == Running ) { @@ -347,7 +347,7 @@ int FGTileMgr::update( double lon, double lat ) { } if ( load_queue.size() ) { - FG_LOG( FG_TERRAIN, FG_INFO, "Load queue size = " << load_queue.size() + SG_LOG( SG_TERRAIN, SG_INFO, "Load queue size = " << load_queue.size() << " loading a tile" ); SGBucket pending = load_queue.front(); diff --git a/src/Sound/soundmgr.cxx b/src/Sound/soundmgr.cxx index 8903da4f9..56c1f81ea 100644 --- a/src/Sound/soundmgr.cxx +++ b/src/Sound/soundmgr.cxx @@ -64,7 +64,7 @@ FGSoundMgr::FGSoundMgr() { audio_sched = new slScheduler( 8000 ); audio_mixer = new smMixer; - FG_LOG( FG_GENERAL, FG_INFO, + SG_LOG( SG_GENERAL, SG_INFO, "Rate = " << audio_sched->getRate() << " Bps = " << audio_sched->getBps() << " Stereo = " << audio_sched->getStereo() ); diff --git a/src/Time/event.cxx b/src/Time/event.cxx index 3d693c639..c497ed521 100644 --- a/src/Time/event.cxx +++ b/src/Time/event.cxx @@ -124,7 +124,7 @@ fgEVENT::~fgEVENT() void fgEVENT::run() { - FG_LOG(FG_EVENT, FG_DEBUG, "Running " << description ); + SG_LOG(SG_EVENT, SG_DEBUG, "Running " << description ); // record starting time last_run.stamp(); @@ -161,7 +161,7 @@ fgEVENT::run() int fgEVENT::PrintStats() const { - FG_LOG( FG_EVENT, FG_INFO, + SG_LOG( SG_EVENT, SG_INFO, " " << description << " int=" << interval / 1000.0 << " cum=" << cum_time @@ -179,7 +179,7 @@ fgEVENT_MGR::fgEVENT_MGR( void ) { // Initialize the scheduling subsystem void fgEVENT_MGR::Init( void ) { - FG_LOG(FG_EVENT, FG_INFO, "Initializing event manager" ); + SG_LOG(SG_EVENT, SG_INFO, "Initializing event manager" ); run_queue.erase( run_queue.begin(), run_queue.end() ); event_table.erase( event_table.begin(), event_table.end() ); @@ -196,7 +196,7 @@ fgEVENT_MGR::Register( const string& desc, // convert interval specified in milleseconds to usec fgEVENT* e = new fgEVENT( desc, cb, status, interval * 1000 ); - FG_LOG( FG_EVENT, FG_INFO, "Registering event: " << desc ); + SG_LOG( SG_EVENT, SG_INFO, "Registering event: " << desc ); // Actually run the event e->run(); @@ -229,9 +229,9 @@ void fgEVENT_MGR::Resume( void ) { void fgEVENT_MGR::PrintStats() { - FG_LOG( FG_EVENT, FG_INFO, "" ); - FG_LOG( FG_EVENT, FG_INFO, "Event Stats" ); - FG_LOG( FG_EVENT, FG_INFO, "-----------" ); + SG_LOG( SG_EVENT, SG_INFO, "" ); + SG_LOG( SG_EVENT, SG_INFO, "Event Stats" ); + SG_LOG( SG_EVENT, SG_INFO, "-----------" ); ConstEventIterator first = event_table.begin(); ConstEventIterator last = event_table.end(); @@ -245,7 +245,7 @@ fgEVENT_MGR::PrintStats() event_table.end(), mem_fun( &fgEVENT::PrintStats ) ); #endif - FG_LOG( FG_EVENT, FG_INFO, ""); + SG_LOG( SG_EVENT, SG_INFO, ""); } @@ -256,12 +256,12 @@ void fgEVENT_MGR::Process( void ) { SGTimeStamp cur_time; unsigned int i, size; - FG_LOG( FG_EVENT, FG_DEBUG, "Processing events" ); + SG_LOG( SG_EVENT, SG_DEBUG, "Processing events" ); // get the current time cur_time.stamp(); - FG_LOG( FG_EVENT, FG_DEBUG, + SG_LOG( SG_EVENT, SG_DEBUG, " Current timestamp = " << cur_time.get_seconds() ); // printf("Checking if anything is ready to move to the run queue\n"); @@ -273,7 +273,7 @@ void fgEVENT_MGR::Process( void ) { // e = *current++; e_ptr = event_table[i]; if ( e_ptr->status == fgEVENT::FG_EVENT_READY ) { - FG_LOG( FG_EVENT, FG_DEBUG, + SG_LOG( SG_EVENT, SG_DEBUG, " Item " << i << " current " << cur_time.get_seconds() << " next run @ " << e_ptr->next_run.get_seconds() ); if ( ( e_ptr->next_run - cur_time ) <= 0 ) { diff --git a/src/Time/light.cxx b/src/Time/light.cxx index 64147ec1b..2b1c10991 100644 --- a/src/Time/light.cxx +++ b/src/Time/light.cxx @@ -71,7 +71,7 @@ fgLIGHT::fgLIGHT( void ) { // initialize lighting tables void fgLIGHT::Init( void ) { - FG_LOG( FG_EVENT, FG_INFO, + SG_LOG( SG_EVENT, SG_INFO, "Initializing Lighting interpolation tables." ); // build the path name to the ambient lookup table @@ -107,19 +107,19 @@ void fgLIGHT::Update( void ) { f = current_aircraft.fdm_state; - FG_LOG( FG_EVENT, FG_INFO, "Updating light parameters." ); + SG_LOG( SG_EVENT, SG_INFO, "Updating light parameters." ); // calculate lighting parameters based on sun's relative angle to // local up deg = sun_angle * SGD_RADIANS_TO_DEGREES; - FG_LOG( FG_EVENT, FG_INFO, " Sun angle = " << deg ); + SG_LOG( SG_EVENT, SG_INFO, " Sun angle = " << deg ); ambient = ambient_tbl->interpolate( deg ); diffuse = diffuse_tbl->interpolate( deg ); sky_brightness = sky_tbl->interpolate( deg ); - FG_LOG( FG_EVENT, FG_INFO, + SG_LOG( SG_EVENT, SG_INFO, " ambient = " << ambient << " diffuse = " << diffuse << " sky = " << sky_brightness ); @@ -160,7 +160,7 @@ void fgLIGHT::UpdateAdjFog( void ) { f = current_aircraft.fdm_state; - FG_LOG( FG_EVENT, FG_DEBUG, "Updating adjusted fog parameters." ); + SG_LOG( SG_EVENT, SG_DEBUG, "Updating adjusted fog parameters." ); // set fog color (we'll try to match the sunset color in the // direction we are looking @@ -179,7 +179,7 @@ void fgLIGHT::UpdateAdjFog( void ) { rotation -= SGD_2PI; } rotation *= SGD_RADIANS_TO_DEGREES; - // fgPrintf( FG_EVENT, FG_INFO, + // fgPrintf( SG_EVENT, SG_INFO, // " View to sun difference in degrees = %.2f\n", rotation); // next check if we are in a sunset/sunrise situation diff --git a/src/Time/moonpos.cxx b/src/Time/moonpos.cxx index 3add5d22c..8cac8cafd 100644 --- a/src/Time/moonpos.cxx +++ b/src/Time/moonpos.cxx @@ -200,7 +200,7 @@ static double julian_date(int y, int m, int d) { /* lazy test to ensure gregorian calendar */ if (y < 1583) { - FG_LOG( FG_EVENT, FG_ALERT, + SG_LOG( SG_EVENT, SG_ALERT, "WHOOPS! Julian dates only valid for 1582 oct 15 or later" ); } @@ -352,7 +352,7 @@ void fgUpdateMoonPos( void ) { SGTime *t = globals->get_time_params(); v = (FGViewerRPH *)globals->get_current_view(); - FG_LOG( FG_EVENT, FG_INFO, " Updating Moon position" ); + SG_LOG( SG_EVENT, SG_INFO, " Updating Moon position" ); // (not sure why there was two) // fgMoonPosition(t->cur_time, &l->moon_lon, &moon_gd_lat); @@ -363,8 +363,8 @@ void fgUpdateMoonPos( void ) { p = Point3D( l->moon_lon, l->moon_gc_lat, sl_radius ); l->fg_moonpos = sgPolarToCart3d(p); - FG_LOG( FG_EVENT, FG_INFO, " t->cur_time = " << t->get_cur_time() ); - FG_LOG( FG_EVENT, FG_INFO, + SG_LOG( SG_EVENT, SG_INFO, " t->cur_time = " << t->get_cur_time() ); + SG_LOG( SG_EVENT, SG_INFO, " Moon Geodetic lat = " << moon_gd_lat << " Geocentric lat = " << l->moon_gc_lat ); @@ -391,7 +391,7 @@ void fgUpdateMoonPos( void ) { // << nmoon[2] << endl; l->moon_angle = acos( sgScalarProductVec3( nup, nmoon ) ); - FG_LOG( FG_EVENT, FG_INFO, "moon angle relative to current location = " + SG_LOG( SG_EVENT, SG_INFO, "moon angle relative to current location = " << l->moon_angle ); // calculate vector to moon's position on the earth's surface diff --git a/src/Time/sunpos.cxx b/src/Time/sunpos.cxx index 92b6ab708..f9d4f19d0 100644 --- a/src/Time/sunpos.cxx +++ b/src/Time/sunpos.cxx @@ -108,7 +108,7 @@ static double julian_date(int y, int m, int d) { /* lazy test to ensure gregorian calendar */ if (y < 1583) { - FG_LOG( FG_EVENT, FG_ALERT, + SG_LOG( SG_EVENT, SG_ALERT, "WHOOPS! Julian dates only valid for 1582 oct 15 or later" ); } @@ -260,8 +260,8 @@ void fgUpdateSunPos( void ) { SGTime *t = globals->get_time_params(); v = (FGViewerRPH *)globals->get_current_view(); - FG_LOG( FG_EVENT, FG_INFO, " Updating Sun position" ); - FG_LOG( FG_EVENT, FG_INFO, " Gst = " << t->getGst() ); + SG_LOG( SG_EVENT, SG_INFO, " Updating Sun position" ); + SG_LOG( SG_EVENT, SG_INFO, " Gst = " << t->getGst() ); fgSunPositionGST(t->getGst(), &l->sun_lon, &sun_gd_lat); @@ -270,8 +270,8 @@ void fgUpdateSunPos( void ) { p = Point3D( l->sun_lon, l->sun_gc_lat, sl_radius ); l->fg_sunpos = sgPolarToCart3d(p); - FG_LOG( FG_EVENT, FG_INFO, " t->cur_time = " << t->get_cur_time() ); - FG_LOG( FG_EVENT, FG_INFO, + SG_LOG( SG_EVENT, SG_INFO, " t->cur_time = " << t->get_cur_time() ); + SG_LOG( SG_EVENT, SG_INFO, " Sun Geodetic lat = " << sun_gd_lat << " Geocentric lat = " << l->sun_gc_lat ); @@ -298,7 +298,7 @@ void fgUpdateSunPos( void ) { // << nsun[2] << endl; l->sun_angle = acos( sgScalarProductVec3 ( nup, nsun ) ); - FG_LOG( FG_EVENT, FG_INFO, "sun angle relative to current location = " + SG_LOG( SG_EVENT, SG_INFO, "sun angle relative to current location = " << l->sun_angle ); // calculate vector to sun's position on the earth's surface diff --git a/src/Weather/weather.cxx b/src/Weather/weather.cxx index 35e12966b..7d2c45ae7 100644 --- a/src/Weather/weather.cxx +++ b/src/Weather/weather.cxx @@ -55,7 +55,7 @@ FGWeather::~FGWeather() { // Initialize the weather modeling subsystem void FGWeather::Init( ) { - FG_LOG( FG_GENERAL, FG_INFO, "Initializing weather subsystem"); + SG_LOG( SG_GENERAL, SG_INFO, "Initializing weather subsystem"); // Configure some wind // FG_V_north_airmass = 15; // ft/s =~ 10mph diff --git a/src/Weather/weather.hxx b/src/Weather/weather.hxx index e703d704b..03e5714f2 100644 --- a/src/Weather/weather.hxx +++ b/src/Weather/weather.hxx @@ -69,8 +69,8 @@ public: xglFogf (GL_FOG_DENSITY, fog_exp2_density); xglFogi( GL_FOG_MODE, GL_EXP2 ); - // FG_LOG( FG_INPUT, FG_DEBUG, "Fog density = " << fog_density ); - // FG_LOG( FG_INPUT, FG_INFO, + // SG_LOG( SG_INPUT, SG_DEBUG, "Fog density = " << fog_density ); + // SG_LOG( SG_INPUT, SG_INFO, // "Fog exp2 density = " << fog_exp2_density ); } };