|
From: <ai...@us...> - 2009-02-21 16:20:21
|
Revision: 9572
http://plplot.svn.sourceforge.net/plplot/?rev=9572&view=rev
Author: airwin
Date: 2009-02-21 16:20:17 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
Handle default time transformation for PLplot in a more centralized
way.
Modified Paths:
--------------
trunk/src/plcore.c
trunk/src/pltime.c
Modified: trunk/src/plcore.c
===================================================================
--- trunk/src/plcore.c 2009-02-21 07:48:29 UTC (rev 9571)
+++ trunk/src/plcore.c 2009-02-21 16:20:17 UTC (rev 9572)
@@ -1718,11 +1718,11 @@
if (plsc->timefmt == NULL)
c_pltimefmt("%c");
- /* Default transformation between continuous and broken-down time
- (and vice versa) defined here for PLplot. */
- /* Temporarily the default is defined to be seconds past the Unix epoch. */
+ /* Use default transformation between continuous and broken-down time
+ (and vice versa) if the transformation has not yet been defined
+ for this stream. */
if (plsc->qsasconfig == NULL)
- c_plconfigtime(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0.);
+ c_plconfigtime(0., 0., 0., 0x0, 0, 0, 0, 0, 0, 0, 0.);
/* Switch to graphics mode and set color and arrow style*/
Modified: trunk/src/pltime.c
===================================================================
--- trunk/src/pltime.c 2009-02-21 07:48:29 UTC (rev 9571)
+++ trunk/src/pltime.c 2009-02-21 16:20:17 UTC (rev 9572)
@@ -35,7 +35,15 @@
void
c_plconfigtime(PLFLT scale, PLFLT offset1, PLFLT offset2, PLINT ccontrol, PLBOOL ifbtime_offset, PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec)
{
- configqsas(scale, offset1, offset2, ccontrol, ifbtime_offset, year, month, day, hour, min, sec, &(plsc->qsasconfig));
+ if(scale == 0.) {
+ /* Default transformation between continuous and broken-down time
+ (and vice versa) defined here for PLplot. */
+ /* Note the PLplot default is not necessarily the same as the
+ libqsastime default. */
+ configqsas(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0., &(plsc->qsasconfig));
+ } else {
+ configqsas(scale, offset1, offset2, ccontrol, ifbtime_offset, year, month, day, hour, min, sec, &(plsc->qsasconfig));
+ }
}
/* Calculate continuous time from broken-down time for current stream. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|