diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-03-22 17:13:47 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-03-23 05:44:06 -0700 |
commit | 86ac7fdf47142d8ad26a27a36daa64a5ea435bdc (patch) | |
tree | f125a3b3e154e68c869422f48503b1a8fb5abced /file.c | |
parent | cb49c37b31fcebb3a1ba97b0a804d398ae0df22d (diff) | |
download | subsurface-86ac7fdf47142d8ad26a27a36daa64a5ea435bdc.tar.gz |
Import support for new Seabear format
This add support for Seabear's new import format that is used by H3 and
T1. In the future also the Hudc should switch to the new format. The
main difference to the old one is that time stamps are no longer
recorded in the samples, but intervali is specified in the header.
The header contains other useful information as well that we should
build support for. E.g. surface pressure, gas mixes, GF, and mode might
be useful additions later on.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -909,11 +909,12 @@ int parse_csv_file(const char *filename, int timef, int depthf, int tempf, int p return ret; } -int parse_seabear_csv_file(const char *filename, int timef, int depthf, int tempf, int po2f, int cnsf, int ndlf, int ttsf, int stopdepthf, int pressuref, int sepidx, const char *csvtemplate, int unitidx) +#define SBPARAMS 29 +int parse_seabear_csv_file(const char *filename, int timef, int depthf, int tempf, int po2f, int cnsf, int ndlf, int ttsf, int stopdepthf, int pressuref, int sepidx, const char *csvtemplate, int unitidx, const char *delta) { int ret; struct memblock mem; - char *params[27]; + char *params[SBPARAMS]; char timebuf[MAXCOLDIGITS]; char depthbuf[MAXCOLDIGITS]; char tempbuf[MAXCOLDIGITS]; @@ -925,6 +926,7 @@ int parse_seabear_csv_file(const char *filename, int timef, int depthf, int temp char pressurebuf[MAXCOLDIGITS]; char unitbuf[MAXCOLDIGITS]; char separator_index[MAXCOLDIGITS]; + char deltabuf[MAXCOLDIGITS]; time_t now; struct tm *timep = NULL; char curdate[DATESTR]; @@ -991,6 +993,11 @@ int parse_seabear_csv_file(const char *filename, int timef, int depthf, int temp params[21][5] = 0; } + snprintf(deltabuf, MAXCOLDIGITS, "%s", delta); + params[SBPARAMS - 3] = "delta"; + params[SBPARAMS - 2] = deltabuf; + params[SBPARAMS - 1] = NULL; + /* Move the CSV data to the start of mem buffer */ memmove(mem.buffer, ptr_old, mem.size - (ptr_old - (char*)mem.buffer)); mem.size = (int)mem.size - (ptr_old - (char*)mem.buffer); |