odxtools 7.4.0__py3-none-any.whl → 8.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. odxtools/cli/_print_utils.py +4 -3
  2. odxtools/cli/browse.py +13 -11
  3. odxtools/cli/compare.py +1 -1
  4. odxtools/cli/list.py +20 -10
  5. odxtools/cli/snoop.py +28 -5
  6. odxtools/database.py +46 -10
  7. odxtools/diagcomm.py +4 -4
  8. odxtools/diaglayercontainer.py +23 -11
  9. odxtools/diaglayers/basevariant.py +128 -0
  10. odxtools/diaglayers/basevariantraw.py +117 -0
  11. odxtools/diaglayers/diaglayer.py +422 -0
  12. odxtools/{diaglayerraw.py → diaglayers/diaglayerraw.py} +18 -156
  13. odxtools/diaglayers/ecushareddata.py +96 -0
  14. odxtools/diaglayers/ecushareddataraw.py +81 -0
  15. odxtools/diaglayers/ecuvariant.py +124 -0
  16. odxtools/diaglayers/ecuvariantraw.py +123 -0
  17. odxtools/diaglayers/functionalgroup.py +110 -0
  18. odxtools/diaglayers/functionalgroupraw.py +100 -0
  19. odxtools/{diaglayer.py → diaglayers/hierarchyelement.py} +183 -498
  20. odxtools/diaglayers/hierarchyelementraw.py +52 -0
  21. odxtools/diaglayers/protocol.py +64 -0
  22. odxtools/diaglayers/protocolraw.py +85 -0
  23. odxtools/diagvariable.py +10 -1
  24. odxtools/ecuvariantmatcher.py +6 -7
  25. odxtools/field.py +3 -4
  26. odxtools/matchingparameter.py +1 -1
  27. odxtools/nameditemlist.py +4 -3
  28. odxtools/parameterinfo.py +10 -1
  29. odxtools/parameters/parameterwithdop.py +2 -3
  30. odxtools/parentref.py +1 -1
  31. odxtools/snrefcontext.py +1 -1
  32. odxtools/templates/diag_layer_container.odx-d.xml.jinja2 +11 -6
  33. odxtools/templates/macros/printBaseVariant.xml.jinja2 +53 -0
  34. odxtools/templates/macros/printCompuMethod.xml.jinja2 +1 -1
  35. odxtools/templates/macros/printDiagLayer.xml.jinja2 +206 -0
  36. odxtools/templates/macros/printEcuSharedData.xml.jinja2 +30 -0
  37. odxtools/templates/macros/printEcuVariant.xml.jinja2 +53 -0
  38. odxtools/templates/macros/printFunctionalGroup.xml.jinja2 +40 -0
  39. odxtools/templates/macros/printHierarchyElement.xml.jinja2 +24 -0
  40. odxtools/templates/macros/printProtocol.xml.jinja2 +30 -0
  41. odxtools/variablegroup.py +11 -1
  42. odxtools/version.py +2 -2
  43. {odxtools-7.4.0.dist-info → odxtools-8.0.0.dist-info}/METADATA +1 -1
  44. {odxtools-7.4.0.dist-info → odxtools-8.0.0.dist-info}/RECORD +49 -31
  45. odxtools/templates/macros/printVariant.xml.jinja2 +0 -241
  46. /odxtools/{diaglayertype.py → diaglayers/diaglayertype.py} +0 -0
  47. {odxtools-7.4.0.dist-info → odxtools-8.0.0.dist-info}/LICENSE +0 -0
  48. {odxtools-7.4.0.dist-info → odxtools-8.0.0.dist-info}/WHEEL +0 -0
  49. {odxtools-7.4.0.dist-info → odxtools-8.0.0.dist-info}/entry_points.txt +0 -0
  50. {odxtools-7.4.0.dist-info → odxtools-8.0.0.dist-info}/top_level.txt +0 -0
@@ -1,241 +0,0 @@
1
- {#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
- #
3
- # SPDX-License-Identifier: MIT
4
- -#}
5
-
6
- {%- import('macros/printElementId.xml.jinja2') as peid %}
7
- {%- import('macros/printDOP.xml.jinja2') as pdop %}
8
- {%- import('macros/printTable.xml.jinja2') as pt %}
9
- {%- import('macros/printFunctionalClass.xml.jinja2') as pfc %}
10
- {%- import('macros/printStructure.xml.jinja2') as pst %}
11
- {%- import('macros/printEndOfPdu.xml.jinja2') as peopdu %}
12
- {%- import('macros/printStaticField.xml.jinja2') as psf %}
13
- {%- import('macros/printDynamicLengthField.xml.jinja2') as pdlf %}
14
- {%- import('macros/printDynamicEndmarkerField.xml.jinja2') as pdemf %}
15
- {%- import('macros/printMux.xml.jinja2') as pm %}
16
- {%- import('macros/printEnvData.xml.jinja2') as ped %}
17
- {%- import('macros/printEnvDataDesc.xml.jinja2') as pedd %}
18
- {%- import('macros/printUnitSpec.xml.jinja2') as punit %}
19
- {%- import('macros/printService.xml.jinja2') as ps %}
20
- {%- import('macros/printSingleEcuJob.xml.jinja2') as psej %}
21
- {%- import('macros/printRequest.xml.jinja2') as prq %}
22
- {%- import('macros/printResponse.xml.jinja2') as presp %}
23
- {%- import('macros/printComparamRef.xml.jinja2') as pcom %}
24
- {%- import('macros/printParentRef.xml.jinja2') as pparref %}
25
- {%- import('macros/printStateChart.xml.jinja2') as psc %}
26
- {%- import('macros/printAudience.xml.jinja2') as paud %}
27
- {%- import('macros/printSpecialData.xml.jinja2') as psd %}
28
- {%- import('macros/printEcuVariantPattern.xml.jinja2') as pvpat %}
29
- {%- import('macros/printDynDefinedSpec.xml.jinja2') as pdynspec %}
30
- {%- import('macros/printDiagVariable.xml.jinja2') as pdv %}
31
-
32
- {%- macro printVariant(dl) -%}
33
- {%- set dlr = dl.diag_layer_raw %}
34
- <{{dlr.variant_type.value}} ID="{{dlr.odx_id.local_id}}">
35
- {{ peid.printElementIdSubtags(dlr)|indent(1) }}
36
- {%- if dlr.functional_classes %}
37
- <FUNCT-CLASSS>
38
- {%- for fc in dlr.functional_classes %}
39
- {{ pfc.printFunctionalClass(fc)|indent(3) }}
40
- {%- endfor%}
41
- </FUNCT-CLASSS>
42
- {%- endif %}
43
- {%- if dlr.diag_data_dictionary_spec %}
44
- {%- set ddds = dlr.diag_data_dictionary_spec %}
45
- <DIAG-DATA-DICTIONARY-SPEC>
46
- {%- if ddds.dtc_dops %}
47
- <DTC-DOPS>
48
- {%- for dop in ddds.dtc_dops -%}
49
- {{ pdop.printDtcDop(dop)|indent(3) }}
50
- {%- endfor %}
51
- </DTC-DOPS>
52
- {%- endif %}
53
- {%- if ddds.env_data_descs %}
54
- <ENV-DATA-DESCS>
55
- {%- for env_data_desc in ddds.env_data_descs -%}
56
- {{ pedd.printEnvDataDesc(env_data_desc)|indent(3) }}
57
- {%- endfor %}
58
- </ENV-DATA-DESCS>
59
- {%- endif %}
60
- {%- if ddds.data_object_props %}
61
- <DATA-OBJECT-PROPS>
62
- {%- for dop in ddds.data_object_props %}
63
- {{- pdop.printDataObjectProp(dop)|indent(3) }}
64
- {%- endfor %}
65
- </DATA-OBJECT-PROPS>
66
- {%- endif %}
67
- {%- if ddds.structures %}
68
- <STRUCTURES>
69
- {%- for st in ddds.structures %}
70
- {{ pst.printStructure(st)|indent(3) }}
71
- {%- endfor %}
72
- </STRUCTURES>
73
- {%- endif %}
74
- {%- if ddds.static_fields %}
75
- <STATIC-FIELDS>
76
- {%- for sf in ddds.static_fields %}
77
- {{ psf.printStaticField(sf)|indent(3) }}
78
- {%- endfor %}
79
- </STATIC-FIELDS>
80
- {%- endif %}
81
- {%- if ddds.dynamic_length_fields %}
82
- <DYNAMIC-LENGTH-FIELDS>
83
- {%- for dlf in ddds.dynamic_length_fields %}
84
- {{ pdlf.printDynamicLengthField(dlf)|indent(3) }}
85
- {%- endfor %}
86
- </DYNAMIC-LENGTH-FIELDS>
87
- {%- endif %}
88
- {%- if ddds.dynamic_endmarker_fields %}
89
- <DYNAMIC-ENDMARKER-FIELDS>
90
- {%- for demf in ddds.dynamic_endmarker_fields %}
91
- {{ pdemf.printDynamicEndmarkerField(demf)|indent(3) }}
92
- {%- endfor %}
93
- </DYNAMIC-ENDMARKER-FIELDS>
94
- {%- endif %}
95
- {%- if ddds.end_of_pdu_fields %}
96
- <END-OF-PDU-FIELDS>
97
- {%- for eopdu in ddds.end_of_pdu_fields %}
98
- {{ peopdu.printEndOfPdu(eopdu)|indent(3) }}
99
- {%- endfor %}
100
- </END-OF-PDU-FIELDS>
101
- {%- endif %}
102
- {%- if ddds.muxs %}
103
- <MUXS>
104
- {%- for mux in ddds.muxs %}
105
- {{ pm.printMux(mux)|indent(3) }}
106
- {%- endfor %}
107
- </MUXS>
108
- {%- endif %}
109
- {%- if ddds.env_datas %}
110
- <ENV-DATAS>
111
- {%- for env_data in ddds.env_datas %}
112
- {{ ped.printEnvData(env_data)|indent(3) }}
113
- {%- endfor %}
114
- </ENV-DATAS>
115
- {%- endif %}
116
- {%- if ddds.unit_spec %}
117
- {{ punit.printUnitSpec(ddds.unit_spec)|indent(2) }}
118
- {%- endif %}
119
- {%- if ddds.tables %}
120
- <TABLES>
121
- {%- for table in ddds.tables -%}
122
- {{ pt.printTable(table)|indent(3) }}
123
- {%- endfor %}
124
- </TABLES>
125
- {{- psd.printSpecialDataGroups(ddds.sdgs)|indent(2, first=True) }}
126
- {%- endif %}
127
- </DIAG-DATA-DICTIONARY-SPEC>
128
- {%- endif %}
129
- {%- if dlr.diag_comms_raw %}
130
- <DIAG-COMMS>
131
- {%- for dc in dlr.diag_comms_raw %}
132
-
133
- {#- use some serious duck typing to determine the kind of diag-comm
134
- #- object. this would not be necessary if something like
135
- #- isinstance() was available in jinja...
136
- #}
137
-
138
- {%- if hasattr(dc, "ref_id") %}
139
- {#- -> reference to a diag-comm object #}
140
- <DIAG-COMM-REF ID-REF="{{dc.ref_id}}" />
141
- {%- elif hasattr(dc, "request") %}
142
- {#- -> service #}
143
- {{ ps.printService(dc)|indent(2) }}
144
- {%- elif hasattr(dc, "prog_codes") %}
145
- {#- -> single-ECU job #}
146
- {{ psej.printSingleEcuJob(dc)|indent(2) }}
147
- {%- else %}
148
- <!-- Error: database contains an unrecognized DIAG-COMM. -->
149
- {%- endif %}
150
- {%- endfor %}
151
- </DIAG-COMMS>
152
- {%- endif %}
153
- {%- if dlr.requests %}
154
- <REQUESTS>
155
- {%- for req in dlr.requests %}
156
- {{ prq.printRequest(req)|indent(2) }}
157
- {%- endfor %}
158
- </REQUESTS>
159
- {%- endif %}
160
- {%- if dlr.positive_responses %}
161
- <POS-RESPONSES>
162
- {%- for resp in dlr.positive_responses %}
163
- {{ presp.printResponse(resp, "POS-RESPONSE")|indent(2) }}
164
- {%- endfor %}
165
- </POS-RESPONSES>
166
- {%- endif %}
167
- {%- if dlr.negative_responses %}
168
- <NEG-RESPONSES>
169
- {%- for resp in dlr.negative_responses %}
170
- {{ presp.printResponse(resp, "NEG-RESPONSE")|indent(2) }}
171
- {%- endfor %}
172
- </NEG-RESPONSES>
173
- {%- endif %}
174
- {%- if dlr.global_negative_responses %}
175
- <GLOBAL-NEG-RESPONSES>
176
- {%- for resp in dlr.global_negative_responses %}
177
- {{ presp.printResponse(resp, "GLOBAL-NEG-RESPONSE")|indent(2) }}
178
- {%- endfor %}
179
- </GLOBAL-NEG-RESPONSES>
180
- {%- endif %}
181
- {%- if dlr.state_charts %}
182
- <STATE-CHARTS>
183
- {%- for sc in dlr.state_charts %}
184
- {{ psc.printStateChart(sc) }}
185
- {%- endfor %}
186
- </STATE-CHARTS>
187
- {%- endif %}
188
- {%- if dlr.additional_audiences %}
189
- <ADDITIONAL-AUDIENCES>
190
- {%- for audience in dlr.additional_audiences %}
191
- {{ paud.printAdditionalAudience(audience)|indent(2) }}
192
- {%- endfor %}
193
- </ADDITIONAL-AUDIENCES>
194
- {%- endif %}
195
- {{- psd.printSpecialDataGroups(dlr.sdgs)|indent(1, first=True) }}
196
- {%- if dlr.comparam_refs %}
197
- <COMPARAM-REFS>
198
- {%- for cp in dlr.comparam_refs -%}
199
- {{ pcom.printComparamRef(cp)|indent(2) }}
200
- {%- endfor %}
201
- </COMPARAM-REFS>
202
- {%- endif %}
203
- {%- if dlr.variant_type.value == "PROTOCOL" %}
204
- <COMPARAM-SPEC-REF ID-REF="{{dlr.comparam_spec_ref.ref_id}}" DOCREF="{{dlr.comparam_spec_ref.ref_docs[0].doc_name}}" DOCTYPE="COMPARAM-SPEC"/>
205
- {%- if dlr.prot_stack_snref is not none %}
206
- <PROT-STACK-SNREF SHORT-NAME="{{dlr.prot_stack_snref}}"/>
207
- {%- endif %}
208
- {%- endif %}
209
- {%- if dlr.diag_variables %}
210
- <DIAG-VARIABLES>
211
- {%- for dv in dlr.diag_variables -%}
212
- {{ pdv.printDiagVariable(dv)|indent(4) }}
213
- {%- endfor -%}
214
- </DIAG-VARIABLES>
215
- {%- endif %}
216
- {%- if dlr.variable_groups %}
217
- <VARIABLE-GROUPS>
218
- {%- for vg in dlr.variable_groups -%}
219
- {{ pdv.printVariableGroup(vg)|indent(4) }}
220
- {%- endfor -%}
221
- </VARIABLE-GROUPS>
222
- {%- endif %}
223
- {%- if dlr.dyn_defined_spec %}
224
- {{ pdynspec.printPrintDefinedSpec(dlr.dyn_defined_spec)|indent(4) }}
225
- {%- endif %}
226
- {%- if dlr.ecu_variant_patterns %}
227
- <ECU-VARIANT-PATTERNS>
228
- {%- for vp in dlr.ecu_variant_patterns -%}
229
- {{ pvpat.printEcuVariantPattern(vp)|indent(4) }}
230
- {%- endfor -%}
231
- </ECU-VARIANT-PATTERNS>
232
- {%- endif %}
233
- {%- if dlr.parent_refs %}
234
- <PARENT-REFS>
235
- {%- for parent in dlr.parent_refs -%}
236
- {{ pparref.printParentRef(parent)|indent(2) }}
237
- {%- endfor %}
238
- </PARENT-REFS>
239
- {%- endif %}
240
- </{{dlr.variant_type.value}}>
241
- {%- endmacro -%}