- // printf ("Current greenwich mean time = %24s", asctime(gmtime(&cur_time)));
- // printf ("Current local time = %24s", asctime(localtime(&cur_time)));
- // time_t tmp = cur_time;
- GeoCoord location( RAD_TO_DEG * lat, RAD_TO_DEG * lon );
-
- GeoCoord* nearestTz = tzContainer->getNearest(location);
-
- FGPath zone( root );
- zone.append( "Timezone" );
- zone.append( nearestTz->getDescription() );
-
- cout << "Using " << zone.str() << " for timezone information" << endl;
- zonename = strdup( zone.c_str() );
- cout << "zonename = " << zonename << endl;
- //show( buffer.c_str(), cur_time, 1);
- //printf ("Current greenwich mean time = %24s", asctime(gmtime(&cur_time)));
- //printf ("Current local time = %24s", asctime(localtime(&cur_time)));
- currGMT = get_gmt( gmtime(&cur_time) );
- cout << "currGMT = " << currGMT << endl;
-
- systemLocalTime = get_gmt( localtime(&cur_time) );
- cout << "systemLocalTime = " << systemLocalTime << endl;
-
- aircraftLocalTime = get_gmt( fgLocaltime(&cur_time, zone.c_str()) );
- //printf ("Current greenwich mean time = %24s", asctime(gmtime(&cur_time)));
- //printf ("Current local time = %24s", asctime(localtime(&cur_time)));
-
- //printf("LT = %d\n", computerLocalTime);
- // Okay, in principle, this trick allows to calculate the
- // difference between GMT and localtime, in seconds.
- // printf("Gmt = %d, SLT = %d, (difference = %d)\n", currGMT, systemLocalTime, (currGMT - systemLocalTime));
- // printf("Gmt = %d, ALT = %d, (difference = %d)\n", currGMT, aircraftLocalTime, (currGMT - aircraftLocalTime));
- // exit(1);
-
-#if 0
- // Okay, we now have six possible scenarios
- switch (offsetType)
- {
- case SG_TIME_SYS_OFFSET:
- warp = timeOffset;
- break;
- case SG_TIME_GMT_OFFSET:
- warp = timeOffset - (currGMT - systemLocalTime);
- break;
- case SG_TIME_LAT_OFFSET:
- // warp = timeOffset - (currGMT - systemLocalTime +
- // (currGMT - aircraftLocalTime));
- warp = timeOffset - (aircraftLocalTime - systemLocalTime);
- break;
- case SG_TIME_SYS_ABSOLUTE:
- warp = timeOffset - cur_time;
- //printf("warp = %d\n", warp);
- break;
- case SG_TIME_GMT_ABSOLUTE:
- warp = timeOffset - currGMT;
- break;
- case SG_TIME_LAT_ABSOLUTE:
- warp = timeOffset - (aircraftLocalTime - systemLocalTime) -
- cur_time;
- break;
- default:
- printf("Unsupported type\n");
- exit(1);
- }
-
- warp_delta = 0;
- // pause = current_options.get_pause();
-#endif