]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_props.cxx
ITM radio calculations are only considered valid
[flightgear.git] / src / Main / fg_props.cxx
index 3312889f0cd7e3c2bd847a74c289cbb76ab19326..4ad261adf00cb646fb6eb995a6ed7c8b9afe31e5 100644 (file)
@@ -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, "")
 };
 
@@ -122,7 +127,7 @@ addLoggingClass (const string &name)
 /**
  * Set the logging classes.
  */
-static void
+void
 setLoggingClasses (const char * c)
 {
   string classes = c;
@@ -142,12 +147,16 @@ setLoggingClasses (const char * 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 "
@@ -183,7 +192,7 @@ getLoggingPriority ()
 /**
  * Set the logging priority.
  */
-static void
+void
 setLoggingPriority (const char * p)
 {
   if (p == 0)
@@ -356,10 +365,8 @@ getMagDip ()
 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.5, 360.5, magheading );
 }
 
 /**
@@ -368,10 +375,8 @@ getHeadingMag ()
 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.5, 360.5, magtrack );
 }
 
 static bool
@@ -527,8 +532,8 @@ FGProperties::unbind ()
 
                                // 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