aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models
AgeCommit message (Collapse)Author
2017-04-26Correct divesite geocoding translationGravatar Jan Mulder
See https://github.com/Subsurface-divelog/subsurface/issues/345. The menues where not translated. The basis of this error is a simple typo in core/taxonomy.c where the classname was mis-spelled in the QT_TRANSLATE_NOOP. In addition, to pull and translate the strings from C code, the normal tr() does not work, and the functionality from the gettextfromc class is used. Fixes: #345 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-24Deal with additional line break in dive notes from plannerGravatar Stefan Fuchs
With current code when re-planning a dive the planner output in the dive notes is always moved down by one line. This fix avoids that this additional line break is added. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-20Identify user provided notes in plain text in replanGravatar Robert C. Helling
This is another attept at the problem if identifying a potentially user supplied text in the dive notes upon replannig a dive. It gets rid of the user visable position markers (*!* and ***) and cirumvents problems with mark-up by first converting the old notes to plan text (assuming that user only enters plain text in the notes field as we do in other places as well). Then the automatically added part is identified by locating the disclaimer in the text (if the user edited/delted the disclaimer or changed langue in between it is her problem to manually delete the old plan). Everything from the disclaimer on is deleted and replaced by the new plan. If the disclaimer is not found, the new plan is appended to the old notes. This way we make sure no information gets automatically deleted. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-04-20Handle CCR setpoint when replanning a diveGravatar Jan Mulder
When replanning a dive, the setpoint information from the profile waypoints were reset to 0, resulting in a dive that has a dive mode of CCR, but only with OC legs in the profile. This is just wrong, and is corrected here. Notice that there is no averaging involved (in the reduction of a replanned real dive that has more than 100 waypoints) as is done for depth. This is just fine for setpoint data. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-16Handle notes from plannerGravatar Stefan Fuchs
New strategy to identify old planner output in notes when replanning a dive: Text anchors ("*!*" and "***") added for planner output For backwards compatibility: If there is no anchor but an old table delete everything. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-16Last added dive planner point for correct lenght not always addedGravatar Stefan Fuchs
Don't add the last stop with addstop for correcting the lenght of the dive if planner generated points can be removed when replanning. Otherwise this will not be deleted when replanning a dive. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-28Always show notes when replanningGravatar Robert C. Helling
... as per popular request. Plus adding const keyword to constant strings. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-28Handle notes in replanGravatar Robert C. Helling
Upon replanning a dive, we want to delete the old dive plan in the notes and replace it with the actual. This fixes a problem when we failed to detect the old plan due to the deco model name appearing in the disclaimer that was used as a marker for the notes. This patch also adds translation markers for the deco model name strings.. Fixes #285 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-24Fix double to int truncation in C++ codeGravatar Jeremie Guichard
Wfloat-conversion enabled for C++ part of the code Fix warnings raised by the flag using lrint Original issue reported on the mailing list: The ascent/descent rates are sometimes not what is expected. E.g. setting the ascent rate to 10m/min results in an actual ascent rate of 9m/min. This is due to truncating the ascent rate preference, then effectively rounding up the time to reach each stop to 2s intervals. The result being that setting the ascent rate to 10m/min results in 20s to ascend 3m (9m/min), when it should be exactly 18s. Reported-by: John Smith <noseygit@hotmail.com> Reported-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-24Don't erroneously mark the cylinder pressure red - second tryGravatar Stefan Fuchs
Second attempt to do the thing with the red background color for cylinder start and end pressure correctly. This now should cover all scenarios. This rewrites and partitially reverts commit b8e044d Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-13Correctly trigger update of cylinder table trash icons in plannerGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11Correct trash or trashforbidden icon and tooltip in cylinder tableGravatar Stefan Fuchs
Display the correct trash or trashforbidden icon and tooltip in the cylinder table. This should fit together with if it is really possible to remove a cylinder. Search for "same gas" based on used cylinders only. Otherwise one could remove a used cylinder because there is an unused cylinder with same gas. ToDo: In planner update trash icon on change of planner points. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11Add units (m or ft) for MOD and MND in cylinder table in plannerGravatar Stefan Fuchs
We do display the unit for "Gas change at" today so we should also display it for MOD and MND. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11Merge branch 'master' of https://github.com/dje29/subsurfaceGravatar Dirk Hohndel
2017-03-11Use abbreviations with dots.Gravatar Martin Měřinský
2017-03-11Use 'Temp.' for abbreviations.Gravatar Martin Měřinský
2017-03-11Cyl > CylinderGravatar Martin Měřinský
2017-03-11Change type of divedatepoint.depth to depth_tGravatar Robert C. Helling
... for consistency, while we are at it. There are still some internal depth variables which are ints somebody might take a go at those. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-11Make depth conversion work for negative depthsGravatar Robert C. Helling
This is needed in the altitude pressure conversion as there negative altitudes are possible (for diving in the netherlands or the Dead Sea). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-11Minimum gas calculation - Calculations and UI parametersGravatar Stefan Fuchs
Add minimum gas calculation to planner output. Add the two UI parameters prefs.sacfactor and prefs.problemsolvingtime. Connect UI signals and slots for recalculation of diveplan. Disable minimum gas calculation if there was already a warning before. If minimum gas result is larger then cylinder start pressure give warning message instead of result. Add line break before pO2 warnings but only if warnings exist. Signed-off-by: Joachim Ritter <jritter@bitsenke.de> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11Don't erroneously mark the cylinder pressure red and set font italicGravatar Stefan Fuchs
In the cylinder table today the cylinder start and end pressure fields are marked red and the end pressure font is set to italic if cyl->end is 0. But sometimes with planned dives there is no cyl->end but only cyl->sample_end. This is taken into account now. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11Fix cyclinder table issue "workingpressure" in plannerGravatar Stefan Fuchs
Fixes the issue that the cylinder table in the planner is messed up after changing the table header. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-08Change calls to rint into lrint avoiding conversion warningsGravatar Jeremie Guichard
Using gcc option "-Wfloat-conversion" is useful to catch potential conversion errors (where lrint should be used). rint returns double and still raises the same warning, this is why this change updates all rint calls to lrint. In few places, where input type is a float, corresponding lrinf is used. Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-05Don't clear plan when (re-) planningGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04Initialize cylinder indexGravatar Dirk Hohndel
Otherwise it's possible for an uninitialized value to be used in addStop which can cause crashes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04Ensure correct length of the created diveGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04Only honor drop stone mode when planning a diveGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04Implement manual setting of depthGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-26Call the cylinder working pressure "starting pressure" in plannerGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-17Handle negative dates (before the epoch) betterGravatar Linus Torvalds
The Qt model sorting for the dive date was using a unsigned number, which doesn't work for dates before 1970. Also, the dive date parsing got the year 1900 wrong. Not that we really care, because other parts of date handling will screw up with any date before the year 1904. So if you claim to be diving before 1904, you get basically random behavior. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-15Always use emitDataChanged() in diveplannermodel.cppGravatar Stefan Fuchs
Use the function in every place instead of once using it and once copying the code again. No functional change. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-02-04Let cylinderid = -1 mean same gas as beforeGravatar Robert C. Helling
It's not too clever to give 0 a special meaning (as here: use same gas as for previous leg) when 0 is a legitimate value. This should solve Willem's gas disappearance problem when reediting a dive in the planner. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-02-03Revert "In statistics, ignore gas use of planned dives"Gravatar Dirk Hohndel
This reverts commit 1d8662006cbb5edae941315e30ede381c23a817b. Mistakenly pushed to master Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-02In statistics, ignore gas use of planned divesGravatar Robert C. Helling
When merged with real dives, those would double count otherwise. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-23Reenable Ctrl-Click to delet all further dive points in plannerGravatar Robert C. Helling
This is needed to make "Edit dive in planner" work reasonable. Partly undoes f432b764 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-23Allow user to disable a cylinder in plannerGravatar Robert C. Helling
In the cylinder table, the last column ("use") always showed OC-GAS. Editing was enabled, but the user had to guess to enter a small integer meaning dilluent or CCR oxygen cylingder. I guess, nobody has ever done that. This patch makes this column clickable. A click toggles if the cylinder is used for planning or not. This wait it is much easier to investigate the consequences of gas loss on a plan. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-23Don't creat zero minute legs for gas switchen when replanningGravatar Robert C. Helling
Gas switches appear as special samples with zero or one second duration. Those can be confusing when they appear as zero duration in the dive plan when replanning, so better suppress theose. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-16Revert "Show both the nominal and "real" size for an imperial cylinder"Gravatar Dirk Hohndel
This reverts commit adaeb506b7a1485cab741f12450abeb76e109276. commit a8e8d56ec016 ("Tweak cylinder equipment tooltips") does a much better job allowing the user to know the true volume of the cylinder (given the gas entered) and clutters the UI a lot less.
2017-01-16Tweak cylinder equipment tooltipsGravatar Linus Torvalds
While playing around with the current subsurface, I realized that while we give the gas volume and Z factor for the beginning/end pressures in the newly added tooltips, there is no way to actually see that same information for the working pressure. So if you have filled in cylinder type information, but don't have any actual gas usage information, there will be no cylinder tooltips at all. But you might still want to know what the actual volume for a particular cylinder is, and what the Z value for that working pressure is. So this tweaks the tool-tips a bit. When mousing over the pressure fields (ie "working pressure", "start" and "end"), it now always gives the cylinder gas volume and Z factor for that pressure, so for example on an AL72 that has a working pressure of 3000 psi and that contains air the tooltip will say: 69 cuft, Z=1.040 when you mouse over the working pressure field (that's obviously with imperial units, in metric you'll see liters of gas). When mousing over the type/size field, it gives the used gas amounts, ie something like this: 37 cuft (82 cuft -> 45 cuft) but if the cylinder doesn't have starting/ending pressures (and thus no used gas information), this patch will make subsurface show the working pressure data instead, so that you at least get something. This all seems more useful than what my first version gave. NOTE! This makes commit adaeb506b7a1 ("Show both the nominal and "real" size for an imperial cylinder") kind of pointless. You now see the real size in the tooltip when you mouse over the size, and now it actually works both for imperial and metric people, so the tooltip is in many ways the better model. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-12Add cylinder equipment tooltips with gas volumeGravatar Linus Torvalds
This adds tooltips for the equipment tab for each cylinder, showing the amount of gas used. When you mouse over the size and working pressure fields, the tooltip will show the amount of gas used (along with start and end gas volumes). And when you mouse over the start and end pressures, it will show the start and end gas volumes, and the Z factor used. I started doing this because of the gas volume questions in the last day or two (and a few from a few weeks ago). When even Robert Helling starts wondering about the effects of compressibility on the SAC calculation, our numbers are clearly too opaque. With these tooltips, at least you can see what went into the used gas calculations, instead of having to add debugging options to print out Z factors. [ This patch also adds a "rint()" to get the rounding right in the gas_volume() function. Although rounding to the nearst milliliter really doesn't matter, it's the right thing to do after doing FP calculations ;^] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-01-07Merge branch 'plannerSettings'Gravatar Dirk Hohndel
2017-01-07Set planner settings with SettingsObjectWrapperGravatar Rick Walsh
By using SettingsObjectWrapper, the planner settings can be saved and restored correctly Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-06Rename prefs.deco_mode to prefs.planner_deco_modeGravatar Robert C. Helling
This is to avoid confusion with planner.display_deco_mode. When accessing the "current deco mode" use the decoMode() helper function. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-12-26Remove unused variableGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-24Provide phots summary on dive list (Part 2)Gravatar Willem Ferguson
Please apply this patch on top of the previous patch with the same title. 1) Provide icons with white margin to look more like photos 2) Optimise code, following Robert's suggestions. 3) Column heading for photos column is now: Photos. This takes up extra horizontal space but makes the user interface more understandable. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-24Provide photos summary on dive listGravatar Willem Ferguson
1) Add an extra column to dive list, just left of Locality field. 2) For each dive, give summary of photos as follows: i) no photos: no icon in that column ii) photos taken during dive: show icon of fish iii) photos taken before/after dive: show icon of sun iv) photos taken during as well as before/after dive: show icon with both fish and sun 3) Provide information for the sort operation to work on this column of the dive list. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-09Use fake profile when replanning dives without samplesGravatar Robert C. Helling
This can happen when the user asks to replan a dive that was imported from CSV. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-27Planner: populate gaslist for initial simple diveGravatar Rick Walsh
Call GasSelectionModel::instance()->repopulate() when creating the initial simple dive. Without this call, the gas selection dropdown list does not work in the DivePLannerPointsModel table until the cylinders table has been edited. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24Separate VPM-B conservatism preference for planner and profileGravatar Rick Walsh
Separate the VPM-B conservatism preference into diveplan.vpmb_conservatism for planning dives and prefs.vpmb_conservatism for profile ceiling display of saved dives. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24Rename conservatism_level to vpmb_conservatismGravatar Rick Walsh
Make the variable purpose less ambiguous Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>