CCR code: Change to sample structure

1) All the variables in the sample structures are strongly typed
2) Two additional types were declared in units.h:
     o2pressure_t
     bearing_t
3) The following variables were added:
     diluentpressure
     o2setpoint
     o2sensor[3]
4) Changes to a number of files were made to chanf
     sample->po2 to sample->po2.mbar
     bearing to bearring.degrees

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Willem Ferguson 2014-06-03 19:21:41 +02:00 committed by Dirk Hohndel
parent 1fec6453a2
commit eaf6d56487
11 changed files with 64 additions and 51 deletions

View file

@ -198,7 +198,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
sample->ndl.seconds = ndl;
sample->stoptime.seconds = stoptime;
sample->stopdepth.mm = stopdepth;
sample->po2 = po2;
sample->po2.mbar = po2;
sample->cns = cns;
}
sample = prepare_sample(dc);
@ -225,7 +225,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
sample->heartbeat = value.heartbeat;
break;
case DC_SAMPLE_BEARING:
sample->bearing = value.bearing;
sample->bearing.degrees = value.bearing;
break;
case DC_SAMPLE_VENDOR:
printf(" <vendor time='%u:%02u' type=\"%u\" size=\"%u\">", FRACTION(sample->time.seconds, 60),
@ -237,10 +237,10 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
#if DC_VERSION_CHECK(0, 3, 0)
case DC_SAMPLE_SETPOINT:
/* for us a setpoint means constant pO2 from here */
sample->po2 = po2 = rint(value.setpoint * 1000);
sample->po2.mbar = po2 = rint(value.setpoint * 1000);
break;
case DC_SAMPLE_PPO2:
sample->po2 = po2 = rint(value.ppo2 * 1000);
sample->po2.mbar = po2 = rint(value.ppo2 * 1000);
break;
case DC_SAMPLE_CNS:
sample->cns = cns = rint(value.cns * 100);