mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
9590709e8c
commit
a969d1dd45
2 changed files with 7 additions and 5 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue