<div dir="ltr">About patch -0002-<br><br>The thing is timeAxis->valueAt(scenePos) can return a negative value if the<br><div>cursor was pointing to the negative part of the axis to the left, which is the case<br>here.<br><br>The unsigned assigning happens at the very end of assigning series when assigned<br>finally to duration_t of event which is uint32_t.<br><br>About -0003-<br><br>I coded the solution mentioned by Robert and will submit it tonight after making sure<br>It's safe.<br><br>It just looked like a hack to me though I made the patch and posted here for exactly this<br>discussion<br>Adding gas change at @0:00 can be handy, I'm not a diver myself but as of this moment<br>there's not a way -at least that I'm ware of- to sort Cylinders so If the user entered them<br>in the wrong order and wanted to change the initial one instead of sorting them manually<br>he can add that gas change @0:00<br><br>§Yousef</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 9, 2015 at 6:05 PM, Dirk Hohndel <span dir="ltr"><<a href="mailto:dirk@hohndel.org" target="_blank">dirk@hohndel.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Mar 09, 2015 at 07:49:47AM +0200, Yosef Hamza wrote:<br>
> Those 2 patches are actually one, But I think that the second patch needs<br>
> some discussion.<br>
<br>
</span>As Robert already mentioned, the second patch (0003) is simply wrong. That<br>
code was there for a reason :-)<br>
<span class=""><br>
> I think it's better this way because through trying and fixing the error<br>
> there wasn't  a way -that I'm aware of at least- to cancel the added event<br>
> @0:00.<br>
<br>
</span>There are different reasons why there would be an event at time 0:00<br>
Some dive computers include a gas change event in the first sample (which<br>
often is a few seconds into the dive and not at 0:00) to indicate the<br>
first gas used. Those are valid and important events for the logic of how<br>
we treat a dive, but they shouldn't be displayed as they make no sense to<br>
the casual user.<br>
<br>
The question to ask the bug submitter is "why do you want to add a gas<br>
change at 0'/0:00? -- is this to correct the first gas used?"<br>
<br>
<br>
The other patch (0002) I don't understand. At least in the function where<br>
you added this code there is no unsigned comparison. Can you explain this<br>
a bit more?<br>
<span class="HOEnZb"><font color="#888888"><br>
/D<br>
</font></span></blockquote></div><br></div>