diff options
author | willemferguson <willemferguson@zoology.up.ac.za> | 2019-04-30 12:42:33 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-05-15 07:37:14 -0700 |
commit | 1bdf00b2b472078a0b24f1c269782d822cb96e02 (patch) | |
tree | 13a5e784118d9abb0a1bc1dfa9cbe4a9f457de80 /core/load-git.c | |
parent | ca6aa3813956b5e8be68b86ed36a5786b3ee746f (diff) | |
download | subsurface-1bdf00b2b472078a0b24f1c269782d822cb96e02.tar.gz |
Convert the atmospheric pressure in the Information Tab to an editable field
The Information tab shows the atmospheric pressure. Make this value editable
and also ensure that changes to it are undo-able.
Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Diffstat (limited to 'core/load-git.c')
-rw-r--r-- | core/load-git.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/load-git.c b/core/load-git.c index c6b3400a8..a0baedecd 100644 --- a/core/load-git.c +++ b/core/load-git.c @@ -76,6 +76,13 @@ static weight_t get_weight(const char *line) return w; } +static pressure_t get_airpressure(const char *line) +{ + pressure_t p; + p.mbar = lrint(ascii_strtod(line, NULL)); + return p; +} + static pressure_t get_pressure(const char *line) { pressure_t p; @@ -245,6 +252,9 @@ static void parse_dive_airtemp(char *line, struct membuffer *str, void *_dive) static void parse_dive_watertemp(char *line, struct membuffer *str, void *_dive) { UNUSED(str); struct dive *dive = _dive; dive->watertemp = get_temperature(line); } +static void parse_dive_airpressure(char *line, struct membuffer *str, void *_dive) +{ UNUSED(str); struct dive *dive = _dive; dive->surface_pressure = get_airpressure(line); } + static void parse_dive_duration(char *line, struct membuffer *str, void *_dive) { UNUSED(str); struct dive *dive = _dive; dive->duration = get_duration(line); } @@ -980,7 +990,7 @@ static void divecomputer_parser(char *line, struct membuffer *str, void *_dc) struct keyword_action dive_action[] = { #undef D #define D(x) { #x, parse_dive_ ## x } - D(airtemp), D(buddy), D(cylinder), D(divemaster), D(divesiteid), D(duration), + D(airpressure), D(airtemp), D(buddy), D(cylinder), D(divemaster), D(divesiteid), D(duration), D(gps), D(location), D(notes), D(notrip), D(rating), D(suit), D(tags), D(visibility), D(watertemp), D(weightsystem) }; |