On Thu, May 29, 2014 at 3:49 PM, Robert C. Helling <[email protected]> wrote:
>
> On 29 May 2014, at 17:26, Dirk Hohndel <[email protected]> wrote:
>
>> I've been thinking about this... the planner could do a much better job
>> tracking tanks and gases. Right now this is a mess, left over from the old
>> planner code written for Subsurface 3.
>>
>> Instead of having create_dive_from_plan re-create the cylinders as it
>> parses the plan, it should use the cylinders that were added in the UI.
>> And then as it walks the plan, it should update the samples to include
>> cylinderpressure values for each segment, based on the SAC rate that was
>> set (and yes, this includes adding samples at time - 1 before every gas
>> switch.
>>
>> This requires a bit more tracking of data but at the same time should get
>> rid of quite a bit of awkward code that's there today and will give very
>> pleasing visualization of gas use during planning. If done right it will
>> even respond to changes to the cylinder type in the plan, etc.
>>
>> Robert, does that sound reasonable?
>> Is this something you'd like to tackle? Or should I add this to my TODO
>> list?
>
> indeed the problem is that the information is kept (at least in part) in 
> several data structures (model (i.e. UI), struct dive, dive plan and in the 
> deco part as well in a list of depth at which something happens). We should 
> come up at least with a good decision which is the primary place that gets 
> copied to the others. I have to admit I haven’t understood this model thing 
> well enough to have an informed opinion if that is a good primary place as 
> you seem to suggest.

The code right now is a bit of mess. What we *should* do:

- the model shouldn't change any datastructure, it should call a c -
function passing the data structure and the changed values.
- the view shouldn't change any datastructures, it should call a c -
function passing the data structure and the changed values.

right now, the *logic* of the planner is on planner.c /
diveplannerpointsmodel.cpp, should be moved to planner.c

the planner is an awesome place to test the unittests, I will start there. ;p

> I am happy to look into that but it might take some time. So, if somebody 
> else wants to look into that, great. If not, it’s one of the things on my 
> todo list for the planner.
>
> Best
> RObert
>
> --
> .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
> Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics
>                       Scientific Coordinator
>                       Ludwig Maximilians Universitaet Muenchen, Dept. Physik
> print "Just another   Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
>     stupid .sig\n";   http://www.atdotde.de
>
> _______________________________________________
> subsurface mailing list
> [email protected]
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to