From e2fe196d82f7fb67c960cebbcd8f7dd0245f33c0 Mon Sep 17 00:00:00 2001 From: Salvador Cuñat Date: Fri, 17 Mar 2017 23:10:36 +0100 Subject: smtk-import fix is_same_cylinder() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add return value to the gasmix condition, and fix the rest of the conditions. Signed-off-by: Salvador Cuñat --- smtk-import/smartrak.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'smtk-import/smartrak.c') diff --git a/smtk-import/smartrak.c b/smtk-import/smartrak.c index a525409b6..c7fadacf5 100644 --- a/smtk-import/smartrak.c +++ b/smtk-import/smartrak.c @@ -424,14 +424,15 @@ static void smtk_build_tank_info(MdbHandle *mdb, cylinder_t *tank, char *idx) bool is_same_cylinder(cylinder_t *cyl_a, cylinder_t *cyl_b) { // different gasmixes (non zero) - if (gasmix_distance(&cyl_a->gasmix, &cyl_b->gasmix) != 0 && + if (cyl_a->gasmix.o2.permille - cyl_b->gasmix.o2.permille != 0 && cyl_a->gasmix.o2.permille != 0 && cyl_b->gasmix.o2.permille != 0) + return false; // different start pressures (possible error 0.1 bar) - if (!abs(cyl_a->start.mbar - cyl_b->start.mbar) <= 100) + if (!(abs(cyl_a->start.mbar - cyl_b->start.mbar) <= 100)) return false; // different end pressures (possible error 0.1 bar) - if (!abs(cyl_a->end.mbar - cyl_b->end.mbar) <= 100) + if (!(abs(cyl_a->end.mbar - cyl_b->end.mbar) <= 100)) return false; // different names (none of them null) if (!same_string(cyl_a->type.description, "---") && -- cgit v1.2.3-70-g09d2