aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-10-28Improve tank handling for CobaltGravatar Dirk Hohndel
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>
2014-10-28dive.h: add a variant of FOR_EACH_PICTUREGravatar Lubomir I. Ivanov
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>
2014-10-28Assigment in if statementsGravatar Dirk Hohndel
This is one of the warnings that I agree with. The original code was very hard on my eyes... the explicit comparison to NULL is just so much easier to understand when reading the code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28cochran.c: make cochran_predive_event_bytes() return 0Gravatar Lubomir I. Ivanov
It seems that an iteration will happen even if the function returns 0, but this looks like a non-breaking change. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28cochran.c: mark 'ascent_rate' as unusedGravatar Lubomir I. Ivanov
cochran_parse_samples(): 'ascent_rate' can be used at some point so we mark it as unused with (void) Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28cochran.c: coding style cleanupGravatar Lubomir I. Ivanov
- empty lines - indentation - { placement - others... Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28Parse meta information from Seaber logGravatar Miika Turkia
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>
2014-10-28Add test dive for Seabear HUDCGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28Fix reading of CDATA elementsGravatar Miika Turkia
If the element we are parsing is of type XML_CDATA_SECTION_NODE, we have to check the node's name from the parent. Fixes #718 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Create a delegate for depth and gas componentsGravatar Anton Lundin
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>
2014-10-27Create a delegate for gas type columnsGravatar Anton Lundin
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>
2014-10-27Finished Cochran dive log importGravatar John Van Ostrand
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>
2014-10-27Write config data to the OSTCGravatar Anton Lundin
This adds code that writes configuration data to the OSTC. As we don't look at all the values in the OSTC config blocks, we read the current blocks and only change the values we can change. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Debug code for OSTC CFGravatar Anton Lundin
This code is to debug the rest of the existing CF's, so we can look at the rest of the values. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Decode CF configuration data from OSTCGravatar Anton Lundin
This adds code to decode the custom functions data. We only decode the relevant CF's. The relevant ones are chosen by which ones have corresponding settings in the OSTC3. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Decode configuration data from OSTCGravatar Anton Lundin
This adds code to decode the configuration blocks from the OSTC. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Debug code to simulate read/write to OSTC memoryGravatar Anton Lundin
This adds debug code to simulate the read and write to OSTC memory dumps. The OSTC configuration happens via writing whole 512 byte blocks to the memory and this code is useful when debugging that process Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Change the salinity setting for OSTCGravatar Anton Lundin
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>
2014-10-27Change the OSTC3 copied ui to be sane for OSTCGravatar Anton Lundin
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>
2014-10-27Copy the configure OSTC3 ui to the OSTC UIGravatar Anton Lundin
Just renumber the ui components. _3 for OSTC. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Compare image times and sample times as signed intsGravatar Robert C. Helling
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>
2014-10-27Cleanup syntax and styling in Configure DCGravatar Anton Lundin
This cleans up some styling and syntax in the Configure Dive Computer code path. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Add a icon to the OSTC, Mk.2/2N config lineGravatar Anton Lundin
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>
2014-10-27Remove now obsolete forward declarationGravatar Anton Lundin
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>
2014-10-27Set a max value for the custom text in OSTC3Gravatar Anton Lundin
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>
2014-10-27Add a shortcut to Configure dive computer dialogGravatar Anton Lundin
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>
2014-10-27Correctly save a re-planned diveGravatar Dirk Hohndel
In commit a85a219df325 ("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>
2014-10-27Update translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Quiet some warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Set old setpoint value, if new one is not recordedGravatar Miika Turkia
Since the setpoint value is initialized as zero, we have to set the previous value if we do not have a current reading. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27Do not zero setpoint value when duplicateGravatar Miika Turkia
We cannot zero setpoint value upon import if the current and previous values are zero. This is because on setpoint context a value of 0 means open circuit. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27divelistview.cpp: move a variable in a Q_OS_MAC branchGravatar Lubomir I. Ivanov
Not used on other OS and triggers a warning. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27profile.c: remove a variable which is set but not usedGravatar Lubomir I. Ivanov
fill_o2_values(): struct gas_pressures *pressures; Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27profile.c: remove unused variables in calculate_ccr_po2()Gravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27deco.c: remove unused variables in add_segment()Gravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27divelogexportdialog.cpp: fix a 'uninitialized variable' warningGravatar Lubomir I. Ivanov
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>
2014-10-27globe.cpp: fix a NO_MARBLE warningGravatar Lubomir I. Ivanov
Make eventFilter() return a value for NO_MARBLE. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27configuredivecomputerdialog.ui: fix a UIC warningGravatar Lubomir I. Ivanov
"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>
2014-10-27MainWindow: prevent a possible crash on "re-plan"Gravatar Lubomir I. Ivanov
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>
2014-10-26Make the buffers const char *Gravatar Dirk Hohndel
Addresses a warning, but also seems more correct. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-26Support for importing Poseidon MK6 logsGravatar Miika Turkia
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>
2014-10-26Take water vapor pressure into account again for decoGravatar Robert C. Helling
In the transition to the partial pressure helper function, the water vapor component of the breathing gas had been dropped. This had a significant effect on deco times for deep dives. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-22Set dctype of dives with pO2 setpoint information to CCR.Gravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21Check return value after firmware updatesGravatar Anton Lundin
This reports back a error to the user if the firmware update failed. We should re-wire this to have a log-function that gets called from libdivecomputer via the context to get an actual error message. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21Dereference the right pointer in fw update slotGravatar Anton Lundin
This fixes a copy-paste error, dereferencing the wrong pointer in the slot that gets called when the firmware update thread has run. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21Fix compability with libdivecomputer < 0.5.0Gravatar Anton Lundin
hw_ostc_device_fwupdate was introduced after 0.4.2 so ifdef it to libdivecomputer >= 0.5.0. The scope of users interested in this feature probably isn't big enough to justify a bump of our dependencies to a unreleased version of libdivecomputer. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21Correctly place the first gas label in drop to bottom modeGravatar Dirk Hohndel
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>
2014-10-21Fix dc nickname helper functionGravatar Linus Torvalds
This helper function is used to get a nickname for a dive computer, when the model information on its own may be ambiguous (ie there may be multiple dive computers of the same model, and we've nicknamed them by owner). However, the helper did completely the wrong thing if it didn't find a dive computer entry at all due to a missing device ID - it would just return empty. Which is bogus: it should return the model name, the same way it does if the nickname is missing. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20Configure support for OSTC, Mk.2/2N/2CGravatar Anton Lundin
First out is firmware updates. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20Add a icon for the Suunto Vyper Family config pageGravatar Anton Lundin
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>