mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add support for air temp on DL7 import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
65c4891a71
commit
d23600eb9e
1 changed files with 18 additions and 0 deletions
|
@ -75,6 +75,7 @@ int parse_dan_format(const char *filename, char **params, int pnr)
|
|||
}
|
||||
|
||||
while ((end_ptr < mem.size) && (ptr = strstr(mem.buffer + end_ptr, "ZDH"))) {
|
||||
char *iter_end = NULL;
|
||||
|
||||
/*
|
||||
* Process the dives, but let the last round be parsed
|
||||
|
@ -125,6 +126,23 @@ int parse_dan_format(const char *filename, char **params, int pnr)
|
|||
params[pnr + 5] = strdup(tmpbuf);
|
||||
params[pnr + 6] = NULL;
|
||||
|
||||
/* Air temperature */
|
||||
memset(tmpbuf, 0, sizeof(tmpbuf));
|
||||
iter = strchr(iter, '|');
|
||||
|
||||
if (iter && iter + 1) {
|
||||
iter = iter + 1;
|
||||
iter_end = strchr(iter, '|');
|
||||
|
||||
if (iter_end) {
|
||||
memcpy(tmpbuf, iter, iter_end - iter);
|
||||
params[pnr + 6] = "airTemp";
|
||||
params[pnr + 7] = strdup(tmpbuf);
|
||||
params[pnr + 8] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Search for the next line */
|
||||
if (iter)
|
||||
iter = strstr(iter, NL);
|
||||
|
|
Loading…
Add table
Reference in a new issue