armodel 1.4.0__py3-none-any.whl → 1.5.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.
- armodel/__init__.py +2 -1
- armodel/cli/arxml_dump_cli.py +9 -7
- armodel/cli/arxml_format_cli.py +72 -0
- armodel/cli/connector_update_cli.py +11 -4
- armodel/data_models/__init__.py +0 -0
- armodel/data_models/sw_connector.py +22 -0
- armodel/lib/data_analyzer.py +1 -1
- armodel/models/__init__.py +3 -2
- armodel/models/annotation.py +20 -0
- armodel/models/ar_object.py +163 -18
- armodel/models/ar_package.py +228 -24
- armodel/models/ar_ref.py +85 -6
- armodel/models/bsw_module_template.py +113 -27
- armodel/models/calibration.py +107 -4
- armodel/models/common_structure.py +142 -52
- armodel/models/communication.py +10 -1
- armodel/models/data_def_properties.py +16 -0
- armodel/models/data_dictionary.py +46 -9
- armodel/models/data_prototype.py +24 -5
- armodel/models/datatype.py +69 -20
- armodel/models/end_to_end_protection.py +67 -0
- armodel/models/fibex/__init__.py +0 -0
- armodel/models/fibex/can_communication.py +6 -0
- armodel/models/fibex/fibex_4_multiplatform.py +145 -0
- armodel/models/fibex/fibex_core.py +341 -0
- armodel/models/fibex/lin_communication.py +17 -0
- armodel/models/fibex/lin_topology.py +7 -0
- armodel/models/general_structure.py +44 -18
- armodel/models/global_constraints.py +4 -4
- armodel/models/implementation.py +79 -32
- armodel/models/internal_behavior.py +63 -0
- armodel/models/m2_msr.py +6 -4
- armodel/models/mode_declaration.py +8 -0
- armodel/models/multilanguage_data.py +42 -0
- armodel/models/per_instance_memory.py +14 -0
- armodel/models/port_interface.py +27 -4
- armodel/models/port_prototype.py +57 -19
- armodel/models/record_layout.py +118 -0
- armodel/models/rpt_scenario.py +20 -0
- armodel/models/service_mapping.py +11 -0
- armodel/models/service_needs.py +48 -0
- armodel/models/sw_component.py +293 -45
- armodel/models/system_template/__init__.py +0 -0
- armodel/models/system_template/network_management.py +7 -0
- armodel/models/system_template/transport_protocols.py +7 -0
- armodel/models/timing.py +91 -0
- armodel/parser/abstract_arxml_parser.py +248 -0
- armodel/parser/arxml_parser.py +1571 -844
- armodel/parser/connector_xlsx_parser.py +190 -0
- armodel/parser/excel_parser.py +18 -0
- armodel/tests/test_armodel/models/test_ar_object.py +152 -0
- armodel/tests/test_armodel/models/test_ar_package.py +1 -1
- armodel/tests/test_armodel/models/test_common_structure.py +2 -2
- armodel/tests/test_armodel/models/test_data_dictionary.py +7 -7
- armodel/tests/test_armodel/models/test_data_prototype.py +3 -3
- armodel/tests/test_armodel/models/test_datatype.py +11 -11
- armodel/tests/test_armodel/models/test_general_structure.py +1 -1
- armodel/tests/test_armodel/models/test_implementation.py +26 -0
- armodel/tests/test_armodel/models/test_m2_msr.py +4 -4
- armodel/tests/test_armodel/models/test_port_interface.py +5 -5
- armodel/tests/test_armodel/parser/test_arxml_parser.py +15 -0
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +74 -42
- armodel/tests/test_armodel/parser/test_sw_components.py +93 -0
- armodel/writer/abstract_arxml_writer.py +123 -0
- armodel/writer/arxml_writer.py +1701 -358
- {armodel-1.4.0.dist-info → armodel-1.5.0.dist-info}/METADATA +114 -3
- armodel-1.5.0.dist-info/RECORD +91 -0
- {armodel-1.4.0.dist-info → armodel-1.5.0.dist-info}/WHEEL +1 -1
- {armodel-1.4.0.dist-info → armodel-1.5.0.dist-info}/entry_points.txt +2 -0
- armodel-1.4.0.dist-info/RECORD +0 -60
- {armodel-1.4.0.dist-info → armodel-1.5.0.dist-info}/LICENSE +0 -0
- {armodel-1.4.0.dist-info → armodel-1.5.0.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
from abc import ABCMeta
|
|
2
|
-
from typing import List
|
|
2
|
+
from typing import Dict, List
|
|
3
|
+
|
|
4
|
+
from .internal_behavior import IncludedDataTypeSet, InternalBehavior
|
|
3
5
|
from .general_structure import AtpStructureElement, ARObject, ARElement
|
|
4
|
-
from .ar_object import ARBoolean
|
|
5
|
-
from .common_structure import ExecutableEntity,
|
|
6
|
+
from .ar_object import ARBoolean, ARFloat, ARLiteral, ARNumerical, ARPositiveInteger
|
|
7
|
+
from .common_structure import ExecutableEntity, IncludedModeDeclarationGroupSet, ModeDeclarationGroupPrototype, Identifiable
|
|
6
8
|
from .ar_ref import RefType
|
|
7
9
|
|
|
8
10
|
class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
@@ -11,10 +13,16 @@ class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
|
11
13
|
raise NotImplementedError("BswModuleEntity is an abstract class.")
|
|
12
14
|
super().__init__(parent, short_name)
|
|
13
15
|
|
|
14
|
-
self.
|
|
15
|
-
self.
|
|
16
|
-
self.implemented_entry_ref = None
|
|
17
|
-
self.
|
|
16
|
+
self.accessedModeGroupRefs = [] # type: List[RefType]
|
|
17
|
+
self.activationPointRefs = [] # type: List[RefType]
|
|
18
|
+
self.implemented_entry_ref = None # type: RefType
|
|
19
|
+
self._managedModeGroupRefs = [] # type: List[RefType]
|
|
20
|
+
|
|
21
|
+
def addManagedModeGroupRef(self, ref: RefType):
|
|
22
|
+
self._managedModeGroupRefs.append(ref)
|
|
23
|
+
|
|
24
|
+
def getManagedModeGroupRefs(self) -> List[RefType]:
|
|
25
|
+
return self._managedModeGroupRefs
|
|
18
26
|
|
|
19
27
|
class BswCalledEntity(BswModuleEntity):
|
|
20
28
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -47,7 +55,7 @@ class BswEvent(Identifiable, metaclass=ABCMeta):
|
|
|
47
55
|
raise NotImplementedError("BswEvent is an abstract class.")
|
|
48
56
|
super().__init__(parent, short_name)
|
|
49
57
|
|
|
50
|
-
self.
|
|
58
|
+
self.startsOnEventRef = None # type: RefType
|
|
51
59
|
|
|
52
60
|
class BswOperationInvokedEvent(BswEvent):
|
|
53
61
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -79,11 +87,13 @@ class BswTimingEvent(BswScheduleEvent):
|
|
|
79
87
|
def __init__(self, parent: ARObject, short_name: str):
|
|
80
88
|
super().__init__(parent, short_name)
|
|
81
89
|
|
|
82
|
-
self.period =
|
|
90
|
+
self.period = None # type: ARFloat
|
|
83
91
|
|
|
84
92
|
@property
|
|
85
|
-
def
|
|
86
|
-
|
|
93
|
+
def periodMs(self) -> int:
|
|
94
|
+
if self.period is not None:
|
|
95
|
+
return int(self.period.value * 1000)
|
|
96
|
+
return None
|
|
87
97
|
|
|
88
98
|
class BswDataReceivedEvent(BswScheduleEvent):
|
|
89
99
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -95,16 +105,63 @@ class BswInternalTriggerOccurredEvent(BswScheduleEvent):
|
|
|
95
105
|
def __init__(self, parent: ARObject, short_name: str):
|
|
96
106
|
super().__init__(parent, short_name)
|
|
97
107
|
|
|
98
|
-
self.event_source_ref = None
|
|
108
|
+
self.event_source_ref = None # type: RefType
|
|
109
|
+
|
|
110
|
+
class BswModeSwitchAckRequest(ARObject):
|
|
111
|
+
def __init__(self):
|
|
112
|
+
super().__init__()
|
|
113
|
+
|
|
114
|
+
self.timeout = None # type: ARFloat
|
|
115
|
+
|
|
116
|
+
class BswModeSenderPolicy(ARObject):
|
|
117
|
+
def __init__(self):
|
|
118
|
+
super().__init__()
|
|
119
|
+
|
|
120
|
+
self.ack_request = None # type: BswModeSwitchAckRequest
|
|
121
|
+
self.enhanced_mode_api = None # type: ARBoolean
|
|
122
|
+
self._provided_mode_group_ref = None # type: RefType
|
|
123
|
+
self._queue_length = None # type: ARNumerical
|
|
124
|
+
|
|
125
|
+
def setProvidedModeGroupRef(self, ref: RefType):
|
|
126
|
+
self._provided_mode_group_ref = ref
|
|
127
|
+
return self
|
|
128
|
+
|
|
129
|
+
def getProvidedModeGroupRef(self) -> RefType:
|
|
130
|
+
return self._provided_mode_group_ref
|
|
131
|
+
|
|
132
|
+
def setQueueLength(self, length: any):
|
|
133
|
+
if isinstance(length, ARNumerical):
|
|
134
|
+
self._queue_length = length
|
|
135
|
+
elif isinstance(length, int):
|
|
136
|
+
self._queue_length = ARNumerical()
|
|
137
|
+
self._queue_length.setValue(length)
|
|
138
|
+
else:
|
|
139
|
+
raise ValueError("Unsupported type <%s>" % type(length))
|
|
140
|
+
|
|
141
|
+
def getQueueLength(self) -> ARNumerical:
|
|
142
|
+
return self._queue_length
|
|
99
143
|
|
|
100
144
|
class BswInternalBehavior(InternalBehavior):
|
|
101
145
|
def __init__(self, parent: ARObject, short_name: str):
|
|
102
146
|
super().__init__(parent, short_name)
|
|
103
147
|
|
|
148
|
+
self.entities = [] # type: List[BswModuleEntity]
|
|
149
|
+
self.events = [] # type: List[BswEvent]
|
|
150
|
+
self.mode_sender_policies = [] # type: List[BswModeSenderPolicy]
|
|
151
|
+
self.included_mode_declaration_group_sets = [] # type: List[IncludedModeDeclarationGroupSet]
|
|
152
|
+
self.included_data_type_sets = [] # type: List[IncludedDataTypeSet]
|
|
153
|
+
|
|
154
|
+
def addModeSenderPolicy(self, policy: BswModeSenderPolicy):
|
|
155
|
+
self.mode_sender_policies.append(policy)
|
|
156
|
+
|
|
157
|
+
def getModeSenderPolicies(self) -> List[BswModeSenderPolicy]:
|
|
158
|
+
return self.mode_sender_policies
|
|
159
|
+
|
|
104
160
|
def createBswCalledEntity(self, short_name: str) -> BswCalledEntity:
|
|
105
161
|
if (short_name not in self.elements):
|
|
106
162
|
event = BswCalledEntity(self, short_name)
|
|
107
163
|
self.elements[short_name] = event
|
|
164
|
+
self.entities.append(event)
|
|
108
165
|
return self.elements[short_name]
|
|
109
166
|
|
|
110
167
|
def getBswCalledEntities(self) -> List[BswCalledEntity]:
|
|
@@ -114,24 +171,30 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
114
171
|
if (short_name not in self.elements):
|
|
115
172
|
event = BswSchedulableEntity(self, short_name)
|
|
116
173
|
self.elements[short_name] = event
|
|
174
|
+
self.entities.append(event)
|
|
117
175
|
return self.elements[short_name]
|
|
118
176
|
|
|
119
177
|
def getBswSchedulableEntities(self) -> List[BswSchedulableEntity]:
|
|
120
178
|
return list(filter(lambda a: isinstance(a, BswSchedulableEntity), self.elements.values()))
|
|
179
|
+
|
|
180
|
+
def getBswModuleEntities(self) -> List[BswModuleEntity]:
|
|
181
|
+
return list(filter(lambda a: isinstance(a, BswModuleEntity), self.elements.values()))
|
|
121
182
|
|
|
122
183
|
def createBswModeSwitchEvent(self, short_name: str) -> BswModeSwitchEvent:
|
|
123
184
|
if (short_name not in self.elements):
|
|
124
185
|
event = BswModeSwitchEvent(self, short_name)
|
|
125
186
|
self.elements[short_name] = event
|
|
187
|
+
self.events.append(event)
|
|
126
188
|
return self.elements[short_name]
|
|
127
189
|
|
|
128
190
|
def getBswModeSwitchEvents(self) -> List[BswModeSwitchEvent]:
|
|
129
191
|
return list(filter(lambda a: isinstance(a, BswModeSwitchEvent), self.elements.values()))
|
|
130
|
-
|
|
192
|
+
|
|
131
193
|
def createBswTimingEvent(self, short_name: str) -> BswTimingEvent:
|
|
132
194
|
if (short_name not in self.elements):
|
|
133
195
|
event = BswTimingEvent(self, short_name)
|
|
134
196
|
self.elements[short_name] = event
|
|
197
|
+
self.events.append(event)
|
|
135
198
|
return self.elements[short_name]
|
|
136
199
|
|
|
137
200
|
def getBswTimingEvents(self) -> List[BswTimingEvent]:
|
|
@@ -141,6 +204,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
141
204
|
if (short_name not in self.elements):
|
|
142
205
|
event = BswDataReceivedEvent(self, short_name)
|
|
143
206
|
self.elements[short_name] = event
|
|
207
|
+
self.events.append(event)
|
|
144
208
|
return self.elements[short_name]
|
|
145
209
|
|
|
146
210
|
def getBswDataReceivedEvents(self) -> List[BswDataReceivedEvent]:
|
|
@@ -150,10 +214,26 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
150
214
|
if (short_name not in self.elements):
|
|
151
215
|
event = BswInternalTriggerOccurredEvent(self, short_name)
|
|
152
216
|
self.elements[short_name] = event
|
|
217
|
+
self.events.append(event)
|
|
153
218
|
return self.elements[short_name]
|
|
154
219
|
|
|
155
220
|
def getBswInternalTriggerOccurredEvents(self) -> List[BswInternalTriggerOccurredEvent]:
|
|
156
221
|
return list(filter(lambda a: isinstance(a, BswInternalTriggerOccurredEvent), self.elements.values()))
|
|
222
|
+
|
|
223
|
+
def getBswEvents(self) -> List[BswEvent]:
|
|
224
|
+
return list(filter(lambda a: isinstance(a, BswEvent), self.elements.values()))
|
|
225
|
+
|
|
226
|
+
def addIncludedModeDeclarationGroupSet(self, group_set: IncludedModeDeclarationGroupSet):
|
|
227
|
+
self.included_mode_declaration_group_sets.append(group_set)
|
|
228
|
+
|
|
229
|
+
def getIncludedModeDeclarationGroupSets(self) -> List[IncludedModeDeclarationGroupSet]:
|
|
230
|
+
return self.included_mode_declaration_group_sets
|
|
231
|
+
|
|
232
|
+
def addIncludedDataTypeSet(self, type_set: IncludedDataTypeSet):
|
|
233
|
+
self.included_data_type_sets.append(type_set)
|
|
234
|
+
|
|
235
|
+
def getIncludedDataTypeSets(self) -> List[IncludedDataTypeSet]:
|
|
236
|
+
return self.included_data_type_sets
|
|
157
237
|
|
|
158
238
|
class BswModuleDescription(AtpStructureElement):
|
|
159
239
|
'''
|
|
@@ -169,12 +249,18 @@ class BswModuleDescription(AtpStructureElement):
|
|
|
169
249
|
super().__init__(parent, short_name)
|
|
170
250
|
|
|
171
251
|
# MODULE-ID
|
|
172
|
-
self.module_id =
|
|
252
|
+
self.module_id = None # type: ARPositiveInteger
|
|
173
253
|
# PROVIDED-ENTRYS
|
|
174
|
-
self.
|
|
254
|
+
self._implementedEntryRefs = [] # type: List[RefType]
|
|
255
|
+
|
|
256
|
+
self.providedModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
257
|
+
self.requiredModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
258
|
+
|
|
259
|
+
def addImplementedEntry(self, entry_ref: RefType):
|
|
260
|
+
self._implementedEntryRefs.append(entry_ref)
|
|
175
261
|
|
|
176
|
-
|
|
177
|
-
self.
|
|
262
|
+
def getImplementedEntries(self) -> List[RefType]:
|
|
263
|
+
return self._implementedEntryRefs
|
|
178
264
|
|
|
179
265
|
@property
|
|
180
266
|
def category(self) -> str:
|
|
@@ -190,21 +276,21 @@ class BswModuleDescription(AtpStructureElement):
|
|
|
190
276
|
if (short_name not in self.elements):
|
|
191
277
|
prototype = ModeDeclarationGroupPrototype(self, short_name)
|
|
192
278
|
self.elements[short_name] = prototype
|
|
193
|
-
self.
|
|
279
|
+
self.providedModeGroups[short_name] = prototype
|
|
194
280
|
return self.elements[short_name]
|
|
195
281
|
|
|
196
282
|
def getProvidedModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
197
|
-
return sorted(self.
|
|
283
|
+
return sorted(self.providedModeGroups.values(), key=lambda v: v.short_name)
|
|
198
284
|
|
|
199
285
|
def createRequiredModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
200
286
|
if (short_name not in self.elements):
|
|
201
287
|
prototype = ModeDeclarationGroupPrototype(self, short_name)
|
|
202
288
|
self.elements[short_name] = prototype
|
|
203
|
-
self.
|
|
289
|
+
self.requiredModeGroups[short_name] = property
|
|
204
290
|
return self.elements[short_name]
|
|
205
291
|
|
|
206
292
|
def getRequiredModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
207
|
-
return sorted(self.
|
|
293
|
+
return sorted(self.requiredModeGroups.values(), key=lambda v: v.short_name)
|
|
208
294
|
|
|
209
295
|
def createBswInternalBehavior(self, short_name: str) -> BswInternalBehavior:
|
|
210
296
|
'''
|
|
@@ -222,12 +308,12 @@ class BswModuleEntry(ARElement):
|
|
|
222
308
|
def __init__(self, parent: ARObject, short_name: str):
|
|
223
309
|
super().__init__(parent, short_name)
|
|
224
310
|
|
|
225
|
-
self.service_id = None
|
|
226
|
-
self.is_reentrant = None
|
|
227
|
-
self.is_synchronous = None
|
|
228
|
-
self.call_type = None
|
|
229
|
-
self._execution_context = None
|
|
230
|
-
self._sw_service_impl_policy = None
|
|
311
|
+
self.service_id = None # type: ARNumerical
|
|
312
|
+
self.is_reentrant = None # type: ARBoolean
|
|
313
|
+
self.is_synchronous = None # type: ARBoolean
|
|
314
|
+
self.call_type = None # type: ARLiteral
|
|
315
|
+
self._execution_context = None # type: ARLiteral
|
|
316
|
+
self._sw_service_impl_policy = None # type: ARLiteral
|
|
231
317
|
|
|
232
318
|
@property
|
|
233
319
|
def execution_context(self):
|
armodel/models/calibration.py
CHANGED
|
@@ -1,16 +1,119 @@
|
|
|
1
|
-
from
|
|
1
|
+
from abc import ABCMeta
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from .ar_object import ARFloat, ARNumerical, ARObject
|
|
2
5
|
from .ar_ref import RefType
|
|
6
|
+
from .data_def_properties import ValueList
|
|
3
7
|
|
|
4
8
|
class SwValues(ARObject):
|
|
5
9
|
def __init__(self):
|
|
6
10
|
super().__init__()
|
|
7
11
|
|
|
8
|
-
self.
|
|
12
|
+
self._v = [] # type: List[ARNumerical]
|
|
13
|
+
self.vt = None # type: float
|
|
14
|
+
|
|
15
|
+
def addV(self, v: ARNumerical):
|
|
16
|
+
self._v.append(v)
|
|
9
17
|
|
|
18
|
+
def getVs(self) -> List[ARNumerical]:
|
|
19
|
+
return self._v
|
|
20
|
+
|
|
10
21
|
class SwValueCont(ARObject):
|
|
11
22
|
def __init__(self):
|
|
12
23
|
super().__init__()
|
|
13
24
|
|
|
14
|
-
self.
|
|
15
|
-
self.
|
|
25
|
+
self.sw_arraysize = None # type: ValueList
|
|
26
|
+
self.unit_ref = None # type: RefType
|
|
27
|
+
self.sw_values_phys = None # type: SwValues
|
|
28
|
+
|
|
29
|
+
class SwGenericAxisParam(ARObject):
|
|
30
|
+
def __init__(self):
|
|
31
|
+
super().__init__()
|
|
32
|
+
|
|
33
|
+
self.swGenericAxisParamTypeRef = None # type: RefType
|
|
34
|
+
self.vf = [] # type: List[ARFloat]
|
|
35
|
+
class SwAxisGeneric(ARObject):
|
|
36
|
+
def __init__(self):
|
|
37
|
+
super().__init__()
|
|
38
|
+
|
|
39
|
+
self.swAxisTypeRef = None # type: RefType
|
|
40
|
+
self.swGenericAxisParam = [] # type: List[SwGenericAxisParam]
|
|
41
|
+
|
|
42
|
+
class SwCalprmAxisTypeProps(ARObject, metaclass = ABCMeta):
|
|
43
|
+
def __init__(self):
|
|
44
|
+
if type(self) == SwCalprmAxisTypeProps:
|
|
45
|
+
raise NotImplementedError("SwCalprmAxisTypeProps is an abstract class.")
|
|
46
|
+
|
|
47
|
+
super().__init__()
|
|
48
|
+
|
|
49
|
+
self.maxGradient = None # type: ARFloat
|
|
50
|
+
self.monotony = None # type: MonotonyEnum
|
|
51
|
+
|
|
52
|
+
class SwAxisIndividual(SwCalprmAxisTypeProps):
|
|
53
|
+
def __init__(self):
|
|
54
|
+
super().__init__()
|
|
55
|
+
|
|
56
|
+
self.compuMethodRef = None # type: RefType
|
|
57
|
+
self.dataConstrRef = None # type: RefType
|
|
58
|
+
self.inputVariableTypeRef = None # type: RefType
|
|
59
|
+
self.swAxisGeneric = None # type: SwAxisGeneric
|
|
60
|
+
self.swMaxAxisPoints = None # type: ARNumerical
|
|
61
|
+
self.swMinAxisPoints = None # type: ARNumerical
|
|
62
|
+
self.swVariableRefs = [] # type: List
|
|
63
|
+
self.unitRef = None # type: RefType
|
|
64
|
+
|
|
65
|
+
def setInputVariableTypeRef(self, ref: RefType):
|
|
66
|
+
self.inputVariableTypeRef = ref
|
|
67
|
+
return self
|
|
68
|
+
|
|
69
|
+
def setCompuMethodRef(self, ref: RefType):
|
|
70
|
+
self.compuMethodRef = ref
|
|
71
|
+
return self
|
|
72
|
+
|
|
73
|
+
def setSwMaxAxisPoints(self, points: int):
|
|
74
|
+
self.swMaxAxisPoints = points
|
|
75
|
+
return self
|
|
76
|
+
|
|
77
|
+
def setSwMinAxisPoints(self, points: int):
|
|
78
|
+
self.swMinAxisPoints = points
|
|
79
|
+
return self
|
|
80
|
+
|
|
81
|
+
def setDataConstrRef(self, ref: RefType):
|
|
82
|
+
self.dataConstrRef = ref
|
|
83
|
+
return self
|
|
84
|
+
|
|
85
|
+
class SwAxisGrouped(SwCalprmAxisTypeProps):
|
|
86
|
+
def __init__(self):
|
|
87
|
+
super().__init__()
|
|
88
|
+
|
|
89
|
+
self.sharedAxisTypeRef = None # type: RefType
|
|
90
|
+
self.swAxisIndex = None # type: ARNumerical
|
|
91
|
+
self.swCalprmRef = None # type: SwCalprmRefProxy
|
|
92
|
+
|
|
93
|
+
def setSharedAxisTypeRef(self, ref: RefType):
|
|
94
|
+
self.sharedAxisTypeRef = ref
|
|
95
|
+
return self
|
|
96
|
+
|
|
97
|
+
class SwCalprmAxis(ARObject):
|
|
98
|
+
def __init__(self):
|
|
99
|
+
super().__init__()
|
|
100
|
+
|
|
101
|
+
self.category = None # type: CalprmAxisCategoryEnum
|
|
102
|
+
self.displayFormat = None # type: DisplayFormatString
|
|
103
|
+
self.sw_axis_index = None # type: AxisIndexType
|
|
104
|
+
self.swCalibrationAccess = None # type: SwCalibrationAccessEnum
|
|
105
|
+
self.sw_calprm_axis_type_props = None # type: SwCalprmAxisTypeProps
|
|
106
|
+
|
|
107
|
+
class SwCalprmAxisSet(ARObject):
|
|
108
|
+
def __init__(self):
|
|
109
|
+
super().__init__()
|
|
110
|
+
|
|
111
|
+
self._swCalprmAxis = [] # type: List[SwCalprmAxis]
|
|
112
|
+
|
|
113
|
+
def addSwCalprmAxis(self, axis: SwCalprmAxis):
|
|
114
|
+
self._swCalprmAxis.append(axis)
|
|
115
|
+
|
|
116
|
+
def getSwCalprmAxises(self) -> List[SwCalprmAxis]:
|
|
117
|
+
return self._swCalprmAxis
|
|
118
|
+
|
|
16
119
|
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
from abc import ABCMeta
|
|
4
4
|
from typing import List
|
|
5
5
|
|
|
6
|
+
from .ar_object import ARFloat, ARLiteral, ARNumerical
|
|
6
7
|
from .general_structure import ARObject, ARElement, Identifiable
|
|
7
8
|
from .data_dictionary import SwDataDefProps
|
|
8
|
-
from .ar_ref import RefType
|
|
9
|
+
from .ar_ref import RefType, TRefType
|
|
9
10
|
|
|
10
11
|
import re
|
|
11
12
|
|
|
@@ -96,7 +97,7 @@ class NumericalValueSpecification(ValueSpecification):
|
|
|
96
97
|
def __init__(self):
|
|
97
98
|
super().__init__()
|
|
98
99
|
|
|
99
|
-
self.value = None # type:
|
|
100
|
+
self.value = None # type: ARFloat
|
|
100
101
|
|
|
101
102
|
class ArrayValueSpecification(ValueSpecification):
|
|
102
103
|
def __init__(self):
|
|
@@ -133,10 +134,10 @@ class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
|
|
|
133
134
|
def __init__(self, parent, short_name: str):
|
|
134
135
|
super().__init__(parent, short_name)
|
|
135
136
|
|
|
136
|
-
self.
|
|
137
|
-
self.array_size_semantics = None
|
|
138
|
-
self.
|
|
139
|
-
self.sw_data_def_props = None
|
|
137
|
+
self.arraySize = None # type: int
|
|
138
|
+
self.array_size_semantics = None # type: str
|
|
139
|
+
self.isOptional = None # type: bool
|
|
140
|
+
self.sw_data_def_props = None # type: SwDataDefProps
|
|
140
141
|
|
|
141
142
|
def createImplementationDataTypeElement(self, short_name: str): # type: (...) -> ImplementationDataTypeElement
|
|
142
143
|
if (short_name not in self.elements):
|
|
@@ -144,41 +145,46 @@ class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
|
|
|
144
145
|
self.elements[short_name] = event
|
|
145
146
|
return self.elements[short_name]
|
|
146
147
|
|
|
147
|
-
def getImplementationDataTypeElements(self): # type:(...) -> List[ImplementationDataTypeElement]
|
|
148
|
+
def getImplementationDataTypeElements(self): # type:(...) -> List[ImplementationDataTypeElement]
|
|
148
149
|
return list(filter(lambda c: isinstance(c, ImplementationDataTypeElement), self.elements.values()))
|
|
149
150
|
|
|
150
151
|
class ExclusiveArea(Identifiable):
|
|
151
152
|
def __init__(self, parent: ARObject, short_name: str):
|
|
152
153
|
super().__init__(parent, short_name)
|
|
153
154
|
|
|
154
|
-
class
|
|
155
|
-
def __init__(self
|
|
156
|
-
|
|
157
|
-
raise NotImplementedError("InternalBehavior is an abstract class.")
|
|
158
|
-
super().__init__(parent, short_name)
|
|
159
|
-
|
|
160
|
-
self._data_type_mapping_refs = [] # type: List[RefType]
|
|
161
|
-
|
|
162
|
-
def addDataTypeMappingRef(self, ref: RefType):
|
|
163
|
-
self._data_type_mapping_refs.append(ref)
|
|
155
|
+
class IncludedModeDeclarationGroupSet(ARObject):
|
|
156
|
+
def __init__(self):
|
|
157
|
+
super().__init__()
|
|
164
158
|
|
|
165
|
-
|
|
166
|
-
|
|
159
|
+
self.mode_declaration_group_refs = [] # type: List[RefType]
|
|
160
|
+
self.prefix = None # type: ARLiteral
|
|
167
161
|
|
|
168
|
-
def
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
self.elements[short_name] = event
|
|
172
|
-
return self.elements[short_name]
|
|
162
|
+
def addModeDeclarationGroupRef(self, ref: RefType):
|
|
163
|
+
self.mode_declaration_group_refs.append(ref)
|
|
164
|
+
return self
|
|
173
165
|
|
|
174
|
-
def
|
|
175
|
-
return
|
|
166
|
+
def getModeDeclarationGroupRefs(self) -> List[RefType]:
|
|
167
|
+
return self.mode_declaration_group_refs
|
|
176
168
|
|
|
169
|
+
def setPrefix(self, prefix: str):
|
|
170
|
+
self.prefix = prefix
|
|
171
|
+
return self
|
|
172
|
+
|
|
173
|
+
def getPrefix(self) -> ARLiteral:
|
|
174
|
+
return self.prefix
|
|
175
|
+
|
|
177
176
|
class ModeDeclaration(Identifiable):
|
|
178
177
|
def __init__(self, parent: ARObject, short_name: str):
|
|
179
178
|
super().__init__(parent, short_name)
|
|
180
179
|
|
|
181
|
-
self.value =
|
|
180
|
+
self.value = None # type: ARNumerical
|
|
181
|
+
|
|
182
|
+
def setValue(self, value):
|
|
183
|
+
self.value = value
|
|
184
|
+
return self
|
|
185
|
+
|
|
186
|
+
def getValue(self) -> ARNumerical:
|
|
187
|
+
return self.value
|
|
182
188
|
|
|
183
189
|
class ExecutableEntity(Identifiable, metaclass=ABCMeta):
|
|
184
190
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -186,14 +192,33 @@ class ExecutableEntity(Identifiable, metaclass=ABCMeta):
|
|
|
186
192
|
raise NotImplementedError("ExecutableEntity is an abstract class.")
|
|
187
193
|
super().__init__(parent, short_name)
|
|
188
194
|
|
|
189
|
-
self.activation_reason = None
|
|
190
|
-
self.minimum_start_interval =
|
|
191
|
-
self.reentrancy_level = None
|
|
192
|
-
self.can_enter_exclusive_area_refs = []
|
|
195
|
+
self.activation_reason = None # *
|
|
196
|
+
self.minimum_start_interval = None # type: ARFloat
|
|
197
|
+
self.reentrancy_level = None #
|
|
198
|
+
self.can_enter_exclusive_area_refs = [] # type: List[RefType]
|
|
199
|
+
self.sw_addr_method_ref = None # type: RefType
|
|
193
200
|
|
|
194
201
|
@property
|
|
195
|
-
def
|
|
196
|
-
|
|
202
|
+
def minimumStartIntervalMs(self) -> int:
|
|
203
|
+
if self.minimum_start_interval is not None:
|
|
204
|
+
return int(self.minimum_start_interval.getValue() * 1000)
|
|
205
|
+
return None
|
|
206
|
+
|
|
207
|
+
@property
|
|
208
|
+
def minimumStartInterval(self) -> ARFloat:
|
|
209
|
+
return self.minimum_start_interval
|
|
210
|
+
|
|
211
|
+
@minimumStartInterval.setter
|
|
212
|
+
def minimumStartInterval(self, value: ARFloat):
|
|
213
|
+
self.minimum_start_interval = value
|
|
214
|
+
|
|
215
|
+
@property
|
|
216
|
+
def swAddrMethodRef(self) -> RefType:
|
|
217
|
+
return self.sw_addr_method_ref
|
|
218
|
+
|
|
219
|
+
@swAddrMethodRef.setter
|
|
220
|
+
def swAddrMethodRef(self, ref: RefType):
|
|
221
|
+
self.sw_addr_method_ref = ref
|
|
197
222
|
|
|
198
223
|
def addCanEnterExclusiveAreaRef(self, ref: RefType):
|
|
199
224
|
self.can_enter_exclusive_area_refs.append(ref)
|
|
@@ -208,44 +233,55 @@ class ModeDeclarationGroupPrototype(Identifiable):
|
|
|
208
233
|
|
|
209
234
|
def __init__(self, parent: ARObject, short_name: str):
|
|
210
235
|
super().__init__(parent, short_name)
|
|
211
|
-
|
|
212
|
-
self.
|
|
236
|
+
|
|
237
|
+
self._swCalibrationAccess = None # type: str
|
|
238
|
+
self.typeTRef = None # type: TRefType
|
|
213
239
|
|
|
214
240
|
@property
|
|
215
241
|
def sw_calibration_access(self):
|
|
216
|
-
return self.
|
|
242
|
+
return self._swCalibrationAccess
|
|
217
243
|
|
|
218
244
|
@sw_calibration_access.setter
|
|
219
245
|
def sw_calibration_access(self, value):
|
|
220
246
|
if (value not in ("notAccessible", "readOnly", "readWrite")):
|
|
221
247
|
raise ValueError("Invalid SwCalibrationAccess <%s> of ModeDeclarationGroupPrototype <%s>" % (value, self.short_name))
|
|
222
|
-
self.
|
|
248
|
+
self._swCalibrationAccess = value
|
|
223
249
|
|
|
224
250
|
class MemorySection(Identifiable):
|
|
225
251
|
def __init__(self, parent: ARObject, short_name: str):
|
|
226
252
|
super().__init__(parent, short_name)
|
|
227
253
|
|
|
228
|
-
self._alignment = None
|
|
229
|
-
self.
|
|
254
|
+
self._alignment = None # type: ARLiteral
|
|
255
|
+
self.size = None
|
|
256
|
+
self._options = [] # type: List[ARLiteral]
|
|
257
|
+
self.swAddrMethodRef = None # type: RefType
|
|
258
|
+
self.symbol = None # type: ARLiteral
|
|
259
|
+
|
|
260
|
+
def addOption(self, option: ARLiteral):
|
|
261
|
+
self._options.append(option)
|
|
262
|
+
|
|
263
|
+
def getOptions(self) -> List[ARLiteral]:
|
|
264
|
+
return self._options
|
|
230
265
|
|
|
231
266
|
@property
|
|
232
|
-
def alignment(self) ->
|
|
267
|
+
def alignment(self) -> ARLiteral:
|
|
233
268
|
return self._alignment
|
|
234
269
|
|
|
235
270
|
@alignment.setter
|
|
236
|
-
def alignment(self, value:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
match = True
|
|
241
|
-
else:
|
|
242
|
-
m = re.match(r'^\d+', value)
|
|
243
|
-
if m:
|
|
271
|
+
def alignment(self, value: ARLiteral):
|
|
272
|
+
if value is not None:
|
|
273
|
+
match = False
|
|
274
|
+
if value.value in ("UNKNOWN", "UNSPECIFIED", "BOOLEAN", "PTR"):
|
|
244
275
|
self._alignment = value
|
|
245
276
|
match = True
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
277
|
+
else:
|
|
278
|
+
m = re.match(r'^\d+', value.value)
|
|
279
|
+
if m:
|
|
280
|
+
self._alignment = value
|
|
281
|
+
match = True
|
|
282
|
+
|
|
283
|
+
if not match:
|
|
284
|
+
raise ValueError("Invalid alignment <%s> of memory section <%s>" % (value, self.short_name))
|
|
249
285
|
|
|
250
286
|
|
|
251
287
|
class ResourceConsumption(Identifiable):
|
|
@@ -262,4 +298,58 @@ class ResourceConsumption(Identifiable):
|
|
|
262
298
|
return list(filter(lambda a : isinstance(a, MemorySection), self.elements.values()))
|
|
263
299
|
|
|
264
300
|
def getMemorySection(self, short_name: str) -> MemorySection:
|
|
265
|
-
return next(filter(lambda o: isinstance(o, MemorySection) and (o.short_name == short_name), self.elements.values()), None)
|
|
301
|
+
return next(filter(lambda o: isinstance(o, MemorySection) and (o.short_name == short_name), self.elements.values()), None)
|
|
302
|
+
|
|
303
|
+
class Trigger(Identifiable):
|
|
304
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
305
|
+
super().__init__(parent, short_name)
|
|
306
|
+
|
|
307
|
+
self.swImplPolicy = None # type: str
|
|
308
|
+
self.triggerPeriod = None # type: float
|
|
309
|
+
|
|
310
|
+
class ModeRequestTypeMap(ARObject):
|
|
311
|
+
def __init__(self):
|
|
312
|
+
super().__init__()
|
|
313
|
+
|
|
314
|
+
self.implementation_data_type_ref = None # type: RefType
|
|
315
|
+
self.mode_group_ref = None # type: RefType
|
|
316
|
+
|
|
317
|
+
class ModeDeclarationGroup(Identifiable):
|
|
318
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
319
|
+
super().__init__(parent, short_name)
|
|
320
|
+
|
|
321
|
+
self._initial_mode_ref = None # type: RefType
|
|
322
|
+
self._on_transition_value = None # type: ARNumerical
|
|
323
|
+
|
|
324
|
+
def createModeDeclaration(self, short_name: str) -> ModeDeclaration:
|
|
325
|
+
if (short_name not in self.elements):
|
|
326
|
+
spec = ModeDeclaration(self, short_name)
|
|
327
|
+
self.elements[short_name] = spec
|
|
328
|
+
return self.elements[short_name]
|
|
329
|
+
|
|
330
|
+
def getModeDeclarations(self) -> List[ModeDeclaration]:
|
|
331
|
+
return list(sorted(filter(lambda a: isinstance(a, ModeDeclaration), self.elements.values()), key= lambda o:o.short_name))
|
|
332
|
+
|
|
333
|
+
def setInitialModeRef(self, ref: RefType):
|
|
334
|
+
self._initial_mode_ref = ref
|
|
335
|
+
return self
|
|
336
|
+
|
|
337
|
+
def getInitialModeRef(self) -> RefType:
|
|
338
|
+
return self._initial_mode_ref
|
|
339
|
+
|
|
340
|
+
def setOnTransitionValue(self, value):
|
|
341
|
+
if isinstance(value, int):
|
|
342
|
+
value = ARNumerical()
|
|
343
|
+
value.setValue(value)
|
|
344
|
+
self._on_transition_value = value
|
|
345
|
+
return self
|
|
346
|
+
|
|
347
|
+
def getOnTransitionValue(self) -> ARNumerical:
|
|
348
|
+
return self._on_transition_value
|
|
349
|
+
|
|
350
|
+
class ModeDeclarationGroupPrototype(Identifiable):
|
|
351
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
352
|
+
super().__init__(parent, short_name)
|
|
353
|
+
|
|
354
|
+
self.swCalibrationAccess = None # type: str
|
|
355
|
+
self.type_tref = None # type: TRefType
|
armodel/models/communication.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
from .data_dictionary import SwDataDefProps
|
|
3
|
+
from .ar_ref import ApplicationCompositeElementInPortInterfaceInstanceRef
|
|
4
|
+
from .ar_object import ARObject
|
|
2
5
|
|
|
3
6
|
class TransmissionAcknowledgementRequest(ARObject):
|
|
4
7
|
def __init__(self):
|
|
@@ -6,3 +9,9 @@ class TransmissionAcknowledgementRequest(ARObject):
|
|
|
6
9
|
|
|
7
10
|
self.timeout = None # type: float
|
|
8
11
|
|
|
12
|
+
class CompositeNetworkRepresentation(ARObject):
|
|
13
|
+
def __init__(self):
|
|
14
|
+
super().__init__()
|
|
15
|
+
|
|
16
|
+
self.leaf_element_iref = None # type: ApplicationCompositeElementInPortInterfaceInstanceRef
|
|
17
|
+
self.network_representation = None # type: SwDataDefProps
|