mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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> |
||
|---|---|---|
| .. | ||
| cleanertablemodel.cpp | ||
| cleanertablemodel.h | ||
| CMakeLists.txt | ||
| completionmodels.cpp | ||
| completionmodels.h | ||
| cylindermodel.cpp | ||
| cylindermodel.h | ||
| divecomputerextradatamodel.cpp | ||
| divecomputerextradatamodel.h | ||
| divecomputermodel.cpp | ||
| divecomputermodel.h | ||
| diveimportedmodel.cpp | ||
| diveimportedmodel.h | ||
| divelistmodel.cpp | ||
| divelistmodel.h | ||
| divelocationmodel.cpp | ||
| divelocationmodel.h | ||
| divepicturemodel.cpp | ||
| divepicturemodel.h | ||
| diveplannermodel.cpp | ||
| diveplannermodel.h | ||
| diveplotdatamodel.cpp | ||
| diveplotdatamodel.h | ||
| divetripmodel.cpp | ||
| divetripmodel.h | ||
| filtermodels.cpp | ||
| filtermodels.h | ||
| gpslistmodel.cpp | ||
| gpslistmodel.h | ||
| maplocationmodel.cpp | ||
| maplocationmodel.h | ||
| messagehandlermodel.cpp | ||
| messagehandlermodel.h | ||
| models.cpp | ||
| models.h | ||
| ssrfsortfilterproxymodel.cpp | ||
| ssrfsortfilterproxymodel.h | ||
| tankinfomodel.cpp | ||
| tankinfomodel.h | ||
| treemodel.cpp | ||
| treemodel.h | ||
| weightmodel.cpp | ||
| weightmodel.h | ||
| weigthsysteminfomodel.cpp | ||
| weigthsysteminfomodel.h | ||
| yearlystatisticsmodel.cpp | ||
| yearlystatisticsmodel.h | ||