Closed nostar closed 6 years ago
hi nostar, thanks for this arxml-snippet. I'll have a look on it.
Still no scaling in the converted DBC file. I get these lines now for all signals:
DEBUG - arxml - No Compmethod found!! - try alternate scheme 1. DEBUG - arxml - No Compmethod found!! - try alternate scheme 2.
I fixed it, i was gonna make a diff to show the difference but I think you took out your change so it didnt make sense... here is the code that works. Basically it was separate calls of arGetChild to each child instead of one call: (starting at line 1008 of arxml.py)
#####################################################################################################
#
#####################################################################################################
if compmethod == None:
logger.debug('No Compmethod found!! - try alternate scheme 2.')
physprop = arGetChild(syssignal, "PHYSICAL-PROPS", arDict, ns)
datdefpropsvar2 = arGetChild(physprop, "SW-DATA-DEF-PROPS-VARIANTS", arDict, ns)
datdefpropscond2 = arGetChild(datdefpropsvar2, "SW-DATA-DEF-PROPS-CONDITIONAL", arDict ,ns)
if datdefpropscond2 != None:
try:
compmethod = arGetChild(datdefpropscond2, "COMPU-METHOD", arDict, ns)
except:
logger.debug('No valid compu method found for this - check ARXML file!!')
compmethod = None
unit = arGetChild(compmethod, "UNIT", arDict, ns)
if unit is not None:
longname = arGetChild(unit, "LONG-NAME", arDict, ns)
EDIT: I see now, the diff is fine its just against the original code:
--- /usr/lib/python2.7/site-packages/canmatrix/arxml.py.orig 2017-10-26 14:27:09.640931953 -0400
+++ /usr/lib/python2.7/site-packages/canmatrix/arxml.py 2017-10-26 14:26:21.804614418 -0400
@@ -1006,11 +1006,20 @@
logger.debug('No valid compu method found for this - check ARXML file!!')
compmethod = None
#####################################################################################################
- # no found compu-method fuzzy search in systemsignal:
+ #
#####################################################################################################
if compmethod == None:
- logger.debug('No Compmethod found!! - fuzzy search in syssignal.')
- compmethod = arGetChild(syssignal, "COMPU-METHOD", arDict, ns)
+ logger.debug('No Compmethod found!! - try alternate scheme 2.')
+ physprop = arGetChild(syssignal, "PHYSICAL-PROPS", arDict, ns)
+ datdefpropsvar2 = arGetChild(physprop, "SW-DATA-DEF-PROPS-VARIANTS", arDict, ns)
+ datdefpropscond2 = arGetChild(datdefpropsvar2, "SW-DATA-DEF-PROPS-CONDITIONAL", arDict ,ns)
+ if datdefpropscond2 != None:
+ try:
+ compmethod = arGetChild(datdefpropscond2, "COMPU-METHOD", arDict, ns)
+ except:
+ logger.debug('No valid compu method found for this - check ARXML file!!')
+ compmethod = None
+
unit = arGetChild(compmethod, "UNIT", arDict, ns)
if unit is not None:
longname = arGetChild(unit, "LONG-NAME", arDict, ns)
@@ -1023,7 +1032,7 @@
logger.debug('No Unit Display name found!! - using long name')
if displayname is not None:
Unit = displayname.text
- else:
+ else:
#####################################################################################################
#####################################################################################################
l4 = arGetChild(longname, "L-4", arDict, ns)
so my simple 'fuzzy'-search works for you also? can I close this Issue?
The only thing that works for me is the patch shown above. The software as it stands in git does not work, nor did the patch https://github.com/ebroecker/canmatrix/commit/141b561d338843919466e901a522e208370f4e83
in deed my question is: does the development-branch work for you as is, or does only your patched version work for you?
the development branch does not work as-is. Only my patched version works.
I know that https://github.com/ebroecker/canmatrix/commit/141b561d338843919466e901a522e208370f4e83 did not work. But this simpler solution (https://github.com/ebroecker/canmatrix/commit/1eb7224afbd4cabef65059d46bc6d3bcb193d6a6) works for my hacked arxml: test.arxml.txt
Your patch does also work with this hacked arxml. My one is simpler and should be more fault tolerant. Are you shure, https://github.com/ebroecker/canmatrix/commit/1eb7224afbd4cabef65059d46bc6d3bcb193d6a6 does not work for you?
Sorry, I got confused about the different patches. https://github.com/ebroecker/canmatrix/commit/1eb7224afbd4cabef65059d46bc6d3bcb193d6a6 works for me.
ok, thanks for checking once more. Thus I can close this issue...
None of the signals in a dbc file converted from arxml have factors/offsets due to 'No Compmethod found!! - try alternate scheme.' on all signals. The compmethods exist, but the layout seems different from other arxml files that work correctly with canmatrix. Here is a snip from an example signal: