uwatec time format suggestion
Kurt
postdive at postdive.com
Fri Dec 23 18:08:54 UTC 2011
Jeff and all
Thanks for the good and interesting work on the libdivecomputer project.
By way of introduction I will say that I have been writing Aladin readers and logs for my own use since the prior century. I still have a working Palm Pilot and home made cable. Alas, the Palm platform and SDK changed too frequently to make publishing worthwhile. I also wrote my own reader for the Smart and was quite excited/disappointed to see that you got no further decoding Smart Com/Pro than I did. (c:
Down to business:
I don't know why, but everyone since time immemorial has wanted to complicate the calculation of Uwatec time by attempting to attach it to an epoch. It changes from model to model and becomes problematic with battery changes and other malfunctions, though it will will seem to work most of the time.
I believe this is the wrong approach.
The Aladin computers since the days of MemoMouse have utilized a 500 ms counter (2 tics/second). It is not attached to any particular epoch though it may appear that way since the factory has to initialize the counter with _something_. However, battery changes and other vagaries may change that.
Each dive has a four byte tic count (UInt32)
Each *download* also specifies the tic count at the time of download in the old MemoMouse, or you explicitly retrieve the Dive Computer Time (in tics) as outlined in the Uwatec Smart protocol page.
The difference between the two divided by two: ( DiveComputerTimeInTics-DiveTimeInTics ) >> 1
is the total number of seconds since the dive began.
This is perfectly clean number that is completely independent of epoch, timezone or platform.
It is also independent of Aladin platform, be it plain, Nitrox, ultra, tech or smart. You don't need any +/- 1800 adjusters magic numbers or anything of that sort.
The introduction of epochs and timezone adjustments are then left to the implementor and platform as they should be.
This also generally reduces time errors since the difference between ticsnow and ticsthen, is much smaller quantity of tics to be operated on and time interpretation accuracy will depend on the host computer time source instead of the dive computer.
Regards,
kurt
More information about the Devel
mailing list