<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 27 July 2017 at 17:44, Robert Helling <span dir="ltr"><<a href="mailto:helling@atdotde.de" target="_blank">helling@atdotde.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>a few quick comments from my side (without looking at the actual code):</div><div><br><div><span class=""><blockquote type="cite"><div>On 27. Jul 2017, at 06:57, Linus Torvalds <<a href="mailto:torvalds@linux-foundation.org" target="_blank">torvalds@linux-foundation.org</a><wbr>> wrote:</div><br></blockquote></span><span class=""><blockquote type="cite"><div><div><br>   So the only _known_ breakage is the "TankItem" profile widget. That's <br>   the bar at the bottom of the profile that shows which cylinder is in<br>   use right now. You'd think that would be trivial to fix up, and yes it <br>   would be - I could just use the regular model of<br><br>     firstcyl = explicit_first_cylinder(dive, dc)<br>     .. then iterate over the gas change events to see the others ..<br><br>   but the problem with the "TankItem" widget is that it does its own <br>   model, and it has thrown away the dive and the dive computer <br>   information. It just doesn't even know. It only knows what cylinders <br>   there are, and the plot_info. And it just used to look at the sensor <br>   number in the plot_info, and be done with that. That number no longer <br>   exists.<br></div></div></blockquote><div><br></div></span><div>As I said, I haven’t looked at the code. But from what I would expect to see as the user would be that the TankItem for a given moment in time should report the gas whose pressure has most recently changed (i.e. that was connected to the divers mouth). As far as I can see, the only reason why actually more than one gas is used is that it’s a CCR dive (where the TankItem should be disabled anyway) but maybe that assumption is incorrect. Do we have non-CCR dives from the wild where actually more than one gas changing pressure (beyond sensor jitter or tanks cooling down) at any point in time? Maybe another approach would be to guess gaschange events from the sensor data?</div></div></div></div></blockquote><div>I haven't looked at either the current or proposed code either, and I don't have any AI data, but I can see where gas pressure for two non-ccr tanks would change simultaneously.<br>Let's assume our diver has twin independent 10l cylinders and a 20l (~45lb) wing.  On descent she breathes from one cylinder, while her wing is connected to the other.  She inflates her wing as she descends over 3 minutes, and at 30m it is fully inflated.  That's 80l of (ideal) gas, or 8 bar from the cylinder she isn't breathing.  Now, she's got a pretty low SAC, let's say 12l/min.  As she descends to 30m over 3 minutes, she's consumed 12l/min * 3 min * 2.5 bar (average ambient pressure) = 90l, or 9 bar from her other cylinder.  How could we possibly determine which one she was breathing if the user or dive computer doesn't tell us?  If both cylinders have the same gas, it wouldn't really matter as far as the tankitem widget goes, but if she was breathing travel gas (on the way to a deep dive), while the wing was being inflated with bottom gas, it would be significant.<br><br></div><div>This issue isn't just for showing the cylinder in the widget at the bottom of the profile, it also applies to which gas is used for deco calculations (ceiling, NDL, TTS).<br><br></div><div>Cheers,<br><br></div><div>Rick<br></div></div></div></div>