odxtools 6.6.1__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.
- odxtools/__init__.py +7 -5
- odxtools/additionalaudience.py +3 -5
- odxtools/admindata.py +5 -7
- odxtools/audience.py +10 -13
- odxtools/basecomparam.py +3 -5
- odxtools/basicstructure.py +55 -241
- odxtools/cli/_parser_utils.py +16 -1
- odxtools/cli/_print_utils.py +169 -134
- odxtools/cli/browse.py +127 -103
- odxtools/cli/compare.py +114 -87
- odxtools/cli/decode.py +2 -1
- odxtools/cli/dummy_sub_parser.py +3 -1
- odxtools/cli/find.py +2 -1
- odxtools/cli/list.py +26 -16
- odxtools/cli/main.py +1 -0
- odxtools/cli/snoop.py +32 -6
- odxtools/codec.py +211 -0
- odxtools/commrelation.py +122 -0
- odxtools/companydata.py +5 -7
- odxtools/companydocinfo.py +7 -8
- odxtools/companyrevisioninfo.py +3 -5
- odxtools/companyspecificinfo.py +8 -9
- odxtools/comparam.py +4 -6
- odxtools/comparaminstance.py +14 -14
- odxtools/comparamspec.py +16 -54
- odxtools/comparamsubset.py +22 -62
- odxtools/complexcomparam.py +5 -7
- odxtools/compumethods/compucodecompumethod.py +63 -0
- odxtools/compumethods/compuconst.py +31 -0
- odxtools/compumethods/compudefaultvalue.py +27 -0
- odxtools/compumethods/compuinternaltophys.py +56 -0
- odxtools/compumethods/compuinversevalue.py +7 -0
- odxtools/compumethods/compumethod.py +94 -15
- odxtools/compumethods/compuphystointernal.py +56 -0
- odxtools/compumethods/compurationalcoeffs.py +20 -9
- odxtools/compumethods/compuscale.py +67 -32
- odxtools/compumethods/createanycompumethod.py +31 -172
- odxtools/compumethods/identicalcompumethod.py +31 -6
- odxtools/compumethods/limit.py +70 -36
- odxtools/compumethods/linearcompumethod.py +70 -181
- odxtools/compumethods/linearsegment.py +190 -0
- odxtools/compumethods/ratfunccompumethod.py +106 -0
- odxtools/compumethods/ratfuncsegment.py +87 -0
- odxtools/compumethods/scalelinearcompumethod.py +132 -26
- odxtools/compumethods/scaleratfunccompumethod.py +113 -0
- odxtools/compumethods/tabintpcompumethod.py +123 -92
- odxtools/compumethods/texttablecompumethod.py +117 -57
- odxtools/createanydiagcodedtype.py +10 -67
- odxtools/database.py +167 -87
- odxtools/dataobjectproperty.py +25 -32
- odxtools/decodestate.py +14 -17
- odxtools/description.py +47 -0
- odxtools/determinenumberofitems.py +4 -5
- odxtools/diagcodedtype.py +37 -106
- odxtools/diagcomm.py +24 -12
- odxtools/diagdatadictionaryspec.py +120 -96
- odxtools/diaglayercontainer.py +46 -54
- odxtools/diaglayers/basevariant.py +128 -0
- odxtools/diaglayers/basevariantraw.py +123 -0
- odxtools/diaglayers/diaglayer.py +432 -0
- odxtools/{diaglayerraw.py → diaglayers/diaglayerraw.py} +105 -120
- odxtools/diaglayers/diaglayertype.py +42 -0
- odxtools/diaglayers/ecushareddata.py +96 -0
- odxtools/diaglayers/ecushareddataraw.py +87 -0
- odxtools/diaglayers/ecuvariant.py +124 -0
- odxtools/diaglayers/ecuvariantraw.py +129 -0
- odxtools/diaglayers/functionalgroup.py +110 -0
- odxtools/diaglayers/functionalgroupraw.py +106 -0
- odxtools/{diaglayer.py → diaglayers/hierarchyelement.py} +273 -472
- odxtools/diaglayers/hierarchyelementraw.py +58 -0
- odxtools/diaglayers/protocol.py +64 -0
- odxtools/diaglayers/protocolraw.py +91 -0
- odxtools/diagnostictroublecode.py +8 -9
- odxtools/diagservice.py +57 -44
- odxtools/diagvariable.py +113 -0
- odxtools/docrevision.py +5 -7
- odxtools/dopbase.py +15 -15
- odxtools/dtcdop.py +170 -50
- odxtools/dynamicendmarkerfield.py +134 -0
- odxtools/dynamiclengthfield.py +47 -42
- odxtools/dyndefinedspec.py +177 -0
- odxtools/dynenddopref.py +38 -0
- odxtools/ecuvariantmatcher.py +6 -7
- odxtools/element.py +13 -15
- odxtools/encodestate.py +199 -22
- odxtools/endofpdufield.py +31 -18
- odxtools/environmentdata.py +8 -1
- odxtools/environmentdatadescription.py +198 -36
- odxtools/exceptions.py +11 -2
- odxtools/field.py +10 -10
- odxtools/functionalclass.py +3 -5
- odxtools/inputparam.py +3 -12
- odxtools/internalconstr.py +14 -5
- odxtools/isotp_state_machine.py +14 -6
- odxtools/leadinglengthinfotype.py +37 -18
- odxtools/library.py +66 -0
- odxtools/loadfile.py +64 -0
- odxtools/matchingparameter.py +3 -3
- odxtools/message.py +0 -7
- odxtools/minmaxlengthtype.py +61 -33
- odxtools/modification.py +3 -5
- odxtools/multiplexer.py +135 -75
- odxtools/multiplexercase.py +39 -18
- odxtools/multiplexerdefaultcase.py +15 -12
- odxtools/multiplexerswitchkey.py +4 -5
- odxtools/nameditemlist.py +33 -8
- odxtools/negoutputparam.py +3 -5
- odxtools/odxcategory.py +83 -0
- odxtools/odxlink.py +62 -53
- odxtools/odxtypes.py +93 -8
- odxtools/outputparam.py +5 -16
- odxtools/parameterinfo.py +219 -61
- odxtools/parameters/codedconstparameter.py +45 -32
- odxtools/parameters/createanyparameter.py +19 -193
- odxtools/parameters/dynamicparameter.py +25 -4
- odxtools/parameters/lengthkeyparameter.py +83 -25
- odxtools/parameters/matchingrequestparameter.py +48 -18
- odxtools/parameters/nrcconstparameter.py +76 -54
- odxtools/parameters/parameter.py +97 -73
- odxtools/parameters/parameterwithdop.py +41 -38
- odxtools/parameters/physicalconstantparameter.py +41 -20
- odxtools/parameters/reservedparameter.py +36 -18
- odxtools/parameters/systemparameter.py +74 -7
- odxtools/parameters/tableentryparameter.py +47 -7
- odxtools/parameters/tablekeyparameter.py +142 -55
- odxtools/parameters/tablestructparameter.py +79 -58
- odxtools/parameters/valueparameter.py +39 -21
- odxtools/paramlengthinfotype.py +56 -33
- odxtools/parentref.py +20 -3
- odxtools/physicaldimension.py +3 -8
- odxtools/progcode.py +26 -11
- odxtools/protstack.py +3 -5
- odxtools/py.typed +0 -0
- odxtools/relateddoc.py +7 -9
- odxtools/request.py +120 -10
- odxtools/response.py +123 -23
- odxtools/scaleconstr.py +14 -8
- odxtools/servicebinner.py +1 -1
- odxtools/singleecujob.py +12 -10
- odxtools/snrefcontext.py +29 -0
- odxtools/specialdata.py +3 -5
- odxtools/specialdatagroup.py +7 -9
- odxtools/specialdatagroupcaption.py +3 -6
- odxtools/standardlengthtype.py +80 -14
- odxtools/state.py +3 -5
- odxtools/statechart.py +13 -19
- odxtools/statetransition.py +8 -18
- odxtools/staticfield.py +107 -0
- odxtools/subcomponent.py +288 -0
- odxtools/swvariable.py +21 -0
- odxtools/table.py +9 -9
- odxtools/tablerow.py +30 -15
- odxtools/teammember.py +3 -5
- odxtools/templates/comparam-spec.odx-c.xml.jinja2 +4 -24
- odxtools/templates/comparam-subset.odx-cs.xml.jinja2 +5 -26
- odxtools/templates/diag_layer_container.odx-d.xml.jinja2 +15 -31
- odxtools/templates/{index.xml.xml.jinja2 → index.xml.jinja2} +1 -1
- odxtools/templates/macros/printAudience.xml.jinja2 +1 -1
- odxtools/templates/macros/printBaseVariant.xml.jinja2 +53 -0
- odxtools/templates/macros/printCompanyData.xml.jinja2 +4 -7
- odxtools/templates/macros/printComparam.xml.jinja2 +6 -4
- odxtools/templates/macros/printComparamRef.xml.jinja2 +5 -12
- odxtools/templates/macros/printCompuMethod.xml.jinja2 +147 -0
- odxtools/templates/macros/printDOP.xml.jinja2 +27 -137
- odxtools/templates/macros/printDescription.xml.jinja2 +18 -0
- odxtools/templates/macros/printDiagComm.xml.jinja2 +1 -1
- odxtools/templates/macros/printDiagLayer.xml.jinja2 +222 -0
- odxtools/templates/macros/printDiagVariable.xml.jinja2 +66 -0
- odxtools/templates/macros/printDynDefinedSpec.xml.jinja2 +48 -0
- odxtools/templates/macros/printDynamicEndmarkerField.xml.jinja2 +16 -0
- odxtools/templates/macros/printDynamicLengthField.xml.jinja2 +1 -1
- odxtools/templates/macros/printEcuSharedData.xml.jinja2 +30 -0
- odxtools/templates/macros/printEcuVariant.xml.jinja2 +53 -0
- odxtools/templates/macros/printEcuVariantPattern.xml.jinja2 +1 -1
- odxtools/templates/macros/printElementId.xml.jinja2 +8 -3
- odxtools/templates/macros/printEndOfPdu.xml.jinja2 +1 -1
- odxtools/templates/macros/printEnvDataDesc.xml.jinja2 +1 -1
- odxtools/templates/macros/printFunctionalClass.xml.jinja2 +1 -1
- odxtools/templates/macros/printFunctionalGroup.xml.jinja2 +40 -0
- odxtools/templates/macros/printHierarchyElement.xml.jinja2 +24 -0
- odxtools/templates/macros/printLibrary.xml.jinja2 +21 -0
- odxtools/templates/macros/printMux.xml.jinja2 +5 -3
- odxtools/templates/macros/printOdxCategory.xml.jinja2 +28 -0
- odxtools/templates/macros/printParam.xml.jinja2 +18 -19
- odxtools/templates/macros/printProtStack.xml.jinja2 +1 -1
- odxtools/templates/macros/printProtocol.xml.jinja2 +30 -0
- odxtools/templates/macros/printRequest.xml.jinja2 +1 -1
- odxtools/templates/macros/printResponse.xml.jinja2 +1 -1
- odxtools/templates/macros/printService.xml.jinja2 +3 -2
- odxtools/templates/macros/printSingleEcuJob.xml.jinja2 +5 -26
- odxtools/templates/macros/printSpecialData.xml.jinja2 +1 -1
- odxtools/templates/macros/printState.xml.jinja2 +1 -1
- odxtools/templates/macros/printStateChart.xml.jinja2 +1 -1
- odxtools/templates/macros/printStateTransition.xml.jinja2 +1 -1
- odxtools/templates/macros/printStaticField.xml.jinja2 +15 -0
- odxtools/templates/macros/printStructure.xml.jinja2 +1 -1
- odxtools/templates/macros/printSubComponent.xml.jinja2 +104 -0
- odxtools/templates/macros/printTable.xml.jinja2 +4 -5
- odxtools/templates/macros/printUnitSpec.xml.jinja2 +3 -5
- odxtools/uds.py +2 -10
- odxtools/unit.py +4 -8
- odxtools/unitgroup.py +3 -5
- odxtools/unitspec.py +17 -17
- odxtools/utils.py +38 -20
- odxtools/variablegroup.py +32 -0
- odxtools/version.py +2 -2
- odxtools/{write_pdx_file.py → writepdxfile.py} +22 -12
- odxtools/xdoc.py +3 -5
- {odxtools-6.6.1.dist-info → odxtools-9.3.0.dist-info}/METADATA +44 -33
- odxtools-9.3.0.dist-info/RECORD +228 -0
- {odxtools-6.6.1.dist-info → odxtools-9.3.0.dist-info}/WHEEL +1 -1
- odxtools/createcompanydatas.py +0 -17
- odxtools/createsdgs.py +0 -19
- odxtools/diaglayertype.py +0 -30
- odxtools/load_file.py +0 -13
- odxtools/load_odx_d_file.py +0 -6
- odxtools/load_pdx_file.py +0 -8
- odxtools/templates/macros/printVariant.xml.jinja2 +0 -208
- odxtools-6.6.1.dist-info/RECORD +0 -180
- {odxtools-6.6.1.dist-info → odxtools-9.3.0.dist-info}/LICENSE +0 -0
- {odxtools-6.6.1.dist-info → odxtools-9.3.0.dist-info}/entry_points.txt +0 -0
- {odxtools-6.6.1.dist-info → odxtools-9.3.0.dist-info}/top_level.txt +0 -0
odxtools/table.py
CHANGED
@@ -1,22 +1,19 @@
|
|
1
1
|
# SPDX-License-Identifier: MIT
|
2
2
|
from dataclasses import dataclass
|
3
|
-
from typing import
|
3
|
+
from typing import Any, Dict, List, Optional, Union
|
4
4
|
from xml.etree import ElementTree
|
5
5
|
|
6
6
|
from .admindata import AdminData
|
7
|
-
from .createsdgs import create_sdgs_from_et
|
8
7
|
from .dataobjectproperty import DataObjectProperty
|
9
8
|
from .element import IdentifiableElement
|
10
9
|
from .exceptions import odxassert
|
11
10
|
from .nameditemlist import NamedItemList
|
12
11
|
from .odxlink import OdxDocFragment, OdxLinkDatabase, OdxLinkId, OdxLinkRef
|
12
|
+
from .snrefcontext import SnRefContext
|
13
13
|
from .specialdatagroup import SpecialDataGroup
|
14
14
|
from .tablerow import TableRow
|
15
15
|
from .utils import dataclass_fields_asdict
|
16
16
|
|
17
|
-
if TYPE_CHECKING:
|
18
|
-
from .diaglayer import DiagLayer
|
19
|
-
|
20
17
|
|
21
18
|
@dataclass
|
22
19
|
class Table(IdentifiableElement):
|
@@ -45,11 +42,14 @@ class Table(IdentifiableElement):
|
|
45
42
|
for sub_elem in et_element:
|
46
43
|
if sub_elem.tag == "TABLE-ROW":
|
47
44
|
table_rows_raw.append(
|
48
|
-
TableRow.
|
45
|
+
TableRow.tablerow_from_et(
|
46
|
+
sub_elem, doc_frags, table_ref=OdxLinkRef.from_id(odx_id)))
|
49
47
|
elif sub_elem.tag == "TABLE-ROW-REF":
|
50
48
|
table_rows_raw.append(OdxLinkRef.from_et(sub_elem, doc_frags))
|
51
49
|
|
52
|
-
sdgs =
|
50
|
+
sdgs = [
|
51
|
+
SpecialDataGroup.from_et(sdge, doc_frags) for sdge in et_element.iterfind("SDGS/SDG")
|
52
|
+
]
|
53
53
|
|
54
54
|
return Table(
|
55
55
|
semantic=semantic,
|
@@ -98,7 +98,7 @@ class Table(IdentifiableElement):
|
|
98
98
|
|
99
99
|
self._table_rows = NamedItemList(table_rows)
|
100
100
|
|
101
|
-
def _resolve_snrefs(self,
|
101
|
+
def _resolve_snrefs(self, context: SnRefContext) -> None:
|
102
102
|
for table_row_wrapper in self.table_rows_raw:
|
103
103
|
if isinstance(table_row_wrapper, TableRow):
|
104
|
-
table_row_wrapper._resolve_snrefs(
|
104
|
+
table_row_wrapper._resolve_snrefs(context)
|
odxtools/tablerow.py
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
# SPDX-License-Identifier: MIT
|
2
|
-
from dataclasses import dataclass
|
3
|
-
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
2
|
+
from dataclasses import dataclass, fields
|
3
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
|
4
4
|
from xml.etree import ElementTree
|
5
5
|
|
6
6
|
from .basicstructure import BasicStructure
|
7
|
-
from .createsdgs import create_sdgs_from_et
|
8
7
|
from .dataobjectproperty import DataObjectProperty
|
9
8
|
from .dtcdop import DtcDop
|
10
9
|
from .element import IdentifiableElement
|
11
10
|
from .exceptions import odxassert, odxraise, odxrequire
|
12
|
-
from .odxlink import OdxDocFragment, OdxLinkDatabase, OdxLinkId, OdxLinkRef
|
11
|
+
from .odxlink import OdxDocFragment, OdxLinkDatabase, OdxLinkId, OdxLinkRef, resolve_snref
|
13
12
|
from .odxtypes import AtomicOdxType
|
13
|
+
from .snrefcontext import SnRefContext
|
14
14
|
from .specialdatagroup import SpecialDataGroup
|
15
15
|
from .utils import dataclass_fields_asdict
|
16
16
|
|
17
17
|
if TYPE_CHECKING:
|
18
|
-
from .diaglayer import DiagLayer
|
19
18
|
from .table import Table
|
20
19
|
|
21
20
|
|
@@ -51,9 +50,13 @@ class TableRow(IdentifiableElement):
|
|
51
50
|
)
|
52
51
|
|
53
52
|
@staticmethod
|
54
|
-
def from_et(
|
55
|
-
|
56
|
-
|
53
|
+
def from_et(et_element: ElementTree.Element, doc_frags: List[OdxDocFragment]) -> Any:
|
54
|
+
raise RuntimeError(
|
55
|
+
"Calling TableRow.from_et() is not allowed. Use TableRow.tablerow_from_et().")
|
56
|
+
|
57
|
+
@staticmethod
|
58
|
+
def tablerow_from_et(et_element: ElementTree.Element, doc_frags: List[OdxDocFragment], *,
|
59
|
+
table_ref: OdxLinkRef) -> "TableRow":
|
57
60
|
"""Reads a TABLE-ROW."""
|
58
61
|
kwargs = dataclass_fields_asdict(IdentifiableElement.from_et(et_element, doc_frags))
|
59
62
|
semantic = et_element.get("SEMANTIC")
|
@@ -66,7 +69,9 @@ class TableRow(IdentifiableElement):
|
|
66
69
|
dop_snref: Optional[str] = None
|
67
70
|
if (dop_snref_elem := et_element.find("DATA-OBJECT-PROP-SNREF")) is not None:
|
68
71
|
dop_snref = dop_snref_elem.attrib["SHORT-NAME"]
|
69
|
-
sdgs =
|
72
|
+
sdgs = [
|
73
|
+
SpecialDataGroup.from_et(sdge, doc_frags) for sdge in et_element.iterfind("SDGS/SDG")
|
74
|
+
]
|
70
75
|
|
71
76
|
return TableRow(
|
72
77
|
table_ref=table_ref,
|
@@ -95,12 +100,15 @@ class TableRow(IdentifiableElement):
|
|
95
100
|
if not isinstance(self._dop, (DataObjectProperty, DtcDop)):
|
96
101
|
odxraise("The DOP-REF of TABLE-ROWs must reference a simple DOP!")
|
97
102
|
|
98
|
-
|
103
|
+
if TYPE_CHECKING:
|
104
|
+
self._table = odxlinks.resolve(self.table_ref, Table)
|
105
|
+
else:
|
106
|
+
self._table = odxlinks.resolve(self.table_ref)
|
99
107
|
|
100
108
|
for sdg in self.sdgs:
|
101
109
|
sdg._resolve_odxlinks(odxlinks)
|
102
110
|
|
103
|
-
def _resolve_snrefs(self,
|
111
|
+
def _resolve_snrefs(self, context: SnRefContext) -> None:
|
104
112
|
# convert the raw key into the proper internal
|
105
113
|
# representation. note that we cannot do this earlier because
|
106
114
|
# the table's ODXLINKs must be resolved and the order of
|
@@ -118,15 +126,17 @@ class TableRow(IdentifiableElement):
|
|
118
126
|
else:
|
119
127
|
self._key = key_dop.physical_type.base_data_type.from_string(self.key_raw)
|
120
128
|
|
121
|
-
ddd_spec = diag_layer.diag_data_dictionary_spec
|
129
|
+
ddd_spec = odxrequire(context.diag_layer).diag_data_dictionary_spec
|
122
130
|
|
123
131
|
if self.structure_snref is not None:
|
124
|
-
self._structure =
|
132
|
+
self._structure = resolve_snref(self.structure_snref, ddd_spec.structures,
|
133
|
+
BasicStructure)
|
125
134
|
if self.dop_snref is not None:
|
126
|
-
self._dop =
|
135
|
+
self._dop = resolve_snref(self.dop_snref, ddd_spec.data_object_props,
|
136
|
+
DataObjectProperty)
|
127
137
|
|
128
138
|
for sdg in self.sdgs:
|
129
|
-
sdg._resolve_snrefs(
|
139
|
+
sdg._resolve_snrefs(context)
|
130
140
|
|
131
141
|
@property
|
132
142
|
def table(self) -> "Table":
|
@@ -147,3 +157,8 @@ class TableRow(IdentifiableElement):
|
|
147
157
|
def dop(self) -> Optional[DataObjectProperty]:
|
148
158
|
"""The data object property object resolved by dop_ref."""
|
149
159
|
return self._dop
|
160
|
+
|
161
|
+
def __reduce__(self) -> Tuple[Any, ...]:
|
162
|
+
"""This ensures that the object can be correctly reconstructed during unpickling."""
|
163
|
+
state = self.__dict__.copy()
|
164
|
+
return self.__class__, tuple([getattr(self, x.name) for x in fields(self)]), state
|
odxtools/teammember.py
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
# SPDX-License-Identifier: MIT
|
2
2
|
from dataclasses import dataclass
|
3
|
-
from typing import
|
3
|
+
from typing import Any, Dict, List, Optional
|
4
4
|
from xml.etree import ElementTree
|
5
5
|
|
6
6
|
from .element import IdentifiableElement
|
7
7
|
from .exceptions import odxrequire
|
8
8
|
from .odxlink import OdxDocFragment, OdxLinkDatabase, OdxLinkId
|
9
|
+
from .snrefcontext import SnRefContext
|
9
10
|
from .utils import dataclass_fields_asdict
|
10
11
|
|
11
|
-
if TYPE_CHECKING:
|
12
|
-
from .diaglayer import DiagLayer
|
13
|
-
|
14
12
|
|
15
13
|
@dataclass
|
16
14
|
class TeamMember(IdentifiableElement):
|
@@ -55,5 +53,5 @@ class TeamMember(IdentifiableElement):
|
|
55
53
|
def _resolve_odxlinks(self, odxlinks: OdxLinkDatabase) -> None:
|
56
54
|
pass
|
57
55
|
|
58
|
-
def _resolve_snrefs(self,
|
56
|
+
def _resolve_snrefs(self, context: SnRefContext) -> None:
|
59
57
|
pass
|
@@ -5,35 +5,15 @@
|
|
5
5
|
# This template writes an .odx-c file for a communication
|
6
6
|
# parameter specification.
|
7
7
|
-#}
|
8
|
-
{%- import('macros/
|
9
|
-
{%- import('macros/printCompanyData.xml.jinja2') as pcd -%}
|
8
|
+
{%- import('macros/printOdxCategory.xml.jinja2') as poc %}
|
10
9
|
{%- import('macros/printProtStack.xml.jinja2') as pps %}
|
11
10
|
{#- -#}
|
12
11
|
|
13
12
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
14
|
-
<ODX MODEL-VERSION="2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="odx.xsd">
|
15
13
|
<!-- Written using odxtools {{odxtools_version}} -->
|
16
|
-
|
17
|
-
|
18
|
-
{
|
19
|
-
<LONG-NAME>{{comparam_spec.long_name|e}}</LONG-NAME>
|
20
|
-
{%- endif %}
|
21
|
-
{%- if comparam_spec.description and comparam_spec.description.strip() %}
|
22
|
-
<DESC>
|
23
|
-
{{comparam_spec.description}}
|
24
|
-
</DESC>
|
25
|
-
{%- endif %}
|
26
|
-
{%- if comparam_spec.admin_data is not none %}
|
27
|
-
{{- pad.printAdminData(comparam_spec.admin_data) | indent(3) }}
|
28
|
-
{%- endif %}
|
29
|
-
{%- if comparam_spec.company_datas %}
|
30
|
-
<COMPANY-DATAS>
|
31
|
-
{%- for cd in comparam_spec.company_datas %}
|
32
|
-
{{- pcd.printCompanyData(cd) | indent(5) -}}
|
33
|
-
{%- endfor %}
|
34
|
-
</COMPANY-DATAS>
|
35
|
-
{%- endif %}
|
36
|
-
|
14
|
+
<ODX MODEL-VERSION="2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="odx.xsd">
|
15
|
+
<COMPARAM-SPEC {{- poc.printOdxCategoryAttribs(comparam_spec) }}>
|
16
|
+
{{- poc.printOdxCategorySubtags(comparam_spec)|indent(3) }}
|
37
17
|
{%- if comparam_spec.prot_stacks %}
|
38
18
|
<PROT-STACKS>
|
39
19
|
{%- for ps in comparam_spec.prot_stacks %}
|
@@ -5,39 +5,18 @@
|
|
5
5
|
# This template writes an .odx-cs file for a communication
|
6
6
|
# parameter subset.
|
7
7
|
-#}
|
8
|
+
{%- import('macros/printOdxCategory.xml.jinja2') as poc %}
|
8
9
|
{%- import('macros/printComparam.xml.jinja2') as pcp -%}
|
9
|
-
{%- import('macros/printAdminData.xml.jinja2') as pad -%}
|
10
|
-
{%- import('macros/printCompanyData.xml.jinja2') as pcd -%}
|
11
10
|
{%- import('macros/printDOP.xml.jinja2') as pdop %}
|
12
11
|
{%- import('macros/printUnitSpec.xml.jinja2') as pus %}
|
13
|
-
{%- import('macros/
|
12
|
+
{%- import('macros/printDescription.xml.jinja2') as pd %}
|
14
13
|
{#- -#}
|
15
14
|
|
16
15
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
17
|
-
<ODX MODEL-VERSION="2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="odx.xsd">
|
18
16
|
<!-- Written using odxtools {{odxtools_version}} -->
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
{%- if comparam_subset.long_name is not none %}
|
23
|
-
<LONG-NAME>{{comparam_subset.long_name|e}}</LONG-NAME>
|
24
|
-
{%- endif %}
|
25
|
-
{%- if comparam_subset.description and comparam_subset.description.strip() %}
|
26
|
-
<DESC>
|
27
|
-
{{comparam_subset.description}}
|
28
|
-
</DESC>
|
29
|
-
{%- endif %}
|
30
|
-
{%- if comparam_subset.admin_data is not none %}
|
31
|
-
{{- pad.printAdminData(comparam_subset.admin_data) | indent(3) }}
|
32
|
-
{%- endif %}
|
33
|
-
{%- if comparam_subset.company_datas %}
|
34
|
-
<COMPANY-DATAS>
|
35
|
-
{%- for cd in comparam_subset.company_datas %}
|
36
|
-
{{- pcd.printCompanyData(cd) | indent(5, first=True) }}
|
37
|
-
{%- endfor %}
|
38
|
-
</COMPANY-DATAS>
|
39
|
-
{%- endif %}
|
40
|
-
{{- psd.printSpecialDataGroups(comparam_subset.sdgs)|indent(3, first=True) }}
|
17
|
+
<ODX MODEL-VERSION="2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="odx.xsd">
|
18
|
+
<COMPARAM-SUBSET {{- poc.printOdxCategoryAttribs(comparam_subset) }} {{make_xml_attrib("CATEGORY", comparam_subset.category)}}>
|
19
|
+
{{- poc.printOdxCategorySubtags(comparam_subset)|indent(3) }}
|
41
20
|
{%- if comparam_subset.comparams %}
|
42
21
|
<COMPARAMS>
|
43
22
|
{%- for cp in comparam_subset.comparams %}
|
@@ -2,68 +2,52 @@
|
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: MIT
|
4
4
|
-#}
|
5
|
-
{%- import('macros/
|
6
|
-
{%- import('macros/
|
7
|
-
{%- import('macros/
|
8
|
-
{%- import('macros/
|
5
|
+
{%- import('macros/printOdxCategory.xml.jinja2') as poc %}
|
6
|
+
{%- import('macros/printEcuSharedData.xml.jinja2') as pecusd -%}
|
7
|
+
{%- import('macros/printProtocol.xml.jinja2') as pprot %}
|
8
|
+
{%- import('macros/printFunctionalGroup.xml.jinja2') as pfuncgroup %}
|
9
|
+
{%- import('macros/printEcuSharedData.xml.jinja2') as pecusd %}
|
10
|
+
{%- import('macros/printBaseVariant.xml.jinja2') as pbv %}
|
11
|
+
{%- import('macros/printEcuVariant.xml.jinja2') as pecuv %}
|
9
12
|
{#- -#}
|
10
13
|
|
11
14
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
15
|
+
<!-- Written using odxtools {{odxtools_version}} -->
|
12
16
|
<ODX MODEL-VERSION="2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="odx.xsd">
|
13
|
-
|
14
|
-
|
15
|
-
<SHORT-NAME>{{dlc.short_name}}</SHORT-NAME>
|
16
|
-
{%- if dlc.long_name %}
|
17
|
-
<LONG-NAME>{{dlc.long_name|e}}</LONG-NAME>
|
18
|
-
{%- endif %}
|
19
|
-
{%- if dlc.description %}
|
20
|
-
<DESC>
|
21
|
-
{{dlc.description}}
|
22
|
-
</DESC>
|
23
|
-
{%- endif %}
|
24
|
-
{%- if dlc.admin_data %}
|
25
|
-
{{pad.printAdminData(dlc.admin_data)|indent(2)}}
|
26
|
-
{%- endif %}
|
27
|
-
{%- if dlc.company_datas %}
|
28
|
-
<COMPANY-DATAS>
|
29
|
-
{%- for cd in dlc.company_datas %}
|
30
|
-
{{pcd.printCompanyData(cd)|indent(3)}}
|
31
|
-
{%- endfor %}
|
32
|
-
</COMPANY-DATAS>
|
33
|
-
{%- endif %}
|
34
|
-
{{- psd.printSpecialDataGroups(dlc.sdgs)|indent(2, first=True) }}
|
17
|
+
<DIAG-LAYER-CONTAINER {{- poc.printOdxCategoryAttribs(dlc) }}>
|
18
|
+
{{- poc.printOdxCategorySubtags(dlc)|indent(3) }}
|
35
19
|
{%- if dlc.protocols %}
|
36
20
|
<PROTOCOLS>
|
37
21
|
{%- for dl in dlc.protocols %}
|
38
|
-
{{
|
22
|
+
{{pprot.printProtocol(dl)|indent(3)}}
|
39
23
|
{%- endfor %}
|
40
24
|
</PROTOCOLS>
|
41
25
|
{%- endif %}
|
42
26
|
{%- if dlc.functional_groups %}
|
43
27
|
<FUNCTIONAL-GROUPS>
|
44
28
|
{%- for dl in dlc.functional_groups %}
|
45
|
-
{{
|
29
|
+
{{pfuncgroup.printFunctionalGroup(dl)|indent(3)}}
|
46
30
|
{%- endfor %}
|
47
31
|
</FUNCTIONAL-GROUPS>
|
48
32
|
{%- endif %}
|
49
33
|
{%- if dlc.ecu_shared_datas %}
|
50
34
|
<ECU-SHARED-DATAS>
|
51
35
|
{%- for dl in dlc.ecu_shared_datas %}
|
52
|
-
{{
|
36
|
+
{{pecusd.printEcuSharedData(dl)|indent(3)}}
|
53
37
|
{%- endfor %}
|
54
38
|
</ECU-SHARED-DATAS>
|
55
39
|
{%- endif %}
|
56
40
|
{%- if dlc.base_variants %}
|
57
41
|
<BASE-VARIANTS>
|
58
42
|
{%- for dl in dlc.base_variants %}
|
59
|
-
{{
|
43
|
+
{{pbv.printBaseVariant(dl)|indent(3)}}
|
60
44
|
{%- endfor %}
|
61
45
|
</BASE-VARIANTS>
|
62
46
|
{%- endif %}
|
63
47
|
{%- if dlc.ecu_variants %}
|
64
48
|
<ECU-VARIANTS>
|
65
49
|
{%- for dl in dlc.ecu_variants %}
|
66
|
-
{{
|
50
|
+
{{pecuv.printEcuVariant(dl)|indent(3)}}
|
67
51
|
{%- endfor %}
|
68
52
|
</ECU-VARIANTS>
|
69
53
|
{%- endif %}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
-#}
|
5
5
|
<?xml version="1.0" encoding="UTF-8"?>
|
6
6
|
<CATALOG xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" F-DTD-VERSION="ODX-2.2.0" xsi:noNamespaceSchemaLocation="odx-cc.xsd">
|
7
|
-
<SHORT-NAME>{{
|
7
|
+
<SHORT-NAME>{{database.short_name}}</SHORT-NAME>
|
8
8
|
<ABLOCKS>
|
9
9
|
{%- for file_name, creation_date, mime_type in file_index %}
|
10
10
|
<ABLOCK UPD="UNCHANGED">
|
@@ -6,7 +6,7 @@
|
|
6
6
|
{%- import('macros/printElementId.xml.jinja2') as peid %}
|
7
7
|
|
8
8
|
{%- macro printAdditionalAudience(audience) -%}
|
9
|
-
<ADDITIONAL-AUDIENCE
|
9
|
+
<ADDITIONAL-AUDIENCE {{-peid.printElementIdAttribs(audience)}}>
|
10
10
|
{{ peid.printElementIdSubtags(audience)|indent(1) }}
|
11
11
|
</ADDITIONAL-AUDIENCE>
|
12
12
|
{%- 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
|
+
|
10
|
+
{%- macro printBaseVariant(base_variant) -%}
|
11
|
+
<BASE-VARIANT {{- phe.printHierarchyElementAttribs(base_variant) -}}>
|
12
|
+
{{ phe.printHierarchyElementSubtags(base_variant) | indent(2) }}
|
13
|
+
{%- set dlr = base_variant.base_variant_raw %}
|
14
|
+
|
15
|
+
{%- if dlr.diag_variables %}
|
16
|
+
<DIAG-VARIABLES>
|
17
|
+
{%- for dv in dlr.diag_variables -%}
|
18
|
+
{{ pdv.printDiagVariable(dv)|indent(4) }}
|
19
|
+
{%- endfor -%}
|
20
|
+
</DIAG-VARIABLES>
|
21
|
+
{%- endif %}
|
22
|
+
|
23
|
+
{%- if dlr.variable_groups %}
|
24
|
+
<VARIABLE-GROUPS>
|
25
|
+
{%- for vg in dlr.variable_groups -%}
|
26
|
+
{{ pdv.printVariableGroup(vg)|indent(4) }}
|
27
|
+
{%- endfor -%}
|
28
|
+
</VARIABLE-GROUPS>
|
29
|
+
{%- endif %}
|
30
|
+
|
31
|
+
{%- if dlr.dyn_defined_spec %}
|
32
|
+
{{ pdynspec.printPrintDefinedSpec(dlr.dyn_defined_spec)|indent(4) }}
|
33
|
+
{%- endif %}
|
34
|
+
|
35
|
+
{#
|
36
|
+
{%- if dlr.base_variant_patterns %}
|
37
|
+
<BASE-VARIANT-PATTERNS>
|
38
|
+
{%- for vp in dlr.base_variant_patterns -%}
|
39
|
+
{{ pvpat.printBaseVariantPattern(vp)|indent(4) }}
|
40
|
+
{%- endfor -%}
|
41
|
+
</BASE-VARIANT-PATTERNS>
|
42
|
+
{%- endif %}
|
43
|
+
#}
|
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
|
+
</BASE-VARIANT>
|
53
|
+
{%- endmacro %}
|
@@ -5,9 +5,10 @@
|
|
5
5
|
|
6
6
|
{%- import('macros/printElementId.xml.jinja2') as peid %}
|
7
7
|
{%- import('macros/printSpecialData.xml.jinja2') as psd %}
|
8
|
+
{%- import('macros/printDescription.xml.jinja2') as pd %}
|
8
9
|
|
9
10
|
{%- macro printCompanyData(company_data) %}
|
10
|
-
<COMPANY-DATA
|
11
|
+
<COMPANY-DATA {{-peid.printElementIdAttribs(company_data)}}>
|
11
12
|
{{ peid.printElementIdSubtags(company_data)|indent(1) }}
|
12
13
|
{%- if company_data.roles is not none %}
|
13
14
|
<ROLES>
|
@@ -19,7 +20,7 @@
|
|
19
20
|
{%- if company_data.team_members is not none %}
|
20
21
|
<TEAM-MEMBERS>
|
21
22
|
{%- for team_member in company_data.team_members %}
|
22
|
-
<TEAM-MEMBER
|
23
|
+
<TEAM-MEMBER {{-peid.printElementIdAttribs(team_member)}}>
|
23
24
|
{{ peid.printElementIdSubtags(team_member)|indent(3) }}
|
24
25
|
{%- if team_member.roles is not none %}
|
25
26
|
<ROLES>
|
@@ -81,11 +82,7 @@
|
|
81
82
|
{%- endif %}
|
82
83
|
</XDOC>
|
83
84
|
{%- endif %}
|
84
|
-
{
|
85
|
-
<DESC>
|
86
|
-
{{rd.description}}
|
87
|
-
</DESC>
|
88
|
-
{%- endif %}
|
85
|
+
{{pd.printDescription(rd.description)}}
|
89
86
|
</RELATED-DOC>
|
90
87
|
{%- endfor %}
|
91
88
|
</RELATED-DOCS>
|
@@ -38,19 +38,21 @@
|
|
38
38
|
{%- endmacro %}
|
39
39
|
|
40
40
|
{%- macro printSimpleComparam(cp) %}
|
41
|
-
<COMPARAM
|
41
|
+
<COMPARAM {{-peid.printElementIdAttribs(cp)}}
|
42
42
|
PARAM-CLASS="{{cp.param_class}}"
|
43
43
|
CPTYPE="{{cp.cptype.value}}"
|
44
44
|
{{make_xml_attrib("DISPLAY-LEVEL", cp.display_level)}}{#- #}
|
45
45
|
CPUSAGE="{{cp.cpusage.value}}">
|
46
46
|
{{ peid.printElementIdSubtags(cp)|indent(1) }}
|
47
|
-
|
47
|
+
{%- if cp.physical_default_value is not none %}
|
48
|
+
<PHYSICAL-DEFAULT-VALUE>{{cp.physical_default_value | e}}</PHYSICAL-DEFAULT-VALUE>
|
49
|
+
{%- endif %}
|
48
50
|
<DATA-OBJECT-PROP-REF ID-REF="{{cp.dop_ref.ref_id}}" />
|
49
51
|
</COMPARAM>
|
50
52
|
{%- endmacro %}
|
51
53
|
|
52
54
|
{%- macro printComplexComparam(cp) %}
|
53
|
-
<COMPLEX-COMPARAM
|
55
|
+
<COMPLEX-COMPARAM {{-peid.printElementIdAttribs(cp)}}
|
54
56
|
PARAM-CLASS="{{cp.param_class}}"
|
55
57
|
CPTYPE="{{cp.cptype.value}}"
|
56
58
|
{{make_xml_attrib("DISPLAY-LEVEL", cp.display_level)}}{#- #}
|
@@ -61,7 +63,7 @@
|
|
61
63
|
{%- for sub_cp in cp.subparams %}
|
62
64
|
{{- printAnyComparam(sub_cp) | indent(1, first=True) }}
|
63
65
|
{%- endfor %}
|
64
|
-
{%- if
|
66
|
+
{%- if cp.physical_default_value is not none %}
|
65
67
|
{{ printComplexValue(cp.physical_default_value, "COMPLEX-PHYSICAL-DEFAULT-VALUE") | indent(1) }}
|
66
68
|
{%- endif %}
|
67
69
|
</COMPLEX-COMPARAM>
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
4
4
|
-#}
|
5
5
|
{%- import('macros/printComparam.xml.jinja2') as pcp %}
|
6
|
+
{%- import('macros/printDescription.xml.jinja2') as pd %}
|
6
7
|
{#- -#}
|
7
8
|
|
8
9
|
{%- macro printComparamRef(cp) %}
|
@@ -11,27 +12,19 @@
|
|
11
12
|
DOCTYPE="COMPARAM-SUBSET">
|
12
13
|
{%- if cp.value is string %}
|
13
14
|
<SIMPLE-VALUE>{{cp.value}}</SIMPLE-VALUE>
|
14
|
-
{
|
15
|
-
<DESC>{{cp.description}}</DESC>
|
16
|
-
{%- endif %}
|
15
|
+
{{ pd.printDescription(cp.description) }}
|
17
16
|
{%- elif cp.value is iterable %}
|
18
17
|
{%- if hasattr(cp.value, "hex") %}
|
19
18
|
{#- the value has a hex() method. assume that is a bytes or bytestring #}
|
20
19
|
<SIMPLE-VALUE>{{cp.value.hex().upper()}}</SIMPLE-VALUE>
|
21
|
-
{
|
22
|
-
<DESC>{{cp.description}}</DESC>
|
23
|
-
{%- endif %}
|
20
|
+
{{ pd.printDescription(cp.description) }}
|
24
21
|
{%- else %}
|
25
22
|
{{ pcp.printComplexValue(cp.value)|indent(1) }}
|
26
|
-
{
|
27
|
-
<DESC>{{cp.description}}</DESC>
|
28
|
-
{%- endif %}
|
23
|
+
{{ pd.printDescription(cp.description) }}
|
29
24
|
{%- endif %}
|
30
25
|
{%- else %}
|
31
26
|
<SIMPLE-VALUE>{{cp.value}}</SIMPLE-VALUE>
|
32
|
-
{
|
33
|
-
<DESC>{{cp.description}}</DESC>
|
34
|
-
{%- endif %}
|
27
|
+
{{ pd.printDescription(cp.description) }}
|
35
28
|
{%- endif %}
|
36
29
|
{%- if cp.prot_stack_snref is not none %}
|
37
30
|
<PROT-STACK-SNREF SHORT-NAME="{{cp.prot_stack_snref}}"/>
|