]> git.mxchange.org Git - flightgear.git/commitdiff
- implemented get/setViewOffset and get/setGoalViewOffset
authorcurt <curt>
Fri, 1 Jun 2001 17:51:39 +0000 (17:51 +0000)
committercurt <curt>
Fri, 1 Jun 2001 17:51:39 +0000 (17:51 +0000)
- tied to properties /sim/view/offset and /sim/view/goal-offset

src/Main/bfi.cxx

index c1ab91178da0ded0ae383049baba57578c2c37fa..1137c0359c2bfe4d174d4ebf0b846ae89d4f9785 100644 (file)
@@ -181,6 +181,8 @@ FGBFI::init ()
 
                                // Simulation
   fgTie("/sim/aircraft-dir", getAircraftDir, setAircraftDir);
+  fgTie("/sim/view/offset", getViewOffset, setViewOffset);
+  fgTie("/sim/view/goal-offset", getGoalViewOffset, setGoalViewOffset);
   fgTie("/sim/time/gmt", getDateString, setDateString);
   fgTie("/sim/time/gmt-string", getGMTString);
 
@@ -201,6 +203,7 @@ FGBFI::init ()
                                // Autopilot
   fgTie("/autopilot/locks/altitude", getAPAltitudeLock, setAPAltitudeLock);
   fgTie("/autopilot/settings/altitude", getAPAltitude, setAPAltitude);
+  fgTie("/autopilot/locks/glide-slope", getAPGSLock, setAPGSLock);
   fgTie("/autopilot/settings/climb-rate", getAPClimb, setAPClimb, false);
   fgTie("/autopilot/locks/heading", getAPHeadingLock, setAPHeadingLock);
   fgTie("/autopilot/settings/heading-bug", getAPHeadingBug, setAPHeadingBug,
@@ -280,6 +283,39 @@ FGBFI::setAircraftDir (string dir)
 }
 
 
+/**
+ * Get the current view offset in degrees.
+ */
+double
+FGBFI::getViewOffset ()
+{
+  return (globals->get_current_view()
+         ->get_view_offset() * SGD_RADIANS_TO_DEGREES);
+}
+
+void
+FGBFI::setViewOffset (double offset)
+{
+  globals->get_current_view()->set_view_offset(offset * SGD_DEGREES_TO_RADIANS);
+}
+
+double
+FGBFI::getGoalViewOffset ()
+{
+  return (globals->get_current_view()
+         ->get_goal_view_offset() * SGD_RADIANS_TO_DEGREES);
+}
+
+void
+FGBFI::setGoalViewOffset (double offset)
+{
+  globals->get_current_view()
+    ->set_goal_view_offset(offset * SGD_DEGREES_TO_RADIANS);
+}
+
+
+
+
 /**
  * Return the current Zulu time.
  */
@@ -772,6 +808,27 @@ FGBFI::setAPAltitudeLock (bool lock)
 }
 
 
+/**
+ * Get the autopilot altitude lock (true=on).
+ */
+bool
+FGBFI::getAPGSLock ()
+{
+    return current_autopilot->get_AltitudeEnabled();
+}
+
+
+/**
+ * Set the autopilot altitude lock (true=on).
+ */
+void
+FGBFI::setAPGSLock (bool lock)
+{
+  current_autopilot->set_AltitudeMode(FGAutopilot::FG_ALTITUDE_GS1);
+  current_autopilot->set_AltitudeEnabled(lock);
+}
+
+
 /**
  * Get the autopilot target altitude in feet.
  */