From: <ai...@us...> - 2009-02-21 00:30:15
|
Revision: 9567 http://plplot.svn.sourceforge.net/plplot/?rev=9567&view=rev Author: airwin Date: 2009-02-21 00:30:02 +0000 (Sat, 21 Feb 2009) Log Message: ----------- Implement plconfigtime, plbtime, and plctime, the new time API for PLplot. Modified Paths: -------------- trunk/include/plplot.h trunk/src/CMakeLists.txt Added Paths: ----------- trunk/src/pltime.c Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2009-02-20 23:26:02 UTC (rev 9566) +++ trunk/include/plplot.h 2009-02-21 00:30:02 UTC (rev 9567) @@ -490,6 +490,7 @@ #define pladv c_pladv #define plaxes c_plaxes #define plbin c_plbin +#define plbtime c_plbtime #define plbop c_plbop #define plbox c_plbox #define plbox3 c_plbox3 @@ -497,8 +498,10 @@ #define plclear c_plclear #define plcol0 c_plcol0 #define plcol1 c_plcol1 +#define plconfigtime c_plconfigtime #define plcont c_plcont #define plcpstrm c_plcpstrm +#define plctime c_plctime #define plend c_plend #define plend1 c_plend1 #define plenv c_plenv @@ -716,6 +719,10 @@ PLDLLIMPEXP void c_plbin(PLINT nbin, PLFLT *x, PLFLT *y, PLINT opt); +/* Calculate broken-down time from continuous time for current stream. */ +PLDLLIMPEXP void +c_plbtime(PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT ctime); + /* Start new page. Should only be used with pleop(). */ PLDLLIMPEXP void @@ -754,6 +761,11 @@ PLDLLIMPEXP void c_plcol1(PLFLT col1); +/* Configure transformation between continuous and broken-down time (and + vice versa) for current stream. */ +PLDLLIMPEXP 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); + /* Draws a contour plot from data in f(nx,ny). Is just a front-end to * plfcont, with a particular choice for f2eval and f2eval_data. */ @@ -785,7 +797,11 @@ /* Converts input values from relative device coordinates to relative plot */ /* coordinates. */ +/* Calculate continuous time from broken-down time for current stream. */ PLDLLIMPEXP void +c_plctime(PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec, PLFLT *ctime); + +PLDLLIMPEXP void pldid2pc(PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax); /* Converts input values from relative plot coordinates to relative */ @@ -1544,7 +1560,7 @@ PLDLLIMPEXP void c_pltext(void); -/* Set the format for date / time labels */ +/* Set the format for date / time labels for current stream. */ PLDLLIMPEXP void c_pltimefmt(const char *fmt); Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2009-02-20 23:26:02 UTC (rev 9566) +++ trunk/src/CMakeLists.txt 2009-02-21 00:30:02 UTC (rev 9567) @@ -49,6 +49,7 @@ plgridd.c plvect.c mt19937ar.c +pltime.c ) if(LTDL_WIN32) set(plplot${LIB_TAG}_LIB_SRCS ${plplot${LIB_TAG}_LIB_SRCS} ltdl_win32.c) Added: trunk/src/pltime.c =================================================================== --- trunk/src/pltime.c (rev 0) +++ trunk/src/pltime.c 2009-02-21 00:30:02 UTC (rev 9567) @@ -0,0 +1,59 @@ +/* $Id$ + + Routines for interfacing with qsastime library routines. + + Copyright (C) 2009 Alan W. Irwin + + This file is part of PLplot. + + PLplot is free software; you can redistribute it and/or modify + it under the terms of the GNU General Library Public License as published + by the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + PLplot is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with PLplot; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "plplotP.h" + +/* Calculate broken-down time from continuous time for current stream. */ +void +c_plbtime(PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT ctime) +{ + btimeqsas(year, month, day, hour, min, sec, ctime, plsc->qsasconfig); +} + +/* Configure transformation between continuous and broken-down time (and + vice versa) for current stream. */ +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)); +} + +/* Calculate continuous time from broken-down time for current stream. */ +void +c_plctime(PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec, PLFLT *ctime) +{ + ctimeqsas(year, month, day, hour, min, sec, ctime, plsc->qsasconfig); +} + +/* Set format for date / time labels. */ +void +c_pltimefmt(const char *fmt) +{ + if (plsc->timefmt) + free_mem(plsc->timefmt); + + plsc->timefmt = (char *) malloc((size_t) (strlen(fmt)+1)); + strcpy(plsc->timefmt, fmt); + +} + Property changes on: trunk/src/pltime.c ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |