[PATCH] Do not plot temperatures on DM4 import if no info

Miika Turkia miika.turkia at gmail.com
Thu Jan 9 00:55:17 UTC 2014


On Thu, Jan 9, 2014 at 10:43 AM, Dirk Hohndel <dirk at hohndel.org> wrote:

> On Thu, 2014-01-09 at 07:44 +0200, Miika Turkia wrote:
> > If we do not have temperature readings, we do not want to plot the
> > temperature samples either.
> >
> > See #415
> >
> > Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
> > ---
> >  parse-xml.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/parse-xml.c b/parse-xml.c
> > index 59e04ef..5212f6e 100644
> > --- a/parse-xml.c
> > +++ b/parse-xml.c
> > @@ -1803,7 +1803,7 @@ extern int dm4_dive(void *param, int columns, char
> **data, char **column)
> >               else
> >                       cur_sample->depth.mm = cur_dive->dc.maxdepth.mm;
> >
> > -             if (tempBlob)
> > +             if (data[18] && data[18][0])
> >                       cur_sample->temperature.mkelvin =
> C_to_mkelvin(tempBlob[i]);
>
> So you are testing data[18][0] but then convert data[18][i]
> (conveniently called tempBlog[i]). That at least has me worried.
>
> I haven't pulled this into 4.0.2 for that reason
>

If we have the first temperature reading, then we should have them all. The
reason not to test each individual reading is to include 0 temperatures in
the plot, if those are recorded.

miika
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140109/4ca15772/attachment.html>


More information about the subsurface mailing list