aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
AgeCommit message (Collapse)Author
2015-05-29Move DivePlotDataModel to qt-modelsGravatar Tomaz Canabrava
I think with this one I'm finished. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Move DivePictureModel to qt-modelsGravatar Tomaz Canabrava
This class will surely be used on the mobile version, and it was very tangled inside divepicturewidget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Move DivePlannerModel and CylinderModel to qt-modelsGravatar Tomaz Canabrava
Still trying to make it easier for the Mobile Port: This patch is a bit bigger than I hopped, but it was the smallest that I could get. A lot of TODO items where added where I broke the code because the current implementation would break the QML implementtion on the designer. I'll most probably fix those myself when I finish the transition to the models to the new folder. I only moved both models at once because there's an interdependency between them (seems inevitable, tough, but I'll take a better look at it later). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-08Only print gasname for a segment in planner if it differs from the previous oneGravatar Robert C. Helling
This is to avoid visual clutter when replanning logged dives. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-23Profile context menu: trigger editing of manually added diveGravatar Dirk Hohndel
Right now the way to edit the profile of a manually added dive is really counterintuitive: you have to first make some random change to the dive information, then the profile switches in to editing mode. This commit adds a simple context menu entry on the profile that is only shown when the a manually added dive is displayed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-02Introduce recreational planner modeGravatar Robert C. Helling
This adopts the planner to the needs of the recreational diver. Rather than immediately starting to ascent doing deco stops this mode, this mode stays at the last manually entered depth for the maximal time before mandantory stops appear (NDL). It does not change gas but keeps using the last used cylinder. TODO: * Grey out unused UI elements of the planner in this mode * Start ascent before gas runs out (or into reserve) * Do a 3min @ 5m safety stop. Fixes #840 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-19RulerItem2::settingsChanged() - NULL pointer dereferenceGravatar Marcos CARDINOT
The current code is dereferencing the null pointer 'profWidget'. It can cause a segmentation fault. Signed-off-by: Marcos Cardinot <mcardinot@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14Profile: fix a couple of warningsGravatar Lubomir I. Ivanov
profilewidget2.cpp:1398:25: warning: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Wparentheses] profilewidget2.cpp:1403:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14Profile: call clearHandlers() in setAddState()Gravatar Lubomir I. Ivanov
Points (handles) from the last dive ADD operation remain on the profile unless we clear them. fixes #846 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14Profile: fix potential mem leak in pointsInserted()Gravatar Lubomir I. Ivanov
The point graphics are allocated but doens't seem to be deleted anywhere. We attempt to fix that in clearHandlers(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11Better testing if the first gas is explicitGravatar Dirk Hohndel
Given that we might be adding a gas change event at t = 0 we need to check for both that and t = time_or_first_sample. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11Don't allow two gas changes at the same timeGravatar Dirk Hohndel
t = 0 isn't really special here. We shouldn't allow two gas changes at the same time, period. We also can do away with the special handling to mark the dive list changed and replot things if a gas change gets removed. That's done at the end of this function either way. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11Make sure no gas changes with negative time can be addedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11Simplify the code that replaces a gas change event at t=0Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11Removing gas change events @0:00 when new one is addedGravatar Yousef Hamza
Remove the existing gas change events @0:00 when new one is added @0:00. Signed-off-by: Yousef Hamza <jo.adam.93@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11Planner: disable mouse interaction when zoomed inGravatar Lubomir I. Ivanov
When zoomed in, things like moving planner points is not possible, but if the user attempts that, replan() -> plotDive() is called and the zoomLevel should be reset to the default value (we don't really want that), but instead it's lost for some reason (as the user reports: "Somes times, it changes to 100% which is ok"). If moving points becomes possible eventually while zoomed in, we need to figure a way to replot without resetting the zoom level in plotDive(). Fixes #851 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27Change the references to ShowError to the new notification object.Gravatar Gehad elrobey
Showing an Error message is better called from the Notification Object, So for consistency old references to showError is replaced by calling the notification object. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Fix broken connectionGravatar Tomaz Canabrava
The old way of creating the mainwindow made things a bit dependent of the order of initialization, and we don't assume that anymore. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Finish the cleanup of mainwindow.uiGravatar Tomaz Canabrava
This is the last patch in the series of clearing up the mainwindo.ui. Now to bugfixing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the ProfileWidget from mainwindow.uiGravatar Tomaz Canabrava
It is now in mainwindo.cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove information panel from mainwindow.uiGravatar Tomaz Canabrava
Now it's created in the mainwindow.cpp as part of the new way to configure the interface. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the DiveList from the mainwindow.uiGravatar Tomaz Canabrava
It's now set up from the mainwindow.cpp file. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-07Change the tooltip for bailoutGravatar Dirk Hohndel
While this text makes sense if this is a CCR dive and the diver does bail out, the more neutral text "Manual switch to OC" works in all use cases for this event, e.g. at the beginning of a dive when we manually set this dive to be OC. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-07Don't show a setpoint switch event at t=0Gravatar Dirk Hohndel
When using that to indicate the dive type at the start of the dive, it's visually strange to have an event marker. See #826 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-05CCR gas composition and gas pressure labels on dive profile: revisitedGravatar willem ferguson
This patch cleans up code for achieving the above with respect to CCR dives. The code is simplified and shortened. The display of gas lables on the profile is made consistent with the cylinder pressure closest to the graph and the gas composition above/below the cylinder pressure. The patch significantly improves the maintainability of this code. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-03Disable dive component copy/paste shortcuts when no profile showGravatar Dirk Hohndel
Instead of inventing another way to do this (and inevitably forgetting a path where this should be re-enabled) I renamed the DcShortcup related function and made them enable/disable the copy and paste shortcuts as well. Of course there now is one exception (isn't there always?): in "ADD" state we don't want to be able to switch DCs, but we do want to be able to paste. Fixes #825 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-02Don't show the plot_info table in every debug buildGravatar Dirk Hohndel
Instead add a new define SHOW_PLOT_INFO_TABLE that triggers if this debugging aid is shown. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31Update ceiling when changing dive modeGravatar Robert C. Helling
Without this patch, the user effectively cannot change the dive mode as any change is overwritten by replot copying current_dive over displayed_dive. The way out is not to call replot but only update the deco ceiling directly. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31Hide tooltip when posting a profile to FacebookGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31DiveMeanDepthItem: fix bad translated depth unitsGravatar Lubomir I. Ivanov
probably just a typo; taking the value of a (char *) will return the first char (or byte). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-29Prevent potential access to uninitialized variableGravatar Dirk Hohndel
If we have a dive with no data (e.g. from a failed import), we might never assign a value otherwise. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28Small changes to the mean depth textGravatar Dirk Hohndel
Add a tiny bit of white space to the left and display the unit as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28Implement the mean depth textGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28Remove dead codeGravatar Tomaz Canabrava
We changed this MeanDepthLine to the MeanDepthCurve (or something), no need to keep old code around. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28Hide ruler when in ADD or PLAN mode.Gravatar Tomaz Canabrava
This ruler shouldn't appear in ADD or PLAN mode, it's a bug and may crash things. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27diveplotdatamodel.cpp: use space before sensor indexGravatar Lubomir I. Ivanov
the manual uses "Sensor 1:", not sure if it breaks anything. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26Change mean depth/s to mean depth @ sGravatar Tim Wootton
Mean depth/s sounds too much like a rate of change but this referers to instantaneus mean depth at a time. Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26Heartrate sounds better than heart beatGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Fix crash with empty dive listGravatar Dirk Hohndel
Don't access current_dc unless there is a valid current_dive. Fixes #817 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Avoid overprinting of cylinder presssure labels for CCR divesGravatar willem ferguson
This patch takes the cylinder pressures of CCR dives and prints them in a non-overlapping way. Remaining issue: When the dive profile is made taller by dragging the window or the appropriate slider far down the screen, the labels move further apart; similarly, when the profle is made flat/shallow by dragging the window edge or appropriate slider up, the labels get close to each other and start to overlap. There are quite a few lines of additional code going into the patch. This is primarily because separate provisions for when po2 > p(diluent) or vice versa. In addition, I could not determine the size of the text characters which would allow much more precise placement of text. This is because the .scale member of the text is private and not available in the methods involved in printing the labels. However, the height of the vertical scale of the cylinder pressure graph can be determined [e.g. vAxis->maximum()]. This helped a lot to get the positioning of the text more or less correct. While the results of the patch is not perfect, It contributes significantly to make the profiles of Poseidon dives more readable. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Correcly look at all relevant dive computer structuresGravatar Dirk Hohndel
When calculating maxima for a dive, we need to take data from all existing dive computer structures plus potentially also a fake dive computer structure that is just passed in in order to create a meaningful profile. Commit 86c961614bfa ("Actually walk all dive computers, don't just claim to do so") missed that second case and no longer took the fake_dc into account, breaking the display of dives that don't have samples. Reported-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Don't show previous dive computer textGravatar Dirk Hohndel
There were situations when the last text was still shown. E.g. when the current file was closed and then a new dive was imported from CSV. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-23Code cleanup: CCR setpoint and o2 sensor visualisationGravatar willem ferguson
This patch does some cleaning up of the code that provides visualisation of CCR o2 sensor and o2 setpoint data. It reduces the number of conditional evalauations that are required and it improves the readability of these parts of the code. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21CCR option: display o2 sensor dataGravatar willem ferguson
This patch creates the possibility of viewing the individual sensor values when the po2 button on the profile toolbar is activated. This follows exactly the procedure for optionally displaying the setpoint values while viewing po2. A checkbox in the preferences panel determines whether sensor information is shown. By default it is set to OFF. When checked, and the po2 button is activated, sensor1 values are shown in grey, sensor2 in blue and sensor3 in brown. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19Actually walk all dive computers, don't just claim to do soGravatar Dirk Hohndel
If the first dive computer had pressure samples, but the second one (and no higher one) did, then we would draw a flat horizontal line for the tank pressure graph (but lable it with the correct pressures). This routine that is hunting for the actual maxima and minima does have to really go through all dive computers, not just "this one and up". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19Fix extreme sluggish profile over timeGravatar Tomaz Canabrava
Whoa, this deserves a good explanation. Everytime that the mouse moved in add / plan mode, or anytime a new dive was displayed on the profile, this method would be called and connect the dataModel to the modelChanged method. This added the slot in a call-vector that the fired signal would call, adding one call to the Slot per add / plan mouse move (about 20x/s) or each time a new dive was displayed. Quickly filling the vector with more than 200 - 300 calls to this same Slot. The fix is to only connect one time. this made the add / plan mode *so* much smoother... :) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-18Fix build: add missing #includesGravatar Thiago Macieira
qt-ui/profile/profilewidget2.cpp:1351:10: error: invalid use of incomplete type ‘class QDebug’ qt-ui/printlayout.cpp:141:27: error: variable ‘QPointer<ProfileWidget2> profile’ has initializer but incomplete type In commit f9ceff009b35 ("Clean up the header files") things got broken for an as of now unreliesed future version of Qt. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-18Move the heart rate graphGravatar Joakim Bygdell
Move the heart rate graph down to the same space as the tissue saturation graph so that it does not overlap with temperature or partial pressures. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-18Clean up the header filesGravatar Dirk Hohndel
Lots and lots and lots of header files were being included without being needed. This attempts to clean some of that crud up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Cache the complex items to give us a boost of speedGravatar Tomaz Canabrava
This cache give us a huge gain in performance, going from 17% moving the mouse frenetically to 9%, wich is quite acceptable. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>