Skip to content

Commit

Permalink
add warning for polynoms not supported for signal scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
ebroecker committed Aug 19, 2019
1 parent 286a3da commit f29af5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/canmatrix/formats/arxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,8 @@ def decode_compu_method(compu_method, root_or_cache, ns, float_factory):
factor = float_factory(numerator[1].text) / float_factory(denominator[0].text)
offset = float_factory(numerator[0].text) / float_factory(denominator[0].text)
except decimal.DivisionByZero:
if numerator[0].text != denominator[0].text or numerator[1].text != denominator[1].text:
logger.warning("ARXML signal scaling: polynom is not supported and it is replaced by factor=1 and offset =0.")
factor = float_factory(1)
offset = float_factory(0)
else:
Expand Down

0 comments on commit f29af5a

Please sign in to comment.