diff --git a/src/asammdf/blocks/v2_v3_blocks.py b/src/asammdf/blocks/v2_v3_blocks.py index ee0a34f97..cfea9a7b9 100644 --- a/src/asammdf/blocks/v2_v3_blocks.py +++ b/src/asammdf/blocks/v2_v3_blocks.py @@ -1565,16 +1565,13 @@ def convert(self, values, as_object=False, as_bytes=False, ignore_value2text_con P6 = self.P6 X = values - if (P1, P4, P5, P6) == (0, 0, 0, 1): - if (P2, P3) != (1, 0): - values = values * P2 - if P3: - values += P3 - elif (P3, P4, P5, P6) == (0, 0, 1, 0): - if (P1, P2) != (1, 0): - values = values * P1 - if P2: - values += P2 + if (P1, P3, P4, P5) == (0, 0, 0, 0): + if P2 != P6: + values = values * (P2 / P6) + + elif (P2, P3, P4, P6) == (0, 0, 0, 0): + if P1 != P5: + values = values * (P1 / P5) else: try: values = evaluate(v23c.RAT_CONV_TEXT) diff --git a/src/asammdf/blocks/v4_blocks.py b/src/asammdf/blocks/v4_blocks.py index c0769b212..36531ae4a 100644 --- a/src/asammdf/blocks/v4_blocks.py +++ b/src/asammdf/blocks/v4_blocks.py @@ -3154,17 +3154,13 @@ def convert(self, values, as_object=False, as_bytes=False, ignore_value2text_con if names: name = names[0] vals = values[name] - if (P1, P4, P5, P6) == (0, 0, 0, 1): - if (P2, P3) != (1, 0): - vals = values[name] * P2 - if P3: - vals = vals + P3 - - elif (P3, P4, P5, P6) == (0, 0, 1, 0): - if (P1, P2) != (1, 0): - vals = values[name] * P1 - if P2: - vals = vals + P2 + if (P1, P3, P4, P5) == (0, 0, 0, 0): + if P2 != P6: + vals = vals * (P2 / P6) + + elif (P2, P3, P4, P6) == (0, 0, 0, 0): + if P1 != P5: + vals = vals * (P1 / P5) else: X = vals @@ -3181,16 +3177,13 @@ def convert(self, values, as_object=False, as_bytes=False, ignore_value2text_con else: X = values - if (P1, P4, P5, P6) == (0, 0, 0, 1): - if (P2, P3) != (1, 0): - values = values * P2 - if P3: - values = values + P3 - elif (P3, P4, P5, P6) == (0, 0, 1, 0): - if (P1, P2) != (1, 0): - values = values * P1 - if P2: - values += P2 + if (P1, P3, P4, P5) == (0, 0, 0, 0): + if P2 != P6: + values = values * (P2 / P6) + + elif (P2, P3, P4, P6) == (0, 0, 0, 0): + if P1 != P5: + values = values * (P1 / P5) else: try: values = evaluate(v4c.CONV_RAT_TEXT) diff --git a/src/asammdf/version.py b/src/asammdf/version.py index e768b1fd8..2b372a510 100644 --- a/src/asammdf/version.py +++ b/src/asammdf/version.py @@ -1,3 +1,3 @@ """ asammdf version module """ -__version__ = "7.3.15.dev17" +__version__ = "7.3.15.dev18"