[PATCH] Add average depth from OSTC/OSTC3 logbook

Anton Lundin glance at acc.umu.se
Wed Jan 21 00:59:31 PST 2015


On 21 January, 2015 - Jef Driesen wrote:

> On 2015-01-21 08:38, Anton Lundin wrote:
> > static const hw_ostc_layout_t hw_ostc_layout_ostc = {
> > 	3,  /* datetime */
> > 	8,  /* maxdepth */
> >+	45, /* avgdepth */
> > 	10, /* divetime */
> > 	15, /* atmospheric */
> > 	43, /* salinity */
> >@@ -121,6 +123,7 @@ static const hw_ostc_layout_t hw_ostc_layout_ostc = {
> > static const hw_ostc_layout_t hw_ostc_layout_frog = {
> > 	9,  /* datetime */
> > 	14, /* maxdepth */
> >+	UNSUPPORTED, /* avgdepth */
> > 	16, /* divetime */
> > 	21, /* atmospheric */
> > 	43, /* salinity */
> 
> This fails to compile because UNSUPPORTED isn't defined. According to the
> frog documentation the average depth is stored at offset 45, just like the
> ostc.
> 

Ah, thats because the UNSUPPORTED flag only exists in the subsurface
branches, and if its at offset 45 it can easily be fixed.

Btw. From where have you gotten any frog documentation? Have you gotten
it straight from HW? As far as i know, none have bin published, at least
not on bitbucket where i've found the OSTC{2,3} documentation.

> >+		case DC_FIELD_AVGDEPTH:
> >+			if (version == 0x22)
> >+				return DC_STATUS_UNSUPPORTED;
> >+			*((double *) value) = array_uint16_le (data + layout->avgdepth) /
> >100.0;
> >+			break;
> 
> With the above info, you no longer need to special case the frog here.
> 
> PS: The average depth field is not implemented for any backend. I added the
> field because I thought it made sense at that time. But most applications
> seem to prefer to calculate avg depth from the profile (which has the
> advantage of being able to take into account preferences like ignore shallow
> samples, etc), so I just never bothered to implement this.
> 

Yea, i saw the field when i dug around in the OSTC{2,3} documentation to
try to figure out other things, so i thought id implement it.

When i check, the eonsteel backed actually implements it.


Maybe it should raise some deprecation warning in dc_parser_get_field?


//Anton


-- 
Anton Lundin	+46702-161604


More information about the devel mailing list