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, "")
};
/**
* Set the logging classes.
*/
-static void
+void
setLoggingClasses (const char * c)
{
string classes = c;
string rest = classes;
string name = "";
- int sep = rest.find('|');
- while (sep > 0) {
+ string::size_type sep = rest.find('|');
+ if (sep == string::npos)
+ sep = rest.find(',');
+ while (sep != string::npos) {
name = rest.substr(0, sep);
rest = rest.substr(sep+1);
addLoggingClass(name);
sep = rest.find('|');
+ if (sep == string::npos)
+ sep = rest.find(',');
}
addLoggingClass(rest);
SG_LOG(SG_GENERAL, SG_INFO, "Set logging classes to "
/**
* Set the logging priority.
*/
-static void
+void
setLoggingPriority (const char * p)
{
if (p == 0)
static double
getHeadingMag ()
{
- double magheading;
- magheading = fgGetDouble("/orientation/heading-deg") - getMagVar();
- if (magheading < 0) magheading += 360;
- return magheading;
+ double magheading = fgGetDouble("/orientation/heading-deg") - getMagVar();
+ return SGMiscd::normalizePeriodic(0, 360, magheading );
}
/**
static double
getTrackMag ()
{
- double magtrack;
- magtrack = fgGetDouble("/orientation/track-deg") - getMagVar();
- if (magtrack < 0) magtrack += 360;
- return magtrack;
+ double magtrack = fgGetDouble("/orientation/track-deg") - getMagVar();
+ return SGMiscd::normalizePeriodic(0, 360, magtrack );
}
static bool
// Misc. Temporary junk.
fgUntie("/sim/temp/winding-ccw");
- fgUntie("/sim/temp/full-screen");
- fgUntie("/sim/temp/fdm-data-logging");
+// fgUntie("/sim/temp/full-screen");
+// fgUntie("/sim/temp/fdm-data-logging");
}
void