we broke Uemis import somewhere...

Dirk Hohndel dirk at hohndel.org
Fri Jan 3 15:42:48 UTC 2014


On Fri, 2014-01-03 at 14:56 -0800, Dirk Hohndel wrote:
> On Fri, 2014-01-03 at 13:34 -0800, Linus Torvalds wrote:
> > On Fri, Jan 3, 2014 at 1:20 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
> > >
> > > I need to build old versions of Subsurface to find one that still works
> > > so I can get a correct download...
> > 
> > Hmm. My last Uemis download was last June. And that was with the gtk
> > version, because back then the Uemis code wasn't hooked up at all in
> > the Qt version..
> > 
> > But you downloaded from your Uemis in Palau, and had the right
> > temperatures then. I'm assuming that was using the Qt version? If so,
> > you should be able to go back to the Qt branch as of November 11 last
> > year, so try around commit cd1149e57fb0 or so. Assuming that works,
> > just bisect it. Bisection tends to be a hell of a lot more efficient
> > than trying to guess - even with intelligent guessing..
> 
> No doubt about that. Bisecting is one of my favorite features in git.
> But given how BLOODY SLOW the Uemis is, I'm trying to revive my old hack
> to copy the Uemis content into a local folder and run without the timing
> delays off of that folder. And something is broken with that right now.

Ok, fixed that. Somehow the image of the filesystem got corrupted.
Great.
But that's besides the point. Here's the culprit:

commit 3fd39a7a87bf438f012167303a564deac72d267a
Author: Anton Lundin <glance at acc.umu.se>
Date:   Tue Nov 26 23:11:30 2013 +0100

    Remove some constants and use helpers instead
    
    We have allot of helpers, use them instead of local variants.
    
    Signed-off-by: Anton Lundin <glance at acc.umu.se>
    Signed-off-by: Dirk Hohndel <dirk at hohndel.org>

diff --git a/uemis.c b/uemis.c
index f3ef27ddbb1e..e37de36adf79 100644
--- a/uemis.c
+++ b/uemis.c
@@ -293,7 +293,7 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
 
        datalen = uemis_convert_base64(base64, &data);
 
-       dive->dc.airtemp.mkelvin = *(uint16_t *)(data + 45) * 100 + ZERO_C_IN_MKELVIN;
+       dive->dc.airtemp.mkelvin = C_to_mkelvin(*(uint16_t *)(data + 45));
        dive->dc.surface_pressure.mbar = *(uint16_t *)(data + 43);
        if (*(uint8_t *)(data + 19))
                dive->dc.salinity = SEAWATER_SALINITY; /* avg grams per 10l sea water */
@@ -351,7 +351,7 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
                sample = prepare_sample(dc);
                sample->time.seconds = u_sample->dive_time;
                sample->depth.mm = rel_mbar_to_depth(u_sample->water_pressure, dive);
-               sample->temperature.mkelvin = (u_sample->dive_temperature * 100) + ZERO_C_IN_MKELVIN;
+               sample->temperature.mkelvin = C_to_mkelvin(u_sample->dive_temperature);
                sample->sensor = active;
                sample->cylinderpressure.mbar =
                        (u_sample->tank_pressure_high * 256 + u_sample->tank_pressure_low) * 10;


That would be the difference between degrees and centi-degrees...

/D



More information about the subsurface mailing list