mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add creation date and Subsurface version to planner output
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
385816be2e
commit
c9c9b1b399
3 changed files with 19 additions and 1 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include "gettext.h"
|
||||
#include "libdivecomputer/parser.h"
|
||||
#include "qthelperfromc.h"
|
||||
#include "version.h"
|
||||
|
||||
#define TIMESTEP 2 /* second */
|
||||
#define DECOTIMESTEP 60 /* seconds. Unit of deco stop times */
|
||||
|
|
@ -67,6 +68,9 @@ void dump_plan(struct diveplan *diveplan)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* this is in qthelper.cpp, so including the .h file is a pain */
|
||||
extern const char *get_current_date();
|
||||
|
||||
bool diveplan_empty(struct diveplan *diveplan)
|
||||
{
|
||||
struct divedatapoint *dp;
|
||||
|
|
@ -837,11 +841,14 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
|
|||
const char *depth_unit;
|
||||
int altitude = (int) get_depth_units((int) (log(1013.0 / diveplan->surface_pressure) * 7800000), NULL, &depth_unit);
|
||||
|
||||
len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)<br></div>"),
|
||||
len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)<br>"),
|
||||
diveplan->surface_pressure,
|
||||
altitude,
|
||||
depth_unit);
|
||||
|
||||
len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Plan creation date and version: %s, %s<br></div>"),
|
||||
get_current_date(), subsurface_canonical_version());
|
||||
|
||||
/* Get SAC values and units for printing it in gas consumption */
|
||||
double bottomsacvalue, decosacvalue;
|
||||
int sacdecimals;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue