armodel 1.5.0__py3-none-any.whl → 1.6.1__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 (96) hide show
  1. armodel/cli/arxml_dump_cli.py +13 -13
  2. armodel/cli/memory_section_cli.py +76 -0
  3. armodel/cli/system_signal_cli.py +74 -0
  4. armodel/data_models/sw_connector.py +3 -3
  5. armodel/lib/__init__.py +2 -1
  6. armodel/lib/system_signal.py +37 -0
  7. armodel/models/__init__.py +9 -4
  8. armodel/models/annotation.py +27 -3
  9. armodel/models/ar_object.py +18 -6
  10. armodel/models/ar_package.py +271 -127
  11. armodel/models/ar_ref.py +11 -166
  12. armodel/models/bsw_module_template.py +37 -14
  13. armodel/models/common_structure.py +91 -174
  14. armodel/models/communication.py +2 -2
  15. armodel/models/data_prototype.py +41 -6
  16. armodel/models/datatype.py +16 -74
  17. armodel/models/end_to_end_protection.py +1 -1
  18. armodel/models/fibex/can_communication.py +119 -3
  19. armodel/models/fibex/fibex_4_can/__init__.py +0 -0
  20. armodel/models/fibex/fibex_4_lin/__init__.py +0 -0
  21. armodel/models/fibex/fibex_4_multiplatform.py +81 -88
  22. armodel/models/fibex/fibex_core/__init__.py +0 -0
  23. armodel/models/fibex/fibex_core/core_communication.py +627 -0
  24. armodel/models/fibex/fibex_core/core_topology.py +180 -0
  25. armodel/models/fibex/lin_communication.py +24 -3
  26. armodel/models/general_structure.py +110 -11
  27. armodel/models/internal_behavior.py +1 -1
  28. armodel/models/m2/__init__.py +0 -0
  29. armodel/models/m2/autosar_templates/__init__.py +0 -0
  30. armodel/models/m2/autosar_templates/common_structure/__init__.py +188 -0
  31. armodel/models/m2/autosar_templates/common_structure/constants.py +0 -0
  32. armodel/models/m2/autosar_templates/common_structure/implementation.py +21 -0
  33. armodel/models/m2/autosar_templates/common_structure/implementation_data_types.py +148 -0
  34. armodel/models/m2/autosar_templates/ecuc_description_template.py +269 -0
  35. armodel/models/m2/autosar_templates/generic_structure/__init__.py +0 -0
  36. armodel/models/m2/autosar_templates/generic_structure/abstract_structure.py +69 -0
  37. armodel/models/m2/autosar_templates/sw_component_template/__init__.py +0 -0
  38. armodel/models/m2/autosar_templates/sw_component_template/communication.py +360 -0
  39. armodel/models/m2/autosar_templates/sw_component_template/components/__init__.py +246 -0
  40. armodel/models/m2/autosar_templates/sw_component_template/components/instance_refs.py +181 -0
  41. armodel/models/m2/autosar_templates/sw_component_template/composition/__init__.py +154 -0
  42. armodel/models/m2/autosar_templates/sw_component_template/composition/instance_refs.py +157 -0
  43. armodel/models/m2/autosar_templates/sw_component_template/data_type/__init__.py +0 -0
  44. armodel/models/m2/autosar_templates/sw_component_template/data_type/data_prototypes.py +104 -0
  45. armodel/models/m2/autosar_templates/sw_component_template/port_interface/__init__.py +243 -0
  46. armodel/models/m2/autosar_templates/sw_component_template/port_interface/instance_refs.py +39 -0
  47. armodel/models/m2/autosar_templates/sw_component_template/port_interface.py +236 -0
  48. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/__init__.py +203 -0
  49. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/access_count.py +13 -0
  50. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py +46 -0
  51. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/instance_refs_usage.py +169 -0
  52. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py +38 -0
  53. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py +27 -0
  54. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/trigger.py +10 -0
  55. armodel/models/m2/autosar_templates/system_template/__init__.py +321 -0
  56. armodel/models/m2/autosar_templates/system_template/data_mapping.py +88 -0
  57. armodel/models/m2/autosar_templates/system_template/instance_refs.py +48 -0
  58. armodel/models/m2/autosar_templates/system_template/network_management.py +554 -0
  59. armodel/models/m2/autosar_templates/system_template/transport_protocols.py +7 -0
  60. armodel/models/m2/msr/__init__.py +0 -0
  61. armodel/models/m2/msr/asam_hdo/__init__.py +0 -0
  62. armodel/models/m2/msr/asam_hdo/units.py +105 -0
  63. armodel/models/m2/msr/data_dictionary/__init__.py +0 -0
  64. armodel/models/m2/msr/data_dictionary/auxillary_objects.py +42 -0
  65. armodel/models/m2/msr/data_dictionary/data_def_properties.py +295 -0
  66. armodel/models/m2/msr/documentation/__init__.py +0 -0
  67. armodel/models/m2/msr/documentation/block_elements.py +18 -0
  68. armodel/models/m2_msr.py +1 -0
  69. armodel/models/multilanguage_data.py +15 -0
  70. armodel/models/per_instance_memory.py +34 -6
  71. armodel/models/port_prototype.py +2 -253
  72. armodel/models/service_needs.py +3 -1
  73. armodel/models/sw_component.py +19 -358
  74. armodel/parser/__init__.py +2 -1
  75. armodel/parser/abstract_arxml_parser.py +10 -1
  76. armodel/parser/arxml_parser.py +912 -229
  77. armodel/parser/file_parser.py +43 -0
  78. armodel/tests/test_armodel/models/test_ar_package.py +6 -3
  79. armodel/tests/test_armodel/models/test_ar_ref.py +18 -16
  80. armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -5
  81. armodel/tests/test_armodel/models/test_common_structure.py +8 -7
  82. armodel/tests/test_armodel/models/test_data_dictionary.py +5 -5
  83. armodel/tests/test_armodel/models/test_data_prototype.py +2 -2
  84. armodel/tests/test_armodel/models/test_datatype.py +9 -9
  85. armodel/tests/test_armodel/models/test_port_interface.py +2 -2
  86. armodel/tests/test_armodel/parser/test_parse_bswmd.py +3 -3
  87. armodel/tests/test_armodel/parser/test_sw_components.py +3 -3
  88. armodel/writer/abstract_arxml_writer.py +5 -1
  89. armodel/writer/arxml_writer.py +870 -224
  90. {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/METADATA +28 -1
  91. armodel-1.6.1.dist-info/RECORD +140 -0
  92. {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/entry_points.txt +3 -1
  93. armodel-1.5.0.dist-info/RECORD +0 -91
  94. {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/LICENSE +0 -0
  95. {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/WHEEL +0 -0
  96. {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,180 @@
1
+ from abc import ABCMeta
2
+ from typing import List
3
+
4
+ from ...fibex.lin_communication import LinFrameTriggering
5
+ from ...fibex.can_communication import CanFrameTriggering
6
+ from ...ar_ref import RefType
7
+ from ...general_structure import Identifiable
8
+ from ...ar_object import ARFloat, ARLiteral, ARObject
9
+ from ...fibex.fibex_core.core_communication import FibexElement, FrameTriggering, ISignalTriggering, PduTriggering
10
+
11
+ class PhysicalChannel (Identifiable, metaclass = ABCMeta):
12
+ def __init__(self, parent: ARObject, short_name: str):
13
+ if type(self) == PhysicalChannel:
14
+ raise NotImplementedError("PhysicalChannel is an abstract class.")
15
+
16
+ super().__init__(parent, short_name)
17
+
18
+ self.commConnectorRefs = [] # type: List[RefType]
19
+ self.managedPhysicalChannelRefs = [] # type: List[RefType]
20
+
21
+ def getCommConnectorRefs(self):
22
+ return self.commConnectorRefs
23
+
24
+ def addCommConnectorRef(self, value):
25
+ self.commConnectorRefs.append(value)
26
+ return self
27
+
28
+ def getFrameTriggerings(self) -> List[FrameTriggering]:
29
+ return list(sorted(filter(lambda a: isinstance(a, FrameTriggering), self.elements.values()), key= lambda o:o.short_name))
30
+
31
+ def createCanFrameTriggering(self, short_name: str):
32
+ if (short_name not in self.elements):
33
+ channel = CanFrameTriggering(self, short_name)
34
+ self.elements[short_name] = channel
35
+ return self.elements[short_name]
36
+
37
+ def createLinFrameTriggering(self, short_name: str):
38
+ if (short_name not in self.elements):
39
+ channel = LinFrameTriggering(self, short_name)
40
+ self.elements[short_name] = channel
41
+ return self.elements[short_name]
42
+
43
+ def getISignalTriggerings(self) -> List[ISignalTriggering]:
44
+ return list(sorted(filter(lambda a: isinstance(a, ISignalTriggering), self.elements.values()), key= lambda o:o.short_name))
45
+
46
+ def createISignalTriggering(self, short_name: str):
47
+ if (short_name not in self.elements):
48
+ channel = ISignalTriggering(self, short_name)
49
+ self.elements[short_name] = channel
50
+ return self.elements[short_name]
51
+
52
+
53
+ def getManagedPhysicalChannelRefs(self):
54
+ return self.managedPhysicalChannelRefs
55
+
56
+ def addManagedPhysicalChannelRef(self, value):
57
+ self.managedPhysicalChannelRefs.append(value)
58
+ return self
59
+
60
+ def getPduTriggerings(self) -> List[PduTriggering]:
61
+ return list(sorted(filter(lambda a: isinstance(a, PduTriggering), self.elements.values()), key= lambda o:o.short_name))
62
+
63
+ def createPduTriggering(self, short_name: str):
64
+ if (short_name not in self.elements):
65
+ channel = PduTriggering(self, short_name)
66
+ self.elements[short_name] = channel
67
+ return self.elements[short_name]
68
+
69
+ class AbstractCanPhysicalChannel(PhysicalChannel, metaclass = ABCMeta):
70
+ def __init__(self, parent, short_name):
71
+ if type(self) == ARObject:
72
+ raise NotImplementedError("AbstractCanPhysicalChannel is an abstract class.")
73
+
74
+ super().__init__(parent, short_name)
75
+
76
+ class CanPhysicalChannel(AbstractCanPhysicalChannel):
77
+ def __init__(self, parent, short_name):
78
+ super().__init__(parent, short_name)
79
+
80
+ class LinPhysicalChannel(PhysicalChannel):
81
+ def __init__(self, parent: ARObject, short_name: str):
82
+ super().__init__(parent, short_name)
83
+
84
+ class CommunicationCluster(FibexElement, metaclass = ABCMeta):
85
+ def __init__(self, parent: ARObject, short_name: str):
86
+ if type(self) == CommunicationCluster:
87
+ raise NotImplementedError("CommunicationCluster is an abstract class.")
88
+
89
+ super().__init__(parent, short_name)
90
+
91
+ self.baudrate = None # type: ARFloat
92
+ self.protocolName = None # type: ARLiteral
93
+ self.protocolVersion = None # type: ARLiteral
94
+
95
+ def getBaudrate(self):
96
+ return self.baudrate
97
+
98
+ def setBaudrate(self, value):
99
+ self.baudrate = value
100
+ return self
101
+
102
+ def getPhysicalChannels(self) -> List[PhysicalChannel]:
103
+ return list(sorted(filter(lambda a: isinstance(a, PhysicalChannel), self.elements.values()), key= lambda o:o.short_name))
104
+
105
+ def getCanPhysicalChannels(self) -> List[CanPhysicalChannel]:
106
+ return list(sorted(filter(lambda a: isinstance(a, CanPhysicalChannel), self.elements.values()), key= lambda o:o.short_name))
107
+
108
+ def getLinPhysicalChannels(self) -> List[LinPhysicalChannel]:
109
+ return list(sorted(filter(lambda a: isinstance(a, LinPhysicalChannel), self.elements.values()), key= lambda o:o.short_name))
110
+
111
+ def createCanPhysicalChannel(self, short_name: str):
112
+ if (short_name not in self.elements):
113
+ channel = CanPhysicalChannel(self, short_name)
114
+ self.elements[short_name] = channel
115
+ return self.elements[short_name]
116
+
117
+ def createLinPhysicalChannel(self, short_name: str):
118
+ if (short_name not in self.elements):
119
+ channel = LinPhysicalChannel(self, short_name)
120
+ self.elements[short_name] = channel
121
+ return self.elements[short_name]
122
+
123
+ def getProtocolName(self):
124
+ return self.protocolName
125
+
126
+ def setProtocolName(self, value):
127
+ self.protocolName = value
128
+ return self
129
+
130
+ def getProtocolVersion(self):
131
+ return self.protocolVersion
132
+
133
+ def setProtocolVersion(self, value):
134
+ self.protocolVersion = value
135
+ return self
136
+
137
+ class AbstractCanCluster(CommunicationCluster, metaclass = ABCMeta):
138
+ def __init__(self, parent: ARObject, short_name: str):
139
+ if type(self) == AbstractCanCluster:
140
+ raise NotImplementedError("AbstractCanCluster is an abstract class.")
141
+
142
+ super().__init__(parent, short_name)
143
+
144
+ self.busOffRecovery = None
145
+ self.canFdBaudrate = None
146
+ self.canXlBaudrate = None
147
+
148
+ def getBusOffRecovery(self):
149
+ return self.busOffRecovery
150
+
151
+ def setBusOffRecovery(self, value):
152
+ self.busOffRecovery = value
153
+ return self
154
+
155
+ def getCanFdBaudrate(self):
156
+ return self.canFdBaudrate
157
+
158
+ def setCanFdBaudrate(self, value):
159
+ self.canFdBaudrate = value
160
+ return self
161
+
162
+ def getCanXlBaudrate(self):
163
+ return self.canXlBaudrate
164
+
165
+ def setCanXlBaudrate(self, value):
166
+ self.canXlBaudrate = value
167
+ return self
168
+
169
+
170
+ class CanCluster(AbstractCanCluster):
171
+ def __init__(self, parent: ARObject, short_name: str):
172
+ super().__init__(parent, short_name)
173
+
174
+ class LinCluster(CommunicationCluster):
175
+ def __init__(self, parent: ARObject, short_name: str):
176
+ super().__init__(parent, short_name)
177
+
178
+ class EcuInstance(FibexElement):
179
+ def __init__(self, parent, short_name):
180
+ super().__init__(parent, short_name)
@@ -1,7 +1,7 @@
1
1
 
2
2
  from abc import ABCMeta
3
- from ..ar_object import ARObject
4
- from .fibex_core import Frame
3
+ from ..ar_object import ARLiteral, ARNumerical, ARObject
4
+ from .fibex_core.core_communication import Frame, FrameTriggering
5
5
 
6
6
  class LinFrame(Frame):
7
7
  __metaclass__ = ABCMeta
@@ -14,4 +14,25 @@ class LinFrame(Frame):
14
14
 
15
15
  class LinUnconditionalFrame(LinFrame):
16
16
  def __init__(self, parent: ARObject, short_name: str):
17
- super().__init__(parent, short_name)
17
+ super().__init__(parent, short_name)
18
+
19
+ class LinFrameTriggering(FrameTriggering):
20
+ def __init__(self, parent, short_name):
21
+ super().__init__(parent, short_name)
22
+
23
+ self.identifier = None # type: ARNumerical
24
+ self.linChecksum = None # type: ARLiteral
25
+
26
+ def getIdentifier(self):
27
+ return self.identifier
28
+
29
+ def setIdentifier(self, value):
30
+ self.identifier = value
31
+ return self
32
+
33
+ def getLinChecksum(self):
34
+ return self.linChecksum
35
+
36
+ def setLinChecksum(self, value):
37
+ self.linChecksum = value
38
+ return self
@@ -1,9 +1,10 @@
1
1
  from abc import ABCMeta
2
2
  from typing import List
3
3
 
4
+ from .annotation import Annotation
4
5
  from .ar_ref import RefType
5
6
  from .multilanguage_data import MultiLanguageOverviewParagraph, MultilanguageLongName
6
- from .ar_object import ARObject
7
+ from .ar_object import ARObject, ARLiteral
7
8
 
8
9
  class Sd(ARObject):
9
10
  def __init__(self):
@@ -12,21 +13,55 @@ class Sd(ARObject):
12
13
  self.gid = ""
13
14
  self.value = ""
14
15
 
16
+ def getGID(self):
17
+ return self.gid
18
+
19
+ def setGID(self, value):
20
+ self.gid = value
21
+ return self
22
+
23
+ def getValue(self):
24
+ return self.value
25
+
26
+ def setValue(self, value):
27
+ self.value = value
28
+ return self
15
29
  class Sdg(ARObject):
16
30
  def __init__(self):
17
31
  super().__init__()
18
32
 
19
33
  self.gid = ""
20
34
  self.sd = [] # type: List[Sd]
21
- self.sdg_caption = None
22
- self.sdg_contents_type = None
35
+ self.sdgCaption = None
36
+ self.sdgContentsTypes = [] # type: List[Sdg]
37
+
38
+ def getGID(self):
39
+ return self.gid
40
+
41
+ def setGID(self, value):
42
+ self.gid = value
43
+ return self
23
44
 
24
45
  def addSd(self, sd: Sd):
25
46
  self.sd.append(sd)
47
+ return self
26
48
 
27
49
  def getSds(self) -> List[Sd]:
28
50
  return self.sd
29
51
 
52
+ def getSdgCaption(self):
53
+ return self.sdgCaption
54
+
55
+ def setSdgCaption(self, value):
56
+ self.sdgCaption = value
57
+ return self
58
+
59
+ def addSdgContentsType(self, sdg):
60
+ self.sdgContentsTypes.append(sdg)
61
+
62
+ def getSdgContentsTypes(self):
63
+ return self.sdgContentsTypes
64
+
30
65
  class AdminData(ARObject):
31
66
  def __init__(self):
32
67
  super().__init__()
@@ -67,21 +102,33 @@ class Referrable(ARObject, metaclass=ABCMeta):
67
102
  def shortName(self, value):
68
103
  self.short_name = value
69
104
 
105
+ def getShortName(self) -> str:
106
+ return self.short_name
107
+
70
108
  @property
71
109
  def full_name(self) -> str:
72
110
  return self._parent.full_name + "/" + self.short_name
73
-
74
- class MultilanguageReferrable(Referrable, metaclass=ABCMeta):
111
+
112
+ def getFullName(self) -> str:
113
+ return self.full_name
114
+
115
+ class MultilanguageReferrable(Referrable, metaclass = ABCMeta):
75
116
  def __init__(self, parent: ARObject, short_name: str):
76
117
  if type(self) == MultilanguageReferrable:
77
118
  raise NotImplementedError("MultilanguageReferrable is an abstract class.")
78
119
 
79
120
  super().__init__(parent, short_name)
80
121
 
81
- self._parent = parent
82
- self.long_name = None # type: MultilanguageLongName
122
+ #self._parent = parent
123
+ self.longName = None # type: MultilanguageLongName
124
+
125
+ def getLongName(self) -> MultilanguageLongName:
126
+ return self.longName
83
127
 
84
- class CollectableElement(ARObject, metaclass=ABCMeta):
128
+ def setLongName(self, value: MultilanguageLongName):
129
+ self.longName = value
130
+ return self
131
+ class CollectableElement(ARObject, metaclass = ABCMeta):
85
132
  def __init__(self):
86
133
  if type(self) == CollectableElement:
87
134
  raise NotImplementedError("CollectableElement is an abstract class.")
@@ -98,6 +145,9 @@ class CollectableElement(ARObject, metaclass=ABCMeta):
98
145
 
99
146
  def getElements(self):
100
147
  return self.elements.values()
148
+
149
+ def addElement(self, element: Referrable):
150
+ self.elements[element.getShortName()] = element
101
151
 
102
152
  def getElement(self, short_name: str) -> Referrable:
103
153
  if (short_name not in self.elements):
@@ -111,16 +161,65 @@ class Identifiable(MultilanguageReferrable, CollectableElement, metaclass=ABCMet
111
161
  MultilanguageReferrable.__init__(self, parent, short_name)
112
162
  CollectableElement.__init__(self)
113
163
 
114
- self.admin_data = None # type: AdminData
115
- self._category = None
164
+ self.annotations = [] # type: List[Annotation]
165
+ self.adminData = None # type: AdminData
166
+ self.category = None # type: ARLiteral
116
167
  self.desc = None # type: MultiLanguageOverviewParagraph
117
168
 
169
+ def getAdminData(self):
170
+ return self.adminData
171
+
172
+ def setAdminData(self, value):
173
+ self.adminData = value
174
+ return self
175
+
176
+ def getDesc(self):
177
+ return self.desc
178
+
179
+ def setDesc(self, value):
180
+ self.desc = value
181
+ return self
182
+
183
+ def getCategory(self):
184
+ return self.category
185
+
186
+ def setCategory(self, value):
187
+ self.category = value
188
+ return self
189
+
190
+ def addAnnotation(self, annotation: Annotation):
191
+ self.annotations.append(annotation)
192
+ return self
193
+
194
+ def getAnnotations(self) -> List[Annotation]:
195
+ return self.annotations
196
+
197
+ class Describable(ARObject, metaclass=ABCMeta):
198
+ def __init__(self):
199
+ if type(self) == Describable:
200
+ raise NotImplementedError("Describable is an abstract class.")
201
+
202
+ super().__init__()
203
+
204
+ self._desc = None
205
+ self._category = None
206
+ self._adminData = None
207
+ self._introduction = None
208
+
209
+ @property
210
+ def desc(self):
211
+ return self._desc
212
+
213
+ @desc.setter
214
+ def desc(self, value):
215
+ self._desc = value
216
+
118
217
  @property
119
218
  def category(self):
120
219
  return self._category
121
220
 
122
221
  @category.setter
123
- def category(self, value):
222
+ def category(self, value: ARLiteral):
124
223
  self._category = value
125
224
 
126
225
  class AtpFeature(Identifiable, metaclass=ABCMeta):
@@ -4,7 +4,7 @@ from typing import List
4
4
  from .ar_object import ARLiteral, ARObject
5
5
  from .ar_ref import RefType
6
6
  from .common_structure import ExclusiveArea
7
- from .data_prototype import ParameterDataPrototype
7
+ from .m2.autosar_templates.sw_component_template.data_type.data_prototypes import ParameterDataPrototype
8
8
  from .general_structure import Identifiable
9
9
 
10
10
  class IncludedDataTypeSet(ARObject):
File without changes
File without changes
@@ -0,0 +1,188 @@
1
+ from abc import ABCMeta
2
+ from typing import List
3
+
4
+ from armodel.models.general_structure import ARElement
5
+ from ....ar_object import ARLiteral, ARNumerical, ARObject
6
+
7
+ class ValueSpecification(ARObject, metaclass = ABCMeta):
8
+ '''
9
+ Base class for expressions leading to a value which can be used to initialize a data object.
10
+
11
+ Base : ARObject
12
+ Subclasses : AbstractRuleBasedValueSpecification, ApplicationValueSpecification, CompositeValueSpecification,
13
+ ConstantReference, NotAvailableValueSpecification, NumericalValueSpecification, ReferenceValueSpecification,
14
+ TextValueSpecification
15
+ '''
16
+ def __init__(self):
17
+ if type(self) == ValueSpecification:
18
+ raise NotImplementedError("ValueSpecification is an abstract class.")
19
+
20
+ super().__init__()
21
+
22
+ self.shortLabel = None
23
+
24
+ def getShortLabel(self):
25
+ return self.shortLabel
26
+
27
+ def setShortLabel(self, value):
28
+ self.shortLabel = value
29
+ return self
30
+
31
+ class CompositeValueSpecification(ValueSpecification, metaclass = ABCMeta):
32
+ '''
33
+ This abstract meta-class acts a base class for ValueSpecifications that have a composite form.
34
+
35
+ Base : ARObject, ValueSpecification
36
+ Subclasses : ArrayValueSpecification, RecordValueSpecification
37
+ '''
38
+ def __init__(self):
39
+ if type(self) == CompositeValueSpecification:
40
+ raise NotImplementedError("CompositeValueSpecification is an abstract class.")
41
+
42
+ super().__init__()
43
+
44
+ class CompositeRuleBasedValueArgument(ARObject, metaclass = ABCMeta):
45
+ '''
46
+ This meta-class has the ability to serve as the abstract base class for ValueSpecifications that can be
47
+ used for compound primitive data types.
48
+
49
+ Base : ARObject
50
+ Subclasses : ApplicationRuleBasedValueSpecification, ApplicationValueSpecification
51
+ '''
52
+ def __init__(self):
53
+ if type(self) == CompositeRuleBasedValueArgument:
54
+ raise NotImplementedError("CompositeRuleBasedValueArgument is an abstract class.")
55
+
56
+ super().__init__()
57
+
58
+ class ApplicationValueSpecification(CompositeRuleBasedValueArgument, ValueSpecification):
59
+ '''
60
+ This meta-class represents values for DataPrototypes typed by ApplicationDataTypes (this includes in
61
+ particular compound primitives).
62
+ For further details refer to ASAM CDF 2.0. This meta-class corresponds to some extent with
63
+ SW-INSTANCE in ASAM CDF 2.0.
64
+
65
+ Base ARObject, CompositeRuleBasedValueArgument, ValueSpecification
66
+ '''
67
+ def __init__(self):
68
+
69
+ CompositeRuleBasedValueArgument.__init__(self)
70
+ ValueSpecification.__init__(self)
71
+
72
+ self.category = None
73
+ self.swAxisCont = []
74
+ self.swValueCont = None
75
+
76
+ def getCategory(self):
77
+ return self.category
78
+
79
+ def setCategory(self, value):
80
+ self.category = value
81
+ return self
82
+
83
+ def getSwAxisCont(self):
84
+ return self.swAxisCont
85
+
86
+ def setSwAxisCont(self, value):
87
+ self.swAxisCont = value
88
+ return self
89
+
90
+ def getSwValueCont(self):
91
+ return self.swValueCont
92
+
93
+ def setSwValueCont(self, value):
94
+ self.swValueCont = value
95
+ return self
96
+
97
+
98
+ class RecordValueSpecification(CompositeValueSpecification):
99
+ '''
100
+ Specifies the values for a record.
101
+
102
+ Base : ARObject, CompositeValueSpecification, ValueSpecification
103
+ '''
104
+ def __init__(self):
105
+ super().__init__()
106
+
107
+ self.fields = []
108
+
109
+ def addField(self, field: ValueSpecification):
110
+ self.fields.append(field)
111
+
112
+ def getFields(self) -> List[ValueSpecification]:
113
+ return self.fields
114
+
115
+ class TextValueSpecification(ValueSpecification):
116
+ def __init__(self):
117
+ super().__init__()
118
+
119
+ self.value = None # type: ARLiteral
120
+
121
+ def getValue(self):
122
+ return self.value
123
+
124
+ def setValue(self, value):
125
+ self.value = value
126
+ return self
127
+
128
+
129
+ class NumericalValueSpecification(ValueSpecification):
130
+ def __init__(self):
131
+ super().__init__()
132
+
133
+ self.value = None # type: ARNumerical
134
+
135
+ def getValue(self):
136
+ return self.value
137
+
138
+ def setValue(self, value):
139
+ self.value = value
140
+ return self
141
+
142
+
143
+ class ArrayValueSpecification(ValueSpecification):
144
+ def __init__(self):
145
+ super().__init__()
146
+
147
+ self.element = [] # type: List[ValueSpecification]
148
+ self.intendedPartialInitializationCount = None
149
+
150
+ def getIntendedPartialInitializationCount(self):
151
+ return self.intendedPartialInitializationCount
152
+
153
+ def setIntendedPartialInitializationCount(self, value):
154
+ self.intendedPartialInitializationCount = value
155
+ return self
156
+
157
+ def addElement(self, element: ValueSpecification):
158
+ self.element.append(element)
159
+
160
+ def getElements(self) -> List[ValueSpecification]:
161
+ return self.element
162
+
163
+ class ConstantSpecification(ARElement):
164
+ def __init__(self, parent, short_name):
165
+ super().__init__(parent, short_name)
166
+
167
+ self.valueSpec = None # type: ValueSpecification
168
+
169
+ def getValueSpec(self):
170
+ return self.valueSpec
171
+
172
+ def setValueSpec(self, value):
173
+ self.valueSpec = value
174
+ return self
175
+
176
+
177
+ class ConstantReference(ValueSpecification):
178
+ def __init__(self):
179
+ super().__init__()
180
+
181
+ self.constantRef = None # type: RefType
182
+
183
+ def getConstantRef(self):
184
+ return self.constantRef
185
+
186
+ def setConstantRef(self, value):
187
+ self.constantRef = value
188
+ return self
@@ -0,0 +1,21 @@
1
+ from abc import ABCMeta
2
+
3
+ from ....ar_object import ARLiteral, ARObject
4
+ from ....general_structure import Referrable
5
+
6
+
7
+ class ImplementationProps(Referrable, metaclass = ABCMeta):
8
+ def __init__(self, parent: ARObject, short_name: str):
9
+ if type(self) == ImplementationProps:
10
+ raise NotImplementedError("ImplementationProps is an abstract class.")
11
+
12
+ super().__init__(parent, short_name)
13
+
14
+ self.symbol = None # type: ARLiteral
15
+
16
+ def getSymbol(self):
17
+ return self.symbol
18
+
19
+ def setSymbol(self, value):
20
+ self.symbol = value
21
+ return self