Commit graph

4218 commits

Author SHA1 Message Date
Miika Turkia
c4c7d85fb5 Adding some supported divelogs to importing info
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:53:04 -08:00
Miika Turkia
4b46385d64 Typo fixes on user manual
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:53:04 -08:00
Miika Turkia
f2a1171b15 Add manual CSV log import to UserManual
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:53:04 -08:00
Miika Turkia
25a9c23635 Update screenshot for CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:53:04 -08:00
Miika Turkia
ac290a923c CSV import instructions improved
Importing CSV files has changed slightly since writing this manual.
Updating accordingly. A typo fix as well (comma separated *values*).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:53:04 -08:00
Miika Turkia
b6ef5198f2 Hook up XSLT and include it in resources
XSLT to import manually kept CSV logs is hooked up and included in
resources.

Fixes #427

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:52:50 -08:00
Miika Turkia
19200932fd Set up the parsing of manual CSV files
This function wraps up the parsing of manually kept CSV log files. Set
up parameters received from C++ code for use in XSLT.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:52:06 -08:00
Miika Turkia
47ad50d6de C++ code to call parsing functions for manual CSV
This code sets up the C++ part for importing manually kept CSV log.
That includes setting up the field separator selection and calling
C-code for parsing the log file.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:52:06 -08:00
Miika Turkia
d010b6a216 GUI for importing manually kept CSV logs
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:52:05 -08:00
Miika Turkia
7048457b30 XSLT for importing manually kept CSV dives
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:52:04 -08:00
Richard Hughes
7c2503a32e Make the appdata file validate
Signed-off-by: Richard Hughes <richard@hughsie.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-24 07:36:25 -08:00
Pedro Neves
e7c2367264 This adds appdata for Subsurface
Fixes #428

Signed-off-by: Pedro Neves <nevesdiver@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:37:54 -08:00
Tomaz Canabrava
b5e8ef160a Added the Po2 Partial Pressure Graph.
Important to note that no Partial Pressure Graph handles
settings yet.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:15 -08:00
Tomaz Canabrava
1cae362c16 Added the code for the PHE gas pressure.
Using the PartialPressureGasItem the addition of a new partial plot
is very easy.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:15 -08:00
Tomaz Canabrava
caa45a1539 Added the first Partial Gas Pressure: PN2
This makes the beginning of the partial gas pressures, there's
two more. but this code uses a good part of the Model View system,
and it's way clearer than the old one. Luckly the other 2
missing items will be even more clear ( the diffs ) to do,
because I just need to create a new PartialPressureGasItem and
set the properties. <3

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:15 -08:00
Tomaz Canabrava
fd45e646dc Added comments explaining why the events are created on the setDive
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:15 -08:00
Tomaz Canabrava
0f5069784d Prevent memory leak by removing the texts on the TemperatureItem
This patch prevents memory leak by adding the text on the list of
'delete me when model changes' items. it also makes things a bit more
snappy because the scene doesn't have to deal with all of the
texts bounding rectangles eveytime.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:15 -08:00
Tomaz Canabrava
43cf4fb984 Move profile item to be used as cache.
the profile item should also use the model to know when to
change something, this makes it happen.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:14 -08:00
Tomaz Canabrava
563c39b822 Moved the temperature item as a 'Cache'
This patch moves the temperature item as a cache that will
be updated as the model updates, instead of deleting / recreating
it everytime the dive changes.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:14 -08:00
Tomaz Canabrava
555ca8245d Fix the ghost-text-on-profile regression
The last patch correctly moved the GasPressure item to use
a cache-based system, but ignored the fact that the Gas
pressure text was not being removed from the scene. this fixed
it.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:14 -08:00
Tomaz Canabrava
2c2d3351ac Move the creation of the Gas Pressure item to the constructor
This makes the Gas Pressure Item a 'cached' item, when the dive
changes, the item will regenerate the drawing based on it's model.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:14 -08:00
Tomaz Canabrava
2f0b778f92 Don't recreate the tissues, but instead, reshape them.
This patch makes the Tissues be used as a 'cache', it will not
be deleted untill the program closes, but whenever a new dive is
selected, the old drawings of the tissues will be regenerated,

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:11:14 -08:00
Miika Turkia
803623042c Fix importing CSV files with empty values
Empty values included the rest of the line in the value, instead of
leaving it empty. This patch leaves empty values empty.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:10:42 -08:00
Tomaz Canabrava
cde9bc0de9 Make the tissues be preferences-aware.
This patch adds a new class DiveCalculatedTissue that's preferences aware.
It knows when to show or hide itself.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 13:28:25 -08:00
Tomaz Canabrava
f8a4f8de81 Do not delete / new object that can be cached.
This way we will always have this object on screen, and as soon as the
model changes, it's contents will change.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 13:16:31 -08:00
Tomaz Canabrava
629a1ea0f9 Simplify the code for the reported ceiling.
The reported ceiling now behaves better by not being deleted / recreated,
instead it uses the same object and connects to the model to know when to
regenerate its plot.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 13:13:20 -08:00
Tomaz Canabrava
bc7b221498 Prepare for plotting partial pressures in the new profile
This patch makes the cartesian axis of the profile depth shrink and
(together with it) the Profile Depth and the grid lines. There will
probabla bey a lot of things that didn't have their correct position
fixed, so I'll fix them in the later commits.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 12:35:52 -08:00
Tomaz Canabrava
4005ee2ae8 Fix the ZLevel value of some items.
Almost all of the items on the new profile were being painted
on the same ZLevel, so the level of awesomeness was a bit random.
This puts things on the correct spots, events on top of everything,
profile at the bottom, things in the middle.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 12:30:23 -08:00
Tomaz Canabrava
2e2a87e619 Add a MeanDepthItem that has 2 strings.
Dirk's implementation of the MeanDepth item was correct, but in order to
add the 2 strings to it ( one at the begin, one at the end ) I had to put
more stuff inside the ProfileWidget that's already packed with graphics
items.

So I created a new class MeanDepthItem that contains these 2 strings and
will get updated whenever the value changes.

I also fixed a math inconsistency where I changed RIGHT to LEFT.
(wich fixed a few text-placements, and broke others.)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 12:29:41 -08:00
Robert Helling
f22428b345 Allow manually added dives to have their location changed
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 08:35:57 -08:00
Robert Helling
b6a30dcdd3 Improve floating point equality test
This allows for a relative error rather than an absolute (which would set
an artificial scale). This basically says “we trust our data (which comes
from the dive computer’s measurement after all) to a certain number of
significant digits” rather than “we will never encounter anything smaller
than 1 / a million but not zero” which would be awfully unit dependent.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 08:30:08 -08:00
Thiago Macieira
a566dbdaf7 Add info to the CodingStyle for C++ constructors
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 08:28:43 -08:00
Thiago Macieira
b08b9183bc Fix creating the list of Qt translation files under Qt5
We were apparently exploiting a bug in qmake for Qt 4. The $$join
function in Qt 5 is fixed: it returns a single string, not a list with
multiple elements.

Instead, we just iterate over the element list.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22 07:59:19 -08:00
Dirk Hohndel
1f785111f7 Whitespace, whitespace, whitespace
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 14:30:36 -08:00
Tomaz Canabrava
bd96036892 Better use of the preferences changed signal.
When the preferences changed signal is fired, the items that can change
their visual based on the preferences now have to reimplement the
preferencesChanged method, so they know if they need to be replotted on
screen. I already implemented that for two of the items ( ProfileDepth and
Ceiling ) but others might need that too.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 14:25:34 -08:00
Tomaz Canabrava
b08da94007 Draw the Ceiling in red if preferences are marked for that.
This code actually uses the preferences for something. It will show and
hide the calculated ceiling in red if the prefrerences are changed for
that. One bad thing that I did in this commit ( so it was easy to try ) is
that a preference change will redraw the whole graph - not optimized. I'll
make this better in a later commit so that only the affected items will be
redrawn.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 14:25:09 -08:00
Tomaz Canabrava
8831bf6350 If we draw ceilings in red do not dig a hole on the profile.
This is an attempt to speed up painting a bit. Since we will draw the red
ceiling on top of the profile, I don't see a reason to dig a hole in it,
creating an more complex shape to be passed to the painter. Easier shapes
are easier to draw. ( I think )

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 14:24:08 -08:00
Tomaz Canabrava
58d9282955 Show dive computer ceiling
This patch adds dive computer calculated ceiling on the profile graph as a
'hole' on it. There's an item that paints it in red - maybe we shouldn't
offer an option here and show that only in red?

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 14:23:33 -08:00
Robert C. Helling
162d674c5b Don't compare floats for equality
Now that we have a macro to replace float equality testing, we should use
it in places where floating point jitter might bite use otherwise.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 14:11:52 -08:00
Robert C. Helling
2f822ec0dc Prevent potential math overflow in new profile
Test for max_temp == min_temp to prevent math overflow when calculating
temperature axis in new profile

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 14:07:10 -08:00
Tomaz Canabrava
4159faa950 Remember to clean the tissues when changing dives.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 11:35:36 -08:00
Anton Lundin
a73f00dcac Fix building in git shallow clones
If we are building from a shallow clone, just guess the version based on
whats hard-coded in VERSION and append a -git to show thats it somwhere
behind that.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 11:35:31 -08:00
Tomaz Canabrava
ce7c3f8314 Add the tissues to the profile graph
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 11:35:24 -08:00
Tomaz Canabrava
8065374793 Add the DiveCalculatedCeiling item.
This item plots the DiveCalculatedCeiling over the profile. I still need
to add the Calc All Tissues version.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 11:35:09 -08:00
Tomaz Canabrava
b1df7aeb4e Plot gas value function ported to the new canvas.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 11:35:04 -08:00
Tomaz Canabrava
9d33640bea Add the gas presssure profile texts.
This just adds the texts for the gas profile. I've also added a method on
the dataModel() to return the diveId of the last used dive in a way that
the other methods can use it.

This code is almost 1-to-1 with the old one, a bit of thinkering can be
used to merge this loop with the upper one.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 09:39:42 -08:00
Tomaz Canabrava
21d34db3a9 Simplfy the code for the cylinder pressure.
Instead of asking the data as we do on the generic models, use the
internal knowledge of the class.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 09:39:21 -08:00
Tomaz Canabrava
0a4e21a168 Add the depth text.
Depth text got added to the new profile.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 09:39:09 -08:00
Tomaz Canabrava
caba6500d6 Add the dive computer text.
Added the dive computer text on the bottom left side of the new Profile.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 09:38:46 -08:00
Tomaz Canabrava
63c1a1b3e9 Plot the events on top of the profile.
Changes the ZValue of the event items so they are plotted
on top of the profile, instead of being hidden on some.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-19 21:38:14 -08:00