subsurface/core
Linus Torvalds da6c753502 Fix sample times in dive merging
Commit c27314d60 ("core: replace add_sample() by append_sample()") broke
the dive computer interleaving when merging two dives: the sample
merging (done by "merge_samples()") no longer took the offset between
the two merged dives into account, and instead just blindly copied the
samples from the second dive computer with no time offset.

The end result was a completely broken profile.

This adds back the sample offset.  It also takes the offset not from the
difference in time of the two dives, but the difference in time of the
dive computers.  That way we're not mixing up different times from
different sources that aren't necessarily in sync (the time *difference*
is hopefully the same, but still..).

The dive merging still messes up the dive location. That's some other bug.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-08-28 10:35:26 +02:00
..
settings
subsurface-qt
android.cpp
btdiscovery.cpp
btdiscovery.h
checkcloudconnection.cpp
checkcloudconnection.h
cloudstorage.cpp
cloudstorage.h mobile: add ability to delete cloud account 2022-08-13 14:08:37 -07:00
CMakeLists.txt
cochran.cpp
cochran.h
color.cpp
color.h
compressibility.r
configuredivecomputer.cpp
configuredivecomputer.h
configuredivecomputerthreads.cpp
configuredivecomputerthreads.h
connectionlistmodel.cpp
connectionlistmodel.h
datatrak.cpp
datatrak.h
deco.cpp
deco.h
device.cpp
device.h
devicedetails.cpp
devicedetails.h
dive.cpp
dive.h
divecomputer.cpp
divecomputer.h
divefilter.cpp
divefilter.h
divelist.cpp
divelist.h
divelog.cpp
divelog.h
divelogexportlogic.cpp
divelogexportlogic.h avoid duplicate and inconsistent applying of QDir::separator() 2019-03-27 07:36:33 -07:00
divemode.h
divesite.cpp
divesite.h
divesitehelpers.cpp
divesitehelpers.h
divesitetable.h
downloadfromdcthread.cpp
downloadfromdcthread.h
equipment.cpp
equipment.h core: add move constructor/copy assignment to weight and cylinder 2024-08-17 23:37:00 +12:00
errorhelper.cpp
errorhelper.h
event.cpp core: add missing #include <tuple> 2024-08-19 22:47:59 +02:00
event.h
eventtype.cpp
eventtype.h
exif.cpp
exif.h
extradata.h
file.cpp preferences: use std::string in struct preferences 2024-08-13 19:28:30 +02:00
file.h
filterconstraint.cpp
filterconstraint.h
filterpreset.cpp
filterpreset.h
filterpresettable.cpp
filterpresettable.h
format.cpp
format.h
fulltext.cpp
fulltext.h
gas-model.cpp
gas.cpp
gas.h
gaspressures.cpp
gaspressures.h
gettext.h build: remove extern "C" linkage 2024-08-13 19:28:30 +02:00
gettextfromc.cpp
gettextfromc.h
git-access.cpp
git-access.h
globals.cpp
globals.h
imagedownloader.cpp
imagedownloader.h
import-cobalt.cpp
import-csv.cpp core: turn C dive-table into an owning table 2024-08-13 19:28:30 +02:00
import-csv.h
import-divinglog.cpp core: move cylinder related functions to struct dive 2024-08-13 19:28:30 +02:00
import-seac.cpp
import-shearwater.cpp
import-suunto.cpp
interpolate.h
ios.cpp
libdivecomputer.cpp
libdivecomputer.h
liquivision.cpp
load-git.cpp
macos.cpp
membuffer.cpp
membuffer.h core: remove add_to_string() function 2024-08-13 19:28:30 +02:00
metadata.cpp
metadata.h
metrics.cpp
metrics.h core: remove DPR from IconMetrics class 2021-12-17 11:54:23 -08:00
namecmp.h
ostctools.cpp
owning_table.h core: turn C dive-table into an owning table 2024-08-13 19:28:30 +02:00
parse-gpx.cpp
parse-gpx.h
parse-xml.cpp
parse.cpp
parse.h
picture.cpp
picture.h
planner.cpp
planner.h
plannernotes.cpp
pref.cpp
pref.h
profile.cpp
profile.h
qt-ble.cpp
qt-ble.h
qt-gui.h
qt-init.cpp
qthelper.cpp
qthelper.h Planner: Improve Gas Handling in CCR Mode. 2024-08-26 12:36:31 +12:00
qtserialbluetooth.cpp
range.h
sample.cpp core: simplify default initialization of struct sample 2024-08-13 19:28:30 +02:00
sample.h
save-git.cpp
save-html.cpp
save-html.h
save-profiledata.cpp desktop: use std::string to format subtitles 2024-08-13 19:28:30 +02:00
save-profiledata.h
save-xml.cpp
selection.cpp
selection.h
serial_ftdi.cpp
serial_usb_android.cpp
serial_usb_android.h android/usb: pass in the UsbDevice when downloading 2020-03-16 07:58:20 -07:00
sha1.cpp
sha1.h
statistics.cpp core: move gas_volume() to cylinder_t 2024-08-13 19:28:30 +02:00
statistics.h core: default initialize units-type objects to 0 2024-08-13 19:28:30 +02:00
string-format.cpp
string-format.h
strtod.cpp
subsurface-float.h
subsurface-string.cpp
subsurface-string.h
subsurface-time.h
subsurfacestartup.cpp
subsurfacestartup.h
subsurfacesysinfo.cpp
subsurfacesysinfo.h
tag.cpp
tag.h
taxonomy.cpp core: move constructLocationTags from divesite.cpp to taxonomy.cpp 2024-08-13 19:28:30 +02:00
taxonomy.h
time.cpp core: move *_surface_pressure() functions into struct dive 2024-08-13 19:28:30 +02:00
trip.cpp
trip.h core: move functions into trip-structure 2024-08-13 19:28:30 +02:00
triptable.cpp
triptable.h
uemis-downloader.cpp uemis downloader: use move instead of copy to return string 2024-08-17 23:37:00 +12:00
uemis.cpp
uemis.h
units.cpp
units.h
unix.cpp
uploadDiveLogsDE.cpp core: turn C dive-table into an owning table 2024-08-13 19:28:30 +02:00
uploadDiveLogsDE.h
uploadDiveShare.cpp
uploadDiveShare.h
version.cpp
version.h
videoframeextractor.cpp
videoframeextractor.h
webservice.h general: remove (void) function parameter declarations 2024-08-13 19:28:30 +02:00
windows.cpp
windowtitleupdate.cpp
windowtitleupdate.h
worldmap-options.h
worldmap-save.cpp
worldmap-save.h
xmlparams.cpp
xmlparams.h
xmp_parser.cpp
xmp_parser.h