]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/auto_gui.cxx
- adjusted for no-value constructor for FGPanel
[flightgear.git] / src / Autopilot / auto_gui.cxx
index e06793de8e546e2cc010290ba2a3e99a7613fcde..b5ce002f89f877e1ce2f69e390c34fecb3d89087 100644 (file)
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/sg_geodesy.hxx>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
 
 #include <Airports/simple.hxx>
 #include <GUI/gui.h>
-#include <Main/bfi.hxx>
 #include <Main/fg_init.hxx>
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
@@ -219,7 +218,7 @@ void NewHeadingInit(void)
     char NewHeadingLabel[] = "Enter New Heading";
     char *s;
 
-    float heading = FGBFI::getHeading();
+    float heading = fgGetDouble("/orientation/heading");
     int len = 260/2 -
        (puGetStringWidth( puGetDefaultLabelFont(), NewHeadingLabel ) /2 );
 
@@ -590,7 +589,7 @@ void TgtAptDialog_OK (puObject *)
 
     string tmp = s;
     double alt = 0.0;
-    int pos = tmp.find( "@" );
+    unsigned int pos = tmp.find( "@" );
     if ( pos != string::npos ) {
        TgtAptId = tmp.substr( 0, pos );
        string alt_str = tmp.substr( pos + 1 );
@@ -609,7 +608,7 @@ void TgtAptDialog_OK (puObject *)
     double t1, t2;
     if ( fgFindAirportID( TgtAptId, &a ) ) {
 
-        FG_LOG( FG_GENERAL, FG_INFO,
+        SG_LOG( SG_GENERAL, SG_INFO,
                 "Adding waypoint (airport) = " << TgtAptId );
         
         sprintf( NewTgtAirportId, "%s", TgtAptId.c_str() );
@@ -620,7 +619,7 @@ void TgtAptDialog_OK (puObject *)
     } else if ( current_fixlist->query( TgtAptId, 0.0, 0.0, 0.0,
                                        &f, &t1, &t2 ) )
     {
-        FG_LOG( FG_GENERAL, FG_INFO,
+        SG_LOG( SG_GENERAL, SG_INFO,
                 "Adding waypoint (fix) = " << TgtAptId );
         
         sprintf( NewTgtAirportId, "%s", TgtAptId.c_str() );
@@ -636,7 +635,6 @@ void TgtAptDialog_OK (puObject *)
 
 void TgtAptDialog_Reset(puObject *)
 {
-    //  strncpy( NewAirportId, fgGetString("/sim/startup/airport-id").c_str(), 16 );
     sprintf( NewTgtAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
     TgtAptDialogInput->setValue ( NewTgtAirportId );
     TgtAptDialogInput->setCursor( 0 ) ;
@@ -644,7 +642,6 @@ void TgtAptDialog_Reset(puObject *)
 
 void AddWayPoint(puObject *cb)
 {
-    //  strncpy( NewAirportId, fgGetString("/sim/startup/airport-id").c_str(), 16 );
     sprintf( NewTgtAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
     TgtAptDialogInput->setValue( NewTgtAirportId );
     
@@ -664,7 +661,8 @@ void PopWayPoint(puObject *cb)
        current_autopilot->set_HeadingMode( FGAutopilot::FG_TC_HEADING_LOCK );
 
        // use current heading
-       current_autopilot->set_TargetHeading( FGBFI::getHeading() );
+       current_autopilot
+            ->set_TargetHeading(fgGetDouble("/orientation/heading"));
     }
 }
 
@@ -675,11 +673,10 @@ void ClearRoute(puObject *cb)
 
 void NewTgtAirportInit(void)
 {
-    FG_LOG( FG_AUTOPILOT, FG_INFO, " enter NewTgtAirportInit()" );
-    // fgAPset_tgt_airport_id( fgGetString("/sim/startup/airport-id") );       
-    sprintf( NewTgtAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
-    FG_LOG( FG_AUTOPILOT, FG_INFO, " NewTgtAirportId " << NewTgtAirportId );
-    // printf(" NewTgtAirportId %s\n", NewTgtAirportId);
+    SG_LOG( SG_AUTOPILOT, SG_INFO, " enter NewTgtAirportInit()" );
+    sprintf( NewTgtAirportId, "%s",
+             fgGetString("/sim/startup/airport-id").c_str() );
+    SG_LOG( SG_AUTOPILOT, SG_INFO, " NewTgtAirportId " << NewTgtAirportId );
     int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
                                       NewTgtAirportLabel ) / 2;