From 4a1632732208d417f160d0c50ec01e53db508623 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sun, 9 Nov 2014 09:20:16 +0100 Subject: [PATCH] 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. --- src/atomics_cobalt_parser.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/atomics_cobalt_parser.c b/src/atomics_cobalt_parser.c index ce17100..d0eda5c 100644 --- a/src/atomics_cobalt_parser.c +++ b/src/atomics_cobalt_parser.c @@ -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;