Fix the tank working pressure for the Cobalt.

The difference between CUFT@PSI and CUFT@BAR is only for the Cobalt user
interface, to allow the user to enter the tank volume independent of the
units configured in the main preferences. Internally the working
pressure is always stored in psi.
This commit is contained in:
Jef Driesen 2014-11-09 09:20:16 +01:00
parent 52a9dc3947
commit 4a16327322

View File

@ -182,14 +182,10 @@ atomics_cobalt_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, un
p += SZ_HEADER + SZ_GASMIX * flags;
switch (p[2]) {
case 1: // Cuft at psi
tank->type = DC_TANKVOLUME_IMPERIAL;
tank->volume = array_uint16_le(p + 8) * CUFT * 1000.0;
tank->workpressure = array_uint16_le(p + 10) * PSI / BAR;
break;
case 2: // Cuft at bar
tank->type = DC_TANKVOLUME_IMPERIAL;
tank->volume = array_uint16_le(p + 8) * CUFT * 1000.0;
tank->workpressure = array_uint16_le(p + 10);
tank->workpressure = array_uint16_le(p + 10) * PSI / BAR;
break;
case 3: // Wet volume in 1/10 liter
tank->type = DC_TANKVOLUME_METRIC;