diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2014-10-31 23:06:37 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-31 14:58:57 -0700 |
commit | 64f816b472a66750ec7e14bf46aa7f8bfb724c20 (patch) | |
tree | 0e980d55f204dc794d3dc3ea5e3701f6b990c393 | |
parent | 8bdc9d1ec49d2991be163f2b7e04013e0ade2a6b (diff) | |
download | subsurface-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |