]> git.mxchange.org Git - flightgear.git/blobdiff - src/Time/tmp.cxx
- adjusted for no-value constructor for FGPanel
[flightgear.git] / src / Time / tmp.cxx
index 0d5b0cba88c1c2d2a918e89dd551f1c3c4ef6b45..12584951449417807cea82ee6eb91a881805e78f 100644 (file)
 #  include <config.h>
 #endif
 
+#include <simgear/misc/sg_path.hxx>
 #include <simgear/magvar/magvar.hxx>
-#include <simgear/timing/fg_time.hxx>
 
 #include <FDM/flight.hxx>
-#include <Main/options.hxx>
+#include <Main/globals.hxx>
 
 #include "light.hxx"
 #include "moonpos.hxx"
 #include "tmp.hxx"
 
 
-FGMagVar::FGMagVar() {
-}
-
-FGMagVar::~FGMagVar() {
-}
-
-
-void FGMagVar::update( double lon, double lat, double alt_m, double jd ) {
-    // Calculate local magnetic variation
-    double field[6];
-    // cout << "alt_m = " << alt_m << endl;
-    magvar = SGMagVar( lat, lon, alt_m / 1000.0, (long)jd, field );
-    magdip = atan(field[5]/sqrt(field[3]*field[3]+field[4]*field[4]));
-}
-
-FGMagVar cur_magvar;
-
-
 // periodic time updater wrapper
 void fgUpdateLocalTime() {
+    SGPath zone( globals->get_fg_root() );
+    zone.append( "Timezone" );
 
-    FGTime::cur_time_params->updateLocal( cur_fdm_state->get_Longitude(),
-                                         cur_fdm_state->get_Latitude(),
-                                         current_options.get_fg_root() );
+    globals->get_time_params()->updateLocal( cur_fdm_state->get_Longitude(),
+                                            cur_fdm_state->get_Latitude(),
+                                            zone.str() );
 }