[PATCH] Calculate deco stops, TTS and NDL

Dirk Hohndel dirk at hohndel.org
Wed Jun 19 11:45:39 PDT 2013


On Wed, 2013-06-19 at 20:19 +0200, Anton Lundin wrote:
> +		/* should we calculate a stop depth and time or have dc already done that? */
> +		if (entry->ceiling && !entry->stopdepth) {
> +			const int time_stepsize = 10;
> +			/* FIXME: This should be configurable */
> +			const int accent_time_per_m = 1;
> +			const int accent_per_s = 200; /* 12 m/s */

I'm not sure I understand these two constants... I read this as accent
time of 1 second per meter (that's 60m/min or pretty much "blow up the
BC and see what happens"). The next one is even better... 12 meters per
second is 43km/h or 27mph...... but it looks like you mean 20cm/s or 12
m/min :-)
Which still is faster than I like, especially for the shallower parts.
Popping up from your safety stop / last stop at 3m in 15 seconds is not
exactly smart...

So let's assume I am misunderstanding the constant names / comments :-)

> +			int next_stop;
> +			int accent_depth;
> +			int stepsize = prefs.calc_ceiling_3m_incr ? 3000 : 1000;

Why a minimum step of 1m? When calculating ceilings I'd do 10cm (which
works well for both metric and imperial people). But for actual stops I
think everyone does 10ft / 3m multiples... and the calc_ceiling_3m_incr
definitely should NOT be used to determine the stop depths for the tts
calculation.

> +		} else if (!entry->ndl) {
> +			const int time_stepsize = 60;
> +			const int max_ndl = 7200;
> +			entry->ndl = max_ndl;
> +			pi->has_ndl = TRUE;
> +
> +			/* don't try to calculate a ndl for lower values than 3m
> +			 * it would take forever */

Even 3m seems aggressive :-)
That's hours and hours and hours... and if people dive on EAN50 your
likely to run into O2 toxicity before running into deco...

> +			if (entry->depth > 3000) {
> +				entry->ndl = 0;
> +				/* stop if the ndl is above max_ndl seconds, and call it plenty of time */
> +				while (entry->ndl < max_ndl && deco_allowed_depth(tissue_tolerance, surface_pressure, dive, 1) <= 0) {
> +					entry->ndl += time_stepsize;
> +					tissue_tolerance = add_segment(depth_to_mbar(entry->depth, dive) / 1000.0,
> +							&dive->cylinder[cylinderindex].gasmix, time_stepsize, ccrdive ? entry->po2 * 1000 : 0, dive);
> +				}
> +			}
> +		}
> +

Other than that the patch looks good.

Would you mind sending a new rev?

Thanks

/D



More information about the subsurface mailing list