Log import of Trimix dive from Shearwater Teric

Linus Torvalds torvalds at linux-foundation.org
Fri Oct 8 14:08:10 PDT 2021


On Fri, Oct 8, 2021 at 1:36 PM Attilla de Groot <attilla at attilla.nl> wrote:
>
> Is it possible to manually change this to how it should be

Sure. You can do it two ways: either manually by editing the dive data
in the xml file (or the git tree - it's a bit more hidden, and you
need to know enough git to do "git commit" on the end result, but the
git data format is also very human-legible and editable).

So I'm assuming that the gas switches are all correctly timed, and the
only issue really is that gases 0/1 are switched around. In that case,
you can literally just take those two lines

  <event time='0:02 min' type='25' flags='1' name='gaschange'
cylinder='0' o2='14.0%' he='49.0%' />
  <event time='3:26 min' type='25' flags='2' name='gaschange' cylinder='1' />

and switch the data in them around, so that they end up like

  <event time='0:02 min' type='25' flags='2' name='gaschange' cylinder='1' />
  <event time='3:26 min' type='25' flags='1' name='gaschange'
cylinder='0' o2='14.0%' he='49.0%' />

instead. That just tells subsurface that "at the beginning of the
dive, we switch to cylinder 1, containing air, and then at 3:26 when
you're deep enough, it switches to cylinder 0, which is your hypoxic
trimix gas.

Doing the same in the git tree is very similar, except that each dive
computer data is in a file of its own, and the syntax is a slioghtly
simpler "one event at a line" one, and would look something like

  event 0:02 type=25 flags=1 name="gaschange" cylinder=0 o2=14.0% he=49.0%
  event 3:26 type=25 flags=2 name="gaschange" cylinder=1

instead. You'd do the equivalent edit (just switch the two lines
around, except for the time), and then you'd use git to commit it.

So the git data is actually pretty much exactly the same, just
organized a bit differently. You'd have to know git a bit, and you'd
have to find where subsurface ends up hiding the git data, but it's
not really that hard.

Finding the git state is basically first figuring out where the
subsurface data directory is (on Linux, it's ~/.subsurface, on Windows
I think it's the "Subsurface" directory in your application-specific
data directory - I have no idea where that is.

The git tree will then be in the "cloudstorage" directory, with an
addition directory that is just the hash of the cloudstorage location
(because you can have multiple user ID's). So for example, one of my
divecomputer files is in

  /home/torvalds/.subsurface/cloudstorage/96758970dcdc1b59/2021/05/19-Mauiwithfamilya/05-19-Wed-08=33=22/Divecomputer-001

and I can just edit that directly.

And tou *can* do this all graphically too.

However, graphically you end up hitting a special case: that first gas
change (at 0:02) is not actually visible in the UI, because it's
treated specially and just treated as a "dive starts with this gas"
rather than being shown as a gas change.

But you can add yet another gas change at the beginning by just
mousing to the beginning of the dive, right-clicking, doing "Add gas
change", picking that "Cylinder 1: air" for that initial gas, then
going to the gas switch at the three-minute mark, and right-clicking
on it and doing "Edit gas change" and switching it to cylinder 0 with
that hypoxic trimix.

So it's doable from the GUI too, although you'll end up with something
like this instead:

  <event time='0:02 min' type='25' flags='1' name='gaschange'
cylinder='0' o2='14.0%' he='49.0%' />
  <event time='0:18 min' type='11' value='21' name='gaschange' cylinder='1' />
  <event time='3:26 min' type='25' value='3211278' name='gaschange'
cylinder='0' o2='14.0%' he='49.0%' />

where that first one is the original (invisible) "start with this gas
one, the second one is the fake added gas switch you did, and then the
third one is the one you ended up doing "Edit gas switch" on to switch
to trimix.

So there are multiple ways to do it. I'd just edit my own git repo
because I find that easy (and it would be fairly straightforward to do
for multiple dives).

The GUI one is perhaps the messiest and the one most painful if you
have multiple dives you want to fix up, but the one that is easiest to
do without having to know anything about subsurface data files.

             Linus


More information about the subsurface mailing list