As of revision 9570 I have implemented a new time API for PLplot which consists of c_configtime, c_plbtime, and c_plctime. These are wrappers (see src/pltime.c) for the qsastime library routines configqsas, btimeqsas, and ctime_qsas. These wrappers internally store and use the needed pointer to a QSASConfig struct in plsc->qsasconfig. That struct compactly stores all the information needed for the transformation between continuous time and broken-down time. The PLplot library also internally calls the qsastime library routines strfqsas for plotting time labels and closeqsas (for properly closing the qsastime library in plend1). I think it would be a big mistake to provide a public PLplot API corresponding to closeqsas since that is all taken care of properly in plend1. If somebody wants to provide a public PLplot API corresponding to strfqsas, please go ahead. That might be useful for putting a formatted time label in a legend or axis title.
The arguments of c_plconfigtime, c_plbtime, and c_plctime (a.k.a. plconfigtime, plbtime, and plctime) correspond to the equivalent arguments of configqsas, btimeqsas, and ctimeqsas which are currently documented in lib/qsastime/README.qsastime_API and the self-documentation of the QSASConfig struct that appears in qsatime. I plan to shortly start working on DocBook documentation of all the new time work. I expect this will be a fairly time-consuming effort since I plan to provide a section giving an overview of the (new) time handling in PLplot, and of course I will be documenting the new PLplot time API as well as the public API of the qsastime library. In conjunction with the documentation effort I also plan to implement leap seconds in qsastime itself (which should not change the PLplot or libqsastime API since whether or not you use leap seconds is controlled by bit one of qsaconfig->ccontrol). I need a volunteer from the QSAS team to test out plconfigtime, plbtime, and plctime for their own plotting needs. The important question is whether these new functions are enough for their plotting needs. If so, it should allow them to replace their patched version of PLplot with the svn trunk version of PLplot which will eventually turn into our next development release. Everything builds fine for me on my Debian Lenny platform for revision 9570, and a valgrind run on example x29c shows no memory management issues for the way I have handled the plsc->qsasconfig pointer. x29 continues to give the same postscript results as previously. I would appreciate testing of this revision on other platforms as well. If somebody would like to help out with the time project while I am working on the DocBook documentation of that project, here are some things that are still left to do. (1) We have some calls of mktime and gmtime in our core library which should all be replaced (and simplified in the mktime case because you don't have to fiddle with time zones) by plbtime and plctime. That change should allow "#include <time.h>" to be removed from plplotP.h. (2) Stream initialization already provides a default transformation between continuous and broken-down time for each different stream. The way this works is that if plinit is called for a given stream and if the user has not already called plconfigtime for that stream, then plconfigtime is called to establish a PLplot default transformation (currently this is seconds since the Unix epoch, but that default may change) in the transformations between continuous and broken-down time for that stream. However, this needs to be followed up by calling plconfigtime (which reconfigures the time transformation in libqsastime, but with all transformation data stored in a QSASConfig struct pointed to by plsc->qsasconfig) for every change in stream and whenever a stream is copied so that if a user calls plconfigtime (before or after plinit for the stream), then that call will only affect the current stream. (3) We need to update all the various language bindings to provide plconfigtime, plbtime, and plctime. Example 29 should exercise all those functions once it is updated (see below). (4) As of revision 9570, I have already considerably simplified the example 29 time handling with this new API. (e.g., no more special numbers are required to represent the starting time for Windows.) However, I don't think we should propagate that change just yet from the C version to other languages because I think this might be a good opportunity to extend example 29 to show off the capabilities of the new API including calls to plconfigtime, plbtime, and plctime (perhaps for two different streams?) Although there is still quite a bit to do, it appears we now have a reasonably short list (see above) of things still left to do rather than the indefinite list we had before. Also, plconfigtime, plbtime, and plctime are now directly available for testing in C (e.g., by the QSAS team or anybody that wants to extend the C version of example 29). I am quite happy with these signs of substantial progress in the PLplot time project. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel