Use more specific logging classes for SG_LOG.
The log filters aren't really useful when everything uses SG_GENERAL.
This commit is contained in:
parent
1827825fcb
commit
458edb9339
17 changed files with 82 additions and 81 deletions
|
@ -79,6 +79,7 @@ LogClassMapping log_class_mappings [] = {
|
|||
LogClassMapping(SG_AI, "ai"),
|
||||
LogClassMapping(SG_ENVIRONMENT, "environment"),
|
||||
LogClassMapping(SG_SOUND, "sound"),
|
||||
LogClassMapping(SG_NAVAID, "navaid"),
|
||||
LogClassMapping(SG_UNDEFD, "")
|
||||
};
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ void FlightPlan::deleteIndex(int aIndex)
|
|||
}
|
||||
|
||||
if ((index < 0) || (index >= numLegs())) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_WARN, "removeAtIndex with invalid index:" << aIndex);
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "removeAtIndex with invalid index:" << aIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -511,7 +511,7 @@ void FlightPlan::setApproach(flightgear::Approach *app)
|
|||
|
||||
bool FlightPlan::save(const SGPath& path)
|
||||
{
|
||||
SG_LOG(SG_IO, SG_INFO, "Saving route to " << path.str());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "Saving route to " << path.str());
|
||||
try {
|
||||
SGPropertyNode_ptr d(new SGPropertyNode);
|
||||
d->setIntValue("version", 2);
|
||||
|
@ -553,7 +553,7 @@ bool FlightPlan::save(const SGPath& path)
|
|||
writeProperties(path.str(), d, true /* write-all */);
|
||||
return true;
|
||||
} catch (sg_exception& e) {
|
||||
SG_LOG(SG_IO, SG_ALERT, "Failed to save flight-plan '" << path.str() << "'. " << e.getMessage());
|
||||
SG_LOG(SG_NAVAID, SG_ALERT, "Failed to save flight-plan '" << path.str() << "'. " << e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -562,13 +562,13 @@ bool FlightPlan::load(const SGPath& path)
|
|||
{
|
||||
if (!path.exists())
|
||||
{
|
||||
SG_LOG(SG_IO, SG_ALERT, "Failed to load flight-plan '" << path.str()
|
||||
SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load flight-plan '" << path.str()
|
||||
<< "'. The file does not exist.");
|
||||
return false;
|
||||
}
|
||||
|
||||
SGPropertyNode_ptr routeData(new SGPropertyNode);
|
||||
SG_LOG(SG_IO, SG_INFO, "going to read flight-plan from:" << path.str());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "going to read flight-plan from:" << path.str());
|
||||
|
||||
bool Status = false;
|
||||
lockDelegate();
|
||||
|
@ -594,7 +594,7 @@ bool FlightPlan::load(const SGPath& path)
|
|||
}
|
||||
Status = true;
|
||||
} catch (sg_exception& e) {
|
||||
SG_LOG(SG_IO, SG_ALERT, "Failed to load flight-plan '" << e.getOrigin()
|
||||
SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load flight-plan '" << e.getOrigin()
|
||||
<< "'. " << e.getMessage());
|
||||
Status = false;
|
||||
}
|
||||
|
@ -764,7 +764,7 @@ bool FlightPlan::loadPlainTextRoute(const SGPath& path)
|
|||
_legs.push_back(new Leg(this, w));
|
||||
} // of line iteration
|
||||
} catch (sg_exception& e) {
|
||||
SG_LOG(SG_IO, SG_ALERT, "Failed to load route from: '" << path.str() << "'. " << e.getMessage());
|
||||
SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load route from: '" << path.str() << "'. " << e.getMessage());
|
||||
_legs.clear();
|
||||
return false;
|
||||
}
|
||||
|
@ -824,7 +824,7 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
|
|||
string_list pieces(simgear::strutils::split(target, "/"));
|
||||
FGPositionedRef p = FGPositioned::findClosestWithIdent(pieces.front(), basePosition);
|
||||
if (!p) {
|
||||
SG_LOG( SG_AUTOPILOT, SG_INFO, "Unable to find FGPositioned with ident:" << pieces.front());
|
||||
SG_LOG( SG_NAVAID, SG_INFO, "Unable to find FGPositioned with ident:" << pieces.front());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -841,12 +841,12 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
|
|||
} else if (pieces.size() == 2) {
|
||||
FGAirport* apt = dynamic_cast<FGAirport*>(p.ptr());
|
||||
if (!apt) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_INFO, "Waypoint is not an airport:" << pieces.front());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "Waypoint is not an airport:" << pieces.front());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!apt->hasRunwayWithIdent(pieces[1])) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_INFO, "No runway: " << pieces[1] << " at " << pieces[0]);
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "No runway: " << pieces[1] << " at " << pieces[0]);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -856,7 +856,7 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
|
|||
// navid/radial/navid/radial notation
|
||||
FGPositionedRef p2 = FGPositioned::findClosestWithIdent(pieces[2], basePosition);
|
||||
if (!p2) {
|
||||
SG_LOG( SG_AUTOPILOT, SG_INFO, "Unable to find FGPositioned with ident:" << pieces[2]);
|
||||
SG_LOG( SG_NAVAID, SG_INFO, "Unable to find FGPositioned with ident:" << pieces[2]);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -868,7 +868,7 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
|
|||
SGGeod intersection;
|
||||
bool ok = SGGeodesy::radialIntersection(p->geod(), r1, p2->geod(), r2, intersection);
|
||||
if (!ok) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_INFO, "no valid intersection for:" << target);
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "no valid intersection for:" << target);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -877,7 +877,7 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
|
|||
}
|
||||
|
||||
if (!wpt) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_INFO, "Unable to parse waypoint:" << target);
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "Unable to parse waypoint:" << target);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ Waypt* NavdataVisitor::buildWaypoint(RouteBase* owner)
|
|||
SGGeodesy::direct(pos, _course, _dmeDistance, pos2, az2);
|
||||
wp = new BasicWaypt(pos2, _wayptName, owner);
|
||||
} else {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "implement waypoint type:" << _wayptType);
|
||||
SG_LOG(SG_NAVAID, SG_ALERT, "implement waypoint type:" << _wayptType);
|
||||
throw sg_format_exception("Unrecognized waypt type", _wayptType);
|
||||
}
|
||||
|
||||
|
@ -327,11 +327,11 @@ void NavdataVisitor::pi (const char * target, const char * data) {
|
|||
}
|
||||
|
||||
void NavdataVisitor::warning (const char * message, int line, int column) {
|
||||
SG_LOG(SG_IO, SG_WARN, "Warning: " << message << " (" << line << ',' << column << ')');
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "Warning: " << message << " (" << line << ',' << column << ')');
|
||||
}
|
||||
|
||||
void NavdataVisitor::error (const char * message, int line, int column) {
|
||||
SG_LOG(SG_IO, SG_ALERT, "Error: " << message << " (" << line << ',' << column << ')');
|
||||
SG_LOG(SG_NAVAID, SG_ALERT, "Error: " << message << " (" << line << ',' << column << ')');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
using std::string;
|
||||
|
||||
#define SG_NAVCACHE SG_GENERAL
|
||||
#define SG_NAVCACHE SG_NAVAID
|
||||
//#define LAZY_OCTREE_UPDATES 1
|
||||
|
||||
namespace {
|
||||
|
@ -163,7 +163,7 @@ public:
|
|||
SGTimeStamp st;
|
||||
st.stamp();
|
||||
_cache->doRebuild();
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "cache rebuild took:" << st.elapsedMSec() << "msec");
|
||||
SG_LOG(SG_NAVCACHE, SG_INFO, "cache rebuild took:" << st.elapsedMSec() << "msec");
|
||||
|
||||
SGGuard<SGMutex> g(_lock);
|
||||
_isFinished = true;
|
||||
|
@ -1338,7 +1338,7 @@ PositionedID NavDataCache::insertAirport(FGPositioned::Type ty, const string& id
|
|||
void NavDataCache::updatePosition(PositionedID item, const SGGeod &pos)
|
||||
{
|
||||
if (d->cache.find(item) != d->cache.end()) {
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "updating position of an item in the cache");
|
||||
SG_LOG(SG_NAVCACHE, SG_DEBUG, "updating position of an item in the cache");
|
||||
d->cache[item]->modifyPosition(pos);
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ void Airway::load(const SGPath& path)
|
|||
|
||||
sg_gzifstream in( path.str() );
|
||||
if ( !in.is_open() ) {
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
throw sg_io_exception("Could not open airways data", sg_location(path.str()));
|
||||
}
|
||||
// toss the first two lines of the file
|
||||
|
@ -174,13 +174,13 @@ void Airway::Network::addEdge(int aWay, const SGGeod& aStartPos,
|
|||
FGPositionedRef end = FGPositioned::findClosestWithIdent(aEndIdent, aEndPos);
|
||||
|
||||
if (!start) {
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "unknown airways start pt: '" << aStartIdent << "'");
|
||||
SG_LOG(SG_NAVAID, SG_DEBUG, "unknown airways start pt: '" << aStartIdent << "'");
|
||||
start = FGPositioned::createUserWaypoint(aStartIdent, aStartPos);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!end) {
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "unknown airways end pt: '" << aEndIdent << "'");
|
||||
SG_LOG(SG_NAVAID, SG_DEBUG, "unknown airways end pt: '" << aEndIdent << "'");
|
||||
end = FGPositioned::createUserWaypoint(aEndIdent, aEndPos);
|
||||
return;
|
||||
}
|
||||
|
@ -219,8 +219,8 @@ bool Airway::Network::route(WayptRef aFrom, WayptRef aTo,
|
|||
boost::tie(to, exactTo) = findClosestNode(aTo);
|
||||
|
||||
#ifdef DEBUG_AWY_SEARCH
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "from:" << from->ident() << "/" << from->name());
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "to:" << to->ident() << "/" << to->name());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "from:" << from->ident() << "/" << from->name());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "to:" << to->ident() << "/" << to->name());
|
||||
#endif
|
||||
|
||||
bool ok = search2(from, to, aPath);
|
||||
|
@ -348,7 +348,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
|
|||
closedNodes.insert(xp->guid());
|
||||
|
||||
#ifdef DEBUG_AWY_SEARCH
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "x:" << xp->ident() << ", f(x)=" << x->totalCost());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "x:" << xp->ident() << ", f(x)=" << x->totalCost());
|
||||
#endif
|
||||
|
||||
// check if xp is the goal; if so we're done, since there cannot be an open
|
||||
|
@ -373,7 +373,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
|
|||
if (g > y->distanceFromStart) {
|
||||
// worse path, ignore
|
||||
#ifdef DEBUG_AWY_SEARCH
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "\tabandoning " << yp->ident() <<
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "\tabandoning " << yp->ident() <<
|
||||
" path is worse: g(y)" << y->distanceFromStart << ", g'=" << g);
|
||||
#endif
|
||||
continue;
|
||||
|
@ -382,7 +382,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
|
|||
// we need to update y. Unfortunately this means rebuilding the heap,
|
||||
// since y's score can change arbitrarily
|
||||
#ifdef DEBUG_AWY_SEARCH
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "\tfixing up previous for new path to " << yp->ident() << ", d =" << g);
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "\tfixing up previous for new path to " << yp->ident() << ", d =" << g);
|
||||
#endif
|
||||
y->previous = x;
|
||||
y->distanceFromStart = g;
|
||||
|
@ -391,7 +391,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
|
|||
} else { // not open, insert a new node for y into the heap
|
||||
y = new AStarOpenNode(yp, edgeDistanceM, other.first, aDest, x);
|
||||
#ifdef DEBUG_AWY_SEARCH
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "\ty=" << yp->ident() << ", f(y)=" << y->totalCost());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "\ty=" << yp->ident() << ", f(y)=" << y->totalCost());
|
||||
#endif
|
||||
openNodes.push_back(y);
|
||||
std::push_heap(openNodes.begin(), openNodes.end(), ordering);
|
||||
|
@ -399,7 +399,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
|
|||
} // of neighbour iteration
|
||||
} // of open node iteration
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "A* failed to find route");
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "A* failed to find route");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ void FGAirwayNetwork::load(const SGPath& path)
|
|||
|
||||
sg_gzifstream in( path.str() );
|
||||
if ( !in.is_open() ) {
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
exit(-1);
|
||||
}
|
||||
// toss the first two lines of the file
|
||||
|
@ -364,7 +364,7 @@ FGAirRoute FGAirwayNetwork::findShortestRoute(int start, int end)
|
|||
|
||||
if (!foundRoute)
|
||||
{
|
||||
SG_LOG( SG_GENERAL, SG_INFO, "Failed to find route from waypoint " << start << " to " << end );
|
||||
SG_LOG( SG_NAVAID, SG_INFO, "Failed to find route from waypoint " << start << " to " << end );
|
||||
cerr << "Failed to find route from waypoint " << start << " to " << end << endl;
|
||||
//exit(1);
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ void FGAirwayNetwork::trace(FGNode *currNode, int end, int depth, double distanc
|
|||
}
|
||||
else
|
||||
{
|
||||
//SG_LOG( SG_GENERAL, SG_DEBUG, "4" );
|
||||
//SG_LOG( SG_NAVAID, SG_DEBUG, "4" );
|
||||
//cerr << "4" << endl;
|
||||
}
|
||||
traceStack.pop_back();
|
||||
|
|
|
@ -49,7 +49,7 @@ void loadFixes(const SGPath& path)
|
|||
{
|
||||
sg_gzifstream in( path.str() );
|
||||
if ( !in.is_open() ) {
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ void alignLocaliserWithRunway(FGRunway* rwy, const string& ident, SGGeod& pos, d
|
|||
pos = SGGeod::fromGeodFt(newPos, pos.getElevationFt());
|
||||
heading = rwy->headingDeg();
|
||||
} else {
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "localizer:" << ident << ", aligning with runway "
|
||||
SG_LOG(SG_NAVAID, SG_DEBUG, "localizer:" << ident << ", aligning with runway "
|
||||
<< rwy->ident() << " exceeded heading threshold");
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ static double defaultNavRange(const string& ident, FGPositioned::Type type)
|
|||
// Ranges are included with the latest data format, no need to
|
||||
// assign our own defaults, unless the range is not set for some
|
||||
// reason.
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "navaid " << ident << " has no range set, using defaults");
|
||||
SG_LOG(SG_NAVAID, SG_DEBUG, "navaid " << ident << " has no range set, using defaults");
|
||||
switch (type) {
|
||||
case FGPositioned::NDB:
|
||||
case FGPositioned::VOR:
|
||||
|
@ -216,7 +216,7 @@ bool navDBInit(const SGPath& path)
|
|||
{
|
||||
sg_gzifstream in( path.str() );
|
||||
if ( !in.is_open() ) {
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -238,11 +238,11 @@ bool navDBInit(const SGPath& path)
|
|||
|
||||
bool loadCarrierNav(const SGPath& path)
|
||||
{
|
||||
SG_LOG( SG_GENERAL, SG_INFO, "opening file: " << path.str() );
|
||||
SG_LOG( SG_NAVAID, SG_INFO, "opening file: " << path.str() );
|
||||
sg_gzifstream incarrier( path.str() );
|
||||
|
||||
if ( !incarrier.is_open() ) {
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -256,11 +256,11 @@ bool loadCarrierNav(const SGPath& path)
|
|||
|
||||
bool loadTacan(const SGPath& path, FGTACANList *channellist)
|
||||
{
|
||||
SG_LOG( SG_GENERAL, SG_INFO, "opening file: " << path.str() );
|
||||
SG_LOG( SG_NAVAID, SG_INFO, "opening file: " << path.str() );
|
||||
sg_gzifstream inchannel( path.str() );
|
||||
|
||||
if ( !inchannel.is_open() ) {
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -302,7 +302,7 @@ bool FGTACANList::add( FGTACANRecord *c )
|
|||
FGTACANRecord *FGTACANList::findByChannel( const string& channel )
|
||||
{
|
||||
const tacan_list_type& stations = ident_channels[channel];
|
||||
SG_LOG( SG_INSTR, SG_DEBUG, "findByChannel " << channel<< " size " << stations.size() );
|
||||
SG_LOG( SG_NAVAID, SG_DEBUG, "findByChannel " << channel<< " size " << stations.size() );
|
||||
|
||||
if (!stations.empty()) {
|
||||
return stations[0];
|
||||
|
|
|
@ -131,7 +131,7 @@ FGPositioned::Type FGPositioned::typeFromName(const std::string& aName)
|
|||
}
|
||||
}
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "FGPositioned::typeFromName: couldn't match:" << aName);
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "FGPositioned::typeFromName: couldn't match:" << aName);
|
||||
return INVALID;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ bool Approach::route(WayptRef aIAF, WayptVec& aWps)
|
|||
} // of transitions iteration
|
||||
|
||||
if (!haveTrans) {
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "approach " << ident() << " has no transition " <<
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "approach " << ident() << " has no transition " <<
|
||||
"for IAF: " << aIAF->ident());
|
||||
return false;
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ bool ArrivalDeparture::commonRoute(Transition* t, WayptVec& aPath, FGRunwayRef a
|
|||
return true;
|
||||
}
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_INFO, ident() << " using runway transition for " << r->first->ident());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, ident() << " using runway transition for " << r->first->ident());
|
||||
r->second->route(aPath);
|
||||
return true;
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ Transition* ArrivalDeparture::findTransitionByEnroute(Waypt* aEnroute) const
|
|||
WptTransitionMap::const_iterator eit;
|
||||
for (eit = _enrouteTransitions.begin(); eit != _enrouteTransitions.end(); ++eit) {
|
||||
if (eit->second->enroute()->matches(aEnroute)) {
|
||||
SG_LOG(SG_GENERAL, SG_INFO, ident() << " using enroute transition " << eit->second->ident());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, ident() << " using enroute transition " << eit->second->ident());
|
||||
return eit->second;
|
||||
}
|
||||
} // of enroute transition iteration
|
||||
|
@ -276,7 +276,7 @@ WayptRef ArrivalDeparture::findBestTransition(const SGGeod& aPos) const
|
|||
{
|
||||
// no transitions, that's easy
|
||||
if (_enrouteTransitions.empty()) {
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "no enroute transitions for " << ident());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "no enroute transitions for " << ident());
|
||||
return _common.front();
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ WayptRef ArrivalDeparture::findBestTransition(const SGGeod& aPos) const
|
|||
WptTransitionMap::const_iterator eit;
|
||||
for (eit = _enrouteTransitions.begin(); eit != _enrouteTransitions.end(); ++eit) {
|
||||
WayptRef c = eit->second->enroute();
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "findBestTransition for " << ident() << ", looking at " << c->ident());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "findBestTransition for " << ident() << ", looking at " << c->ident());
|
||||
// assert(c->hasFixedPosition());
|
||||
double cd = SGGeodesy::distanceM(aPos, c->position());
|
||||
|
||||
|
@ -321,7 +321,7 @@ SID::SID(const string& aIdent, FGAirport* apt) :
|
|||
bool SID::route(FGRunwayRef aWay, Transition* trans, WayptVec& aPath)
|
||||
{
|
||||
if (!isForRunway(aWay)) {
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "SID " << ident() << " not for runway " << aWay->ident());
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "SID " << ident() << " not for runway " << aWay->ident());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ void RouteBase::dumpRouteToKML(const WayptVec& aRoute, const std::string& aName)
|
|||
std::fstream f;
|
||||
f.open(p.str().c_str(), fstream::out | fstream::app);
|
||||
if (!f.is_open()) {
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "unable to open:" << p.str());
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "unable to open:" << p.str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -376,10 +376,10 @@ void RouteBase::loadAirportProcedures(const SGPath& aPath, FGAirport* aApt)
|
|||
NavdataVisitor visitor(aApt, aPath);
|
||||
readXML(aPath.str(), visitor);
|
||||
} catch (sg_io_exception& ex) {
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "failure parsing procedures: " << aPath.str() <<
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "failure parsing procedures: " << aPath.str() <<
|
||||
"\n\t" << ex.getMessage() << "\n\tat:" << ex.getLocation().asString());
|
||||
} catch (sg_exception& ex) {
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "failure parsing procedures: " << aPath.str() <<
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "failure parsing procedures: " << aPath.str() <<
|
||||
"\n\t" << ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ double pointsKnownDistanceFromGC(const SGGeoc& a, const SGGeoc&b, const SGGeoc&
|
|||
double p = atan2(sin(bDist)*cos(A), cos(bDist));
|
||||
|
||||
if (sqr(cos(dist)) > sqr(r)) {
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "pointsKnownDistanceFromGC, no points exist");
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "pointsKnownDistanceFromGC, no points exist");
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,7 @@ bool RoutePath::computedPositionForIndex(int index, SGGeod& r) const
|
|||
return true;
|
||||
}
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "RoutePath::computedPositionForIndex: unhandled type:" << w->type());
|
||||
SG_LOG(SG_NAVAID, SG_INFO, "RoutePath::computedPositionForIndex: unhandled type:" << w->type());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ double RoutePath::computeAltitudeForIndex(int index) const
|
|||
if (!computedPositionForIndex(index, pos) ||
|
||||
!computedPositionForIndex(index - 1, prevPos))
|
||||
{
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "unable to compute position for waypoints");
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "unable to compute position for waypoints");
|
||||
throw sg_range_exception("unable to compute position for waypoints");
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ double RoutePath::computeTrackForIndex(int index) const
|
|||
Hold* h = (Hold*) w.get();
|
||||
return h->inboundRadial();
|
||||
} else if (w->type() == "vectors") {
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "asked for track from VECTORS");
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "asked for track from VECTORS");
|
||||
throw sg_range_exception("asked for track from vectors waypt");
|
||||
} else if (w->type() == "runway") {
|
||||
FGRunway* rwy = static_cast<RunwayWaypt*>(w.get())->runway();
|
||||
|
@ -338,7 +338,7 @@ double RoutePath::computeTrackForIndex(int index) const
|
|||
if (!computedPositionForIndex(index, pos) ||
|
||||
!computedPositionForIndex(index - 1, prevPos))
|
||||
{
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "unable to compute position for waypoints");
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "unable to compute position for waypoints");
|
||||
throw sg_range_exception("unable to compute position for waypoints");
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ NavaidWaypoint::NavaidWaypoint(FGPositioned* aPos, RouteBase* aOwner) :
|
|||
_navaid(aPos)
|
||||
{
|
||||
if (aPos->type() == FGPositioned::RUNWAY) {
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "sure you don't want to be building a runway waypt here?");
|
||||
SG_LOG(SG_NAVAID, SG_WARN, "sure you don't want to be building a runway waypt here?");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ FGScheduledFlight::FGScheduledFlight(const string& cs,
|
|||
else
|
||||
{
|
||||
repeatPeriod = 365*24*60*60;
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Unknown repeat period in flight plan "
|
||||
SG_LOG( SG_AI, SG_ALERT, "Unknown repeat period in flight plan "
|
||||
"of flight '" << cs << "': " << rep );
|
||||
}
|
||||
|
||||
|
@ -272,13 +272,13 @@ bool FGScheduledFlight::initializeAirports()
|
|||
departurePort = FGAirport::findByIdent(depId);
|
||||
if(departurePort == NULL)
|
||||
{
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG, "Traffic manager could not find departure airport : " << depId);
|
||||
SG_LOG( SG_AI, SG_DEBUG, "Traffic manager could not find departure airport : " << depId);
|
||||
return false;
|
||||
}
|
||||
arrivalPort = FGAirport::findByIdent(arrId);
|
||||
if(arrivalPort == NULL)
|
||||
{
|
||||
SG_LOG( SG_GENERAL, SG_DEBUG, "Traffic manager could not find arrival airport : " << arrId);
|
||||
SG_LOG( SG_AI, SG_DEBUG, "Traffic manager could not find arrival airport : " << arrId);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@ bool FGAISchedule::update(time_t now, const SGVec3d& userCart)
|
|||
// This flight entry is entirely in the past, do we need to
|
||||
// push it forward in time to the next scheduled departure.
|
||||
if (flight->getArrivalTime() < now) {
|
||||
SG_LOG (SG_GENERAL, SG_BULK, "Traffic Manager: Flight is in the Past");
|
||||
SG_LOG (SG_AI, SG_BULK, "Traffic Manager: Flight is in the Past");
|
||||
// Don't just update: check whether we need to load a new leg. etc.
|
||||
// This update occurs for distant aircraft, so we can update the current leg
|
||||
// and detach it from the current list of aircraft.
|
||||
|
@ -272,14 +272,14 @@ bool FGAISchedule::update(time_t now, const SGVec3d& userCart)
|
|||
|
||||
SGGeodesy::direct(dep->geod(), course, coveredDistance, position, az2);
|
||||
|
||||
SG_LOG (SG_GENERAL, SG_BULK, "Traffic Manager: Flight is in progress, %=" << x);
|
||||
SG_LOG (SG_AI, SG_BULK, "Traffic Manager: Flight is in progress, %=" << x);
|
||||
speed = ((distanceM - coveredDistance) * SG_METER_TO_NM) / 3600.0;
|
||||
} else {
|
||||
// not departed yet
|
||||
//remainingTimeEnroute = totalTimeEnroute;
|
||||
elapsedTimeEnroute = 0;
|
||||
position = dep->geod();
|
||||
SG_LOG (SG_GENERAL, SG_BULK, "Traffic Manager: Flight is pending, departure in "
|
||||
SG_LOG (SG_AI, SG_BULK, "Traffic Manager: Flight is pending, departure in "
|
||||
<< flight->getDepartureTime() - now << " seconds ");
|
||||
}
|
||||
} else {
|
||||
|
@ -297,7 +297,7 @@ bool FGAISchedule::update(time_t now, const SGVec3d& userCart)
|
|||
// then 500nm, create this flight. At jet speeds 500 nm is roughly
|
||||
// one hour flight time, so that would be a good approximate point
|
||||
// to start a more detailed simulation of this aircraft.
|
||||
SG_LOG (SG_GENERAL, SG_BULK, "Traffic manager: " << registration << " is scheduled for a flight from "
|
||||
SG_LOG (SG_AI, SG_BULK, "Traffic manager: " << registration << " is scheduled for a flight from "
|
||||
<< dep->getId() << " to " << arr->getId() << ". Current distance to user: "
|
||||
<< distanceToUser);
|
||||
if (distanceToUser >= TRAFFICTOAIDISTTOSTART) {
|
||||
|
@ -323,7 +323,7 @@ bool FGAISchedule::createAIAircraft(FGScheduledFlight* flight, double speedKnots
|
|||
FGAirport* dep = flight->getDepartureAirport();
|
||||
FGAirport* arr = flight->getArrivalAirport();
|
||||
string flightPlanName = dep->getId() + "-" + arr->getId() + ".xml";
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Traffic manager: Creating AIModel from:" << flightPlanName);
|
||||
SG_LOG(SG_AI, SG_INFO, "Traffic manager: Creating AIModel from:" << flightPlanName);
|
||||
|
||||
// Only allow traffic to be created when the model path (or the AI version of mp) exists
|
||||
SGPath mp(globals->get_fg_root());
|
||||
|
@ -334,7 +334,7 @@ bool FGAISchedule::createAIAircraft(FGScheduledFlight* flight, double speedKnots
|
|||
mp_ai.append(modelPath);
|
||||
|
||||
if (!mp.exists() && !mp_ai.exists()) {
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "TrafficManager: Could not load model " << mp_ai.str());
|
||||
SG_LOG(SG_AI, SG_WARN, "TrafficManager: Could not load model " << mp_ai.str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -388,7 +388,7 @@ void FGAISchedule::scheduleFlights(time_t now)
|
|||
}
|
||||
//string startingPort;
|
||||
string userPort = fgGetString("/sim/presets/airport-id");
|
||||
SG_LOG(SG_GENERAL, SG_BULK, "Scheduling Flights for : " << modelPath << " " << registration << " " << homePort);
|
||||
SG_LOG(SG_AI, SG_BULK, "Scheduling Flights for : " << modelPath << " " << registration << " " << homePort);
|
||||
FGScheduledFlight *flight = NULL;
|
||||
do {
|
||||
if (currentDestination.empty()) {
|
||||
|
@ -423,7 +423,7 @@ void FGAISchedule::scheduleFlights(time_t now)
|
|||
|
||||
depT = depT.substr(0,24);
|
||||
arrT = arrT.substr(0,24);
|
||||
SG_LOG(SG_GENERAL, SG_BULK, " Flight " << flight->getCallSign() << ":"
|
||||
SG_LOG(SG_AI, SG_BULK, " Flight " << flight->getCallSign() << ":"
|
||||
<< " " << flight->getDepartureAirport()->getId() << ":"
|
||||
<< " " << depT << ":"
|
||||
<< " \"" << flight->getArrivalAirport()->getId() << "\"" << ":"
|
||||
|
@ -431,7 +431,7 @@ void FGAISchedule::scheduleFlights(time_t now)
|
|||
|
||||
flights.push_back(flight);
|
||||
} while (currentDestination != homePort);
|
||||
SG_LOG(SG_GENERAL, SG_BULK, " Done ");
|
||||
SG_LOG(SG_AI, SG_BULK, " Done ");
|
||||
}
|
||||
|
||||
bool FGAISchedule::next()
|
||||
|
|
|
@ -307,7 +307,7 @@ void FGTrafficManager::loadHeuristics()
|
|||
std::ifstream data(cacheData.c_str());
|
||||
data >> revisionStr;
|
||||
if (revisionStr != "[TrafficManagerCachedata:ref:2011:09:04]") {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT,"Traffic Manager Warning: discarding outdated cachefile " <<
|
||||
SG_LOG(SG_AI, SG_ALERT,"Traffic Manager Warning: discarding outdated cachefile " <<
|
||||
cacheData.c_str() << " for Airport " << airport);
|
||||
} else {
|
||||
while (1) {
|
||||
|
@ -317,7 +317,7 @@ void FGTrafficManager::loadHeuristics()
|
|||
break;
|
||||
HeuristicMapIterator itr = heurMap.find(h.registration);
|
||||
if (itr != heurMap.end()) {
|
||||
SG_LOG(SG_GENERAL, SG_WARN,"Traffic Manager Warning: found duplicate tailnumber " <<
|
||||
SG_LOG(SG_AI, SG_WARN,"Traffic Manager Warning: found duplicate tailnumber " <<
|
||||
h.registration << " for AI aircraft");
|
||||
} else {
|
||||
heurMap[h.registration] = h;
|
||||
|
@ -450,7 +450,7 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
|
|||
if (!tokens.empty()) {
|
||||
if (tokens[0] == string("AC")) {
|
||||
if (tokens.size() != 13) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "Error parsing traffic file " << infileName.str() << " at " << buffString);
|
||||
SG_LOG(SG_AI, SG_ALERT, "Error parsing traffic file " << infileName.str() << " at " << buffString);
|
||||
exit(1);
|
||||
}
|
||||
model = tokens[12];
|
||||
|
@ -471,11 +471,11 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
|
|||
offset = atof(tokens[7].c_str());;
|
||||
|
||||
if (!FGAISchedule::validModelPath(model)) {
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "TrafficMgr: Missing model path:" <<
|
||||
SG_LOG(SG_AI, SG_WARN, "TrafficMgr: Missing model path:" <<
|
||||
model << " from " << infileName.str());
|
||||
} else {
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "Adding Aircraft" << model << " " << livery << " " << homePort << " "
|
||||
SG_LOG(SG_AI, SG_INFO, "Adding Aircraft" << model << " " << livery << " " << homePort << " "
|
||||
<< registration << " " << flightReq << " " << isHeavy
|
||||
<< " " << acType << " " << airline << " " << m_class
|
||||
<< " " << FlightType << " " << radius << " " << offset);
|
||||
|
@ -496,7 +496,7 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
|
|||
if (tokens[0] == string("FLIGHT")) {
|
||||
//cerr << "Found flight " << buffString << " size is : " << tokens.size() << endl;
|
||||
if (tokens.size() != 10) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "Error parsing traffic file " << infileName.str() << " at " << buffString);
|
||||
SG_LOG(SG_AI, SG_ALERT, "Error parsing traffic file " << infileName.str() << " at " << buffString);
|
||||
exit(1);
|
||||
}
|
||||
string callsign = tokens[1];
|
||||
|
@ -511,7 +511,7 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
|
|||
string requiredAircraft = tokens[9];
|
||||
|
||||
if (weekdays.size() != 7) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "Found misconfigured weekdays string" << weekdays);
|
||||
SG_LOG(SG_AI, SG_ALERT, "Found misconfigured weekdays string" << weekdays);
|
||||
exit(1);
|
||||
}
|
||||
depTime.clear();
|
||||
|
@ -543,7 +543,7 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
|
|||
snprintf(buffer, 4, "%d/", 0);
|
||||
arrivalTime = string(buffer) + arrTimeGen + string(":00");
|
||||
}
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "Adding flight " << callsign << " "
|
||||
SG_LOG(SG_AI, SG_ALERT, "Adding flight " << callsign << " "
|
||||
<< fltrules << " "
|
||||
<< departurePort << " "
|
||||
<< arrivalPort << " "
|
||||
|
@ -699,7 +699,7 @@ void FGTrafficManager::endElement(const char *name)
|
|||
snprintf(buffer, 16, "%d", acCounter);
|
||||
requiredAircraft = buffer;
|
||||
}
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "Adding flight: " << callsign << " "
|
||||
SG_LOG(SG_AI, SG_DEBUG, "Adding flight: " << callsign << " "
|
||||
<< fltrules << " "
|
||||
<< departurePort << " "
|
||||
<< arrivalPort << " "
|
||||
|
@ -709,7 +709,7 @@ void FGTrafficManager::endElement(const char *name)
|
|||
// For database maintainance purposes, it may be convenient to
|
||||
//
|
||||
if (fgGetBool("/sim/traffic-manager/dumpdata") == true) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "Traffic Dump FLIGHT," << callsign << ","
|
||||
SG_LOG(SG_AI, SG_ALERT, "Traffic Dump FLIGHT," << callsign << ","
|
||||
<< fltrules << ","
|
||||
<< departurePort << ","
|
||||
<< arrivalPort << ","
|
||||
|
@ -746,7 +746,7 @@ void FGTrafficManager::endAircraft()
|
|||
|
||||
if (!FGAISchedule::validModelPath(mdl)) {
|
||||
missingModels.insert(mdl);
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "TrafficMgr: Missing model path:" << mdl);
|
||||
SG_LOG(SG_AI, SG_WARN, "TrafficMgr: Missing model path:" << mdl);
|
||||
requiredAircraft = homePort = "";
|
||||
return;
|
||||
}
|
||||
|
@ -760,7 +760,7 @@ void FGTrafficManager::endAircraft()
|
|||
}
|
||||
|
||||
if (fgGetBool("/sim/traffic-manager/dumpdata") == true) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "Traffic Dump AC," << homePort << "," << registration << "," << requiredAircraft
|
||||
SG_LOG(SG_AI, SG_ALERT, "Traffic Dump AC," << homePort << "," << registration << "," << requiredAircraft
|
||||
<< "," << acType << "," << livery << ","
|
||||
<< airline << "," << m_class << "," << offset << "," << radius << "," << flighttype << "," << isHeavy << "," << mdl);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue