subsurface/profile-widget
Linus Torvalds eff4059802 Start using the actual cylinder data for gas switch events
Now that gas switch events always have indices into the cylinder table,
start using that to look up the gas mix from the cylinders rather than
from the gas switch event itself.  In other words, the cylinder index is
now the primary data for gas switch events.

This means that now as you change the cylinder information, the gas
switch events will automatically update to reflect those changes.

Note that on loading data from the outside (either from a xml file, from
a git/cloud account, or from a dive computer), we may or may not
initially have an index for the gas change event.  The external data may
be from an older version of subsurface, or it may be from a
libdivecomputer download that just doesn't give index data at all.

In that case, we will do:

 - if there is no index, but there is explicit gas mix information, we
   will look up the index based on that gas mix, picking the cylinder
   that has the closest mix.

 - if there isn't even explicit gas mix data, so we only have the event
   value from libdivecomputer, we will turn that value into a gasmix,
   and use that to look up the cylinder index as above.

 - if no valid cylinder information is available at all, gas switch
   events will just be dropped.

When saving the data, we now always save the cylinder index, and the gas
mix associated with that cylinder (that gas mix will be ignored on load,
since the index is the primary, but it makes the event much easier to
read).

It is worth noting we do not modify the libdivecomputer value, even if
the gasmix has changed, so that remains as a record of the original
download.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:37:18 -07:00
..
animationfunctions.cpp Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
animationfunctions.h Move Profile widget out of desktop-widgets 2015-10-30 10:36:49 -07:00
CMakeLists.txt Correctly handle SubsurfaceMobile 2016-01-08 08:04:24 -08:00
divecartesianaxis.cpp Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
divecartesianaxis.h Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
diveeventitem.cpp Start using the actual cylinder data for gas switch events 2016-04-04 22:37:18 -07:00
diveeventitem.h Prevent gaschange tank icons from using garbage coords. 2015-12-03 22:56:23 -08:00
divelineitem.cpp Move Profile widget out of desktop-widgets 2015-10-30 10:36:49 -07:00
divelineitem.h Move Profile widget out of desktop-widgets 2015-10-30 10:36:49 -07:00
divepixmapitem.cpp Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
divepixmapitem.h Move Profile widget out of desktop-widgets 2015-10-30 10:36:49 -07:00
diveprofileitem.cpp Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
diveprofileitem.h Fix Ceiling Graph 2016-01-25 13:04:32 -08:00
diverectitem.cpp Move Profile widget out of desktop-widgets 2015-10-30 10:36:49 -07:00
diverectitem.h Move Profile widget out of desktop-widgets 2015-10-30 10:36:49 -07:00
divetextitem.cpp Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
divetextitem.h Move Profile widget out of desktop-widgets 2015-10-30 10:36:49 -07:00
divetooltipitem.cpp Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
divetooltipitem.h Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
profilewidget2.cpp Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
profilewidget2.h Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
ruleritem.cpp Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
ruleritem.h Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
tankitem.cpp Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
tankitem.h Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00