Subsurface can now open CAN files as an alternative to importing.
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This isn't Cobalt specific, this is specific to dive computers that
indicate the first tank that's in use with a gaschange event that
coincides with the first sample.
We need to make sure that we suppress showing that gas change event
(regardless which cylinder it goes to) and instead set the correct
cylinder index from the very start of the dive.
This works with the test data I have and doesn't seem to break thing with
any of the files that I tried... but I'm worried that this is not the
right way to do things.
Fixes#742
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This prevents a warning caused by -Waddress, that the address
of 'displayed_dive' will always be defined.
Exact macro variant suggested by Dirk.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This will parse date information from Seabear log file and skips the
"header" data to allow parsing of the CSV content.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This creates a delegate to simplify the handling of gas components and
the change depth.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This creates a delegate for the type column to choose the type value for
gases that is less confusing then the raw value.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I fixed up the decode and finished the parse for Cochran EMC, Commander
and Gemini computers. I suspect that this code may only work with files
from certain versions of Cochran Analyst. It works with my own CAN files
and with the samples that came with Analyst v4.01v.
A seemingly arbitrary offset of 0x4914 is needed to access data.
The previous code uses 0x4a14 and 0x4b14. I suspect these are from
different version of Analyst.
[Dirk Hohndel: whitespace cleanup, add files to subsurface.pro, made sure
this compiles without the corresponding patch to
libdivecomputer (that isn't upstream, yet), cleaned up the
usage of structs, removed a few unused variables]
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On the OSTC's the salinity is in kg/l and is stored as kg/l * 100
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The OSTC supports a bit different functionalities than the OSTC3 does.
The "unsupported" bits are
setBrightness
setCalibrationGas
setCompassGain
setDiveMode - Bult into setDecoType (OC/CCR)
setDiveModeColor - Lots of different colors
setFlipScreen
setLanguage - Controlled via flashing different firmwares
setPressureSensorOffset
setUnits
setSetPointFallback
setCcrMode - there are some ppO2 reading functionality in the fist gen
OSTC that we don't care about, and the rest is controlled
via choosing a CCR deco algorithm
Also the OSTC have a notion of number of dives it has done, so this adds
ui for that value.
There are also differences in how some values are handled. Ex the OSTC
don't have fixed samplerates that you can choose between. You can rather
just set your sample rate to X seconds.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The problem that we were comparing signed and unsigned ints was originally
found by Lubomir. As image times can be negative (and the comparison should
fail in that case) we need to compared them as signed.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Acked-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The icon comes from heinrichsweikamp.com, the same as the ostc3.png did.
I've emailed with Matthias Heinrichs at HW and they have given us
permission to use both the ostc3.png and ostc2n.png under the GPL v2.
They also can provide the hi-res originals if anyone needs to do more
work on these icons.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We now include the Ui header file, so we can remove the forward
declaration.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The device supports a up to 60 chars custom text. This limits the
LineEdit to that amount, so users see when they reach the max limit.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a shortcut, Ctrl+Shift+C to jump into the Configure dive computer
dialog.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit a85a219df3 ("Add ability to replan a dive that we planned
before") I completely mishandled the saving of the replanned data.
How embarrassing.
Fixes#747
See #527
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
DiveLogExportDialog::export_depths()
We set a default value of 'unit' which will silence the warning itself.
Then hope that the compiler will respect the argument order i.e. call
get_depth_units() (which sets 'unit') before using *unit as the last
argument passsed to put_format().
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"gridLayout_1" is used twice. Re-order the grid layouts as 1, 2, 3.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
MainWindow::on_actionReplanDive_triggered():
If a dive in the divelist does not have a "DC Model" for some reason,
selecting "re-plan" from the menu will pass a NULL value
current_dive->dc.model to strcmp() and break before the debug output.
To fix that we check if the said .model value is NULL.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds support for importing the logs from a Poseidon MK6
rebreather. This DC produces logs that contain of a .txt file that has
all the meta data and a .csv file that contains the sample readings. The
CSV file is different from the others in that it has a line per each
sample reading at given time. Thus we have to merge all the lines from
one point in time into one sample reading of ours.
[Dirk Hohndel: addressed some compiler warnings]
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When dropping to the bottom in plan (and add) mode, the gas label was
placed along the diagonal line from (0,0) to the second dive data point
(i.e. the one at the end of the "at deptch" segment). That looks terrible,
the label needs to be along the segment that we are spending at the
bottom.
This patch fixes that problem.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a icon to the Vyper config page. The image is taken by me of
my Suunto Vyper. Thats the reason for the quality.
Question: Would it be ok to grab a PR image from Suunto's web page to
use here? If so they got better ones...
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We currently don't support update firmware for the OSTC3. Where waiting
for support in libdivecomputer for that, so disable that button for now.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Working on HTML exports to support imperial and metric units and also
custom selected units based on subsurface preferences.
User selected units is exported to settings file that will be mainly used
by listlib javascript file.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The pre-existing tissue load going into a dive can change if the start
time of a dive changes. Therefore we need to recalculate the ceiling when
editing start time (or date) of a dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While the existing code worked fine for editing that start date or time of
dives downloaded from a dive computer or imported from some other source,
for manually entered dives this did not work and the date or time was
always reset to the original time once the changes were saved.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Ensure that there is no (clipped) overflowfrom the header.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The previous hard-coded solution for GTK+ didn't work on HiDPI, and a
comment hinted that even on Mac OS X it might need tuning. Find a more
generic solution that should work regardless of platform and style,
based purely on the geometries reported by the style itself.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also, generate the corresponding pixmap only once, and distribute it to
all models that need it.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The latest CCR patches had rendered the planner not usable for CCR dives.
This patch corrects this (and reenables the CCR set point column for
segments). The problem was that a new member setpoint of struct divepoint
had been introduced, but there was already po2 which had the same meaning.
This patch merges the two and renames them setpoint to prevent future
confusion.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds the settings not previously available in the OSTC3 settings.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This creates a Advanced settings page for the OSTC3 and moves the deco
settings off to that page.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These settings are gas related so they fitted in the spare space in the
gas screen.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I hope this time I got it right. basically, the old code
tried to guess where the plus icon should be with a fairly
bad set of defauults.
This one patch asks for the Qt style where everything is and
uses that knowledge to make it be in a more sane position.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Giuseppe Bilotta <giuseppe.bilota@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Collect font, font metrics and icon size functions in a separate module.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Compute the default widths for the columns in the dive trip list from
their header and (expected) content length rather than some fixed pixel
sizes.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't hard-code column widths or icon sizes/positions. Instead, compute
them from the fonts used.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of hard-coding the icon sizes and spacing, compute them from the
font sizes, that Qt auto-computes from the displya DPI.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The default IMG_SIZE and SPACING in the StarWidget are not appropriate
for HiDPI displays. Replace them with StarMetrics which are
auto-computed from the (default) font size (which Qt determines from the
display DPI settings).
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>