aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-05-31Merge branch 'latest'Gravatar Dirk Hohndel
2014-05-31Allow editing segment duration. This shifts all following waypoints.Gravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: don't recreate the dive while cleaning up the widgetsGravatar Dirk Hohndel
Otherwise the change to the Cylinder widget would trigger a recreation of the dive in an inconsistent state. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: remove check for empty diveplanGravatar Dirk Hohndel
This was introduced in commit fc1336107930 ("Don't crash if we try to save a empty plan") - but it doesn't seem to make any sense. It is perfectly reasonable for the diveplan to have no datapoints at this spot - we are just about to call createTemporaryPlan() which will fill those datapoints from the mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: don't do unnecessary work on empty dive plansGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Remove unused structure memberGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: remove pointless codeGravatar Dirk Hohndel
This never made any sense. If we have NO datapoints then go and cancel the plan? And anyway, we already check this higher up in the call stack. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: after freeing the plan, throw away the pointerGravatar Dirk Hohndel
Otherwise we'll happily go back and access the freed data structures later. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: make sure all cylinders have a sane depthGravatar Dirk Hohndel
When copying cylinders from an existing dive, the mod of the cylinder might not be set. Assume a conservative 1.4 pO2 and fill in those data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-30Planner: start the ascend with the strongest allowed deco mix.Gravatar Robert C. Helling
In analyze_gaslist() we were only keeping gases that had their .depth above the current depth, i.e. where we could switch to in the future. Now we take note as well of the strongest gas that we could have already switched to and switch to it before we attempt to ascend. [Dirk Hohndel: minor whitespace and code cleanup] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29HTML: Quote the '<' and '>' operators before inserting break tagsGravatar Gehad elrobey
The smaller than and greater than operators should be quoted before inserting the <br> tags in HTML. Otherwise breaks will be quoted which corrupts the format. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Do not offer an editor when double-clicking REMOVE on the planner.Gravatar Tomaz Canabrava
The planner would offer an text-editor if the user double clicked it's remove column. forbidding that. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Do not show 'trash' icon for deco stops.Gravatar Tomaz Canabrava
Besides not deleting them, we shouldn't offer the icon for it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Do not remove a Deco Stop by clicking on the trashGravatar Tomaz Canabrava
This patch forbids deletion of the Deco Stop from the QTableView that holds the model. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Hide the DiveHandlers that are not entered by mouse.Gravatar Tomaz Canabrava
We need to create them, even if we don't display ( only because it was a pain to correctly track them from the model ) - so, hide them if it's not entered by mouse, but a deco one. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Hide DiveHandlers and GasTexts when on profile mode too.Gravatar Tomaz Canabrava
When switching from PLAN or ADD mode to PROFILE, we kept the dive handlers visible, not anymore. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Fix CMakeGravatar Tomaz Canabrava
save-html was not there yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Planner: only update the plan after the cylinder data has been updatedGravatar Dirk Hohndel
This way we avoid trying to create a dive from the plan while the plan references the cylinder that has just been changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Planner: clean up the function that tracks our gasesGravatar Dirk Hohndel
This doesn't add gases. It just makes sure they are there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Show the calculated deco stops in the planner tableGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Planner: track gas consumption in cylinders and samplesGravatar Dirk Hohndel
This commit is a little bigger than I usually prefer, but it's all somewhat interconnected. - we pass around the cylinders throughout the planning process and as we create the plan we calculate the gas consumption in every segment and track this both in the end pressure of the cylinder and over time in the samples - because of that we no longer try to calculate the gas consumption after being done planning; we just use what we calculated along the way - we also no longer add gases during the planning process - all gases have to come from the list of cylinders passed in (which makes sense as we should only use those gases that the user added in the UI or inherited from a the selected dive (when starting to plan with a dive already selected) With this patch I think we are close do being able to move all of the planning logic back into the planner.c code where it belongs. The one issue that still bothers me is that we are juggling so many dive structures and then keep copying content around. It seems like we should be able to reduce that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Don't assume that pressures are always positiveGravatar Dirk Hohndel
When planning a dive, the dive could use more gas than is in the cylinder. So getting a negative end pressure is a useful indication to the user that there plan might not be a good one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Planner: remove infobox overlay and enable calculated ceilingGravatar Robert C. Helling
Make the infobox invisible in planner (it really doesn't provide a lot of useful info while planning a dive and more likely gets in the way). Make the calculated ceiling always visible in planner and add mode. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Small whitespace fixesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Need to quote some more HTML charactersGravatar Miika Turkia
Double quote will break HTML export when it is e.g. within notes. Similarly < and > characters are treated as HTML tags unless quoted properly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Export tags in json arrayGravatar Gehad elrobey
This will help in searching based on tags Also some minor coding-style fixes Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Fix json exporter outputGravatar Gehad elrobey
The note is prefixed by a colon Fix the output of Null values of dive master, dive suit, location and buddy. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Some fixes for the json exporterGravatar Gehad elrobey
- check for zero Kelvin degrees temperature - show dives in group of trips - show the number of dives starting from 1 as in subsurface application. - produce localized output as selected in the user's preferences. - use &lt; and &gt; on the arrow buttons in the HTML file. - Call the translation functions for text strings Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29HTML list exporterGravatar Gehad elrobey
Exporting the raw dive list into JSON format for later viewing with html and js files. Also some worldmap code organizations. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Planner: record the new dive at the correct timeGravatar Dirk Hohndel
We don't want to do this when calling plan() from createTemporaryPlan() - we only want to record the dive at the end of createPlan(). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Planner: always recreate staging diveGravatar Dirk Hohndel
Instead of even trying to keep one around (which then could cause all kinds of trouble) we now always delete it at the end of the planner. So simply always recreate one when starting the planner (and make sure that the staging dive has always been cleared out, first). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Planner: add missing disclaimerGravatar Dirk Hohndel
This may not be the best way to do it, but it's better than just printing "(null)". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Planner: make sure stagingDive is reset to NULLGravatar Dirk Hohndel
If we first ADD a dive and then PLAN a dive, stagingDive first was an alias to the current_dive (for ADD) - we need to make sure that when PLAN is started, a new dive is allocated. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Add dive: only copy cylinders when necessaryGravatar Dirk Hohndel
If the stagingDive is just an alias for the current_dive (as it is in dive ADD mode), there's no need to copy the cylinders; they are already there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Fix edition of manually added dives.Gravatar Tomaz Canabrava
This patch correctly sets the state of the planner to "NOTHING" after trying to edit a manually added dive. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Fix crash on adding / removing a dives from add menuGravatar Tomaz Canabrava
This patch removes some inconsistencies that were happening on the add dive / cancel actions. a bit of legacy code from the old system was still in, which made things quite... EXPLOSIVE. This fixes restoring the selection only if we have a selection and not deleting the temporary dive twice. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Move code from the Planner that doesn't belongs there.Gravatar Tomaz Canabrava
Moved the connections between DivePlannerPointsModel and MainWindow from inside the Planner class to the MainWindow. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Planner: set up a cylinder, even if no current dive is selectedGravatar Dirk Hohndel
If there was no current dive we didn't set up any cylinder at all which was a bit awkward as we use AIR but have no cylinder corresponding to it, which breaks assumptions elsewhere. Instead we use either the default cylinder or make one up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Planner: really fix crash after aborting plannerGravatar Dirk Hohndel
Duh. We had to reload the list (and make sure the internal data structures are recreated as well) before restoring the selection. I also switched to simply accessing the widget directly, instead of via the dive_list() call. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Planner: prevent crash when canceling plan with existing dive listGravatar Dirk Hohndel
There is still something seriously wrong here. For now let's just not restore the selection and at least this prevents us from crashing. But I still don't understand why it crashes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Dive list: use helper function when restoring selectionGravatar Dirk Hohndel
Looping over the individual dives will be very slow if there are many of them, as the profile will try to render each of them in succession. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Fixes showing the Empty Profile when Add / Plan dive is cancelled.Gravatar Tomaz Canabrava
for some reason the next selected dive is NULL after cancelling the plan. I'm investigating. This patch fixes the show of the empty profile and it also untangles some parts of the code, keeping the mainwindow where it should belong : the mainwindow. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Minor cleanupGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Try to clear out the profile when dive list is emptyGravatar Dirk Hohndel
This only partially works. If I start from an empty dive list, plan a dive, then abort, there are still leftovers in the profile widget. Hitting Ctrl-W clears that out. But it just runs the same cleanUpEmpty() again... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Dive planner: remove the fake dive earlier on cancelGravatar Dirk Hohndel
This way it's already gone from the dive list before it gets reprocessed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Dive planner: remember the selection before new dives get handledGravatar Dirk Hohndel
On an empty dive list we would remember the new dive (which gets auto-selected since it's the only dive) and then crash when we try to restore that selection after cancel (in which case that new dive is gone). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Dive add: remove duplicate codeGravatar Dirk Hohndel
This is already done when we create the fake dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-27Dive add: fix crash when cancelingGravatar Dirk Hohndel
We need to reset the editMode right away, otherwise all the changes to the input field (when resetting the data after the user cancels) will cause Subsurface to crash as current_dive will temporarily be NULL. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-27Much, much smarter way of finding the TagsGravatar Tomaz Canabrava
The old way manually implemented a parser, where it could simply call a regexp (or, in my case, a QChar) that will split the QString into many, to find the beginning and end of the strings on the tags. This patch also fixes a Qt5 off-by-one bug on the tag Visualization. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-27Fix manually adding diveGravatar Dirk Hohndel
I'm sure canceling the plan when saving an added dive made sense at some point for some reason. Right now it makes things crash, so let's not do it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>