mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Better handling of manually edited air temperature
We now load and save this in the XML file, we do the right thing when merging dives and show the edited air temperature in the Dive Info notebook when a divecomputer doesn't have an air temperature. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ca19578e40
commit
23cfd907de
5 changed files with 50 additions and 3 deletions
17
save-xml.c
17
save-xml.c
|
@ -150,6 +150,21 @@ static void save_depths(FILE *f, struct divecomputer *dc)
|
|||
fputs(" />\n", f);
|
||||
}
|
||||
|
||||
static void save_dive_temperature(FILE *f, struct dive *dive)
|
||||
{
|
||||
temperature_t temp;
|
||||
temp.mkelvin = dive->airtemp.mkelvin;
|
||||
dive->airtemp.mkelvin = 0;
|
||||
fixup_airtemp(dive);
|
||||
if (dive->airtemp.mkelvin && temp.mkelvin != dive->airtemp.mkelvin) {
|
||||
fputs(" <divetemperature", f);
|
||||
show_temperature(f, temp, " air='", "'");
|
||||
fputs(" />\n", f);
|
||||
}
|
||||
dive->airtemp.mkelvin = temp.mkelvin;
|
||||
|
||||
}
|
||||
|
||||
static void save_temperatures(FILE *f, struct divecomputer *dc)
|
||||
{
|
||||
if (!dc->airtemp.mkelvin && !dc->watertemp.mkelvin)
|
||||
|
@ -448,7 +463,7 @@ void save_dive(FILE *f, struct dive *dive)
|
|||
save_overview(f, dive);
|
||||
save_cylinder_info(f, dive);
|
||||
save_weightsystem_info(f, dive);
|
||||
|
||||
save_dive_temperature(f, dive);
|
||||
/* Save the dive computer data */
|
||||
dc = &dive->dc;
|
||||
do {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue