aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-03-06qt-gui.h shouldn't include QApplicationGravatar Tomaz Canabrava
[Dirk Hohndel: refactored the iOS patches] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06iOS build: don't include CoreServices on iOSGravatar Tomaz Canabrava
[Dirk Hohndel: refactored the iOS patches] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06Clean up handling of various include fileGravatar Tomaz Canabrava
This is in the context of the iOS port and shouldn't impact any of the other builds. [Dirk Hohndel: refactored the iOS patches] Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06iOS build: add various support filesGravatar Tomaz Canabrava
It's unclear why the build fails if we don't add the sample app files as well. [Dirk Hohndel: refactored the patches] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06iOS build: Updated build scriptGravatar Tomaz Canabrava
This now only builds all the prerequisits but not the actual Subsurface binaries - that will be done with qmake (oh the irony) in a later commit. [Dirk Hohndel: refactored the patches] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05Android build: pass in build nrGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05Android build: automate setting the right version numberGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05Introduce separate version number for Subsurface-mobileGravatar Dirk Hohndel
This is hard coded in version.cmake for now. The intent is to go to 1.0 in the first release version and to increment from there whenever we create an update. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05QML UI: small modification to About screenGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-04Rewrite the Subsurface-mobile user manualGravatar Dirk Hohndel
This brings the text closer to the current version of Subsurface-mobile, but a lot more fine tuning will be required (and of course the images need to be updated to reflect the current UI). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-04gas model: use virial cubic polynomial formGravatar Linus Torvalds
The "virial" form of the Z compression factor is of the form Z = 1.0 + A*p + B*p^2 + C*p^3 + .. and it's considered the "right" polynomial form to use. It happens to also make for one constant less per gas (since the 1.0 can be added later), and can be used to simplify the expression and avoid a few floating point operations. However, in order for that kind of expression simplification to make sense, we need to make sure that we don't calculate the powers of the pressure multiple times either, and that means we have to inline all the actual calculations. Our compiler options still mean that the generated code isn't optimal, but that's a separate issue. And it is a lot better than it used to be. Being clever about this does potentially make the code a tiny bit less legible, but maybe that's not too bad for something that we'd expect to not ever touch once we get it right. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: make sure the drawer is closed after going back to dive listGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: brute force around Qt 5.6.0 bugGravatar Dirk Hohndel
With the current release candidate of Qt 5.6.0 we get into an infinite recursion of the grid layout engine. This had happened before (prior to the 5.6 beta) and it appeared that setting the maximum width of the columns was sufficient to fix this. But with the RC even that isn't sufficient, so now we give up on having QML figure out the best possible column width and hard code both preferred and maximum width to the same, predefined values. That's a total shame, but at least now we can build against Qt 5.6 without infinite recursions and crashes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: remove commented out / unused codeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03Build scripts: work with both Qt 5.5 and 5.6Gravatar Dirk Hohndel
This is all a bit hackish but seems to work Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03Don't access undefined diveGravatar Dirk Hohndel
When walking the dive table we need to stop before accessing the yet-to-be-added new dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03Avoid dangling else warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03gas model: simplify and improve our Z factor calculationsGravatar Linus Torvalds
Lubomir found better compressibility data for the pure gases that we need for scuba, making the air table superfluous: we get good values from just regular linear mixing of the Oxygen, Nitrogen and Helium calculations. Also, rather than using a quintic polynomial, a cubic one does sufficiently well, making for smaller code and fewer coefficients. And judging by the reactions from people on G+ (as well as just looking at how good the fit is with the air data), this is all the right way to do this, and this thus removes the Redlich-Kwong equation. All-credit-goes-to: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: try to avoid binding loopGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03use the global showPassiveNotification functionGravatar Marco Martin
don't create a local PassiveNotification copy, use the global show/hidePassiveNotification from ApplicationWindow, now that it works Signed-off-by: Marco Martin <notmart@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: remove incorrect statementGravatar Dirk Hohndel
Not sure what this was even supposed to do... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: show notification for saving dives to cloud as wellGravatar Dirk Hohndel
Fixes #1014 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03QML UI: ensure that cloud notification is always clearedGravatar Dirk Hohndel
All error cases need to reset it as well. And it's easier to reset it right after we come back from parse_file() instead of trying to track all the exit cases after that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02gas model: add polynomials for Z factors of oxygen/nitrogen/heliumGravatar Linus Torvalds
.. and use a linear mix of them for arbitrary gas mixes. For the special case of air, we continue to use the air-specific polynomial. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02gas model: replace Redlich-Kwong with least-square quinticGravatar Linus Torvalds
This goes back to just doing air compressibility, but using the least-squares quintic polynomial equation that Lubomir generated based on the Wikipedia table for air at 300K in the 1-500 bar range. We might be able to do similar things for mixed gases.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02gas model: split up gas compressibility into a file of its ownGravatar Linus Torvalds
The gas compressibility is such a specialized thing that I really prefer having it separate. This keeps Robert's Redlich-Kwong equation as-is, but let's experiment with other models soon... Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: show notification when cloud is accessedGravatar Dirk Hohndel
And hide the notification either after 5 seconds or once we are done. This requires an extension to the Kirigami components that isn't upstream, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: new property to tell the UI that we are accessing cloud storageGravatar Dirk Hohndel
This can then be used to give the user visual feedback (instead of them just thinking the app is hung). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: resolve confusion about dive list model orderingGravatar Dirk Hohndel
Oops, I forgot to take the sort model on top of the model into account. Now everything should stay consistent - ListView order when accessed from QML, but internal order when accessing the underlying array. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: update profile when editing duration of manually added diveGravatar Dirk Hohndel
We need to make sure that a new fake DC is created after the duration was changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: update the correct dive in the model when committing a changeGravatar Dirk Hohndel
When manually adding a dive and moving it in the dive list (by editing it's start time) we could create a situation where the dive list internally was correct, but the dive list model on screen showed an incorrect dive list with the new dive in two different spots. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: create a chronological dive list when manually adding diveGravatar Dirk Hohndel
The dive list might contain dives in the future, don't add the new dive to then end but instead add it at the correct spot in the list Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02QML UI: after adding a dive, jump to it in the listGravatar Dirk Hohndel
Don't do the slow motion scrolling through the list if we previously showed a different dive in the list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02Add helper functions to identify the position of a dive in the dive listGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29templatelayout.cpp: fix potential issue in preprocessTemplate()Gravatar Lubomir I. Ivanov
The function preprocessTemplate(), did not account well for indexes in Grantlee variables, such as: dive.weight# (where # is the index) dive.cylinder# To solve the issue the list (QList<QPair<QString, QString> >) for variables to be replaced is populated will all possible indexes: 0 - MAX_WEIGHTSYSTEM for weights 0 - MAX_CYLINDERS for cylinders Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29QML UI: implement undeleteGravatar Dirk Hohndel
This code is very similar to the undo code in the desktop UI, but untangling that from the desktop seemed massive overkill; we don't have lists of dives to delete and undelete here - so this is actually much simpler and easier to maintain (I hope). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29QML UI: present an undo dialog after deleteGravatar Dirk Hohndel
The dialog gives the user 3 seconds to undo the delete and then disappears without any user interaction. This isn't hooked up, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29This computes the compressibility of the gas depending on the mixture.Gravatar Robert C. Helling
As it turns out, the van der Waals equation gives results that are numerically not really useful, so we use the Redlich Kwong equation which is, according to Wikipedia, much more accurate, which can be confirmed given the empirical values for air. As opposed to the previous approach with a look-up table, this takes into account the actual gasmix. This always assumes the gas to be at 20 degrees Centigrade. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29user-manual.txt: mention some more Grantlee variablesGravatar Lubomir I. Ivanov
With the recent refactoring of the DiveHelperObject class, some more Q_PROPERTIES were added and can be used with the Grantlee engine. We expose some of the additions to the user via the manual. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29DiveHelperObject: add the weightList and cylinderList propertiesGravatar Lubomir I. Ivanov
"weights" and "cylinders" are QStringList Q_PROPERTIES, and Grantlee should be able to render them, but it doesn't. To be able to print the whole list of weights and cylinders we introduce two new QString properties "weightList" and "cylinderList". The variable replacement in the previous patch deals with the conversation of the user side HTML, e.g.: USER -> INTERNAL "{{ dive.weights }} -> {{ dive.weightList }}" "{{ dive.cylinders }} -> {{ dive.cylinderList }}" Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29templatelayout.cpp: add a HTML preprocessor stageGravatar Lubomir I. Ivanov
The current Grantlee template loading scheme does not allow a preprocessing layer. With the recent DiveObjectHelper changes the layer is required if we don't want to add a set of dummy methods and Q_PROPERTIES which will only inflate the DiveObjectHelper class. Use the already present helper readTemplate() to load the raw HTML template and pass it to a static function which does some variable replacement to accomudate DiveObjectHelper. This change is done for the sake of not breaking the Grantlee HTML variables on the user side! Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-28QML UI: small adjustment to DiveDetailsViewGravatar Dirk Hohndel
This reduces the margin to use more of the available space and also makes the first column slightly wider so the word "Cylinder" isn't broken on a Nexus 6p. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-28QML UI: ensure that after a dive edit the profile is redrawnGravatar Dirk Hohndel
Normally this is triggered when the DiveDetailsView component is completed, but since QML isn't recreating this component unless we switch to a dive a couple of spots in the dive list away from this one, we wouldn't get any changes in the data reflected in the profile. But since this now redraws the same dive that potentially was drawn last, we need to make sure we call plotDive() with force=true. I also suspect that this could help with the strange bug that sometimes we show a blank profile after certain edits. See #1013 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-28QML UI: we no longer use the return value of commitChanges()Gravatar Dirk Hohndel
So make it a void function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-28If salinity is not density, add density of fresh waterGravatar Robert C. Helling
There was a reported case of an import of a dive that gave a salinity of 35g/l. This is an actual salinity (an amount of salt in the water) but for subsurface the salinity is actually the density of the water. So for too small values of the salinity add the density of fresh water. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-25gas pressures: use an actual compressibility table for airGravatar Linus Torvalds
We could in theory make this dependent on the gasmix, but for now let's just assume (incorrectly) that everything we breathe acts like air. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-25Show both the nominal and "real" size for an imperial cylinderGravatar Linus Torvalds
This is questionable, but perhaps useful. When showing imperial cylinder sizes, show both the nominal value (with no compensation for compressibility of the gas) and the "actual" amount of gas the cylinder contains. So an AL80 will show as a size of "80 (77)cuft", because while 80 is the nominal size, the actual amount of gas that will fit is just 77 cuft. [Dirk Hohndel: adjusted to take translation of the unit into account] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-25Don't use "get_volume_string()" for cylinder size stringGravatar Linus Torvalds
We had two totally different usage cases for "get_volume_string()": one that did the obvious "show this volume as a string", and one that tried to show a cylinder size. The function used a magic third argument (the working pressure of the cylinder) to distinguish between the two cases, but it still got it wrong. A metric cylinder doesn't necessarily have a working pressure at all, and the size is a wet size in liters. We'd pass in zero as the working pressure, and if the volume units were set to cubic feet, the logic in "get_volume_string()" would happily convert the metric wet size into the wet size in cubic feet. But that's completely wrong. An imperial cylinder size simply isn't a wet size. If you don't have a working pressure, you cannot convert the cylinder size to cubic feet. End of story. So instead of having "get_volume_string()" have magical behavior depending on working pressure, and getting it wrong anyway, just make get_volume_string do a pure volume conversion, and create a whole new function for showing the size of a cylinder. Now, if the cylinder doesn't have a working pressure, we just show the metric size, even if the user had asked for cubic feet. [Dirk Hohndel: added call to translation functions for the units] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-25gas pressures: do not use gas compressibility for cylinder namingGravatar Linus Torvalds
This actually didn't make a difference for the common case, since our simplified gas compressibility model had a compressibility factor of 1.0 up to 200 bar, and increased smoothly from there. As a result, the common 2400 and 3000 psi workpressures didn't really see an effect from this. Not taking compressibility into account does kind of make sense for cylinder naming, since the cylinder may be used for different gases with very different compressibility characteristics. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-25gas pressures: do some initial cleanupGravatar Linus Torvalds
This marks "surface_volume_multiplier()" static in preparation for changing it to use an actual honest-to-goodness compressibility estimation. Without that, it wasn't obvious that the function wasn't used in other random places. Also, remove the "wet_volume()" function. It was unused, but more importantly, it was wrong. Yes, it was the inverse of "gas_volume()", but when you calculate wet volumes from the imperial sizes, you don't actually use the "real" gas volume, you use the idealized one. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>