mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Editing air or water temperature should modify dive computer, not dive
The dive fields are summary fields, the actual data needs to be in the divecomputer specific fields. Fixes #307
This commit is contained in:
parent
d936c55a01
commit
ff5fa70a88
4 changed files with 25 additions and 11 deletions
|
@ -153,13 +153,16 @@ static void save_depths(FILE *f, struct divecomputer *dc)
|
|||
|
||||
static void save_dive_temperature(FILE *f, struct dive *dive)
|
||||
{
|
||||
if (!dive->airtemp.mkelvin)
|
||||
if (!dive->airtemp.mkelvin && !dive->watertemp.mkelvin)
|
||||
return;
|
||||
if (dive->airtemp.mkelvin == dc_airtemp(&dive->dc))
|
||||
if (dive->airtemp.mkelvin == dc_airtemp(&dive->dc) || dive->watertemp.mkelvin == dc_watertemp(&dive->dc))
|
||||
return;
|
||||
|
||||
fputs(" <divetemperature", f);
|
||||
show_temperature(f, dive->airtemp, " air='", "'");
|
||||
if (dive->airtemp.mkelvin && dive->airtemp.mkelvin != dc_airtemp(&dive->dc))
|
||||
show_temperature(f, dive->airtemp, " air='", "'");
|
||||
if (dive->watertemp.mkelvin && dive->watertemp.mkelvin != dc_watertemp(&dive->dc))
|
||||
show_temperature(f, dive->watertemp, " water='", "'");
|
||||
fputs("/>\n", f);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue