diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-23 10:25:31 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-23 12:55:33 -0800 |
commit | b6c9301e584722b9b46dffd4d759e8c60df520ad (patch) | |
tree | 2f963ec75672389692e532a8264dc83396900eb2 /info.c | |
parent | 3e5a508b15fe28083dfdf5a049d33e8769616395 (diff) | |
download | subsurface-b6c9301e584722b9b46dffd4d759e8c60df520ad.tar.gz |
Move more dive computer filled data to the divecomputer structure
This moves the fields 'duration', 'surfacetime', 'maxdepth',
'meandepth', 'airtemp', 'watertemp', 'salinity' and 'surface_pressure'
to the per-divecomputer data structure. They are filled in by the dive
computer, and normally not edited.
NOTE! All actual *use* of this data was then changed from dive->field to
dive->dc.field programmatically with a shell-script and sed, and the
result then edited for details. So while the XML save and restore code
has been updated, all the displaying etc will currently always just show
the first dive computer entry.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r-- | info.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -460,8 +460,8 @@ static void save_dive_info_changes(struct dive *dive, struct dive *master, struc default: mkelvin = 0; } - if (mkelvin != dive->airtemp.mkelvin) { - dive->airtemp.mkelvin = mkelvin; + if (mkelvin != dive->dc.airtemp.mkelvin) { + dive->dc.airtemp.mkelvin = mkelvin; changed = 1; } } @@ -532,9 +532,9 @@ static void dive_info_widget(GtkWidget *box, struct dive *dive, struct dive_info info->viz = text_entry(hbox, _("Visibility"), star_list, star_strings[dive->visibility]); - value = get_temp_units(dive->airtemp.mkelvin, &unit); + value = get_temp_units(dive->dc.airtemp.mkelvin, &unit); snprintf(buffer, sizeof(buffer), _("Air Temp in %s"), unit); - if (dive->airtemp.mkelvin) + if (dive->dc.airtemp.mkelvin) snprintf(airtemp, sizeof(airtemp), "%.1f", value); else airtemp[0] = '\0'; @@ -873,7 +873,7 @@ static timestamp_t dive_time_widget(struct dive *dive) */ if (amount_selected == 1) { timestamp_t when = current_dive->when; - when += current_dive->duration.seconds; + when += current_dive->dc.duration.seconds; when += 60*60; utc_mkdate(when, &tm); time = &tm; @@ -923,12 +923,12 @@ static timestamp_t dive_time_widget(struct dive *dive) val = gtk_spin_button_get_value(GTK_SPIN_BUTTON(depth)); if (prefs.units.length == FEET) { - dive->maxdepth.mm = feet_to_mm(val); + dive->dc.maxdepth.mm = feet_to_mm(val); } else { - dive->maxdepth.mm = val * 1000 + 0.5; + dive->dc.maxdepth.mm = val * 1000 + 0.5; } - dive->duration.seconds = gtk_spin_button_get_value(GTK_SPIN_BUTTON(duration))*60; + dive->dc.duration.seconds = gtk_spin_button_get_value(GTK_SPIN_BUTTON(duration))*60; gtk_widget_destroy(dialog); dive->when = utc_mktime(&tm); |