The log filters aren't really useful when everything uses SG_GENERAL.
LogClassMapping(SG_AI, "ai"),
LogClassMapping(SG_ENVIRONMENT, "environment"),
LogClassMapping(SG_SOUND, "sound"),
+ LogClassMapping(SG_NAVAID, "navaid"),
LogClassMapping(SG_UNDEFD, "")
};
}
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;
}
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);
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;
}
}
{
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();
}
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;
}
_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;
}
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;
}
} 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;
}
// 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;
}
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;
}
}
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;
}
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);
}
}
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 << ')');
}
}
using std::string;
-#define SG_NAVCACHE SG_GENERAL
+#define SG_NAVCACHE SG_NAVAID
//#define LAZY_OCTREE_UPDATES 1
namespace {
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;
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);
}
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
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;
}
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);
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
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;
// 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;
} 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);
} // 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;
}
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
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);
}
}
else
{
- //SG_LOG( SG_GENERAL, SG_DEBUG, "4" );
+ //SG_LOG( SG_NAVAID, SG_DEBUG, "4" );
//cerr << "4" << endl;
}
traceStack.pop_back();
{
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);
}
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");
}
}
// 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:
{
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;
}
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;
}
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;
}
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];
}
}
- 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;
}
} // 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;
}
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;
}
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
{
// 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();
}
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());
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;
}
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;
}
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());
}
}
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;
}
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;
}
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");
}
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();
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");
}
_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?");
}
}
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 );
}
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;
}
// 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.
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 {
// 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) {
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());
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;
}
}
//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()) {
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() << "\"" << ":"
flights.push_back(flight);
} while (currentDestination != homePort);
- SG_LOG(SG_GENERAL, SG_BULK, " Done ");
+ SG_LOG(SG_AI, SG_BULK, " Done ");
}
bool FGAISchedule::next()
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) {
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;
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];
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);
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];
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();
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 << " "
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 << " "
// 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 << ","
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;
}
}
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);
}