odxtools 6.7.0__py3-none-any.whl → 9.3.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 (213) hide show
  1. odxtools/__init__.py +6 -4
  2. odxtools/additionalaudience.py +3 -5
  3. odxtools/admindata.py +5 -7
  4. odxtools/audience.py +10 -13
  5. odxtools/basecomparam.py +3 -5
  6. odxtools/basicstructure.py +55 -240
  7. odxtools/cli/_parser_utils.py +1 -1
  8. odxtools/cli/_print_utils.py +168 -134
  9. odxtools/cli/browse.py +111 -92
  10. odxtools/cli/compare.py +90 -71
  11. odxtools/cli/list.py +24 -15
  12. odxtools/cli/snoop.py +28 -5
  13. odxtools/codec.py +211 -0
  14. odxtools/commrelation.py +122 -0
  15. odxtools/companydata.py +5 -7
  16. odxtools/companydocinfo.py +7 -8
  17. odxtools/companyrevisioninfo.py +3 -5
  18. odxtools/companyspecificinfo.py +8 -9
  19. odxtools/comparam.py +4 -6
  20. odxtools/comparaminstance.py +7 -9
  21. odxtools/comparamspec.py +16 -54
  22. odxtools/comparamsubset.py +22 -62
  23. odxtools/complexcomparam.py +5 -7
  24. odxtools/compumethods/compucodecompumethod.py +63 -0
  25. odxtools/compumethods/compuconst.py +31 -0
  26. odxtools/compumethods/compudefaultvalue.py +27 -0
  27. odxtools/compumethods/compuinternaltophys.py +56 -0
  28. odxtools/compumethods/compuinversevalue.py +7 -0
  29. odxtools/compumethods/compumethod.py +93 -12
  30. odxtools/compumethods/compuphystointernal.py +56 -0
  31. odxtools/compumethods/compurationalcoeffs.py +20 -9
  32. odxtools/compumethods/compuscale.py +30 -35
  33. odxtools/compumethods/createanycompumethod.py +28 -161
  34. odxtools/compumethods/identicalcompumethod.py +31 -6
  35. odxtools/compumethods/linearcompumethod.py +69 -189
  36. odxtools/compumethods/linearsegment.py +190 -0
  37. odxtools/compumethods/ratfunccompumethod.py +106 -0
  38. odxtools/compumethods/ratfuncsegment.py +87 -0
  39. odxtools/compumethods/scalelinearcompumethod.py +132 -26
  40. odxtools/compumethods/scaleratfunccompumethod.py +113 -0
  41. odxtools/compumethods/tabintpcompumethod.py +119 -99
  42. odxtools/compumethods/texttablecompumethod.py +107 -43
  43. odxtools/createanydiagcodedtype.py +10 -67
  44. odxtools/database.py +167 -87
  45. odxtools/dataobjectproperty.py +15 -25
  46. odxtools/decodestate.py +9 -15
  47. odxtools/description.py +47 -0
  48. odxtools/determinenumberofitems.py +4 -5
  49. odxtools/diagcodedtype.py +36 -106
  50. odxtools/diagcomm.py +24 -12
  51. odxtools/diagdatadictionaryspec.py +33 -34
  52. odxtools/diaglayercontainer.py +46 -54
  53. odxtools/diaglayers/basevariant.py +128 -0
  54. odxtools/diaglayers/basevariantraw.py +123 -0
  55. odxtools/diaglayers/diaglayer.py +432 -0
  56. odxtools/{diaglayerraw.py → diaglayers/diaglayerraw.py} +105 -120
  57. odxtools/diaglayers/ecushareddata.py +96 -0
  58. odxtools/diaglayers/ecushareddataraw.py +87 -0
  59. odxtools/diaglayers/ecuvariant.py +124 -0
  60. odxtools/diaglayers/ecuvariantraw.py +129 -0
  61. odxtools/diaglayers/functionalgroup.py +110 -0
  62. odxtools/diaglayers/functionalgroupraw.py +106 -0
  63. odxtools/{diaglayer.py → diaglayers/hierarchyelement.py} +209 -448
  64. odxtools/diaglayers/hierarchyelementraw.py +58 -0
  65. odxtools/diaglayers/protocol.py +64 -0
  66. odxtools/diaglayers/protocolraw.py +91 -0
  67. odxtools/diagnostictroublecode.py +8 -9
  68. odxtools/diagservice.py +56 -43
  69. odxtools/diagvariable.py +113 -0
  70. odxtools/docrevision.py +5 -7
  71. odxtools/dopbase.py +15 -17
  72. odxtools/dtcdop.py +168 -50
  73. odxtools/dynamicendmarkerfield.py +134 -0
  74. odxtools/dynamiclengthfield.py +41 -37
  75. odxtools/dyndefinedspec.py +177 -0
  76. odxtools/dynenddopref.py +38 -0
  77. odxtools/ecuvariantmatcher.py +6 -7
  78. odxtools/element.py +13 -15
  79. odxtools/encodestate.py +199 -22
  80. odxtools/endofpdufield.py +31 -18
  81. odxtools/environmentdata.py +8 -1
  82. odxtools/environmentdatadescription.py +198 -38
  83. odxtools/exceptions.py +11 -2
  84. odxtools/field.py +10 -10
  85. odxtools/functionalclass.py +3 -5
  86. odxtools/inputparam.py +3 -12
  87. odxtools/leadinglengthinfotype.py +37 -18
  88. odxtools/library.py +66 -0
  89. odxtools/loadfile.py +64 -0
  90. odxtools/matchingparameter.py +3 -3
  91. odxtools/message.py +0 -7
  92. odxtools/minmaxlengthtype.py +61 -33
  93. odxtools/modification.py +3 -5
  94. odxtools/multiplexer.py +128 -73
  95. odxtools/multiplexercase.py +13 -14
  96. odxtools/multiplexerdefaultcase.py +15 -12
  97. odxtools/multiplexerswitchkey.py +4 -5
  98. odxtools/nameditemlist.py +29 -5
  99. odxtools/negoutputparam.py +3 -5
  100. odxtools/odxcategory.py +83 -0
  101. odxtools/odxlink.py +60 -51
  102. odxtools/odxtypes.py +37 -5
  103. odxtools/outputparam.py +4 -15
  104. odxtools/parameterinfo.py +218 -67
  105. odxtools/parameters/codedconstparameter.py +16 -24
  106. odxtools/parameters/dynamicparameter.py +5 -4
  107. odxtools/parameters/lengthkeyparameter.py +60 -26
  108. odxtools/parameters/matchingrequestparameter.py +23 -11
  109. odxtools/parameters/nrcconstparameter.py +45 -46
  110. odxtools/parameters/parameter.py +54 -56
  111. odxtools/parameters/parameterwithdop.py +15 -25
  112. odxtools/parameters/physicalconstantparameter.py +15 -18
  113. odxtools/parameters/reservedparameter.py +6 -2
  114. odxtools/parameters/systemparameter.py +55 -11
  115. odxtools/parameters/tableentryparameter.py +3 -2
  116. odxtools/parameters/tablekeyparameter.py +103 -49
  117. odxtools/parameters/tablestructparameter.py +47 -48
  118. odxtools/parameters/valueparameter.py +16 -20
  119. odxtools/paramlengthinfotype.py +52 -32
  120. odxtools/parentref.py +16 -2
  121. odxtools/physicaldimension.py +3 -8
  122. odxtools/progcode.py +26 -11
  123. odxtools/protstack.py +3 -5
  124. odxtools/py.typed +0 -0
  125. odxtools/relateddoc.py +7 -9
  126. odxtools/request.py +120 -10
  127. odxtools/response.py +123 -23
  128. odxtools/scaleconstr.py +3 -3
  129. odxtools/servicebinner.py +1 -1
  130. odxtools/singleecujob.py +12 -10
  131. odxtools/snrefcontext.py +29 -0
  132. odxtools/specialdata.py +3 -5
  133. odxtools/specialdatagroup.py +7 -9
  134. odxtools/specialdatagroupcaption.py +3 -6
  135. odxtools/standardlengthtype.py +80 -14
  136. odxtools/state.py +3 -5
  137. odxtools/statechart.py +13 -19
  138. odxtools/statetransition.py +7 -17
  139. odxtools/staticfield.py +31 -25
  140. odxtools/subcomponent.py +288 -0
  141. odxtools/swvariable.py +21 -0
  142. odxtools/table.py +7 -8
  143. odxtools/tablerow.py +19 -11
  144. odxtools/teammember.py +3 -5
  145. odxtools/templates/comparam-spec.odx-c.xml.jinja2 +4 -24
  146. odxtools/templates/comparam-subset.odx-cs.xml.jinja2 +5 -26
  147. odxtools/templates/diag_layer_container.odx-d.xml.jinja2 +15 -31
  148. odxtools/templates/{index.xml.xml.jinja2 → index.xml.jinja2} +1 -1
  149. odxtools/templates/macros/printAudience.xml.jinja2 +1 -1
  150. odxtools/templates/macros/printBaseVariant.xml.jinja2 +53 -0
  151. odxtools/templates/macros/printCompanyData.xml.jinja2 +4 -7
  152. odxtools/templates/macros/printComparam.xml.jinja2 +6 -4
  153. odxtools/templates/macros/printComparamRef.xml.jinja2 +5 -12
  154. odxtools/templates/macros/printCompuMethod.xml.jinja2 +147 -0
  155. odxtools/templates/macros/printDOP.xml.jinja2 +27 -133
  156. odxtools/templates/macros/printDescription.xml.jinja2 +18 -0
  157. odxtools/templates/macros/printDiagComm.xml.jinja2 +1 -1
  158. odxtools/templates/macros/printDiagLayer.xml.jinja2 +222 -0
  159. odxtools/templates/macros/printDiagVariable.xml.jinja2 +66 -0
  160. odxtools/templates/macros/printDynDefinedSpec.xml.jinja2 +48 -0
  161. odxtools/templates/macros/printDynamicEndmarkerField.xml.jinja2 +16 -0
  162. odxtools/templates/macros/printDynamicLengthField.xml.jinja2 +1 -1
  163. odxtools/templates/macros/printEcuSharedData.xml.jinja2 +30 -0
  164. odxtools/templates/macros/printEcuVariant.xml.jinja2 +53 -0
  165. odxtools/templates/macros/printEcuVariantPattern.xml.jinja2 +1 -1
  166. odxtools/templates/macros/printElementId.xml.jinja2 +8 -3
  167. odxtools/templates/macros/printEndOfPdu.xml.jinja2 +1 -1
  168. odxtools/templates/macros/printEnvDataDesc.xml.jinja2 +1 -1
  169. odxtools/templates/macros/printFunctionalClass.xml.jinja2 +1 -1
  170. odxtools/templates/macros/printFunctionalGroup.xml.jinja2 +40 -0
  171. odxtools/templates/macros/printHierarchyElement.xml.jinja2 +24 -0
  172. odxtools/templates/macros/printLibrary.xml.jinja2 +21 -0
  173. odxtools/templates/macros/printMux.xml.jinja2 +4 -3
  174. odxtools/templates/macros/printOdxCategory.xml.jinja2 +28 -0
  175. odxtools/templates/macros/printParam.xml.jinja2 +11 -12
  176. odxtools/templates/macros/printProtStack.xml.jinja2 +1 -1
  177. odxtools/templates/macros/printProtocol.xml.jinja2 +30 -0
  178. odxtools/templates/macros/printRequest.xml.jinja2 +1 -1
  179. odxtools/templates/macros/printResponse.xml.jinja2 +1 -1
  180. odxtools/templates/macros/printService.xml.jinja2 +3 -2
  181. odxtools/templates/macros/printSingleEcuJob.xml.jinja2 +5 -26
  182. odxtools/templates/macros/printSpecialData.xml.jinja2 +1 -1
  183. odxtools/templates/macros/printState.xml.jinja2 +1 -1
  184. odxtools/templates/macros/printStateChart.xml.jinja2 +1 -1
  185. odxtools/templates/macros/printStateTransition.xml.jinja2 +1 -1
  186. odxtools/templates/macros/printStaticField.xml.jinja2 +1 -1
  187. odxtools/templates/macros/printStructure.xml.jinja2 +1 -1
  188. odxtools/templates/macros/printSubComponent.xml.jinja2 +104 -0
  189. odxtools/templates/macros/printTable.xml.jinja2 +4 -5
  190. odxtools/templates/macros/printUnitSpec.xml.jinja2 +3 -5
  191. odxtools/uds.py +2 -10
  192. odxtools/unit.py +4 -8
  193. odxtools/unitgroup.py +3 -5
  194. odxtools/unitspec.py +17 -17
  195. odxtools/utils.py +38 -20
  196. odxtools/variablegroup.py +32 -0
  197. odxtools/version.py +2 -2
  198. odxtools/{write_pdx_file.py → writepdxfile.py} +20 -10
  199. odxtools/xdoc.py +3 -5
  200. {odxtools-6.7.0.dist-info → odxtools-9.3.0.dist-info}/METADATA +20 -21
  201. odxtools-9.3.0.dist-info/RECORD +228 -0
  202. {odxtools-6.7.0.dist-info → odxtools-9.3.0.dist-info}/WHEEL +1 -1
  203. odxtools/createcompanydatas.py +0 -17
  204. odxtools/createsdgs.py +0 -19
  205. odxtools/load_file.py +0 -13
  206. odxtools/load_odx_d_file.py +0 -6
  207. odxtools/load_pdx_file.py +0 -8
  208. odxtools/templates/macros/printVariant.xml.jinja2 +0 -216
  209. odxtools-6.7.0.dist-info/RECORD +0 -182
  210. /odxtools/{diaglayertype.py → diaglayers/diaglayertype.py} +0 -0
  211. {odxtools-6.7.0.dist-info → odxtools-9.3.0.dist-info}/LICENSE +0 -0
  212. {odxtools-6.7.0.dist-info → odxtools-9.3.0.dist-info}/entry_points.txt +0 -0
  213. {odxtools-6.7.0.dist-info → odxtools-9.3.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,222 @@
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/printStateChart.xml.jinja2') as psc %}
24
+ {%- import('macros/printAudience.xml.jinja2') as paud %}
25
+ {%- import('macros/printSubComponent.xml.jinja2') as psubcomp %}
26
+ {%- import('macros/printLibrary.xml.jinja2') as plib %}
27
+ {%- import('macros/printSpecialData.xml.jinja2') as psd %}
28
+ {%- import('macros/printEcuVariantPattern.xml.jinja2') as pvpat %}
29
+ {%- import('macros/printAdminData.xml.jinja2') as pad %}
30
+
31
+ {%- macro printDiagLayerAttribs(dl) -%}
32
+ {#- #} {{-peid.printElementIdAttribs(dl)}}{# -#}
33
+ {%- endmacro -%}
34
+
35
+ {%- macro printDiagLayerSubtags(dl) -%}
36
+ {%- set dlr = dl.diag_layer_raw %}
37
+ {{ peid.printElementIdSubtags(dlr)|indent(1) }}
38
+ {%- if dlr.admin_data is not none %}
39
+ {{ pad.printAdminData(dlr.admin_data) }}
40
+ {%- endif %}
41
+ {%- if dlr.company_datas %}
42
+ <COMPANY-DATAS>
43
+ {%- for cd in dlr.company_datas %}
44
+ {{ pcd.printCompanyData(cd) }}
45
+ {%- endfor %}
46
+ </COMPANY-DATAS>
47
+ {%- endif %}
48
+ {%- if dlr.functional_classes %}
49
+ <FUNCT-CLASSS>
50
+ {%- for fc in dlr.functional_classes %}
51
+ {{ pfc.printFunctionalClass(fc)|indent(3) }}
52
+ {%- endfor%}
53
+ </FUNCT-CLASSS>
54
+ {%- endif %}
55
+ {%- if dlr.diag_data_dictionary_spec is not none %}
56
+ {%- set ddds = dlr.diag_data_dictionary_spec %}
57
+ <DIAG-DATA-DICTIONARY-SPEC>
58
+ {%- if ddds.dtc_dops %}
59
+ <DTC-DOPS>
60
+ {%- for dop in ddds.dtc_dops -%}
61
+ {{ pdop.printDtcDop(dop)|indent(3) }}
62
+ {%- endfor %}
63
+ </DTC-DOPS>
64
+ {%- endif %}
65
+ {%- if ddds.env_data_descs %}
66
+ <ENV-DATA-DESCS>
67
+ {%- for env_data_desc in ddds.env_data_descs -%}
68
+ {{ pedd.printEnvDataDesc(env_data_desc)|indent(3) }}
69
+ {%- endfor %}
70
+ </ENV-DATA-DESCS>
71
+ {%- endif %}
72
+ {%- if ddds.data_object_props %}
73
+ <DATA-OBJECT-PROPS>
74
+ {%- for dop in ddds.data_object_props %}
75
+ {{- pdop.printDataObjectProp(dop)|indent(3) }}
76
+ {%- endfor %}
77
+ </DATA-OBJECT-PROPS>
78
+ {%- endif %}
79
+ {%- if ddds.structures %}
80
+ <STRUCTURES>
81
+ {%- for st in ddds.structures %}
82
+ {{ pst.printStructure(st)|indent(3) }}
83
+ {%- endfor %}
84
+ </STRUCTURES>
85
+ {%- endif %}
86
+ {%- if ddds.static_fields %}
87
+ <STATIC-FIELDS>
88
+ {%- for sf in ddds.static_fields %}
89
+ {{ psf.printStaticField(sf)|indent(3) }}
90
+ {%- endfor %}
91
+ </STATIC-FIELDS>
92
+ {%- endif %}
93
+ {%- if ddds.dynamic_length_fields %}
94
+ <DYNAMIC-LENGTH-FIELDS>
95
+ {%- for dlf in ddds.dynamic_length_fields %}
96
+ {{ pdlf.printDynamicLengthField(dlf)|indent(3) }}
97
+ {%- endfor %}
98
+ </DYNAMIC-LENGTH-FIELDS>
99
+ {%- endif %}
100
+ {%- if ddds.dynamic_endmarker_fields %}
101
+ <DYNAMIC-ENDMARKER-FIELDS>
102
+ {%- for demf in ddds.dynamic_endmarker_fields %}
103
+ {{ pdemf.printDynamicEndmarkerField(demf)|indent(3) }}
104
+ {%- endfor %}
105
+ </DYNAMIC-ENDMARKER-FIELDS>
106
+ {%- endif %}
107
+ {%- if ddds.end_of_pdu_fields %}
108
+ <END-OF-PDU-FIELDS>
109
+ {%- for eopdu in ddds.end_of_pdu_fields %}
110
+ {{ peopdu.printEndOfPdu(eopdu)|indent(3) }}
111
+ {%- endfor %}
112
+ </END-OF-PDU-FIELDS>
113
+ {%- endif %}
114
+ {%- if ddds.muxs %}
115
+ <MUXS>
116
+ {%- for mux in ddds.muxs %}
117
+ {{ pm.printMux(mux)|indent(3) }}
118
+ {%- endfor %}
119
+ </MUXS>
120
+ {%- endif %}
121
+ {%- if ddds.env_datas %}
122
+ <ENV-DATAS>
123
+ {%- for env_data in ddds.env_datas %}
124
+ {{ ped.printEnvData(env_data)|indent(3) }}
125
+ {%- endfor %}
126
+ </ENV-DATAS>
127
+ {%- endif %}
128
+ {%- if ddds.unit_spec %}
129
+ {{ punit.printUnitSpec(ddds.unit_spec)|indent(2) }}
130
+ {%- endif %}
131
+ {%- if ddds.tables %}
132
+ <TABLES>
133
+ {%- for table in ddds.tables -%}
134
+ {{ pt.printTable(table)|indent(3) }}
135
+ {%- endfor %}
136
+ </TABLES>
137
+ {{- psd.printSpecialDataGroups(ddds.sdgs)|indent(2, first=True) }}
138
+ {%- endif %}
139
+ </DIAG-DATA-DICTIONARY-SPEC>
140
+ {%- endif %}
141
+ {%- if dlr.diag_comms_raw %}
142
+ <DIAG-COMMS>
143
+ {%- for dc in dlr.diag_comms_raw %}
144
+
145
+ {#- use some serious duck typing to determine the kind of diag-comm
146
+ #- object. this would not be necessary if something like
147
+ #- isinstance() was available in jinja...
148
+ #}
149
+
150
+ {%- if hasattr(dc, "ref_id") %}
151
+ {#- -> reference to a diag-comm object #}
152
+ <DIAG-COMM-REF ID-REF="{{dc.ref_id}}" />
153
+ {%- elif hasattr(dc, "request") %}
154
+ {#- -> service #}
155
+ {{ ps.printService(dc)|indent(2) }}
156
+ {%- elif hasattr(dc, "prog_codes") %}
157
+ {#- -> single-ECU job #}
158
+ {{ psej.printSingleEcuJob(dc)|indent(2) }}
159
+ {%- else %}
160
+ <!-- Error: database contains an unrecognized DIAG-COMM. -->
161
+ {%- endif %}
162
+ {%- endfor %}
163
+ </DIAG-COMMS>
164
+ {%- endif %}
165
+ {%- if dlr.requests %}
166
+ <REQUESTS>
167
+ {%- for req in dlr.requests %}
168
+ {{ prq.printRequest(req)|indent(2) }}
169
+ {%- endfor %}
170
+ </REQUESTS>
171
+ {%- endif %}
172
+ {%- if dlr.positive_responses %}
173
+ <POS-RESPONSES>
174
+ {%- for resp in dlr.positive_responses %}
175
+ {{ presp.printResponse(resp, "POS-RESPONSE")|indent(2) }}
176
+ {%- endfor %}
177
+ </POS-RESPONSES>
178
+ {%- endif %}
179
+ {%- if dlr.negative_responses %}
180
+ <NEG-RESPONSES>
181
+ {%- for resp in dlr.negative_responses %}
182
+ {{ presp.printResponse(resp, "NEG-RESPONSE")|indent(2) }}
183
+ {%- endfor %}
184
+ </NEG-RESPONSES>
185
+ {%- endif %}
186
+ {%- if dlr.global_negative_responses %}
187
+ <GLOBAL-NEG-RESPONSES>
188
+ {%- for resp in dlr.global_negative_responses %}
189
+ {{ presp.printResponse(resp, "GLOBAL-NEG-RESPONSE")|indent(2) }}
190
+ {%- endfor %}
191
+ </GLOBAL-NEG-RESPONSES>
192
+ {%- endif %}
193
+ {%- if dlr.state_charts %}
194
+ <STATE-CHARTS>
195
+ {%- for sc in dlr.state_charts %}
196
+ {{ psc.printStateChart(sc) }}
197
+ {%- endfor %}
198
+ </STATE-CHARTS>
199
+ {%- endif %}
200
+ {%- if dlr.additional_audiences %}
201
+ <ADDITIONAL-AUDIENCES>
202
+ {%- for audience in dlr.additional_audiences %}
203
+ {{ paud.printAdditionalAudience(audience)|indent(2) }}
204
+ {%- endfor %}
205
+ </ADDITIONAL-AUDIENCES>
206
+ {%- endif %}
207
+ {%- if dlr.sub_components %}
208
+ <SUB-COMPONENTS>
209
+ {%- for sc in dlr.sub_components %}
210
+ {{ psubcomp.printSubComponent(sc)|indent(2) }}
211
+ {%- endfor %}
212
+ </SUB-COMPONENTS>
213
+ {%- endif %}
214
+ {%- if dlr.libraries %}
215
+ <LIBRARYS>
216
+ {%- for lib in dlr.libraries %}
217
+ {{ plib.printLibrary(lib)|indent(2) }}
218
+ {%- endfor %}
219
+ </LIBRARYS>
220
+ {%- endif %}
221
+ {{- psd.printSpecialDataGroups(dlr.sdgs)|indent(0, first=True) }}
222
+ {%- endmacro -%}
@@ -0,0 +1,66 @@
1
+ {#- -*- mode: sgml; tab-width: 2; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+ {%- import('macros/printElementId.xml.jinja2') as peid %}
6
+ {%- import('macros/printAdminData.xml.jinja2') as pad %}
7
+ {%- import('macros/printDescription.xml.jinja2') as pd %}
8
+
9
+ {%- macro printDiagVariable(diag_var) -%}
10
+ <DIAG-VARIABLE {{-peid.printElementIdAttribs(diag_var)}}>
11
+ {{ peid.printElementIdSubtags(diag_variable)|indent(2) }}
12
+ {%- if diag_variable.admin_data is not none %}
13
+ {{ pad.printAdminData(diag_variable.admin_data)|indent(2) }}
14
+ {%- endif %}
15
+ <VARIABLE-GROUP-REF ID-REF="{{ diag_var.ref_id }}" />
16
+ {%- if diag_variable.sw_variables %}
17
+ <SW-VARIABLES>
18
+ {%- for sw_var in diag_variable.sw_variables %}
19
+ <SW-VARIABLE {{-peid.printElementIdAttribs(sw_var)}}>
20
+ {{ peid.printElementIdSubtags(sw_var)|indent(6) }}
21
+ {%- if sw_var.origin is not none %}
22
+ <ORIGIN>{{ sw_var.origin }}</ORIGIN>
23
+ {%- endif %}
24
+ </SW-VARIABLE>
25
+ {%- endfor %}
26
+ </SW-VARIABLES>
27
+ {%- endif %}
28
+ {%- if diag_variable.comm_relations %}
29
+ <COMM-RELATIONS>
30
+ {%- for comm_relation in diag_variable.comm_relations %}
31
+ <COMM-RELATION>
32
+ {{ pd.printDescription(comm_relation.description) }}
33
+ <RELATION-TYPE>{{comm_relation.relation_type}}</RELATION-TYPE>
34
+ {%- if comm_relation.diag_comm_ref is not none %}
35
+ <DIAG-COMM-REF ID-REF="{{comm_relation.diag_comm_ref.ref_id}}" />
36
+ {%- endif %}
37
+ {%- if comm_relation.diag_comm_snref is not none %}
38
+ <DIAG-COMM-SNREF SHORT-NAME="{{comm_relation.diag_comm_snref}}" />
39
+ {%- endif %}
40
+ {%- if comm_relation.in_param_if_ref is not none %}
41
+ <IN-PARAM-IF-REF ID-REF="{{comm_relation.in_param_if_ref.ref_id}}" />
42
+ {%- endif %}
43
+ {%- if comm_relation.in_param_if_snref is not none %}
44
+ <IN-PARAM-IF-SNREF SHORT-NAME="{{comm_relation.in_param_if_snref}}" />
45
+ {%- endif %}
46
+ {%- if comm_relation.out_param_if_ref is not none %}
47
+ <OUT-PARAM-IF-REF ID-REF="{{comm_relation.out_param_if_ref.ref_id}}" />
48
+ {%- endif %}
49
+ {%- if comm_relation.out_param_if_snref is not none %}
50
+ <OUT-PARAM-IF-SNREF SHORT-NAME="{{comm_relation.out_param_if_snref}}" />
51
+ {%- endif %}
52
+ {%- if comm_relation.value_type_raw is not none %}
53
+ <VALUE-TYPE>{{comm_relation.value_type_raw.value}}</VALUE-TYPE>
54
+ {%- endif %}
55
+ <COMM-RELATION>
56
+ {%- endfor %}
57
+ </COMM-RELATIONS>
58
+ {%- endif %}
59
+ </DIAG-VARIABLE>
60
+ {%- endmacro -%}
61
+
62
+ {%- macro printVariableGroup(var_group) -%}
63
+ <VARIABLE-GROUP {{-peid.printElementIdAttribs(var_group)}}>
64
+ {{ peid.printElementIdSubtags(diag_variable)|indent(2) }}
65
+ </VARIABLE-GROUP>
66
+ {%- endmacro -%}
@@ -0,0 +1,48 @@
1
+ {#- -*- mode: sgml; tab-width: 2; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- macro printDynDefinedSpec(dd_spec) -%}
7
+ <DYN-DEFINED-SPEC>
8
+ {%- if dd_spec.dyn_id_def_mode_infos %}
9
+ <DYN-ID-DEF-MODE-INFOS>
10
+ {%- for diddmi in dd_spec.dyn_id_def_mode_infos %}
11
+ <DYN-ID-DEF-MODE-INFO>
12
+ <DEF-MODE>{{ diddmi.def_mode }}</DEF-MODE>
13
+ {%- if diddmi.clear_dyn_def_message_ref is not none %}
14
+ <CLEAR-DYN-DEF-MESSAGE-REF ID-REF="{{diddmi.clear_dyn_def_message_ref.ref_id}}" />
15
+ {%- endif %}
16
+ {%- if diddmi.clear_dyn_def_message_snref is not none %}
17
+ <CLEAR-DYN-DEF-MESSAGE-SNREF SHORT-NAME="{{diddmi.clear_dyn_def_message_snref}}" />
18
+ {%- endif %}
19
+ {%- if diddmi.read_dyn_def_message_ref is not none %}
20
+ <READ-DYN-DEF-MESSAGE-REF ID-REF="{{diddmi.read_dyn_def_message_ref.ref_id}}" />
21
+ {%- endif %}
22
+ {%- if diddmi.read_dyn_def_message_snref is not none %}
23
+ <READ-DYN-DEF-MESSAGE-SNREF SHORT-NAME="{{diddmi.read_dyn_def_message_snref}}" />
24
+ {%- endif %}
25
+ {%- if diddmi.supported_dyn_ids %}
26
+ <SUPPORTED-DYN-IDS>
27
+ {%- for dynid in diddmi.supported_dyn_ids %}
28
+ <SUPPORTED-DYN-ID>{{ dynid.hex() }}</SUPPORTED-DYN-ID>
29
+ {%- endfor %}
30
+ </SUPPORTED-DYN-IDS>
31
+ {%- endif %}
32
+ {%- if diddmi.selection_table_refs %}
33
+ <SELECTION-TABLE-REFS>
34
+ {%- for seltref in diddmi.selection_table_refs %}
35
+ {%- if hasattr(seltref, "ref_id") %}
36
+ <SELECTION-TABLE-REF ID-REF="{{ seltref.ref_id }}" />
37
+ {%- else %}
38
+ <SELECTION-TABLE-SNREF SHORT-NAME="{{ seltref }}" />
39
+ {%- endif %}
40
+ {%- endfor %}
41
+ </SELECTION-TABLE-REFS>
42
+ {%- endif %}
43
+ </DYN-ID-DEF-MODE-INFO>
44
+ {%- endfor %}
45
+ </DYN-ID-DEF-MODE-INFOS>
46
+ {%- endif %}
47
+ </DYN-DEFINED-SPEC>
48
+ {%- endmacro -%}
@@ -0,0 +1,16 @@
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
+
8
+ {%- macro printStaticField(demf) -%}
9
+ <DYNAMIC-ENDMARKER-FIELD {{-peid.printElementIdAttribs(demf)}}>
10
+ {{ peid.printElementIdSubtags(demf)|indent(1) }}
11
+ <BASIC-STRUCTURE-REF ID-REF="{{demf.structure_ref.ref_id}}" />
12
+ <DYN-END-DOP-REF ID-REF="{{demf.dyn_end_dop_ref.ref_id}}">
13
+ <TERMINATION-VALUE>{{demf.dyn_end_dop_ref.termination_value_raw}}</TERMINATION-VALUE>
14
+ </DYN-END-DOP-REF>
15
+ </DYNAMIC-ENDMARKER-FIELD>
16
+ {%- endmacro -%}
@@ -6,7 +6,7 @@
6
6
  {%- import('macros/printElementId.xml.jinja2') as peid %}
7
7
 
8
8
  {%- macro printDynamicLengthField(dlf) -%}
9
- <DYNAMIC-LENGTH-FIELD ID="{{dlf.odx_id.local_id}}">
9
+ <DYNAMIC-LENGTH-FIELD {{-peid.printElementIdAttribs(dlf)}}>
10
10
  {{ peid.printElementIdSubtags(dlf)|indent(1) }}
11
11
  <BASIC-STRUCTURE-REF ID-REF="{{dlf.structure_ref.ref_id}}" />
12
12
  <OFFSET>{{dlf.offset}}</OFFSET>
@@ -0,0 +1,30 @@
1
+ {#- -*- mode: sgml; tab-width: 2; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printDiagLayer.xml.jinja2') as pdl %}
7
+
8
+ {%- macro printEcuSharedData(ecu_shared_data) -%}
9
+ <ECU-SHARED-DATA {{- pdl.printDiagLayerAttribs(ecu_shared_data) -}}>
10
+ {{ pdl.printDiagLayerSubtags(ecu_shared_data) | indent(2) }}
11
+ {%- set dlr = ecu_shared_data.ecu_shared_data_raw %}
12
+
13
+ {%- if dlr.diag_variables %}
14
+ <DIAG-VARIABLES>
15
+ {%- for dv in dlr.diag_variables -%}
16
+ {{ pdv.printDiagVariable(dv)|indent(4) }}
17
+ {%- endfor -%}
18
+ </DIAG-VARIABLES>
19
+ {%- endif %}
20
+
21
+ {%- if dlr.variable_groups %}
22
+ <VARIABLE-GROUPS>
23
+ {%- for vg in dlr.variable_groups -%}
24
+ {{ pdv.printVariableGroup(vg)|indent(4) }}
25
+ {%- endfor -%}
26
+ </VARIABLE-GROUPS>
27
+ {%- endif %}
28
+
29
+ </ECU-SHARED-DATA>
30
+ {%- endmacro %}
@@ -0,0 +1,53 @@
1
+ {#- -*- mode: sgml; tab-width: 2; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printHierarchyElement.xml.jinja2') as phe %}
7
+ {%- import('macros/printComparamRef.xml.jinja2') as pcom %}
8
+ {%- import('macros/printParentRef.xml.jinja2') as pparref %}
9
+ {%- import('macros/printEcuVariantPattern.xml.jinja2') as pvpat %}
10
+ {%- import('macros/printDynDefinedSpec.xml.jinja2') as pdynspec %}
11
+
12
+ {%- macro printEcuVariant(ecu_variant) -%}
13
+ <ECU-VARIANT {{- phe.printHierarchyElementAttribs(ecu_variant) -}}>
14
+ {{ phe.printHierarchyElementSubtags(ecu_variant) | indent(2) }}
15
+ {%- set dlr = ecu_variant.diag_layer_raw %}
16
+
17
+ {%- if dlr.diag_variables %}
18
+ <DIAG-VARIABLES>
19
+ {%- for dv in dlr.diag_variables -%}
20
+ {{ pdv.printDiagVariable(dv)|indent(4) }}
21
+ {%- endfor -%}
22
+ </DIAG-VARIABLES>
23
+ {%- endif %}
24
+
25
+ {%- if dlr.variable_groups %}
26
+ <VARIABLE-GROUPS>
27
+ {%- for vg in dlr.variable_groups -%}
28
+ {{ pdv.printVariableGroup(vg)|indent(4) }}
29
+ {%- endfor -%}
30
+ </VARIABLE-GROUPS>
31
+ {%- endif %}
32
+
33
+ {%- if dlr.dyn_defined_spec %}
34
+ {{ pdynspec.printPrintDefinedSpec(dlr.dyn_defined_spec)|indent(4) }}
35
+ {%- endif %}
36
+
37
+ {%- if dlr.ecu_variant_patterns %}
38
+ <ECU-VARIANT-PATTERNS>
39
+ {%- for vp in dlr.ecu_variant_patterns -%}
40
+ {{ pvpat.printEcuVariantPattern(vp)|indent(4) }}
41
+ {%- endfor -%}
42
+ </ECU-VARIANT-PATTERNS>
43
+ {%- endif %}
44
+
45
+ {%- if dlr.parent_refs %}
46
+ <PARENT-REFS>
47
+ {%- for parent in dlr.parent_refs -%}
48
+ {{ pparref.printParentRef(parent)|indent(4) }}
49
+ {%- endfor %}
50
+ </PARENT-REFS>
51
+ {%- endif %}
52
+ </ECU-VARIANT>
53
+ {%- endmacro %}
@@ -9,7 +9,7 @@
9
9
 
10
10
  {%- macro printMatchingParameter(mp) -%}
11
11
  <MATCHING-PARAMETER>
12
- <EXPECTED-VALUE>{{mp.expected_value}}</EXPECTED-VALUE>
12
+ <EXPECTED-VALUE>{{mp.expected_value | e}}</EXPECTED-VALUE>
13
13
  <DIAG-COMM-SNREF SHORT-NAME="{{mp.diag_comm_snref}}" />
14
14
  {#- TODO: OUT-PARAM-IF-SNPATHREF #}
15
15
  <OUT-PARAM-IF-SNREF SHORT-NAME="{{mp.out_param_if}}" />
@@ -3,12 +3,17 @@
3
3
  # SPDX-License-Identifier: MIT
4
4
  -#}
5
5
 
6
+ {%- import('macros/printDescription.xml.jinja2') as pd %}
7
+
8
+ {%- macro printElementIdAttribs(obj) -%}
9
+ {#- #} {{- make_xml_attrib("ID", obj.odx_id.local_id) }}
10
+ {#- #} {{- make_xml_attrib("OID", getattr(obj, "oid", none)) -}}
11
+ {%- endmacro -%}
12
+
6
13
  {%- macro printElementIdSubtags(obj) -%}
7
14
  <SHORT-NAME>{{ obj.short_name }}</SHORT-NAME>
8
15
  {%- if obj.long_name %}
9
16
  <LONG-NAME>{{ obj.long_name|e }}</LONG-NAME>
10
17
  {%- endif %}
11
- {%- if obj.description %}
12
- <DESC>{{ obj.description }}</DESC>
13
- {%- endif %}
18
+ {{- pd.printDescription(obj.description) }}
14
19
  {%- endmacro -%}
@@ -6,7 +6,7 @@
6
6
  {%- import('macros/printElementId.xml.jinja2') as peid %}
7
7
 
8
8
  {%- macro printEndOfPdu(eopdu) -%}
9
- <END-OF-PDU-FIELD ID="{{eopdu.odx_id.local_id}}">
9
+ <END-OF-PDU-FIELD {{-peid.printElementIdAttribs(eopdu)}}>
10
10
  {{ peid.printElementIdSubtags(eopdu)|indent(1) }}
11
11
  <BASIC-STRUCTURE-REF ID-REF="{{eopdu.structure_ref.ref_id}}" />
12
12
  {%- if eopdu.max_number_of_items is not none %}
@@ -6,7 +6,7 @@
6
6
  {%- import('macros/printElementId.xml.jinja2') as peid %}
7
7
 
8
8
  {%- macro printEnvDataDesc(env_data_desc) %}
9
- <ENV-DATA-DESC ID="{{env_data_desc.odx_id.local_id}}">
9
+ <ENV-DATA-DESC {{-peid.printElementIdAttribs(env_data_desc)}}>
10
10
  {{ peid.printElementIdSubtags(env_data_desc)|indent(1) }}
11
11
  <PARAM-SNREF SHORT-NAME="{{env_data_desc.param_snref}}"/>
12
12
  <ENV-DATA-REFS>
@@ -7,7 +7,7 @@
7
7
  {%- import('macros/printElementId.xml.jinja2') as peid %}
8
8
 
9
9
  {%- macro printFunctionalClass(fc) -%}
10
- <FUNCT-CLASS ID="{{fc.odx_id.local_id}}">
10
+ <FUNCT-CLASS {{-peid.printElementIdAttribs(fc)}}>
11
11
  {{ peid.printElementIdSubtags(fc)|indent(1) }}
12
12
  </FUNCT-CLASS>
13
13
  {%- endmacro -%}
@@ -0,0 +1,40 @@
1
+ {#- -*- mode: sgml; tab-width: 2; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printHierarchyElement.xml.jinja2') as phe %}
7
+ {%- import('macros/printComparamRef.xml.jinja2') as pcom %}
8
+ {%- import('macros/printParentRef.xml.jinja2') as pparref %}
9
+
10
+ {%- macro printFunctionalGroup(functional_group) -%}
11
+ <FUNCTIONAL-GROUP {{- phe.printHierarchyElementAttribs(functional_group) -}}>
12
+ {{ phe.printHierarchyElementSubtags(functional_group) | indent(2) }}
13
+
14
+ {%- set dlr = functional_group.functional_group_raw %}
15
+
16
+ {%- if dlr.diag_variables %}
17
+ <DIAG-VARIABLES>
18
+ {%- for dv in dlr.diag_variables -%}
19
+ {{ pdv.printDiagVariable(dv)|indent(4) }}
20
+ {%- endfor -%}
21
+ </DIAG-VARIABLES>
22
+ {%- endif %}
23
+
24
+ {%- if dlr.variable_groups %}
25
+ <VARIABLE-GROUPS>
26
+ {%- for vg in dlr.variable_groups -%}
27
+ {{ pdv.printVariableGroup(vg)|indent(4) }}
28
+ {%- endfor -%}
29
+ </VARIABLE-GROUPS>
30
+ {%- endif %}
31
+
32
+ {%- if dlr.parent_refs %}
33
+ <PARENT-REFS>
34
+ {%- for parent in dlr.parent_refs -%}
35
+ {{ pparref.printParentRef(parent)|indent(4) }}
36
+ {%- endfor %}
37
+ </PARENT-REFS>
38
+ {%- endif %}
39
+ </FUNCTIONAL-GROUP>
40
+ {%- endmacro %}
@@ -0,0 +1,24 @@
1
+ {#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printDiagLayer.xml.jinja2') as pdl %}
7
+ {%- import('macros/printComparamRef.xml.jinja2') as pcom %}
8
+
9
+ {%- macro printHierarchyElementAttribs(helem) -%}
10
+ {{- pdl.printDiagLayerAttribs(helem) -}}
11
+ {%- endmacro -%}
12
+
13
+ {%- macro printHierarchyElementSubtags(helem) -%}
14
+ {%- set dlr = helem.hierarchy_element_raw %}
15
+ {{- pdl.printDiagLayerSubtags(helem) }}
16
+ {%- if dlr.comparam_refs %}
17
+ <COMPARAM-REFS>
18
+ {%- for cp in dlr.comparam_refs -%}
19
+ {{ pcom.printComparamRef(cp)|indent(2) }}
20
+ {%- endfor %}
21
+ </COMPARAM-REFS>
22
+ {%- endif %}
23
+
24
+ {%- endmacro %}
@@ -0,0 +1,21 @@
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
+
8
+ {%- macro printLibrary(library) %}
9
+ <LIBRARY{#- #} {{-peid.printElementIdAttribs(library)}}{# -#}>
10
+ {{ peid.printElementIdSubtags(library)|indent(1) }}
11
+ <CODE-FILE>{{library.code_file}}</CODE-FILE>
12
+ {%- if library.encryption is not none %}
13
+ <ENCRYPTION>{{library.encryption}}</ENCRYPTION>
14
+ {%- endif %}
15
+ <SYNTAX>{{library.syntax}}</SYNTAX>
16
+ <REVISION>{{library.revision}}</REVISION>
17
+ {%- if library.entrypoint is not none %}
18
+ <ENTRYPOINT>{{library.entrypoint}}</ENTRYPOINT>
19
+ {%- endif %}
20
+ </LIBRARY>
21
+ {%- endmacro %}
@@ -4,10 +4,11 @@
4
4
  -#}
5
5
 
6
6
  {%- import('macros/printElementId.xml.jinja2') as peid %}
7
+ {%- import('macros/printCompuMethod.xml.jinja2') as pcm %}
7
8
  {%- import('macros/printDOP.xml.jinja2') as pdop %}
8
9
 
9
10
  {%- macro printMux(mux) %}
10
- <MUX ID="{{mux.odx_id.local_id}}"
11
+ <MUX {{-peid.printElementIdAttribs(mux)}}
11
12
  {{-make_bool_xml_attrib("IS-VISIBLE", mux.is_visible_raw)}}
12
13
  {#- #}>
13
14
  {{ peid.printElementIdSubtags(mux)|indent(1) }}
@@ -41,8 +42,8 @@
41
42
  {%- if case.structure_snref is not none %}
42
43
  <STRUCTURE-SNREF SHORT_NAME="{{case.structure_snref}}"/>
43
44
  {%- endif %}
44
- {{ pdop.printLimit("LOWER-LIMIT", case.lower_limit) }}
45
- {{ pdop.printLimit("UPPER-LIMIT", case.upper_limit) }}
45
+ {{ pcm.printLimit("LOWER-LIMIT", case.lower_limit) }}
46
+ {{ pcm.printLimit("UPPER-LIMIT", case.upper_limit) }}
46
47
  </CASE>
47
48
  {%- endfor %}
48
49
  </CASES>
@@ -0,0 +1,28 @@
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/printAdminData.xml.jinja2') as pad -%}
8
+ {%- import('macros/printCompanyData.xml.jinja2') as pcd -%}
9
+ {%- import('macros/printSpecialData.xml.jinja2') as psd %}
10
+
11
+ {%- macro printOdxCategoryAttribs(obj) -%}
12
+ {#- #} {{- peid.printElementIdAttribs(obj) }}
13
+ {%- endmacro -%}
14
+
15
+ {%- macro printOdxCategorySubtags(obj) -%}
16
+ {{ peid.printElementIdSubtags(obj) }}
17
+ {%- if obj.admin_data %}
18
+ {{pad.printAdminData(obj.admin_data)|indent(2)}}
19
+ {%- endif %}
20
+ {%- if obj.company_datas %}
21
+ <COMPANY-DATAS>
22
+ {%- for cd in obj.company_datas %}
23
+ {{pcd.printCompanyData(cd)|indent(3)}}
24
+ {%- endfor %}
25
+ </COMPANY-DATAS>
26
+ {%- endif %}
27
+ {{- psd.printSpecialDataGroups(obj.sdgs)|indent(2, first=True) }}
28
+ {%- endmacro -%}