armodel 1.0.0__py3-none-any.whl → 1.2.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.
@@ -70,7 +70,7 @@ def show_behavior(indent:int, behavior: SwcInternalBehavior):
70
70
  print(" : %s" % (event.start_on_event_ref.value))
71
71
  for event in behavior.getTimingEvents():
72
72
  print("")
73
- print(" - TimingEvent : %s (%d ms)" % (event.short_name, event.peroid_ms))
73
+ print(" - TimingEvent : %s (%d ms)" % (event.short_name, event.period_ms))
74
74
  print(" : %s" % (event.start_on_event_ref.value))
75
75
 
76
76
  def show_sw_component(indent: int, sw_component: SwComponentType):
@@ -0,0 +1,10 @@
1
+ from abc import ABCMeta
2
+
3
+ class ARObject(metaclass=ABCMeta):
4
+ def __init__(self):
5
+ if type(self) == ARObject:
6
+ raise NotImplementedError("ARObject is an abstract class.")
7
+
8
+ self.parent = None
9
+ self.checksum = None # type: str
10
+ self.timestamp = None # type: str
@@ -1,10 +1,10 @@
1
1
  from typing import List
2
- from .general_structure import Identifiable, ARObject, Referrable, CollectableElement
2
+ from .general_structure import Identifiable, ARObject, Referrable, CollectableElement, SwcBswMapping
3
3
  from .port_interface import SenderReceiverInterface, ClientServerInterface
4
- from .sw_component import SwComponentType, EcuAbstractionSwComponentType, AtomicSwComponentType, ApplicationSwComponentType, ServiceSwComponentType, CompositionSwComponentType
4
+ from .sw_component import SwComponentType, EcuAbstractionSwComponentType, AtomicSwComponentType, ApplicationSwComponentType, ServiceSwComponentType, CompositionSwComponentType, SensorActuatorSwComponentType
5
5
  from .datatype import ImplementationDataType, ApplicationDataType, DataTypeMappingSet, DataTypeMap, SwBaseType, ApplicationPrimitiveDataType, ApplicationRecordDataType
6
6
  from .m2_msr import CompuMethod
7
- from .implementation import BswImplementation
7
+ from .implementation import BswImplementation, SwcImplementation, Implementation
8
8
  from .bsw_module_template import BswModuleDescription, BswModuleEntry
9
9
 
10
10
  class ARPackage(Identifiable, CollectableElement):
@@ -38,6 +38,12 @@ class ARPackage(Identifiable, CollectableElement):
38
38
  sw_component = ServiceSwComponentType(self, short_name)
39
39
  self.elements[short_name] = sw_component
40
40
  return self.elements[short_name]
41
+
42
+ def createSensorActuatorSwComponentType(self, short_name: str) -> SensorActuatorSwComponentType:
43
+ if (short_name not in self.elements):
44
+ sw_component = SensorActuatorSwComponentType(self, short_name)
45
+ self.elements[short_name] = sw_component
46
+ return self.elements[short_name]
41
47
 
42
48
  def createCompositionSwComponentType(self, short_name: str) -> CompositionSwComponentType:
43
49
  if (short_name not in self.elements):
@@ -110,6 +116,18 @@ class ARPackage(Identifiable, CollectableElement):
110
116
  sw_component = BswImplementation(self, short_name)
111
117
  self.elements[short_name] = sw_component
112
118
  return self.elements[short_name]
119
+
120
+ def createSwcImplementation(self, short_name: str) -> SwcImplementation:
121
+ if (short_name not in self.elements):
122
+ sw_component = SwcImplementation(self, short_name)
123
+ self.elements[short_name] = sw_component
124
+ return self.elements[short_name]
125
+
126
+ def createSwcBswMapping(self, short_name: str) -> SwcBswMapping:
127
+ if (short_name not in self.elements):
128
+ sw_component = SwcBswMapping(self, short_name)
129
+ self.elements[short_name] = sw_component
130
+ return self.elements[short_name]
113
131
 
114
132
  def getApplicationPrimitiveDataTypes(self) -> List[ApplicationPrimitiveDataType]:
115
133
  return list(filter(lambda a: isinstance(a, ApplicationPrimitiveDataType), self.elements.values()))
@@ -122,6 +140,9 @@ class ARPackage(Identifiable, CollectableElement):
122
140
 
123
141
  def getSwComponentTypes(self) -> List[SwComponentType]:
124
142
  return list(filter(lambda a : isinstance(a, SwComponentType), self.elements.values()))
143
+
144
+ def getSensorActuatorSwComponentType(self) -> List[SensorActuatorSwComponentType]:
145
+ return list(filter(lambda a : isinstance(a, SensorActuatorSwComponentType), self.elements.values()))
125
146
 
126
147
  def getAtomicSwComponentTypes(self) -> List[AtomicSwComponentType]:
127
148
  return list(filter(lambda a : isinstance(a, AtomicSwComponentType), self.elements.values()))
@@ -147,6 +168,18 @@ class ARPackage(Identifiable, CollectableElement):
147
168
  def getBswModuleEntries(self) -> List[BswModuleEntry]:
148
169
  return list(filter(lambda a: isinstance(a, BswModuleEntry), self.elements.values()))
149
170
 
171
+ def getBswImplementations(self) -> List[BswImplementation]:
172
+ return list(filter(lambda a: isinstance(a, BswImplementation), self.elements.values()))
173
+
174
+ def getSwcImplementations(self) -> List[SwcImplementation]:
175
+ return list(filter(lambda a: isinstance(a, SwcImplementation), self.elements.values()))
176
+
177
+ def getImplementations(self) -> List[Implementation]:
178
+ return list(filter(lambda a: isinstance(a, Implementation), self.elements.values()))
179
+
180
+ def getSwcBswMappings(self) -> List[SwcBswMapping]:
181
+ return list(filter(lambda a: isinstance(a, SwcBswMapping), self.elements.values()))
182
+
150
183
  class AUTOSAR (ARObject, CollectableElement):
151
184
  __instance = None
152
185
 
@@ -189,9 +222,9 @@ class AUTOSAR (ARObject, CollectableElement):
189
222
  if (short_name == ""):
190
223
  continue
191
224
  element = element.getElement(short_name)
192
- #print("<%s>" % short_name)
193
225
  if (element == None):
194
- raise ValueError("The %s of reference <%s> does not exist." % (short_name, referred_name))
226
+ return element
227
+ # raise ValueError("The %s of reference <%s> does not exist." % (short_name, referred_name))
195
228
  return element
196
229
 
197
230
  def getDataType(self, data_type: ImplementationDataType) -> ImplementationDataType:
@@ -208,6 +241,8 @@ class AUTOSAR (ARObject, CollectableElement):
208
241
  raise ValueError("%s is not ImplementationDataType." % data_type)
209
242
 
210
243
  def addDataTypeMap(self, data_type_map: DataTypeMap):
244
+ if (data_type_map.application_data_type_ref is None) or (data_type_map.implementation_data_type_ref is None):
245
+ return
211
246
  self._appl_impl_type_maps[data_type_map.application_data_type_ref.value] = data_type_map.implementation_data_type_ref.value
212
247
  self._impl_appl_type_maps[data_type_map.implementation_data_type_ref.value] = data_type_map.application_data_type_ref.value
213
248
 
armodel/models/ar_ref.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from abc import ABCMeta
2
- from .general_structure import ARObject
2
+ from .ar_object import ARObject
3
3
 
4
4
  class RefType(ARObject):
5
5
  def __init__(self):
@@ -60,3 +60,32 @@ class ROperationInAtomicSwcInstanceRef(OperationInAtomicSwcInstanceRef):
60
60
  self.context_r_port_ref = None # type: RefType
61
61
  self.target_required_operation_ref = None # type: RefType
62
62
 
63
+ class VariableInAtomicSwcInstanceRef(AtpInstanceRef, metaclass=ABCMeta):
64
+ def __init__(self):
65
+ if type(self) == OperationInAtomicSwcInstanceRef:
66
+ raise NotImplementedError("OperationInAtomicSwcInstanceRef is an abstract class.")
67
+
68
+ super().__init__()
69
+
70
+ class RVariableInAtomicSwcInstanceRef(VariableInAtomicSwcInstanceRef):
71
+ def __init__(self):
72
+ super().__init__()
73
+
74
+ self.context_r_port_ref = None # type: RefType
75
+ self.target_data_element_ref = None # type: RefType
76
+
77
+ class RVariableInAtomicSwcInstanceRef(VariableInAtomicSwcInstanceRef):
78
+ def __init__(self):
79
+ super().__init__()
80
+
81
+ self.context_r_port_ref = None # type: RefType
82
+ self.target_data_element_ref = None # type: RefType
83
+
84
+ class RModeInAtomicSwcInstanceRef(AtpInstanceRef):
85
+ def __init__(self):
86
+ super().__init__()
87
+
88
+ self.base_ref = None # type: RefType
89
+ self.context_mode_declaration_group_prototype = None # type: RefType
90
+ self.context_port = None # type: RefType
91
+ self.target_mode_declaration = None # type: RefType
@@ -155,11 +155,23 @@ class BswInternalBehavior(InternalBehavior):
155
155
  return list(filter(lambda a: isinstance(a, BswInternalTriggerOccurredEvent), self.elements.values()))
156
156
 
157
157
  class BswModuleDescription(AtpStructureElement):
158
+ '''
159
+ Root element for the description of a single BSW module or BSW cluster. In case it
160
+ describes a BSW module, the short name of this element equals the name of the
161
+ BSW module.
162
+
163
+ **attributes**:
164
+ module_id : MODULE-ID
165
+ implemented_entry_refs : PROVIDED-ENTRYS
166
+ '''
158
167
  def __init__(self, parent: ARObject, short_name: str):
159
168
  super().__init__(parent, short_name)
160
169
 
170
+ # MODULE-ID
161
171
  self.module_id = 0
172
+ # PROVIDED-ENTRYS
162
173
  self.implemented_entry_refs = [] # type: List[RefType]
174
+
163
175
  self.provided_mode_groups = {} # ModeDeclarationGroupPrototype *
164
176
  self.required_mode_groups = {} # ModeDeclarationGroupPrototype *
165
177
 
@@ -194,6 +206,9 @@ class BswModuleDescription(AtpStructureElement):
194
206
  return sorted(self.required_mode_groups.values(), key=lambda v: v.short_name)
195
207
 
196
208
  def createBswInternalBehavior(self, short_name: str) -> BswInternalBehavior:
209
+ '''
210
+ Create the INTERNAL-BEHAVIORS tag
211
+ '''
197
212
  if (short_name not in self.elements):
198
213
  prototype = BswInternalBehavior(self, short_name)
199
214
  self.elements[short_name] = prototype
@@ -7,6 +7,8 @@ from .general_structure import ARObject, ARElement, Identifiable
7
7
  from .data_dictionary import SwDataDefProps
8
8
  from .ar_ref import RefType
9
9
 
10
+ import re
11
+
10
12
  class ValueSpecification(ARObject, metaclass=ABCMeta):
11
13
  def __init__(self):
12
14
  if type(self) == ValueSpecification:
@@ -22,19 +24,16 @@ class ConstantSpecification(ARElement):
22
24
 
23
25
  self.value_spec = None # type: ValueSpecification
24
26
 
25
-
26
27
  class ConstantReference(ValueSpecification):
27
28
  def __init__(self):
28
29
  super().__init__()
29
30
 
30
31
  self.constant_ref = None
31
32
 
32
-
33
33
  class AbstractImplementationDataTypeElement(Identifiable):
34
34
  def __init__(self, parent, short_name: str):
35
35
  super().__init__(parent, short_name)
36
36
 
37
-
38
37
  class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
39
38
  ARRAY_SIZE_SEMANTICS_FIXED_SIZE = "FIXED-SIZE"
40
39
  ARRAY_SIZE_SEMANTICS_VARIABLE_SIZE = "VARIABLE_SIZE"
@@ -42,11 +41,10 @@ class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
42
41
  def __init__(self, parent, short_name: str):
43
42
  super().__init__(parent, short_name)
44
43
 
45
- self.array_size = None # type: int
46
- self.array_size_semantics = None # type: str
47
- self.is_optional = None # type: bool
48
- self.sw_data_def_props = None # type: SwDataDefProps
49
-
44
+ self.array_size = None # type: int
45
+ self.array_size_semantics = None # type: str
46
+ self.is_optional = None # type: bool
47
+ self.sw_data_def_props = None # type: SwDataDefProps
50
48
 
51
49
  def createImplementationDataTypeElement(self, short_name: str): # type: (...) -> ImplementationDataTypeElement
52
50
  if (short_name not in self.elements):
@@ -84,6 +82,12 @@ class InternalBehavior(Identifiable, metaclass=ABCMeta):
84
82
  def getExclusiveAreas(self) -> List[ExclusiveArea]:
85
83
  return list(filter(lambda c: isinstance(c, ExclusiveArea), self.elements.values()))
86
84
 
85
+ class ModeDeclaration(Identifiable):
86
+ def __init__(self, parent: ARObject, short_name: str):
87
+ super().__init__(parent, short_name)
88
+
89
+ self.value = 0
90
+
87
91
  class ExecutableEntity(Identifiable, metaclass=ABCMeta):
88
92
  def __init__(self, parent: ARObject, short_name: str):
89
93
  if type(self) == ExecutableEntity:
@@ -124,3 +128,46 @@ class ModeDeclarationGroupPrototype(Identifiable):
124
128
  if (value not in ("notAccessible", "readOnly", "readWrite")):
125
129
  raise ValueError("Invalid SwCalibrationAccess <%s> of ModeDeclarationGroupPrototype <%s>" % (value, self.short_name))
126
130
  self._sw_calibration_access = value
131
+
132
+ class MemorySection(Identifiable):
133
+ def __init__(self, parent: ARObject, short_name: str):
134
+ super().__init__(parent, short_name)
135
+
136
+ self._alignment = None
137
+ self.sw_addr_method_ref = None # type: RefType
138
+
139
+ @property
140
+ def alignment(self) -> str:
141
+ return self._alignment
142
+
143
+ @alignment.setter
144
+ def alignment(self, value:str):
145
+ match = False
146
+ if value in ("UNKNOWN", "UNSPECIFIED", "BOOLEAN", "PTR"):
147
+ self._alignment = value
148
+ match = True
149
+ else:
150
+ m = re.match(r'^\d+', value)
151
+ if m:
152
+ self._alignment = value
153
+ match = True
154
+
155
+ if not match:
156
+ raise ValueError("Invalid alignment <%s> of memory section <%s>" % (value, self.short_name))
157
+
158
+
159
+ class ResourceConsumption(Identifiable):
160
+ def __init__(self, parent: ARObject, short_name: str):
161
+ super().__init__(parent, short_name)
162
+
163
+ def createMemorySection(self, short_name: str) -> MemorySection:
164
+ if (short_name not in self.elements):
165
+ entry = MemorySection(self, short_name)
166
+ self.elements[short_name] = entry
167
+ return self.elements[short_name]
168
+
169
+ def getMemorySections(self) -> List[MemorySection]:
170
+ return list(filter(lambda a : isinstance(a, MemorySection), self.elements.values()))
171
+
172
+ def getMemorySection(self, short_name: str) -> MemorySection:
173
+ return next(filter(lambda o: isinstance(o, MemorySection) and (o.short_name == short_name), self.elements.values()), None)
File without changes
@@ -1,11 +1,7 @@
1
- from abc import ABCMeta, abstractmethod
2
-
3
-
4
- class ARObject(metaclass=ABCMeta):
5
- def __init__(self):
6
- if type(self) == ARObject:
7
- raise NotImplementedError("ARObject is an abstract class.")
8
- self.parent = None
1
+ from abc import ABCMeta
2
+ from typing import List
3
+ from .ar_object import ARObject
4
+ from .ar_ref import RefType
9
5
 
10
6
 
11
7
  class Referrable(ARObject, metaclass=ABCMeta):
@@ -71,6 +67,36 @@ class PackageableElement(Identifiable, metaclass=ABCMeta):
71
67
  raise NotImplementedError("PackageableElement is an abstract class.")
72
68
  super().__init__(parent, short_name)
73
69
 
70
+ class SwcBswRunnableMapping(ARObject):
71
+ def __init__(self):
72
+ '''
73
+ Maps a BswModuleEntity to a RunnableEntity if it is implemented as part of a BSW
74
+ module (in the case of an AUTOSAR Service, a Complex Driver or an ECU
75
+ Abstraction). The mapping can be used by a tool to find relevant information on the
76
+ behavior, e.g. whether the bswEntity shall be running in interrupt context.
77
+
78
+ '''
79
+ super().__init__()
80
+
81
+ self.bsw_entity_ref = None # type: RefType
82
+ self.swc_runnable_ref = None # type: RefType
83
+
84
+ class SwcBswMapping(Identifiable):
85
+ def __init__(self, parent: ARObject, short_name: str):
86
+ super().__init__(parent, short_name)
87
+
88
+ self.bsw_behavior_ref = None # type: RefType
89
+ self.runnable_mappings = []
90
+ self.swc_behavior_ref = None # type: RefType
91
+ self.synchronized_mode_groups = []
92
+ self.synchronized_triggers = []
93
+
94
+ def addRunnableMapping(self, mapping: SwcBswRunnableMapping):
95
+ self.runnable_mappings.append(mapping)
96
+
97
+ def getRunnableMappings(self) -> List[SwcBswRunnableMapping]:
98
+ return self.runnable_mappings
99
+
74
100
  class ARElement(PackageableElement, metaclass=ABCMeta):
75
101
  def __init__(self, parent: ARObject, short_name: str):
76
102
  if type(self) == ARElement:
@@ -1,12 +1,49 @@
1
1
  from abc import ABCMeta
2
2
  from typing import List
3
- from . import PackageableElement, ARObject
3
+ from .ar_object import ARObject
4
+ from .general_structure import PackageableElement, Identifiable
5
+ from .common_structure import ResourceConsumption
6
+ from .ar_ref import RefType
7
+
8
+ class EngineeringObject(ARObject, metaclass=ABCMeta):
9
+ def __init__(self):
10
+ if type(self) == EngineeringObject:
11
+ raise NotImplementedError("EngineeringObject is an abstract class.")
12
+
13
+ super().__init__()
14
+
15
+ self.category = ""
16
+ self.domain = None # type: str
17
+ self.revision_label = None # type: str
18
+ self.short_label = "" # type: str
19
+
20
+ class AutosarEngineeringObject(EngineeringObject):
21
+ def __init__(self):
22
+ super().__init__()
23
+
24
+ class Code(Identifiable):
25
+ def __init__(self, parent: ARObject, short_name: str):
26
+ super().__init__(parent, short_name)
27
+
28
+ self.artifact_descriptors = [] # type: List[AutosarEngineeringObject]
29
+ self.callback_header_refs = [] # type: List[RefType]
30
+
31
+ def addArtifactDescriptor(self, desc: AutosarEngineeringObject):
32
+ self.artifact_descriptors.append(desc)
33
+
34
+ def getArtifactDescriptors(self, category:str = "") -> List[AutosarEngineeringObject]:
35
+ if (category == ""):
36
+ return self.artifact_descriptors
37
+ else:
38
+ return list(filter(lambda a: a.category == category, self.artifact_descriptors))
4
39
 
5
40
  class Implementation(PackageableElement, metaclass=ABCMeta):
6
41
  def __init__(self, parent: ARObject, short_name: str) -> None:
42
+ if type(self) == Implementation:
43
+ raise NotImplementedError("Implementation is an abstract class.")
44
+
7
45
  super().__init__(parent, short_name)
8
46
  self.build_action_manifest = None # 0..1
9
- self.code_descriptor = None # 1..*
10
47
  self.compiler = None # *
11
48
  self.generated_artifact = None # *
12
49
  self.hw_element = None # *
@@ -15,18 +52,37 @@ class Implementation(PackageableElement, metaclass=ABCMeta):
15
52
  self.programming_language = "" # 1
16
53
  self.required_artifact = None # *
17
54
  self.required_generator_tool = None # *
18
- self.resource_consumption = None # 1
55
+ self.resource_consumption = None # type: ResourceConsumption
19
56
  self.sw_version = "" # 1
20
- self.swc_bsw_mapping = None # 0..1
57
+ self.swc_bsw_mapping_ref = None # type: RefType
21
58
  self.used_code_generator = "" # 0..1
22
59
  self.vendor_id = 0 # 1
23
60
 
61
+ def createCodeDescriptor(self, short_name: str) -> Code:
62
+ if (short_name not in self.elements):
63
+ sw_component = Code(self, short_name)
64
+ self.elements[short_name] = sw_component
65
+ return self.elements[short_name]
66
+
67
+ def getCodeDescriptors(self)-> List[Code]:
68
+ return list(filter(lambda a : isinstance(a, Code), self.elements.values()))
69
+
24
70
  class BswImplementation(Implementation):
25
71
  def __init__(self, parent: ARObject, short_name: str) -> None:
26
72
  super().__init__(parent, short_name)
73
+
74
+ self.ar_release_version = ""
27
75
  self.revision_label_string = "" # 1
28
- self.behavior = None # 1
76
+ self.behavior_ref = None # type: RefType
29
77
  self.preconfigured_configuration_ref = None # *
30
78
  self.recommended_configuration_ref = None # *
31
79
  self.vendor_api_infix = "" # 0..1
32
- self.vendor_specific_module_def_ref = None # *
80
+ self.vendor_specific_module_def_ref = None # *
81
+
82
+ class SwcImplementation(Implementation):
83
+ def __init__(self, parent: ARObject, short_name: str) -> None:
84
+ super().__init__(parent, short_name)
85
+
86
+ self.behavior_ref = None # type: RefType
87
+ self.per_instance_memory_size = None
88
+ self.required_rte_vendor = ""
@@ -1,7 +1,8 @@
1
1
  from typing import List, Dict
2
2
  from abc import ABCMeta
3
3
  from .general_structure import ARElement, Identifiable, ARObject
4
- from .ar_ref import AutosarVariableRef, RefType, POperationInAtomicSwcInstanceRef, ROperationInAtomicSwcInstanceRef, ProvidedPortPrototypeInstanceRef, RequiredPortPrototypeInstanceRef
4
+ from .ar_ref import AutosarVariableRef, RefType, POperationInAtomicSwcInstanceRef, ROperationInAtomicSwcInstanceRef, ProvidedPortPrototypeInstanceRef
5
+ from .ar_ref import RequiredPortPrototypeInstanceRef, RVariableInAtomicSwcInstanceRef, RModeInAtomicSwcInstanceRef
5
6
  from .port_prototype import RPortPrototype, PPortPrototype
6
7
  from .data_prototype import VariableDataPrototype
7
8
  from .common_structure import ExecutableEntity, InternalBehavior
@@ -169,15 +170,43 @@ class DataReceivedEvent(RTEEvent):
169
170
  def __init__(self, parent: ARObject, short_name: str):
170
171
  super().__init__(parent, short_name)
171
172
 
173
+ self.data_iref = None # type: RVariableInAtomicSwcInstanceRef
174
+
175
+ class SwcModeSwitchEvent(RTEEvent):
176
+ def __init__(self, parent: ARObject, short_name: str):
177
+ super().__init__(parent, short_name)
178
+
179
+ self._activation = ""
180
+ self.mode_irefs = [] # type: List[RModeInAtomicSwcInstanceRef]
181
+
182
+ @property
183
+ def activation(self) -> str:
184
+ return self._activation
185
+
186
+ @activation.setter
187
+ def activation(self, value: str):
188
+ if value not in ("ON-ENTRY", "ON-EXIT", "ON-TRANSITION"):
189
+ raise ValueError("Invalid activation <%s> of SwcModeSwitchEvent <%s>" % (value, self.short_name))
190
+ self._activation = value
191
+
192
+ def addModeIRef(self, mode_iref: RModeInAtomicSwcInstanceRef):
193
+ self.mode_irefs.append(mode_iref)
194
+
172
195
  class DataReceiveErrorEvent(RTEEvent):
173
196
  def __init__(self, parent: ARObject, short_name: str):
174
197
  super().__init__(parent, short_name)
175
198
 
199
+ self.variable_data_prototype_iref = None
200
+
176
201
  class OperationInvokedEvent(RTEEvent):
177
202
  def __init__(self, parent: ARObject, short_name: str):
178
203
  super().__init__(parent, short_name)
179
204
  self.operation_iref = None # type: POperationInAtomicSwcInstanceRef
180
205
 
206
+ class InitEvent(RTEEvent):
207
+ def __init__(self, parent: ARObject, short_name: str):
208
+ super().__init__(parent, short_name)
209
+
181
210
  class TimingEvent(RTEEvent):
182
211
  def __init__(self, parent: ARObject, short_name: str):
183
212
  super().__init__(parent, short_name)
@@ -185,7 +214,7 @@ class TimingEvent(RTEEvent):
185
214
  self.period = 0
186
215
 
187
216
  @property
188
- def peroid_ms(self):
217
+ def period_ms(self):
189
218
  if (self.period < 0.001):
190
219
  return self.period * 1000
191
220
  else:
@@ -213,6 +242,24 @@ class SwcInternalBehavior(InternalBehavior):
213
242
  self.elements[short_name] = event
214
243
  return self.elements[short_name]
215
244
 
245
+ def createInitEvent(self, short_name: str) -> InitEvent:
246
+ if (short_name not in self.elements):
247
+ event = InitEvent(self, short_name)
248
+ self.elements[short_name] = event
249
+ return self.elements[short_name]
250
+
251
+ def createDataReceivedEvent(self, short_name: str) -> DataReceivedEvent:
252
+ if (short_name not in self.elements):
253
+ event = DataReceivedEvent(self, short_name)
254
+ self.elements[short_name] = event
255
+ return self.elements[short_name]
256
+
257
+ def createSwcModeSwitchEvent(self, short_name: str) -> SwcModeSwitchEvent:
258
+ if (short_name not in self.elements):
259
+ event = SwcModeSwitchEvent(self, short_name)
260
+ self.elements[short_name] = event
261
+ return self.elements[short_name]
262
+
216
263
  def createInternalTriggerOccurredEvent(self, short_name: str) -> InternalTriggerOccurredEvent:
217
264
  if (short_name not in self.elements):
218
265
  event = InternalTriggerOccurredEvent(self, short_name)
@@ -225,9 +272,18 @@ class SwcInternalBehavior(InternalBehavior):
225
272
  def getOperationInvokedEvents(self) -> List[OperationInvokedEvent]:
226
273
  return sorted(filter(lambda c: isinstance(c, OperationInvokedEvent), self.elements.values()), key=lambda e: e.short_name)
227
274
 
275
+ def getInitEvents(self) -> List[InitEvent]:
276
+ return sorted(filter(lambda c: isinstance(c, InitEvent), self.elements.values()), key=lambda e: e.short_name)
277
+
228
278
  def getTimingEvents(self) -> List[TimingEvent]:
229
279
  return sorted(filter(lambda c: isinstance(c, TimingEvent), self.elements.values()), key=lambda e: e.short_name)
230
280
 
281
+ def getDataReceivedEvents(self) -> List[DataReceivedEvent]:
282
+ return sorted(filter(lambda c: isinstance(c, DataReceivedEvent), self.elements.values()), key=lambda e: e.short_name)
283
+
284
+ def getSwcModeSwitchEvents(self) -> List[SwcModeSwitchEvent]:
285
+ return sorted(filter(lambda c: isinstance(c, SwcModeSwitchEvent), self.elements.values()), key=lambda e: e.short_name)
286
+
231
287
  def getInternalTriggerOccurredEvents(self) -> List[InternalTriggerOccurredEvent]:
232
288
  return sorted(filter(lambda c: isinstance(c, InternalTriggerOccurredEvent), self.elements.values()), key= lambda e: e.short_name)
233
289