aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-01-25Hook up XSLT and include it in resourcesGravatar Miika Turkia
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-25Set up the parsing of manual CSV filesGravatar Miika Turkia
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-25C++ code to call parsing functions for manual CSVGravatar Miika Turkia
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-25GUI for importing manually kept CSV logsGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25XSLT for importing manually kept CSV divesGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-24Make the appdata file validateGravatar Richard Hughes
Signed-off-by: Richard Hughes <richard@hughsie.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23This adds appdata for SubsurfaceGravatar Pedro Neves
Fixes #428 Signed-off-by: Pedro Neves <nevesdiver@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23Added the Po2 Partial Pressure Graph.Gravatar Tomaz Canabrava
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-23Added the code for the PHE gas pressure.Gravatar Tomaz Canabrava
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-23Added the first Partial Gas Pressure: PN2Gravatar Tomaz Canabrava
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-23Added comments explaining why the events are created on the setDiveGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23Prevent memory leak by removing the texts on the TemperatureItemGravatar Tomaz Canabrava
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-23Move profile item to be used as cache.Gravatar Tomaz Canabrava
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-23Moved the temperature item as a 'Cache'Gravatar Tomaz Canabrava
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-23Fix the ghost-text-on-profile regressionGravatar Tomaz Canabrava
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-23Move the creation of the Gas Pressure item to the constructorGravatar Tomaz Canabrava
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-23Don't recreate the tissues, but instead, reshape them.Gravatar Tomaz Canabrava
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-23Fix importing CSV files with empty valuesGravatar Miika Turkia
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-22Make the tissues be preferences-aware.Gravatar Tomaz Canabrava
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-22Do not delete / new object that can be cached.Gravatar Tomaz Canabrava
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-22Simplify the code for the reported ceiling.Gravatar Tomaz Canabrava
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-22Prepare for plotting partial pressures in the new profileGravatar Tomaz Canabrava
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-22Fix the ZLevel value of some items.Gravatar Tomaz Canabrava
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-22Add a MeanDepthItem that has 2 strings.Gravatar Tomaz Canabrava
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-22Allow manually added dives to have their location changedGravatar Robert Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22Improve floating point equality testGravatar Robert Helling
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-22Add info to the CodingStyle for C++ constructorsGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22Fix creating the list of Qt translation files under Qt5Gravatar Thiago Macieira
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-21Whitespace, whitespace, whitespaceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21Better use of the preferences changed signal.Gravatar Tomaz Canabrava
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-21Draw the Ceiling in red if preferences are marked for that.Gravatar Tomaz Canabrava
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-21If we draw ceilings in red do not dig a hole on the profile.Gravatar Tomaz Canabrava
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-21Show dive computer ceilingGravatar Tomaz Canabrava
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-21Don't compare floats for equalityGravatar Robert C. Helling
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-21Prevent potential math overflow in new profileGravatar Robert C. Helling
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-21Remember to clean the tissues when changing dives.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21Fix building in git shallow clonesGravatar Anton Lundin
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-21Add the tissues to the profile graphGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21Add the DiveCalculatedCeiling item.Gravatar Tomaz Canabrava
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-21Plot gas value function ported to the new canvas.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21Add the gas presssure profile texts.Gravatar Tomaz Canabrava
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-21Simplfy the code for the cylinder pressure.Gravatar Tomaz Canabrava
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-21Add the depth text.Gravatar Tomaz Canabrava
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-21Add the dive computer text.Gravatar Tomaz Canabrava
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-19Plot the events on top of the profile.Gravatar Tomaz Canabrava
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-19Make the colors of the texts be prettier.Gravatar Tomaz Canabrava
Just fixes some colors of the texts on the canvas. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-19Remove the ticks on the Axis, we never used them on the old profile.Gravatar Tomaz Canabrava
This patch just cleans a bit the Cartesian Axis, we never used ticks on it, just the grid lines ( that I need to animate a bit. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-19Fixed Temperature TextGravatar Tomaz Canabrava
This fixes temperature text replacing the old code with the new DiveTextItem. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-19Fix the positioning of the Labels using the new DiveTextItemGravatar Tomaz Canabrava
This uses a combination of items on the canvas which makes it easier to position it where I want. This also broke the other texts because I forgot about them. I will fix that on the next commit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-19Remove the plotText function, standardize with the TextItem.Gravatar Tomaz Canabrava
Removed the plotText function and replaced it with the DiveTextItem class - this way there's just one way to add text on screen, and it also makes it easy to fix positioning of stuff there. Which is what I'll try to fix on the next commit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>