Hallo Robert,

I have been looking at the reasons why, when editing an existing dive plan, all the dive points on the plan are indicated as "user-entered" (compare lefthand with righthand screenshots in attached image). It appears it is because of the way dives are saved in the XML dive log. Obviously, not all of the sample and dive information in memory can be stored to the XML log. They are either unnecessary or would make the log impossibly large in XML where the manually_entered sample attribute is not saved. If this were done, it would be simple to recover the exact dive plan that was saved to XML, allowing the planner to recalculate the ascent profile after the last manually-entered dive point.

The recovery of the last manually-entered data point of the dive plan is not trivial. To save that attribute with all XML dive samples is not practical. One needs a way to write only a single value to the dive log, not a value for each sample. I can think of three approaches.

1) Create a lastmanualpoint attribute of the dive XML element.

<dive number='34' divesiteid='a74c192a' date='2017-04-22' time='08:17:10' duration='102:08 min' lastmanualpoint='456'>

where the last manually-entered point would be at 456 seconds into the dive.

But how would this affect the existing system where the dive computer model attribute is used to indicate a dive has been saved by the dive planner with dive->dc->model = PLANNER?

2) In the dive structure, create an element that contains the time of the last manually-entered dive point. This could be an integer. The difficult part is that, in XML, a planner element will be required, of which the last manually-entered dive time is an attribute. e.g.

<planner lastmanualpoint='456' />

This would conflict with the present system where the dive computer model attribute is used to show that a dive has been saved by the dive planner.

3) In the section of the XML dive log containing the samples, a sample attribute could be specified at the sample point on the profile that corresponds to the last manually-entered dive point. e.g.

<sample time='21:04 min' depth='43.1 m' rbt='1:00 min' lastmanualpoint='true' />

None of the other sample elements in the profile would have a lastmanualpoint attribute, so there is no sample element with lastmanualpoint='false.

The disadvantage here is that this lastmanualpoint does not map as a sample attribute in the memory representation of the dive. Rather, it rather belongs as a dive attribute.

Whatever solution is implemented, the code that writes the XML would need to be adapted at least in two places if I remember correctly, for saving XML and for saving to git.

Once the planner has a way to recover the last manually-entered dive point, it becomes trivial to allow the planner to present the dive plan exactly as it was before it was saved to XML.

Do you have any perspectives on this?

Kind regards,

willem.




--
This message and attachments are subject to a disclaimer.
Please refer to http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf for full details.
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to