mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remove the special handling of ndl < 3m
This changes the special handling of ndl calculations when we deem that we are too shallow for doing them. Previously we just set ndl to -1 and printed a "-", now we return and print max_ndl, just as how most divecomputers work. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4bb8368a20
commit
373c26cf00
1 changed files with 2 additions and 5 deletions
|
@ -1076,7 +1076,7 @@ static void calculate_deco_information(struct dive *dive, struct divecomputer *d
|
||||||
/* FIXME: This should be configurable */
|
/* FIXME: This should be configurable */
|
||||||
const int time_stepsize = 60;
|
const int time_stepsize = 60;
|
||||||
const int max_ndl = 7200;
|
const int max_ndl = 7200;
|
||||||
entry->ndl = -1;
|
entry->ndl = max_ndl;
|
||||||
pi->has_ndl = TRUE;
|
pi->has_ndl = TRUE;
|
||||||
|
|
||||||
/* don't try to calculate a ndl for lower values than 3m
|
/* don't try to calculate a ndl for lower values than 3m
|
||||||
|
@ -1253,9 +1253,6 @@ static void plot_string(struct plot_data *entry, char *buf, int bufsize,
|
||||||
snprintf(buf, bufsize, translate("gettextFromC","%s\nIn deco"), buf2);
|
snprintf(buf, bufsize, translate("gettextFromC","%s\nIn deco"), buf2);
|
||||||
} else if (has_ndl) {
|
} else if (has_ndl) {
|
||||||
memcpy(buf2, buf, bufsize);
|
memcpy(buf2, buf, bufsize);
|
||||||
if (entry->ndl == -1)
|
|
||||||
snprintf(buf, bufsize, translate("gettextFromC","%s\nNDL:-"), buf2);
|
|
||||||
else
|
|
||||||
snprintf(buf, bufsize, translate("gettextFromC","%s\nNDL:%umin"), buf2, DIV_UP(entry->ndl, 60));
|
snprintf(buf, bufsize, translate("gettextFromC","%s\nNDL:%umin"), buf2, DIV_UP(entry->ndl, 60));
|
||||||
}
|
}
|
||||||
if (entry->sac && prefs.show_sac) {
|
if (entry->sac && prefs.show_sac) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue