Use some more logging class variety.
Stop using SG_GENERAL and SG_ALL everywhere. Using different classes makes switching the classes really useful...
This commit is contained in:
parent
ce97a1e4c5
commit
e9a9f8c96d
17 changed files with 72 additions and 67 deletions
|
@ -108,7 +108,7 @@ pair<double,double> PT_vs_hpt(
|
|||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ double FGAtmo::QNH(const double field_elev, const double field_press) {
|
|||
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
|
||||
|
|
|
@ -678,13 +678,13 @@ FGEnvironment::_recalc_sl_temperature ()
|
|||
|
||||
#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;
|
||||
}
|
||||
|
@ -728,7 +728,7 @@ FGEnvironment::_recalc_sl_pressure ()
|
|||
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);
|
||||
}
|
||||
|
@ -749,7 +749,7 @@ FGEnvironment::_recalc_alt_pt ()
|
|||
{
|
||||
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
|
||||
|
|
|
@ -182,7 +182,7 @@ void LayerTable::read(FGEnvironment * parent )
|
|||
// 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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ FGEnvironmentMgr::~FGEnvironmentMgr ()
|
|||
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();
|
||||
|
||||
|
@ -150,7 +150,7 @@ FGEnvironmentMgr::init ()
|
|||
void
|
||||
FGEnvironmentMgr::reinit ()
|
||||
{
|
||||
SG_LOG( SG_GENERAL, SG_INFO, "Reinitializing environment subsystem");
|
||||
SG_LOG( SG_ENVIRONMENT, SG_INFO, "Reinitializing environment subsystem");
|
||||
SGSubsystemGroup::reinit();
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ FGEnvironmentMgr::update (double dt)
|
|||
// 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());
|
||||
|
@ -273,7 +273,7 @@ FGEnvironmentMgr::update (double dt)
|
|||
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
|
||||
{
|
||||
|
@ -428,7 +428,7 @@ void
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -148,11 +148,11 @@ FGMetar::FGMetar(const string& icao, const string& proxy, const string& port, co
|
|||
|
||||
_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");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ inline void MagneticVariation::recalc( double lon, double lat, double alt )
|
|||
// 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;
|
||||
|
@ -194,7 +194,7 @@ void MetarProperties::set_metar( const char * metar )
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ BasicRealWxController::BasicRealWxController( SGPropertyNode_ptr rootNode ) :
|
|||
|
||||
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 )));
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ public:
|
|||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -302,23 +302,23 @@ void NoaaMetarRealWxController::update( bool first, double dt )
|
|||
|
||||
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() << "'" );
|
||||
|
@ -335,7 +335,7 @@ void NoaaMetarRealWxController::update( bool first, double dt )
|
|||
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));
|
||||
|
@ -345,7 +345,7 @@ void NoaaMetarRealWxController::update( bool first, double dt )
|
|||
|
||||
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;
|
||||
|
|
|
@ -74,7 +74,12 @@ LogClassMapping log_class_mappings [] = {
|
|||
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, "")
|
||||
};
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ FGLogger::init ()
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -134,8 +134,8 @@ static void fgMainLoop( void ) {
|
|||
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"
|
||||
|
@ -242,7 +242,7 @@ static void fgMainLoop( void ) {
|
|||
|
||||
simgear::AtomicChangeListener::fireChangeListeners();
|
||||
|
||||
SG_LOG( SG_ALL, SG_DEBUG, "" );
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG, "" );
|
||||
}
|
||||
|
||||
void fgInitSoundManager()
|
||||
|
|
|
@ -279,9 +279,9 @@ FGTileMgr::loadTileModel(const string& modelPath, bool cacheModel)
|
|||
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;
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ void FGTileMgr::update_queues()
|
|||
}
|
||||
} 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++;
|
||||
|
|
|
@ -99,7 +99,7 @@ bool FGBeacon::init() {
|
|||
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;
|
||||
|
|
|
@ -71,19 +71,19 @@ FGFX::init()
|
|||
|
||||
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;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ FGFX::init()
|
|||
|
||||
_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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ void FGVoiceMgr::init()
|
|||
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)
|
||||
|
@ -105,7 +105,7 @@ FGVoiceMgr::FGVoice::FGVoice(FGVoiceMgr *mgr, const SGPropertyNode_ptr node) :
|
|||
_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;
|
||||
|
@ -124,7 +124,7 @@ FGVoiceMgr::FGVoice::FGVoice(FGVoiceMgr *mgr, const SGPropertyNode_ptr node) :
|
|||
+ "'. 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());
|
||||
|
|
|
@ -214,7 +214,7 @@ FGVoicePlayer::get_sample (const char *name)
|
|||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ float FGElectricalSupplier::apply_load( float amps, float dt ) {
|
|||
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;
|
||||
|
@ -151,7 +151,7 @@ float FGElectricalSupplier::get_output_volts() {
|
|||
// 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;
|
||||
|
@ -180,7 +180,7 @@ float FGElectricalSupplier::get_output_amps() {
|
|||
// 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;
|
||||
|
@ -274,12 +274,12 @@ FGElectricalConnector::FGElectricalConnector ( SGPropertyNode *node,
|
|||
} 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" ) {
|
||||
|
@ -295,12 +295,12 @@ FGElectricalConnector::FGElectricalConnector ( SGPropertyNode *node,
|
|||
== 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" ) {
|
||||
|
@ -362,7 +362,7 @@ void FGElectricalSystem::init () {
|
|||
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 " <<
|
||||
|
@ -376,7 +376,7 @@ void FGElectricalSystem::init () {
|
|||
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 {
|
||||
|
@ -385,21 +385,21 @@ void FGElectricalSystem::init () {
|
|||
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!");
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ void FGElectricalSystem::update (double dt) {
|
|||
" " );
|
||||
|
||||
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!");
|
||||
}
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ void FGElectricalSystem::update (double dt) {
|
|||
" " );
|
||||
|
||||
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!");
|
||||
}
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ void FGElectricalSystem::update (double dt) {
|
|||
// 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!");
|
||||
}
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ bool FGElectricalSystem::build (SGPropertyNode* config_props) {
|
|||
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;
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ float FGElectricalSystem::propagate( FGElectricalComponent *node, double dt,
|
|||
}
|
||||
// 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;
|
||||
|
|
|
@ -36,7 +36,7 @@ FGSystemMgr::FGSystemMgr ()
|
|||
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 );
|
||||
|
@ -44,21 +44,21 @@ FGSystemMgr::FGSystemMgr ()
|
|||
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!");
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ bool FGSystemMgr::build (SGPropertyNode* config_props)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue