From a74d4ca14d63f70470735bf0d872ba955be5d099 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 27 May 2019 21:23:03 +0200 Subject: [PATCH] Simplify the detection of air integrated models --- src/mares_iconhd_parser.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mares_iconhd_parser.c b/src/mares_iconhd_parser.c index 134e79e..e8a9a82 100644 --- a/src/mares_iconhd_parser.c +++ b/src/mares_iconhd_parser.c @@ -552,6 +552,8 @@ mares_iconhd_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t // Previous gas mix - initialize with impossible value unsigned int gasmix_previous = 0xFFFFFFFF; + unsigned int isairintegrated = (parser->model == ICONHDNET || parser->model == QUADAIR || parser->model == SMARTAIR); + unsigned int time = 0; unsigned int offset = 4; unsigned int nsamples = 0; @@ -647,8 +649,7 @@ mares_iconhd_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t nsamples++; // Some extra data. - if ((parser->model == ICONHDNET || parser->model == QUADAIR || parser->model == SMARTAIR) && - (nsamples % 4) == 0) { + if (isairintegrated && (nsamples % 4) == 0) { // Pressure (1/100 bar). unsigned int pressure = array_uint16_le(data + offset); if (gasmix < parser->ntanks) {