subsurface/qt-models
Willem Ferguson 9a8bab21c9 Improve profile display in planner
This patch allows the planner to save the last manually-entered
dive planner point of a dive plan. When the plan has been saved
and re-opened for edit, the time of the last-entered dive planner
point is used to ensure that dive planning continues from the same
point in the profile as was when the original dive plan was saved.
Mechanism:

1) In dive.h, create a new dc attribute dc->last_manual_time
   with data type of duration_t.
2) In diveplanner.c, ensure that the last manually-entered
   dive planner point is saved in dc->last_manual_time.
3) In save-xml.c, create a new XML attribute for the <divecomputer>
   element, named last-manual-time. For dive plans, the element would
   now look like:
   <divecomputer model='planned dive' last-manual-time='31:17 min'>
4) In parse-xml.c, insert code that recognises the last-manual-time
   XML attribute, reads the time value and assigns this time to
   dc->last_manual_time.
5) In diveplannermodel.cpp, method DiveplannerPointModel::loadfromdive,
   insert code that sets the appropriate boolean value to dp->entered
   by comparing newtime (i.e. time of dp) with dc->last_manual_time.
6) Diveplannermodel.cpp also accepts profile data from normal dives in
   the dive log, whether hand-entered or loaded from dive computer. It
   looks like the reduction of dive points for dives with >100 points
   continues to work ok.
The result is that when a dive plan is saved with manually entered
points up to e.g. 10 minutes into the dive, it can be re-opened for edit
in the dive planner and the planner re-creates the plan with manually
entered points up to 10 minutes. The rest of the points are "soft"
points, shaped by the deco calculations of the planner.

Improvements: Improve code for profile display in dive planner

This responds to #1052.
Change load-git.c and save-git.c so that the last-manual-time is
also saved in the git-format dive log.

Several stylistic changes in text for consistent C source code.

Improvement of dive planner profile display:

Do some simplification of my alterations to diveplannermodel.cpp

Two small style changes in planner.c and diveplannermodel.cpp
as requested ny @neolit123

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
2018-01-19 12:38:11 +02:00
..
cleanertablemodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
cleanertablemodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
CMakeLists.txt Pictures tied to profile are not supported on mobile 2018-01-10 21:28:02 +01:00
completionmodels.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
completionmodels.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
cylindermodel.cpp Remove superfluous QScopedPointer<>s in singletons 2017-12-24 11:04:10 -08:00
cylindermodel.h Planner: Autom. move first datapoint gas to first gaslist position 2017-10-16 17:14:17 +02:00
divecomputerextradatamodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputerextradatamodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputermodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
divecomputermodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
diveimportedmodel.cpp Only call autogroup when it's enabled 2017-11-25 08:12:28 -08:00
diveimportedmodel.h QML UI: clear the previous list when downloading 2017-06-16 01:22:44 -07:00
divelistmodel.cpp mobile: fix crash on delete dive from divelist 2018-01-10 20:34:16 +01:00
divelistmodel.h mobile: fix crash on delete dive from divelist 2018-01-10 20:34:16 +01:00
divelocationmodel.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
divelocationmodel.h Remove unused method LocationInformationModel::addDiveSite() 2017-11-26 23:37:01 +01:00
divepicturemodel.cpp beginInsertRows requires last >= first 2017-12-24 08:25:21 -08:00
divepicturemodel.h Implement different zoom levels for dive photos tab 2017-12-18 12:07:10 -08:00
diveplannermodel.cpp Improve profile display in planner 2018-01-19 12:38:11 +02:00
diveplannermodel.h Move function to proper place 2018-01-10 11:04:24 +01:00
diveplotdatamodel.cpp Typo: indice -> index 2018-01-10 21:25:02 +01:00
diveplotdatamodel.h Unused code: remove CCRMax() and used macro 2018-01-10 16:45:42 +01:00
divetripmodel.cpp Use helper function empty_string() instead of manual checks 2018-01-11 06:07:13 +01:00
divetripmodel.h Display units in dive list table based on prefs option 2017-10-09 11:49:29 +03:00
filtermodels.cpp cleanup: Argument cannot be negative 2017-12-28 17:30:25 +01:00
filtermodels.h Introduce negate-toggle buttons to filter lists 2017-12-26 13:08:49 -08:00
gpslistmodel.cpp Unused code: GpsListModel::addGpsFix() 2018-01-10 16:45:42 +01:00
gpslistmodel.h Unused code: GpsListModel::addGpsFix() 2018-01-10 16:45:42 +01:00
maplocationmodel.cpp cleanup: Uninitialized scalar field 2017-12-28 17:30:25 +01:00
maplocationmodel.h map-widget: allow real-time updates of edited markers 2017-11-09 12:40:25 -08:00
messagehandlermodel.cpp Android: write appLog to file 2017-07-09 17:40:29 -07:00
messagehandlermodel.h Make message handler write to console as well 2017-06-11 13:55:41 -07:00
models.cpp Move function to proper place 2018-01-10 11:04:24 +01:00
models.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
ssrfsortfilterproxymodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
ssrfsortfilterproxymodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
tankinfomodel.cpp Remove superfluous QScopedPointer<>s in singletons 2017-12-24 11:04:10 -08:00
tankinfomodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
treemodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
treemodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weightmodel.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weightmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
weigthsysteminfomodel.cpp Remove superfluous QScopedPointer<>s in singletons 2017-12-24 11:04:10 -08:00
weigthsysteminfomodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
yearlystatisticsmodel.cpp Creation of dive duration string and surface interval string 2017-05-26 15:50:52 -07:00
yearlystatisticsmodel.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00