summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-10-31 23:06:37 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-31 14:58:57 -0700
commit64f816b472a66750ec7e14bf46aa7f8bfb724c20 (patch)
tree0e980d55f204dc794d3dc3ea5e3701f6b990c393
parent8bdc9d1ec49d2991be163f2b7e04013e0ade2a6b (diff)
downloadsubsurface-64f816b472a66750ec7e14bf46aa7f8bfb724c20.tar.gz
Add gas mixes to MK6 import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/file.c b/file.c
index 42f8ef6c0..ad5b0354d 100644
--- a/file.c
+++ b/file.c
@@ -444,7 +444,7 @@ int parse_txt_file(const char *filename, const char *csv)
* make sure the input .txt looks like proper MkVI file, then start parsing the .csv.
*/
if (MATCH(memtxt.buffer, "MkVI_Config") == 0) {
- int d, m, y;
+ int d, m, y, he;
int hh = 0, mm = 0, ss = 0;
int prev_depth = 0, cur_sampletime = 0, prev_setpoint = -1;
bool has_depth = false, has_setpoint = false;
@@ -476,11 +476,15 @@ int parse_txt_file(const char *filename, const char *csv)
dive->cylinder[cur_cylinder_index].type.size.mliter = 3000;
dive->cylinder[cur_cylinder_index].type.workingpressure.mbar = 200000;
dive->cylinder[cur_cylinder_index].type.description = strdup("3l Mk6");
+ dive->cylinder[cur_cylinder_index].gasmix.o2.permille = 1000;
cur_cylinder_index++;
dive->cylinder[cur_cylinder_index].type.size.mliter = 3000;
dive->cylinder[cur_cylinder_index].type.workingpressure.mbar = 200000;
dive->cylinder[cur_cylinder_index].type.description = strdup("3l Mk6");
+ he = atoi(parse_mkvi_value(memtxt.buffer, "Helium percentage"));
+ dive->cylinder[cur_cylinder_index].gasmix.o2.permille = (100 - atoi(parse_mkvi_value(memtxt.buffer, "Nitrogen percentage")) - he) * 10;
+ dive->cylinder[cur_cylinder_index].gasmix.he.permille = he * 10;
cur_cylinder_index++;
dc = &dive->dc;