Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-13 Thread Alez Buzin
Martin Spott wrote:
> Alez Buzin wrote:
>
>   
>> May I have miss something but I have in FG properties
>> "sim/time/gmt" in the form "2009-05-16T12:08:16",
>> "sim/time/gmt-string" as "12:08:16",
>> and sub-trees sim/time/utc/... and sim/time/real/... containing year,
>> day etc as integers. What problems to use this?
>> 
>
> Working with purely numeric values is much easier to deal with in a
> portable, timezone- and localization-independent way, not only for
> internal handling but also if you're planning to interface with
> external applications.
Combine :
sim/time/utc/month
sim/time/utc/day
sim/time/utc/hour
sim/time/utc/minute
sim/time/utc/second

With respect,
Alex





--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-11 Thread Martin Spott
Alez Buzin wrote:

> May I have miss something but I have in FG properties
> "sim/time/gmt" in the form "2009-05-16T12:08:16",
> "sim/time/gmt-string" as "12:08:16",
> and sub-trees sim/time/utc/... and sim/time/real/... containing year,
> day etc as integers. What problems to use this?

Working with purely numeric values is much easier to deal with in a
portable, timezone- and localization-independent way, not only for
internal handling but also if you're planning to interface with
external applications.

James is planning to record timestamps for takeoff and touchdown. Now,
just think of a tool to track a pilot's flying time   just one
application that comes into my mind, don't know if James is aiming at
such a use.

Best regards,
Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-11 Thread Alez Buzin
Hi
May I have miss something but I have in FG properties
"sim/time/gmt" in the form "2009-05-16T12:08:16",
"sim/time/gmt-string" as "12:08:16",
and sub-trees sim/time/utc/... and sim/time/real/... containing year,
day etc as integers. What problems to use this?

With respect,
Alex


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-09 Thread Curtis Olson
I think if you are recording absolute times of day it makes sense to store
those internally as unix time.  I'm sure we could expose some sort of
function (if it's not already available) to format that in the local time
zone or some arbitrary time zone.  I think this also facilitates computing
future time estimates.  If you started out with some sort of HHMMSS format
and tried to do math in that format, you would end up with a lot of messy
code and you could easily hit land mines with time zones, etc.

Regards,

Curt.


On Tue, Jun 9, 2009 at 11:46 AM, James Turner wrote:

>
> On 9 Jun 2009, at 17:12, Erik Hofman wrote:
>
> >> At the end of the day, the "correct" approach really depends on
> >> what you
> >> are trying accomplish (what values and in what format are you
> >> trying to
> >> compute?)
> >
> > Also, there is a difference between the value in the property tree
> > (which is just a nifty way to look at the raw data) and the values
> > presented in the GUI dialogs for instance.
>
> I need to do some very limited 'computations' on the times, but mostly
> it's about making the numbers available in a human-readable form, but
> also in a way that the gui / Nasal instrument code can present.
>
> What I want to do is record the time at takeoff and touchdown (down to
> the second, nothing more precise), and use this combined with
> estimated time enroute information to give estimated arrival time
> (either Zulu or local at the destination). There's some related
> functions, but if I can do that first bit, figuring out the rest will
> be trivial.
>
> I already have the estimated enroute time (in seconds, and of course
> can be presented as a formatted string) and it's trivial to log the
> elapsed flight time (again as seconds since takeoff). Assuming I am
> using integer seconds since the epoch, I can stash that in a property
> just fine - what I suspect I need then is the ability to take that
> value (+ or - some elapsed time in seconds) and convert that into a
> Zulu time string, or a local time string at some lat/lon.
>
> (as always, I hope this is clear enough)
>
> Regards,
> James
>
>
> --
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>



-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-09 Thread James Turner

On 9 Jun 2009, at 17:12, Erik Hofman wrote:

>> At the end of the day, the "correct" approach really depends on  
>> what you
>> are trying accomplish (what values and in what format are you  
>> trying to
>> compute?)
>
> Also, there is a difference between the value in the property tree
> (which is just a nifty way to look at the raw data) and the values
> presented in the GUI dialogs for instance.

I need to do some very limited 'computations' on the times, but mostly  
it's about making the numbers available in a human-readable form, but  
also in a way that the gui / Nasal instrument code can present.

What I want to do is record the time at takeoff and touchdown (down to  
the second, nothing more precise), and use this combined with  
estimated time enroute information to give estimated arrival time  
(either Zulu or local at the destination). There's some related  
functions, but if I can do that first bit, figuring out the rest will  
be trivial.

I already have the estimated enroute time (in seconds, and of course  
can be presented as a formatted string) and it's trivial to log the  
elapsed flight time (again as seconds since takeoff). Assuming I am  
using integer seconds since the epoch, I can stash that in a property  
just fine - what I suspect I need then is the ability to take that  
value (+ or - some elapsed time in seconds) and convert that into a  
Zulu time string, or a local time string at some lat/lon.

(as always, I hope this is clear enough)

Regards,
James

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-09 Thread Erik Hofman


Curtis Olson wrote:
> Hi James,
> At the end of the day, the "correct" approach really depends on what you 
> are trying accomplish (what values and in what format are you trying to 
> compute?)

Also, there is a difference between the value in the property tree 
(which is just a nifty way to look at the raw data) and the values 
presented in the GUI dialogs for instance.

Erik

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-09 Thread Curtis Olson
Hi James,

I know that unix time is used heavily internally in the code.  I guess you
are right, I can't point to a place where it exists in the property tree
(which doesn't mean it might not be in there somewhere.) :-)

I don't see any problem with publishing the integer time in the property
tree if there is a need or desire to do that.

At the end of the day, the "correct" approach really depends on what you are
trying accomplish (what values and in what format are you trying to
compute?)

Regards,

Curt.


On Tue, Jun 9, 2009 at 4:47 AM, James Turner  wrote:

>
> On 8 Jun 2009, at 23:12, Martin Spott wrote:
>
> >> Actually the "official" FlightGear time matches the unix approach of
> >> tracking seconds since the epoch.
> >
> > Well, the scope on which James is focusing in his question is -
> > obviously - the property tree and so far I've been unable to spot a
> > place where Unix epoch date is written to it. Did I really miss that
> > one ?
>
> Curt, just to clarify, I assume you aren't referring to the code in
> SGTime, nor SGTimeInterval. SGTime seems like the core time processing
> logic (and not amenable to being stashed in a property), and
> SGTimeInterval is about intervals. So which code do you have in mind?
>
> And like Martin, I can't see a place where integer seconds are stored
> in a property - not that this stops me doing it, but I'd always rather
> see an example before creating something new and potentially
> unconventional :)
>
> James
>
>
> --
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>



-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-09 Thread James Turner

On 8 Jun 2009, at 23:12, Martin Spott wrote:

>> Actually the "official" FlightGear time matches the unix approach of
>> tracking seconds since the epoch.
>
> Well, the scope on which James is focusing in his question is -
> obviously - the property tree and so far I've been unable to spot a
> place where Unix epoch date is written to it. Did I really miss that
> one ?

Curt, just to clarify, I assume you aren't referring to the code in  
SGTime, nor SGTimeInterval. SGTime seems like the core time processing  
logic (and not amenable to being stashed in a property), and  
SGTimeInterval is about intervals. So which code do you have in mind?

And like Martin, I can't see a place where integer seconds are stored  
in a property - not that this stops me doing it, but I'd always rather  
see an example before creating something new and potentially  
unconventional :)

James

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-08 Thread Martin Spott
Curtis Olson wrote:
> On Mon, Jun 8, 2009 at 2:04 PM, Martin Spott wrote:
>> James Turner wrote:
>>
>> > Is there an accepted way to store an absolute time (as opposed to an
>> > interval  or delta) in the property tree? [...]

>> FlightGear's "official" time seems to be seconds since midnight 
> 
> 
> Actually the "official" FlightGear time matches the unix approach of
> tracking seconds since the epoch.

Well, the scope on which James is focusing in his question is -
obviously - the property tree and so far I've been unable to spot a
place where Unix epoch date is written to it. Did I really miss that
one ?

Cheers,
Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-08 Thread Curtis Olson
On Mon, Jun 8, 2009 at 2:04 PM, Martin Spott wrote:

> Hi James,
>
> James Turner wrote:
>
> > Is there an accepted way to store an absolute time (as opposed to an
> > interval  or delta) in the property tree? The obvious way (to me)
> > would seem to be using a double to store seconds since the Unix epoch,
> > but it's not exactly human-readable. Of course I can (and will)
> > provide a string version alongside, but perhaps there's some even more
> > official way to do this?
>
> FlightGear's "official" time seems to be seconds since midnight 


Actually the "official" FlightGear time matches the unix approach of
tracking seconds since the epoch.  This is typically an "integer" value, not
a double ... unless you want to track partial seconds.  The nice thing about
this approach is that there is a suite of functions to convert this to any
local time zone and output the time and date in a human readable format.
The final solution of course depends a bit on exactly what you are trying to
accomplish, but in general, I'd definitely recommend this approach.

Regards,

Curt.
-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Absolute (calendar) times in properties

2009-06-08 Thread Martin Spott
Hi James,

James Turner wrote:

> Is there an accepted way to store an absolute time (as opposed to an  
> interval  or delta) in the property tree? The obvious way (to me)  
> would seem to be using a double to store seconds since the Unix epoch,  
> but it's not exactly human-readable. Of course I can (and will)  
> provide a string version alongside, but perhaps there's some even more  
> official way to do this?

FlightGear's "official" time seems to be seconds sice midnight 
which doesn't look as a good example to me and probably was born out of
the simple need to drive a clock display on the panel.
Therefore it's probably a good decision to go with widely accepted
standards like the seconds since Unix epoch, no matter if they had been
acknowledged by FlightGear in the past or not  ;-)

You always have the opportunity to add a universal, timezone-aware
conversion routine in a second step, if required, or to refine those in
'sg_time.cxx'.

Cheers,
Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Absolute (calendar) times in properties

2009-06-08 Thread James Turner
Another of those simple-but-awkward questions:

Is there an accepted way to store an absolute time (as opposed to an  
interval  or delta) in the property tree? The obvious way (to me)  
would seem to be using a double to store seconds since the Unix epoch,  
but it's not exactly human-readable. Of course I can (and will)  
provide a string version alongside, but perhaps there's some even more  
official way to do this?

This is for the GPS  / route-manager code - I want to compute not just  
the time-enroute (which the current code does) but also the ETA, based  
on the takeoff time (defined as IAS > 40kts and weight-on-wheels going  
false). Obviously I also want to record the takeoff time, and I can  
imagine various other planning-related functions that might need an  
'absolute' time stored in a property.

(I realise I'm going to get into time-zone issues rapidly - but in the  
short term I'm going to ignore them)

James


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel