Incorrect tank info.
Linus Torvalds
torvalds at linux-foundation.org
Tue Aug 21 13:41:53 PDT 2012
On Tue, Aug 21, 2012 at 1:28 PM, Ďoďo <dodo.sk at gmail.com> wrote:
>
> 1. I opened XML I created some months ago.
> 2. Then I imported new data from D6.
> 3. And then I noticed that all my dives I dived with air had O2 31%.
> The dive I really had Nitrox 33 had correct 33% and later dive with
> Air got already Air.
Can you add some debugging to libdivecomputer.c:parse_gasmixes().
Just a simple
fprintf(stderr, "o2=%d he=%d\n", o2, he);
after the two lines that gets it from the libdivecomputer gasmix field.
IOW, the code should look something like
o2 = gasmix.oxygen * 1000 + 0.5;
he = gasmix.helium * 1000 + 0.5;
fprintf(stderr, "o2=%d he=%d\n", o2, he);
> 6. It looks like it was taken from older dives.
I really don't think we should be leaking data from older dives when
importing, because we create the new dives with "alloc_dive()", which
does a memset() to clear out all fields.
But I'll see if I can reproduce odd gasmixes with my setup.
> 8. Then I imported all to data without reading older XML and the same
> problem. My last trip took the cylinder content from the trip before.
> Trip before took from 2 trips before. Till the air was not found.
> 9. Interesting is, that I did not observe it always. In the past there
> are dives when trip finished with Nitrox 36 but next dive is correctly
> with air.
>
> Any idea what can be the source of the problem?
My guess would be libdivecomputer changes. Maybe a D6-specific issue?
Especially if it happens without even reading the older XML file.
Linus
More information about the subsurface
mailing list