For each polygon that we paint we have to step through the
plot_info from the start again.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We when comparing floating points we do a relative comparison of the difference.
This fails when both numbers are (exactly) 0.0 which happens to occur when plotting
an O2 graph without o2 data resulting in both min and max for the y-axis to be 0.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Before you could 'Cancel' the edit and then would be asked if you wanted
to 'Discard' your changes or 'Cancel'. So clicking 'Cancel' cancelled the
action of having clicked 'Cancel'. That's so confusing, it's even hard to
explain. Yes, it uses "typical" language for user interaction and kind of
makes sense, but it's not easy to understand for the non-technical user.
With the new labels the user is asked to whether they want to 'Apply' the
changes or 'Discard' them. And when they choose 'Discard' the verification
question is still 'Discard' or 'Cancel'. That seems much more consistent.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If not cylinder with type DILUENT or OXYGEN is defined, this function
returns -1 which should not be used as an index to an array. This
patch adds code to check for this return value and exit gracefully.
On line I marked with a comment. Someone more knowledgeable of that part of
code than me should double check that return is here what we want.
[Dirk Hohndel: fixed small oversight...]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Clearly the static dialogs don't work. Even with the previous commit the
dialog still said "Save" insted of "Open". So let's just assemble our own
dialog and be done with it. I hope I got all the options right...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Using the SaveFile dialog to open a file caused it to ask the user if they
wanted to overwrite a file when they actually tried to open an existing
file. This fixes that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When dropping the pointless surface samples at the end of the dive we
stopped going through all the samples - for that reason the offset at the
end to find the data in the footer was wrong.
Now the extra data all seems to match what I can see on my screen after
the dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way we can specify file names that don't exist and therefore make our
git syntax (/path/to/dir[branch]) work.
Thanks to Tomaz for pointing this out.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a pain. We plan with segments but the plan shows waypoints.
If after a constant depth segment the gaschange (or setpoint chenge
for that matter) appears, the _next_ line should get the info
about the new gas (i.e. change _after_ the constant depth segment).
If, however, the gas is changed after a transition, the final waypoint
of the transition gets the gas printed.
And all is different for a verbatim plan, where the gas change is
an event rather than part of a segment.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fixup_pressure() needs to calculate the cylinder pressures at the
start and at the end of the dive, also for CCR oxygen cylinders.
Since, in the case of CCR, the default cylinder is the diluent,
this is not automatically done for oxygen. This code provides
for fixup_pressure() to be able to do the calculations for oxygen
as well. Another change to fixup_dive() invokes fixup_pressure()
to calculate the values for the oxygen cylinder.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correct a bug that I introduced previously.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
From 45570d66ecf238aec8997f5d0c20c01dfe0aa4fa Mon Sep 17 00:00:00 2001
From: willem ferguson <willemferguson@zoology.up.ac.za>
Date: Fri, 21 Nov 2014 14:59:14 +0200
Subject: [PATCH] Save-XML: Correct bug in cylinder gas parameters
Correct a bug that I introduced previously
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is not the right way to get serial numbers and firmware versions. The
libdivecomputer interface here is simply broken. Those ARE NOT numbers.
But until we have the capability in libdivecomputer to return reasonable
strings to us, this could be a stop gap measure to help us understand how
these are formatted.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After some feedback on the mailing list, bitwise XOR wasn't the
preferred way to build the gaschange event.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After some feedback on the mailing list, these strings where preferred.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It seems that in some scenarios we end up with a string that isn't NUL
terminated and that results in garbage being stored as userid. This patch
is a little brute force but it fixes the problem even if a previous
version os Subsurface ended up adding other text to the end of the userid.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added a title bar with close button.
Set an appropriate title.
Centred the window relative to mainwindow.
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I had forgotten a / 1000.0 in the conversion of partial pressures from (double) bar to (int32) mbar.
Fixes#763
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use the right format, now when those variables are integers and not
doubles.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This changes the OSTC3 READ_SETTING/WRITE_SETTING macros into something
that can have a ; in the end which makes some editors auto-indent it better.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is based on the great work done by Søren Reinke's on his MKVI Logfile
Analyzer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This code sets up the UI that will allow the user to adjust tank pressures
at a gaschange event. The actual changing of the pressure is not
implemented, yet, so this is disabled until someone finds time to do so.
The scenario is this: a tec diver or sidemount diver without pressure
sensors on at least one of their tanks still wants to reasonably
accurately track gas consumption during a dive. The diver takes notes of
the pressures at every tank switch (I find that odd, but apparently some
cave divers indeed do that as they switch back and forth between different
gases) and then wants to adjust the pressures in Subsurface to match those
written down.
One difficulty here is that the first and last pressure of a tank with no
sensor data is still considered "sensor pressure" - this is basically an
implementation detail in the code that is used to do the pressure
interpolation to have constant-SAC pressure plots for tanks without
sensors. So when we check if there is indeed no pressure data available at
the gas change, we can't just work with the interpolated pressure - if
this is the first (or last) time the tank was used, that pressure may be
marked as sensor pressure.
What's missing is the UI to enter the desired new pressure plus the black
magic that actually inserts this into the dive in a way that doesn't break
the assumptions in the rest of the code. I'm running out of time to do
that but wanted to preserve this code so someone can continue this later.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We had the variable. As a pointer. Which we used memset to clear. Ouch -
that smells like some bad cut and paste.
With this change the object keeps the corresponding plotInfo around (just
like some others do) and can use it later. I suspect this code could use
some larger cleanup, but it's a bit too late for this in the development
cycle, I guess. I'm sure I'll regret this in the future...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the context menu of the profile it makes no sense to offer the ability
to switch gases unless there is a gas to switch to.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Includes the dive list filters and modifications on tissues graph.
Corrects a typpo.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added comment about meaning of o2pressure in struct plot_info.
Turned some pressures from double (in bar) to pressure_t (in mbar)
[Dirk Hohndel: picked parts of this patch and dropped others]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The only place where I'm not sure if there are unintended sideeffects of
changing over to the new domain is QCoreApplication::setOrganizationDomain
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit 0d7c192e6e ("For CCR dives, the diluent cylinder is the
current cylinder") a few things got broken. This tries to undo those
changes and adds expanded XML output.
1) Calculate correct partial pressure of oxygen to be plotted on
dive profile, taking into account the oxygen sensor data.
Currently, erroneously, OC PO2 values are shown, due to an
erroneous calling parameter to fill_pressures().
2) Read start and end cylinder pressured correctly. some wrong
assignments were done in file.c. This is now corrected and the correct
cylinder pressures are shown in the equipment tab.
3) Write correct cylinder pressures to XML. Currently the data for
the two cylinders are written to XML the wrong way round
(diluent pressures = oxygen and vice versa).
4) Expand XML output:
a) Write oxygen sensor data to XML
b) Write no_of_02sensors to XML
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit d5d7fdc9af ("For CCR dives, show plot for diluent and O2
cylinder pressures") we end up dereferencing current before it is first
initialized. Bad.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Qt by default uses a rather simplistic text heuristic to figure out if a
menu entry is one of the special ones that need to be moved into the
application menu (About, Preferences, Quit - but for Preferences anything
that matches settings, options, config is used as well).
This patch tells Qt to keep its hands off the the DC configuration entry
in the menu.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>