summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-07-09 22:13:38 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-09 13:22:00 -0700
commit6cd0928487dc64238aad40b41f929bfdbc01d824 (patch)
treedbd7589d86dd3186128780e84a21cf7fc5477196 /file.c
parentd5991800eed5af6d84e91706764817211876b03a (diff)
downloadsubsurface-6cd0928487dc64238aad40b41f929bfdbc01d824.tar.gz
Add support for importing TTS from CSV files
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/file.c b/file.c
index cb2c4f22a..9d8dafebd 100644
--- a/file.c
+++ b/file.c
@@ -384,17 +384,18 @@ int parse_file(const char *filename)
#define MAXCOLDIGITS 3
#define MAXCOLS 100
-int parse_csv_file(const char *filename, int timef, int depthf, int tempf, int po2f, int cnsf, int ndlf, int stopdepthf, int sepidx, const char *csvtemplate, int unitidx)
+int parse_csv_file(const char *filename, int timef, int depthf, int tempf, int po2f, int cnsf, int ndlf, int ttsf, int stopdepthf, int sepidx, const char *csvtemplate, int unitidx)
{
struct memblock mem;
int pnr = 0;
- char *params[23];
+ char *params[25];
char timebuf[MAXCOLDIGITS];
char depthbuf[MAXCOLDIGITS];
char tempbuf[MAXCOLDIGITS];
char po2buf[MAXCOLDIGITS];
char cnsbuf[MAXCOLDIGITS];
char ndlbuf[MAXCOLDIGITS];
+ char ttsbuf[MAXCOLDIGITS];
char stopdepthbuf[MAXCOLDIGITS];
char unitbuf[MAXCOLDIGITS];
char separator_index[MAXCOLDIGITS];
@@ -412,6 +413,7 @@ int parse_csv_file(const char *filename, int timef, int depthf, int tempf, int p
snprintf(po2buf, MAXCOLDIGITS, "%d", po2f);
snprintf(cnsbuf, MAXCOLDIGITS, "%d", cnsf);
snprintf(ndlbuf, MAXCOLDIGITS, "%d", ndlf);
+ snprintf(ttsbuf, MAXCOLDIGITS, "%d", ttsf);
snprintf(stopdepthbuf, MAXCOLDIGITS, "%d", stopdepthf);
snprintf(separator_index, MAXCOLDIGITS, "%d", sepidx);
snprintf(unitbuf, MAXCOLDIGITS, "%d", unitidx);
@@ -435,6 +437,8 @@ int parse_csv_file(const char *filename, int timef, int depthf, int tempf, int p
params[pnr++] = cnsbuf;
params[pnr++] = "ndlField";
params[pnr++] = ndlbuf;
+ params[pnr++] = "ttsField";
+ params[pnr++] = ttsbuf;
params[pnr++] = "stopdepthField";
params[pnr++] = stopdepthbuf;
params[pnr++] = "date";