-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong parameter handling with multiple odx files #368
Comments
I found the same issue EV_BatteChargVaria1.odx PR_UDSOnCAN.odx REQUEST ID="Req_ReadDataByIdentECUIdent"> get the EV_BatteChargVaria1.Req_ReadDataByIdentECUIdent.DOP_TEXTTABLERecorDataIdentECUIdent is PR_UDSOnCAN.Req_ReadDataByIdentECUIdent.DOP_TEXTTABLERecorDataIdentECUIdent if EV_BatteChargVaria1 have DOP_TEXTTABLERecorDataIdentECUIdent, It should be called his own DOP_TEXTTABLERecorDataIdentECUIdent, not the PR_UDSOnCAN DOP_TEXTTABLERecorDataIdentECUIdent |
this sounds awfully like #200: the problem seems to be that SNREFs depend on the context which they were called from, not just the object which contains them. As a workaround you can re-target the snrefs of your whole database to the diag layer which you are interested in:
There is no good solution to this issue: In the worst case the whole database needs to be copied for each and every ECU since every ECU might resolve its SNREFs differently even if these references are in inherited objects. (assuming that loading your database currently requires about 1000MB of RAM and that it contains 50 diag layers, you would need about 50GB of RAM just to get around this issue...) |
Yeah, it is a similar issue. But without adding code to resolve snrefs for child items like parameters of base structure, resolving snrefs based on current context will not work for those child items. |
yes, that is the ambiguity of the standard I've mentioned above: In the standard it is not explicitly stated anywhere that all references must be resolvable, but reading the document I get the impression that this is heavily implied. Other implementations (softing's?) might have come to different conclusions. Anyway if you have a not too intrusive way of fixing this issue, I'm happy to review and merge the patch... |
I think #373 won't solve the issue. From my understanding of the standard, SN-REFs follow the hierarchy. Therefore they should be resolved iterative per layer. This should also apply to imported data from ecu shared datas. |
it can be even worse: in principle, SNREFS contexts can be even more fine-grained, e.g. environment data descriptions specify an SNREF to a parameter. This results the reference to be resolved potentially differently depending on the request, response, or structure it is featured in. (That said, it is true that in practice at least 95% of the problem is due to the relevant diagnostic layer.) |
Yes, maybe layer was the wrong definition here. It would be dependent on the highest possible level in ODX, so all types deriving from OdxCategory. Such an iterative approach in addition must handle circular references, like Import-refs and parent-refs correctly. Wouldn't this require a SnRefContext, that handles inheritance? |
As far as I can see, the current Since I consider this "magic SNREF switcheroo" to be pretty much a niche issue and I also have neither the time nor the motivation for such a "90% rewrite" of odxtools (which would also necessitate major refactorings of essentially all current code that uses odxtools), people who run into this issue should for now sidestep it by either resolving SNREFs manually, or by using something like the "database retargeting hack" outlined above... |
Making this more convenient and bullet-proof, a |
I have a pdx file which contains multiple odx files. One of them define a ecu shared data which contains some diag services, and one of them define a basevariant which only contains some definitions of tables/table rows. in ecu shared data file, there is a param definition like below:
and in this file, there is a dummy table which short name is "TABLE_Service22_DataID":
with odxtools, this param would be parsed as a tablekey with a dummy table row in ecu shared data layer.
But in the file which contains basevariant, there is a new definition of table "TABLE_Service22_DataID" which contains real table rows. But with odxtools, the related param of base variant object is still using the dummy table.
I checked the code, and found that when resolving objects from parent, the odxtools will just get the objects from parent and will not do resolve snrefs for those objects. And as those inherited objects are the same objects as the ones of parent, doing resolve snrefs based on current context (with base variant) will also modify the objects of the parent, which shall be a new issue.
I have a workaround for it: call _resolve_snrefs on service before trying to read the details of its content based on current variant. But I still get some issues since some _resolve_snrefs lacks of resolving its children's snrefs like: BaseStructure, DiagService. So I made some code change on those files. For example, in DiagService:
With this workaround, I can get the correct result. But can I get an official fix for it or is it a known issue?
The text was updated successfully, but these errors were encountered: