Jerry,

I'm not quite sure what your latest commit is intended to do? It
certainly doesn't reproduce the C results for me. 

The plplot time functions use 0.0 to represent January 1, 1970. This is
the usual unix convention for the epoch in C time functions. You have
set xmin to be 0.0 by subtracting 2 identical times from each other,
hence the label you see. Is this really what you see with the C version
of the example as well?

The C version is complicated because the C time functions are rather
unhelpful when it comes to timezones. The example is designed to be in
UTC (Universal coordinate time). This is the norm for scientific
applications to avoid problems with synchronising measurements made in
different locations. Anyway, the C functions mostly work in the local
time zone. What we want is to turn a time broken down into year, month,
day, hour, min, sec into a time in seconds since January 1 1970. To
achieve this using POSIX functions you have to set the timezone to be
UTC (by setting the TZ variable and then calling tzset). The call to
mktime (which uses the time in the current time zone) will then assume
time in UTC rather than local time. This is not particularly pretty and
may not work on Windows platforms (testing appreciated!)

Is there any way in ada to convert a broken down time (in UTC) into a
time in seconds since Jan 1 1970? From a brief look at the gnat manuals
it seems that ada time functions are also rather muddled when it comes
to time zones.

Cheers

Andrew

On Sat, Aug 16, 2008 at 05:31:15PM -0700, Jerry wrote:
> I have made Ada example 29 once again generate identical PS to C.  
> However, I don't understand what is going on in the C example. The  
> code sets up the initial time of the plot to be December 1, 2005, but  
> the horizontal label on the plot begins on January 1, 1970.
> 
> Jerry
> 
> 
> On Aug 14, 2008, at 11:51 AM, Andrew Ross wrote:
> 
> > Ada is not too far off. Currently example 20 is missing (plgriddata  
> > not
> > implemented?). There are differences with example 21 (plrandd not
> > implemented) and example 29 (problems with Ada calendar functions - we
> > could just hard code in the time value if required - not a plplot
> > issue.) There is also the open 64-bit issue with example 19.
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Plplot-devel mailing list
> Plplot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plplot-devel
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to