Petrel progress bar problem [was: Re: testing of download from divecomputer needed]

Henrik Brautaset Aronsen subsurface at henrik.synth.no
Wed Jan 14 10:43:58 PST 2015


Jef Driesen wrote:
> On 2015-01-13 09:11, Dirk Hohndel wrote:
>> On Tue, Jan 13, 2015 at 09:00:50AM +0100, Henrik Brautaset Aronsen 
>> wrote:
>>> The only thing I reacted to was that the progress bar only worked 
>>> during
>>> the first couple of minutes.  After that it was at 0%.
>>
>> That's strange. Looking at the shearwater_common_download() function in
>> libdivecomputer's shearwater_common.c, it seems that we should get 
>> regular
>> progress events throughout the download.
>>
>> Could you put some debug printfs in the event_cb() function in
>> Subsurface's libdivecomputer.c ? Something like the patch below
>>
>> I'd be curious what values you get from that...
>
> This is a (known) bug in libdivecomputer. Instead of a global progress 
> for the entire download, the petrel backend reports progress for each 
> individual dive. So the progress bar will go from 0 to 100% for every 
> dive. Due to the fact that the size of a dive isn't known in advance, 
> we have to assume the worst case value (0xFFFFFF). But in practice a 
> dive is usually much smaller, and thus the progress bar will stay near 
> zero.

An individual 0-100% progress for each dive is OK.  The problem was that 
the progress disappeared after a few dives had been imported.  With 
Dirk's debug line it becomes obvious why:

progress 0 of 1540
progress 3 of 1540
progress 131 of 1540
progress 259 of 1540
progress 387 of 1540
progress 515 of 1540
progress 643 of 1540
progress 771 of 1540
progress 899 of 1540
progress 1027 of 1540
progress 1155 of 1540
progress 1283 of 1540
progress 1411 of 1540
progress 1539 of 1540
progress 1540 of 1540
progress 0 of 1540
progress 3 of 1540
progress 131 of 1540
progress 259 of 1540
progress 387 of 1540
progress 515 of 1540
progress 643 of 1540
progress 771 of 1540
progress 899 of 1540
progress 1027 of 1540
progress 1155 of 1540
progress 1283 of 1540
progress 1411 of 1540
progress 1539 of 1540
progress 1540 of 1540
progress 0 of 1540
progress 3 of 1540
progress 131 of 1540
progress 259 of 1540
progress 387 of 1540
progress 515 of 1540
progress 643 of 1540
progress 771 of 1540
progress 899 of 1540
progress 1027 of 1540
progress 1155 of 1540
progress 1283 of 1540
progress 1411 of 1540
progress 1539 of 1540
progress 1540 of 1540
progress 0 of 1540
progress 3 of 1540
progress 131 of 1540
progress 259 of 1540
progress 387 of 1540
progress 515 of 1540
progress 643 of 1540
progress 771 of 1540
progress 899 of 1540
progress 1027 of 1540
progress 1155 of 1540
progress 1283 of 1540
progress 1411 of 1540
progress 1539 of 1540
progress 1540 of 1540
progress 0 of 1540
progress 3 of 1540
progress 131 of 1540
progress 259 of 1540
progress 387 of 1540
progress 515 of 1540
progress 643 of 1540
progress 771 of 1540
progress 899 of 1540
progress 1027 of 1540
progress 1155 of 1540
progress 1283 of 1540
progress 1411 of 1540
progress 1539 of 1540
progress 1540 of 1540
progress 0 of 16777219
progress 3 of 16777219
progress 147 of 16777219
progress 291 of 16777219
progress 435 of 16777219
progress 579 of 16777219
progress 723 of 16777219
progress 867 of 16777219
progress 1011 of 16777219
progress 1155 of 16777219
progress 1299 of 16777219
progress 1443 of 16777219
progress 1587 of 16777219
progress 1731 of 16777219
progress 1875 of 16777219
progress 2019 of 16777219
progress 2163 of 16777219
progress 2307 of 16777219
progress 2451 of 16777219
progress 2595 of 16777219
progress 2739 of 16777219
progress 2883 of 16777219
progress 3027 of 16777219
progress 3171 of 16777219
progress 3172 of 16777219
string field "Serial": 32045a71 -- overwriting the existing serial of (null)
string field "FW Version": 27 -- overwriting the existing firware of (null)
progress 0 of 16777219
progress 3 of 16777219
progress 147 of 16777219
progress 291 of 16777219
progress 435 of 16777219
progress 579 of 16777219
progress 723 of 16777219
progress 867 of 16777219
progress 1011 of 16777219
progress 1155 of 16777219
progress 1299 of 16777219
progress 1443 of 16777219
progress 1587 of 16777219
progress 1731 of 16777219
progress 1875 of 16777219
progress 2019 of 16777219
progress 2163 of 16777219
progress 2307 of 16777219
progress 2451 of 16777219
progress 2595 of 16777219
progress 2596 of 16777219
string field "Serial": 32045a71 -- overwriting the existing serial of (null)
string field "FW Version": 27 -- overwriting the existing firware of (null)
progress 0 of 16777219
progress 3 of 16777219
progress 147 of 16777219
[etc...]

Cheers,
Henrik



More information about the subsurface mailing list