summaryrefslogtreecommitdiffstats
path: root/core/plannernotes.c
diff options
context:
space:
mode:
authorGravatar willemferguson <willemferguson@zoology.up.ac.za>2019-05-15 18:39:29 +0200
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2019-05-17 09:46:05 +0200
commita969d1dd4518ce77e8fba920aec4a5d8cfd1f636 (patch)
tree0906b0c0305cf323585b67522b0487d646e74677 /core/plannernotes.c
parent9590709e8c379e5d8b62b426cf4d5b1d59aa8b84 (diff)
downloadsubsurface-a969d1dd4518ce77e8fba920aec4a5d8cfd1f636.tar.gz
Implement height-to-pressure functions in planner
The units.h file has two functions to convert atm pressure to mbar and also to convert mbar to atm pressure. Implement these two functions in the planner. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Diffstat (limited to 'core/plannernotes.c')
-rw-r--r--core/plannernotes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/plannernotes.c b/core/plannernotes.c
index e7a09d96d..9353fa2ec 100644
--- a/core/plannernotes.c
+++ b/core/plannernotes.c
@@ -11,6 +11,7 @@
#include <string.h>
#include "dive.h"
#include "deco.h"
+#include "units.h"
#include "divelist.h"
#include "planner.h"
#include "gettext.h"
@@ -420,7 +421,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
put_string(&buf, "<br>");
const char *depth_unit;
- int altitude = (int) get_depth_units((int) (log(1013.0 / diveplan->surface_pressure) * 7800000), NULL, &depth_unit);
+ int altitude = (int) get_depth_units((int) (pressure_to_altitude(diveplan->surface_pressure)), NULL, &depth_unit);
put_format_loc(&buf, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)<br></div>"), diveplan->surface_pressure, altitude, depth_unit);