[PATCH 2/2] Ticket #831 Fix

Yosef Hamza jo.adam.93 at gmail.com
Mon Mar 9 09:48:52 PDT 2015


About patch -0002-

The thing is timeAxis->valueAt(scenePos) can return a negative value if the
cursor was pointing to the negative part of the axis to the left, which is
the case
here.

The unsigned assigning happens at the very end of assigning series when
assigned
finally to duration_t of event which is uint32_t.

About -0003-

I coded the solution mentioned by Robert and will submit it tonight after
making sure
It's safe.

It just looked like a hack to me though I made the patch and posted here
for exactly this
discussion
Adding gas change at @0:00 can be handy, I'm not a diver myself but as of
this moment
there's not a way -at least that I'm ware of- to sort Cylinders so If the
user entered them
in the wrong order and wanted to change the initial one instead of sorting
them manually
he can add that gas change @0:00

§Yousef

On Mon, Mar 9, 2015 at 6:05 PM, Dirk Hohndel <dirk at hohndel.org> wrote:

> On Mon, Mar 09, 2015 at 07:49:47AM +0200, Yosef Hamza wrote:
> > Those 2 patches are actually one, But I think that the second patch needs
> > some discussion.
>
> As Robert already mentioned, the second patch (0003) is simply wrong. That
> code was there for a reason :-)
>
> > I think it's better this way because through trying and fixing the error
> > there wasn't  a way -that I'm aware of at least- to cancel the added
> event
> > @0:00.
>
> There are different reasons why there would be an event at time 0:00
> Some dive computers include a gas change event in the first sample (which
> often is a few seconds into the dive and not at 0:00) to indicate the
> first gas used. Those are valid and important events for the logic of how
> we treat a dive, but they shouldn't be displayed as they make no sense to
> the casual user.
>
> The question to ask the bug submitter is "why do you want to add a gas
> change at 0'/0:00? -- is this to correct the first gas used?"
>
>
> The other patch (0002) I don't understand. At least in the function where
> you added this code there is no unsigned comparison. Can you explain this
> a bit more?
>
> /D
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150309/dc0ca3c7/attachment.html>


More information about the subsurface mailing list