Opened 4 years ago

Closed 4 years ago

#313 closed defect (fixed)

Not possible to save Air/Water temperature without a dive profile

Reported by: abelloni Owned by: DirkHH
Priority: major Component: Other
Version: 3.9.1 BETA Keywords: backwards compatibility
Cc: hosch@… Plattform (please give specifics in the ticket text): Linux


Without a dive profile it is not possible to save the air or the water temperature.

Even worse, if it was set in the previous divelog, it will get removed (use the attached file).

Attachments (1)

temp.xml (439 bytes) - added by abelloni 4 years ago.

Download all attachments as: .zip

Change History (11)

Changed 4 years ago by abelloni

comment:1 Changed 4 years ago by DirkHH

  • Owner changed from tcanabrava to DirkHH
  • Status changed from new to assigned

Oh carp. Yes. I know exactly how to fix that.
We no longer create dives without any samples, but we have test dives like that...

comment:2 Changed 4 years ago by hosch

  • Cc hosch@… added

comment:3 Changed 4 years ago by abelloni

Do you mean it won't be possible to add dives that one did without a dive computer ? (I have a few of those)

comment:4 Changed 4 years ago by DirkHH

No, that's not what I mean.
The word "dive computer" means two things in this context.
One is the physical object that a diver takes on a dive.
And one is a data structure internal to our software.
When you manually add a dive in Subsurface 3.9 or later we create the dive computer data structure and that's where the temperature data is stored. I tested that and it appears to work for me.
So the only way this can happen if you have a dive that you manually added earlier (most likely with the Gtk version of Subsurface, so 3.1 or earlier) - that wouldn't have the dive computer data structure associated with the dive and therefore not be able to correctly store that information.

I think the correct way to solve this is to create the data structure when loading such a dive for the first time in 3.9. I'll look into implementing that.

comment:5 Changed 4 years ago by DirkHH

  • Status changed from assigned to accepted

Actually, the situation seems different to me...
When you edit it in the UI, it seems to disappear (I need to fix that), but then when you save the logbook, the next time you open it the data is there.

comment:6 Changed 4 years ago by Dirk Hohndel <dirk@…>

  • Resolution set to fixed
  • Status changed from accepted to closed

In 502a514e919efee172f216acab5a3c8e73931e1d/subsurface:

Reflect air and water temperature changes in dive info

When editing air or water temperature, you are actually editing the
information in the active divecomputer structure. But the Dive Info shows
the summary data created from the temperature data in all dive computers.
For most people who will only ever have one divecomputer per dive this may
seem like an artificial distinction, but it's very important if you track
more than one computer.

So in order to have an edit reflected in what's shown, we must redo the
"summary creation" for data from the different divecomputers into the
summary fields of the dive.

Fixes #313

Signed-off-by: Dirk Hohndel <dirk@…>

comment:7 Changed 4 years ago by DirkHH

In order to test that this was indeed fixed you'll need to build from source or wait for the upcoming second public beta (I hope to cut that by the end of the week, but it might slip, depending how bugfixing, documentation, translations are going).

comment:8 Changed 4 years ago by abelloni

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hum, I just tried again and the air temperature saved on my previously (with 3.1.1) manually added dives are still disappearing when saving with current master.

comment:9 Changed 4 years ago by DirkHH

  • Component changed from Qt-UI to Other
  • Keywords backwards compatibility added
  • Priority changed from minor to major
  • Status changed from reopened to accepted

I think I know why. It's because we moved them to where they belong (in the divecomputer datastructure) and I bet your XML file has them in the dive part.
Yep, confirmed in the XML that you posted.
So I need to add a hook to be backwards compatible there. Dang.

comment:10 Changed 4 years ago by Dirk Hohndel <dirk@…>

  • Resolution set to fixed
  • Status changed from accepted to closed

In 379fa5f65270da85a4a0816a9fab6589cf70893d/subsurface:

Really save airtemp and watertemp in the dive

I thought I had this fixed, but a silly thinko broke my fix.
Only abort the saving if both air AND water temperature are already
covered by the divecomputer(s) in a dive. If at least one of them is
different, then create a divetemperature tag and fill in that value at the
dive level.

Fixes #313

Signed-off-by: Dirk Hohndel <dirk@…>

Note: See TracTickets for help on using tickets.