in Calculate mode: fix the tank change bug
eianlei opened this issue · comments
There is a bug in tank change. Now if you set change depth to 21 or 6m, it does not change at 21 m or 6m, but above that. Deco is done first with the previous tank, and only after deco is done is the tank changed! Workaround is to set changeDepth to 22 and 7 m.
pydplan_profiletools.py: calculatePlan()
block elif divephase == DivePhase.ASC_T:
line 365, needs to have else statement, like this:
if endDepth <= diveplan.changeDepth:
endDepth = diveplan.changeDepth
divephase = DivePhase.STOP_ASC_T
else:
tanksCheck(diveplan, DivePhase.ASC_T, beginDepth, endDepth, intervalMinutes, runtime=runtime)
and then also to lin 440
if divephase == DivePhase.STOP_ASC_T:
# stop for a tank change,
continue