}
// Should never get here.
- SG_LOG(SG_GENERAL, SG_ALERT, "PT_vs_hpt: ran out of layers for h=" << hh );
+ SG_LOG(SG_ENVIRONMENT, SG_ALERT, "PT_vs_hpt: ran out of layers for h=" << hh );
return make_pair(d0, d0);
}
double rslt = field_press
* pow(1. + ISA::lam0 * field_elev / ISA::T0 * prat, 1./nn);
#if 0
- SG_LOG(SG_GENERAL, SG_ALERT, "QNH: elev: " << field_elev
+ SG_LOG(SG_ENVIRONMENT, SG_ALERT, "QNH: elev: " << field_elev
<< " press: " << field_press
<< " prat: " << prat
<< " rslt: " << rslt
#if 0
{
- SG_LOG(SG_GENERAL, SG_DEBUG, "recalc_sl_temperature: using "
+ SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "recalc_sl_temperature: using "
<< temperature_degc << " @ " << elevation_ft << " :: " << this);
}
#endif
if (elevation_ft * atmodel::foot >= ISA_def[1].height) {
- SG_LOG(SG_GENERAL, SG_ALERT, "recalc_sl_temperature: "
+ SG_LOG(SG_ENVIRONMENT, SG_ALERT, "recalc_sl_temperature: "
<< "valid only in troposphere, not " << elevation_ft);
return;
}
using namespace atmodel;
#if 0
{
- SG_LOG(SG_GENERAL, SG_ALERT, "recalc_sl_pressure: using "
+ SG_LOG(SG_ENVIRONMENT, SG_ALERT, "recalc_sl_pressure: using "
<< pressure_inhg << " and "
<< temperature_degc << " @ " << elevation_ft << " :: " << this);
}
{
static int count(0);
if (++count % 1000 == 0) {
- SG_LOG(SG_GENERAL, SG_ALERT,
+ SG_LOG(SG_ENVIRONMENT, SG_ALERT,
"recalc_alt_pt for: " << elevation_ft
<< " using " << pressure_sea_level_inhg
<< " and " << temperature_sea_level_degc
// cleanup entries with (almost)same altitude
for( size_type n = 1; n < size(); n++ ) {
if( fabs(at(n)->altitude_ft - at(n-1)->altitude_ft ) < 1 ) {
- SG_LOG( SG_GENERAL, SG_ALERT, "Removing duplicate altitude entry in environment config for altitude " << at(n)->altitude_ft );
+ SG_LOG( SG_ENVIRONMENT, SG_ALERT, "Removing duplicate altitude entry in environment config for altitude " << at(n)->altitude_ft );
erase( begin() + n );
}
}
void
FGEnvironmentMgr::init ()
{
- SG_LOG( SG_GENERAL, SG_INFO, "Initializing environment subsystem");
+ SG_LOG( SG_ENVIRONMENT, SG_INFO, "Initializing environment subsystem");
SGSubsystemGroup::init();
fgClouds->Init();
void
FGEnvironmentMgr::reinit ()
{
- SG_LOG( SG_GENERAL, SG_INFO, "Reinitializing environment subsystem");
+ SG_LOG( SG_ENVIRONMENT, SG_INFO, "Reinitializing environment subsystem");
SGSubsystemGroup::reinit();
}
// update closest airport information
_positionTimeToLive = 30.0;
- SG_LOG(SG_ALL, SG_INFO, "FGEnvironmentMgr::update: updating closest airport");
+ SG_LOG(SG_ENVIRONMENT, SG_INFO, "FGEnvironmentMgr::update: updating closest airport");
SGGeod pos = SGGeod::fromDeg(_longitude_n->getDoubleValue(),
_latitude_n->getDoubleValue());
FGAirport * nearestAirport = FGAirport::findClosest(pos, 100.0);
if( nearestAirport == NULL )
{
- SG_LOG(SG_ALL,SG_WARN,"FGEnvironmentMgr::update: No airport within 100NM range");
+ SG_LOG(SG_ENVIRONMENT,SG_WARN,"FGEnvironmentMgr::update: No airport within 100NM range");
}
else
{
FGEnvironmentMgr::set_cloud_layer_coverage_type (int index, int type )
{
if( type < 0 || type >= SGCloudLayer::SG_MAX_CLOUD_COVERAGES ) {
- SG_LOG(SG_ALL,SG_WARN,"Unknown cloud layer type " << type << " ignored" );
+ SG_LOG(SG_ENVIRONMENT,SG_WARN,"Unknown cloud layer type " << type << " ignored" );
return;
}
_time = sgTimeGetGMT(_year - 1900, _month - 1, _day, _hour, _minute, 0);
- SG_LOG(SG_GENERAL, SG_INFO, _data);
+ SG_LOG(SG_ENVIRONMENT, SG_INFO, _data);
if (_x_proxy)
- SG_LOG(SG_GENERAL, SG_INFO, "METAR from proxy");
+ SG_LOG(SG_ENVIRONMENT, SG_INFO, "METAR from proxy");
else
- SG_LOG(SG_GENERAL, SG_INFO, "METAR from weather.noaa.gov");
+ SG_LOG(SG_ENVIRONMENT, SG_INFO, "METAR from weather.noaa.gov");
}
// calculation of magnetic variation is expensive. Cache the position
// and perform this calculation only if it has changed
if( _lon != lon || _lat != lat || _alt != alt ) {
- SG_LOG(SG_ALL, SG_DEBUG, "Recalculating magvar for lon=" << lon << ", lat=" << lat << ", alt=" << alt );
+ SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "Recalculating magvar for lon=" << lon << ", lat=" << lat << ", alt=" << alt );
_lon = lon;
_lat = lat;
_alt = alt;
m = new FGMetar( _metar );
}
catch( sg_io_exception ) {
- SG_LOG( SG_GENERAL, SG_WARN, "Can't parse metar: " << _metar );
+ SG_LOG( SG_ENVIRONMENT, SG_WARN, "Can't parse metar: " << _metar );
_metarValidNode->setBoolValue(false);
return;
}
PropertyList metars = rootNode->getChildren("metar");
for( PropertyList::size_type i = 1; i < metars.size(); i++ ) {
- SG_LOG( SG_ALL, SG_INFO, "Adding metar properties at " << metars[i]->getStringValue() );
+ SG_LOG( SG_ENVIRONMENT, SG_INFO, "Adding metar properties at " << metars[i]->getStringValue() );
_metarProperties.push_back( new LiveMetarProperties(
fgGetNode( metars[i]->getStringValue(), true )));
}
if (responseCode() == 200) {
wxController->gotMetar(stationId, metar);
} else {
- SG_LOG(SG_IO, SG_WARN, "metar download failed:" << url() << ": reason:" << responseReason());
+ SG_LOG(SG_ENVIRONMENT, SG_WARN, "metar download failed:" << url() << ": reason:" << responseReason());
}
}
if( _positionTimeToLive <= 0.0 ) {
// check nearest airport
- SG_LOG(SG_ALL, SG_INFO, "NoaaMetarRealWxController::update(): (re) checking nearby airport with METAR" );
+ SG_LOG(SG_ENVIRONMENT, SG_INFO, "NoaaMetarRealWxController::update(): (re) checking nearby airport with METAR" );
_positionTimeToLive = 60.0;
SGGeod pos = SGGeod::fromDeg(_longitude_n->getDoubleValue(), _latitude_n->getDoubleValue());
FGAirport * nearestAirport = FGAirport::findClosest(pos, 10000.0, MetarAirportFilter::instance() );
if( nearestAirport == NULL ) {
- SG_LOG(SG_ALL,SG_WARN,"RealWxController::update can't find airport with METAR within 10000NM" );
+ SG_LOG(SG_ENVIRONMENT,SG_WARN,"RealWxController::update can't find airport with METAR within 10000NM" );
return;
}
- SG_LOG(SG_ALL, SG_INFO,
+ SG_LOG(SG_ENVIRONMENT, SG_INFO,
"NoaaMetarRealWxController::update(): nearest airport with METAR is: " << nearestAirport->ident() );
// if it has changed, invalidate the associated METAR
if( _metarProperties[0]->getStationId() != nearestAirport->ident() ) {
- SG_LOG(SG_ALL, SG_INFO,
+ SG_LOG(SG_ENVIRONMENT, SG_INFO,
"NoaaMetarRealWxController::update(): nearest airport with METAR has changed. Old: '" <<
_metarProperties[0]->getStationId() <<
"', new: '" << nearestAirport->ident() << "'" );
const std::string & stationId = p->getStationId();
if( stationId.empty() ) continue;
- SG_LOG(SG_ALL, SG_INFO,
+ SG_LOG(SG_ENVIRONMENT, SG_INFO,
"NoaaMetarRealWxController::update(): spawning load request for station-id '" << stationId << "'" );
_http.makeRequest(new MetarGetRequest(this, stationId));
void NoaaMetarRealWxController::gotMetar(const string& stationId, const string& metar)
{
- SG_LOG( SG_ALL, SG_INFO, "NoaaMetarRwalWxController::update() received METAR for " << stationId << ": " << metar );
+ SG_LOG( SG_ENVIRONMENT, SG_INFO, "NoaaMetarRwalWxController::update() received METAR for " << stationId << ": " << metar );
BOOST_FOREACH(LiveMetarProperties* p, _metarProperties) {
if (p->getStationId() != stationId)
continue;
LogClassMapping(SG_CLIPPER, "clipper"),
LogClassMapping(SG_NETWORK, "network"),
LogClassMapping(SG_INSTR, "instrumentation"),
+ LogClassMapping(SG_ATC, "atc"),
+ LogClassMapping(SG_NASAL, "nasal"),
LogClassMapping(SG_SYSTEMS, "systems"),
+ LogClassMapping(SG_AI, "ai"),
+ LogClassMapping(SG_ENVIRONMENT, "environment"),
+ LogClassMapping(SG_SOUND, "sound"),
LogClassMapping(SG_UNDEFD, "")
};
log.delimiter = delimiter.c_str()[0];
log.output = new ofstream(filename.c_str());
if (!log.output) {
- SG_LOG(SG_INPUT, SG_ALERT, "Cannot write log to " << filename);
+ SG_LOG(SG_GENERAL, SG_ALERT, "Cannot write log to " << filename);
continue;
}
frame_signal->fireValueChanged();
SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping");
- SG_LOG( SG_ALL, SG_DEBUG, "Running Main Loop");
- SG_LOG( SG_ALL, SG_DEBUG, "======= ==== ====");
+ SG_LOG( SG_GENERAL, SG_DEBUG, "Running Main Loop");
+ SG_LOG( SG_GENERAL, SG_DEBUG, "======= ==== ====");
// update "time"
simgear::AtomicChangeListener::fireChangeListeners();
- SG_LOG( SG_ALL, SG_DEBUG, "" );
+ SG_LOG( SG_GENERAL, SG_DEBUG, "" );
}
void fgInitSoundManager()
string m(exc.getMessage());
m += " ";
m += exc.getLocation().asString();
- SG_LOG( SG_ALL, SG_ALERT, m );
+ SG_LOG( SG_TERRAIN, SG_ALERT, m );
} catch (const sg_exception& exc) { // XXX may be redundant
- SG_LOG( SG_ALL, SG_ALERT, exc.getMessage());
+ SG_LOG( SG_TERRAIN, SG_ALERT, exc.getMessage());
}
return result;
}
}
} else
{
- SG_LOG(SG_INPUT, SG_ALERT, "Warning: empty tile in cache!");
+ SG_LOG(SG_TERRAIN, SG_ALERT, "Warning: empty tile in cache!");
}
tile_cache.next();
sz++;
outer->set_reference_dist( 10.0 );
outer->set_max_dist( 20.0 );
} catch ( sg_io_exception &e ) {
- SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage());
+ SG_LOG(SG_SOUND, SG_ALERT, e.getFormattedMessage());
}
return true;
string path_str = node->getStringValue("path");
if (path_str.empty()) {
- SG_LOG(SG_GENERAL, SG_ALERT, "No path in /sim/sound/path");
+ SG_LOG(SG_SOUND, SG_ALERT, "No path in /sim/sound/path");
return;
}
SGPath path = globals->resolve_aircraft_path(path_str);
- SG_LOG(SG_GENERAL, SG_INFO, "Reading sound " << node->getName()
+ SG_LOG(SG_SOUND, SG_INFO, "Reading sound " << node->getName()
<< " from " << path.str());
SGPropertyNode root;
try {
readProperties(path.str(), &root);
} catch (const sg_exception &) {
- SG_LOG(SG_GENERAL, SG_ALERT,
+ SG_LOG(SG_SOUND, SG_ALERT,
"Error reading file '" << path.str() << '\'');
return;
}
_sound.push_back(sound);
} catch ( sg_exception &e ) {
- SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage());
+ SG_LOG(SG_SOUND, SG_ALERT, e.getFormattedMessage());
delete sound;
}
}
for (unsigned int i = 0; i < voices.size(); i++)
_voices.push_back(new FGVoice(this, voices[i]));
} catch (const string& s) {
- SG_LOG(SG_IO, SG_ALERT, "VOICE: " << s);
+ SG_LOG(SG_SOUND, SG_ALERT, "VOICE: " << s);
}
#if defined(ENABLE_THREADS)
_festival(node->getBoolValue("festival", true)),
_mgr(mgr)
{
- SG_LOG(SG_IO, SG_INFO, "VOICE: adding `" << node->getStringValue("desc", "<unnamed>")
+ SG_LOG(SG_SOUND, SG_INFO, "VOICE: adding `" << node->getStringValue("desc", "<unnamed>")
<< "' voice");
const string &host = _mgr->_host;
const string &port = _mgr->_port;
+ "'. Either it's not\n Festival listening,"
" or Festival couldn't open a sound device.";
- SG_LOG(SG_IO, SG_INFO, "VOICE: connection to Festival server on `"
+ SG_LOG(SG_SOUND, SG_INFO, "VOICE: connection to Festival server on `"
<< host << ':' << port << "' established");
setVolume(_volume = _volumeNode->getDoubleValue());
}
catch (const sg_exception &e)
{
- SG_LOG(SG_INSTR, SG_ALERT, "Error loading sound sample \"" + filename + "\": " + e.getFormattedMessage());
+ SG_LOG(SG_SOUND, SG_ALERT, "Error loading sound sample \"" + filename + "\": " + e.getFormattedMessage());
exit(1);
}
float available_amps = ideal_amps;
return available_amps - amps;
} else {
- SG_LOG( SG_ALL, SG_ALERT, "unknown supplier type" );
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "unknown supplier type" );
}
return 0.0;
// cout << "external amps = " << 0.0 << endl;
return ideal_volts;
} else {
- SG_LOG( SG_ALL, SG_ALERT, "unknown supplier type" );
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "unknown supplier type" );
}
return 0.0;
// cout << "external amps = " << 0.0 << endl;
return ideal_amps;
} else {
- SG_LOG( SG_ALL, SG_ALERT, "unknown supplier type" );
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "unknown supplier type" );
}
return 0.0;
} else if ( s->get_kind() == FG_BUS ) {
s->add_output( this );
} else {
- SG_LOG( SG_ALL, SG_ALERT,
+ SG_LOG( SG_SYSTEMS, SG_ALERT,
"Attempt to connect to something that can't provide an output: "
<< child->getStringValue() );
}
} else {
- SG_LOG( SG_ALL, SG_ALERT, "Can't find named source: "
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "Can't find named source: "
<< child->getStringValue() );
}
} else if ( cname == "output" ) {
== FGElectricalSupplier::FG_BATTERY ) {
s->add_output( this );
} else {
- SG_LOG( SG_ALL, SG_ALERT,
+ SG_LOG( SG_SYSTEMS, SG_ALERT,
"Attempt to connect to something that can't provide an input: "
<< child->getStringValue() );
}
} else {
- SG_LOG( SG_ALL, SG_ALERT, "Can't find named source: "
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "Can't find named source: "
<< child->getStringValue() );
}
} else if ( cname == "switch" ) {
SGPropertyNode *path_n = fgGetNode("/sim/systems/electrical/path");
if ( path_n ) {
if ( path.length() ) {
- SG_LOG( SG_ALL, SG_INFO,
+ SG_LOG( SG_SYSTEMS, SG_INFO,
"NOTICE: System manager configuration specifies an " <<
"electrical system: " << path << " but it is " <<
"being overridden by the one specified in the -set.xml " <<
SGPath config = globals->resolve_aircraft_path(path);
// load an obsolete xml configuration
- SG_LOG( SG_ALL, SG_WARN,
+ SG_LOG( SG_SYSTEMS, SG_WARN,
"Reading deprecated xml electrical system model from\n "
<< config.str() );
try {
if ( build(config_props) ) {
enabled = true;
} else {
- SG_LOG( SG_ALL, SG_ALERT,
+ SG_LOG( SG_SYSTEMS, SG_ALERT,
"Detected a logic error in the electrical system ");
- SG_LOG( SG_ALL, SG_ALERT,
+ SG_LOG( SG_SYSTEMS, SG_ALERT,
"specification file. See earlier errors for " );
- SG_LOG( SG_ALL, SG_ALERT,
+ SG_LOG( SG_SYSTEMS, SG_ALERT,
"details.");
exit(-1);
}
} catch (const sg_exception&) {
- SG_LOG( SG_ALL, SG_ALERT,
+ SG_LOG( SG_SYSTEMS, SG_ALERT,
"Failed to load electrical system model: "
<< config.str() );
}
} else {
- SG_LOG( SG_ALL, SG_INFO,
+ SG_LOG( SG_SYSTEMS, SG_INFO,
"No xml-based electrical model specified for this model!");
}
" " );
if ( node->apply_load( load, dt ) < 0.0 ) {
- SG_LOG(SG_ALL, SG_ALERT,
+ SG_LOG(SG_SYSTEMS, SG_ALERT,
"Error drawing more current than available!");
}
}
" " );
if ( node->apply_load( load, dt ) < 0.0 ) {
- SG_LOG(SG_ALL, SG_ALERT,
+ SG_LOG(SG_SYSTEMS, SG_ALERT,
"Error drawing more current than available!");
}
}
// cout << "battery load = " << load << endl;
if ( node->apply_load( load, dt ) < 0.0 ) {
- SG_LOG(SG_ALL, SG_ALERT,
+ SG_LOG(SG_SYSTEMS, SG_ALERT,
"Error drawing more current than available!");
}
}
new FGElectricalConnector( node, this );
connectors.push_back( c );
} else {
- SG_LOG( SG_ALL, SG_ALERT, "Unknown component type specified: "
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "Unknown component type specified: "
<< name );
return false;
}
}
// cout << s << " input_volts = " << volts << endl;
} else {
- SG_LOG( SG_ALL, SG_ALERT, "unkown node type" );
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "unkown node type" );
}
int i;
if (path_n) {
SGPath config = globals->resolve_aircraft_path(path_n->getStringValue());
- SG_LOG( SG_ALL, SG_INFO, "Reading systems from "
+ SG_LOG( SG_SYSTEMS, SG_INFO, "Reading systems from "
<< config.str() );
try {
readProperties( config.str(), config_props );
if ( build(config_props) ) {
enabled = true;
} else {
- SG_LOG( SG_ALL, SG_ALERT,
+ SG_LOG( SG_SYSTEMS, SG_ALERT,
"Detected an internal inconsistency in the systems");
- SG_LOG( SG_ALL, SG_ALERT,
+ SG_LOG( SG_SYSTEMS, SG_ALERT,
" system specification file. See earlier errors for" );
- SG_LOG( SG_ALL, SG_ALERT,
+ SG_LOG( SG_SYSTEMS, SG_ALERT,
" details.");
exit(-1);
}
} catch (const sg_exception&) {
- SG_LOG( SG_ALL, SG_ALERT, "Failed to load systems system model: "
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "Failed to load systems system model: "
<< config.str() );
}
} else {
- SG_LOG( SG_ALL, SG_WARN,
+ SG_LOG( SG_SYSTEMS, SG_WARN,
"No systems model specified for this model!");
}
set_subsystem( "system" + temp.str(),
new VacuumSystem( node ) );
} else {
- SG_LOG( SG_ALL, SG_ALERT, "Unknown top level section: "
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "Unknown top level section: "
<< name );
return false;
}