[Gpredict-svn] SF.net SVN: gpredict:[827] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <aa...@us...> - 2011-05-30 11:17:01
|
Revision: 827 http://gpredict.svn.sourceforge.net/gpredict/?rev=827&view=rev Author: aa1vs Date: 2011-05-30 11:16:51 +0000 (Mon, 30 May 2011) Log Message: ----------- Fix Bug 3309110: 100% on manual time adjustment. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS trunk/src/gtk-sat-module-tmg.c trunk/src/sgpsdp/sgp4sdp4.h trunk/src/sgpsdp/sgp_time.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/ChangeLog 2011-05-30 11:16:51 UTC (rev 827) @@ -1,3 +1,13 @@ +2011-05-31 Charles Suprin <hamaa1vs at gmail.com> + + * src/sgpsdp/sgp_time.c + * src/sgpsdp/sgp4sdp4.h + * src/gtk-sat-module-tmg.c + Fix discrepancy in year convention with Time_to_UTC between Julian_Date + convention and mktime convention. + Fixes Bug 3309110: 100% on manual time adjustment. + Fixes part of Ubuntu Bug #789691. + 2011-05-26 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-single-sat.c Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/NEWS 2011-05-30 11:16:51 UTC (rev 827) @@ -5,8 +5,9 @@ - Feature request 2130926: Change frequency using mouse wheel. Also for rotator controller. - Applied and extended patch 3237220: natural sort for sat list in module config - Improve handling of decayed satellites. -- Fixed bug 3250344: Win32 uild not working with hamlib. +- Fixed bug 3250344: Win32 build not working with hamlib. - Fixed bug 3294829: Program name wrong in desktop files. +- Fixed bug 3309110: 100% on manual time adjustment. Changes in version 1.3 (1 Mar 2011) Modified: trunk/src/gtk-sat-module-tmg.c =================================================================== --- trunk/src/gtk-sat-module-tmg.c 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/src/gtk-sat-module-tmg.c 2011-05-30 11:16:51 UTC (rev 827) @@ -483,7 +483,6 @@ gdouble slider; gdouble jd; - /* update time only if we are in manual time control */ if (!mod->throttle && !mod->reset) { @@ -513,7 +512,7 @@ /* convert UTC time to Julian Date */ if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME)) { /* convert local time to UTC */ - utim = Time_to_UTC (&tim); + Time_to_UTC (&tim, &utim); /* Convert to JD */ jd = Julian_Date (&utim); @@ -814,7 +813,7 @@ /* convert UTC time to Julian Date */ if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME)) { /* convert local time to UTC */ - utim = Time_to_UTC (&tim); + Time_to_UTC (&tim, &utim); /* Convert to JD */ jd = Julian_Date (&utim); @@ -869,7 +868,7 @@ /* convert UTC time to Julian Date */ if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME)) { /* convert local time to UTC */ - utim = Time_to_UTC (&tim); + Time_to_UTC (&tim, &utim); /* Convert to JD */ jd = Julian_Date (&utim); Modified: trunk/src/sgpsdp/sgp4sdp4.h =================================================================== --- trunk/src/sgpsdp/sgp4sdp4.h 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/src/sgpsdp/sgp4sdp4.h 2011-05-30 11:16:51 UTC (rev 827) @@ -347,7 +347,7 @@ double Julian_Date(struct tm *cdate); void Date_Time(double jd, struct tm *cdate); int Check_Date(struct tm *cdate); -struct tm Time_to_UTC(struct tm *cdate); +void Time_to_UTC(struct tm *cdate, struct tm *odate); struct tm Time_from_UTC(struct tm *cdate); double JD_to_UTC(double jt); double JD_from_UTC(double jt); Modified: trunk/src/sgpsdp/sgp_time.c =================================================================== --- trunk/src/sgpsdp/sgp_time.c 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/src/sgpsdp/sgp_time.c 2011-05-30 11:16:51 UTC (rev 827) @@ -241,13 +241,23 @@ /* The procedures JD_to_UTC and JD_from_UTC are used to */ /* do the same thing working directly with Julian dates. */ -struct tm -Time_to_UTC(struct tm *cdate) +void +Time_to_UTC(struct tm *cdate, struct tm *odate) { time_t tdate; - + /* + functions such as Julian_Date work with tm_year in being + the year since 0 AD and mktime uses it as the year since 1900 + + tm_isdst = -1 forces the mktime call to lookup the daylight + savings for the current timezone instead of using whatever + was in the structure when it was created. + */ + cdate->tm_year -= 1900; + cdate->tm_isdst = -1; tdate = mktime(cdate); - return( *gmtime(&tdate) ); + gmtime_r(&tdate,odate); + odate->tm_year += 1900; } /*Procedure Time_to_UTC*/ /*------------------------------------------------------------------*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |