armodel 1.6.2__py3-none-any.whl → 1.6.3__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/cli/arxml_dump_cli.py +10 -7
- armodel/cli/arxml_format_cli.py +1 -1
- armodel/cli/connector_update_cli.py +1 -1
- armodel/lib/sw_component.py +1 -1
- armodel/lib/system_signal.py +2 -2
- armodel/models/{m2/autosar_templates/autosar_top_level_structure.py → M2/AUTOSARTemplates/AutosarTopLevelStructure.py} +7 -4
- armodel/models/{bsw_module_template.py → M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py} +115 -140
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswImplementation.py +21 -0
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswInterfaces.py +52 -0
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +78 -0
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/__init__.py +1 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +81 -0
- armodel/models/{m2/autosar_templates/common_structure/implementation_data_types.py → M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py} +9 -5
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +108 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +96 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/MemorySectionUsage.py +72 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +22 -0
- armodel/models/{service_needs.py → M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py} +7 -7
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcBswMapping.py +36 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/ModeDeclarationGroup.py +27 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/__init__.py +1 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/TriggerDeclaration.py +9 -0
- armodel/models/{m2/autosar_templates/common_structure → M2/AUTOSARTemplates/CommonStructure}/__init__.py +5 -2
- armodel/models/{m2/autosar_templates/generic_structure/abstract_structure.py → M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py} +25 -2
- armodel/models/{m2/autosar_templates/generic_structure/ar_package.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py} +29 -21
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ArObject.py +16 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ElementCollection.py +1 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/EngineeringObject.py +55 -0
- armodel/models/{general_structure.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py} +37 -149
- armodel/models/{ar_object.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py} +163 -70
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/__init__.py +1 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/__init__.py +1 -0
- armodel/models/{m2/autosar_templates/sw_component_template/communication.py → M2/AUTOSARTemplates/SWComponentTemplate/Communication.py} +22 -5
- armodel/models/{m2/autosar_templates/sw_component_template/components/instance_refs.py → M2/AUTOSARTemplates/SWComponentTemplate/Components/InstanceRefs.py} +2 -2
- armodel/models/{m2/autosar_templates/sw_component_template/components → M2/AUTOSARTemplates/SWComponentTemplate/Components}/__init__.py +10 -8
- armodel/models/{m2/autosar_templates/sw_component_template/composition/instance_refs.py → M2/AUTOSARTemplates/SWComponentTemplate/Composition/InstanceRefs.py} +2 -2
- armodel/models/{m2/autosar_templates/sw_component_template/composition → M2/AUTOSARTemplates/SWComponentTemplate/Composition}/__init__.py +5 -5
- armodel/models/{m2/autosar_templates/sw_component_template/data_type/data_prototypes.py → M2/AUTOSARTemplates/SWComponentTemplate/Datatype/DataPrototypes.py} +25 -7
- armodel/models/{datatype.py → M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py} +16 -73
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/__init__.py +1 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/EndToEndProtection.py +177 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcImplementation.py +11 -0
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/access_count.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AccessCount.py} +2 -2
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/DataElements.py} +7 -5
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/IncludedDataTypes.py +24 -0
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/instance_refs_usage.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/InstanceRefsUsage.py} +3 -3
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py} +3 -3
- armodel/models/{per_instance_memory.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/PerInstanceMemory.py} +5 -6
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServerCall.py} +3 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +23 -0
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/trigger.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/Trigger.py} +2 -2
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior}/__init__.py +9 -10
- armodel/models/{m2/autosar_templates/sw_component_template → M2/AUTOSARTemplates/SWComponentTemplate}/port_interface/__init__.py +10 -6
- armodel/models/{m2/autosar_templates/sw_component_template → M2/AUTOSARTemplates/SWComponentTemplate}/port_interface/instance_refs.py +2 -2
- armodel/models/{m2/autosar_templates/system_template/instance_refs.py → M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py} +2 -2
- armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/__init__.py +4 -2
- armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/data_mapping.py +2 -2
- armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/network_management.py +7 -3
- armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/transport_protocols.py +1 -1
- armodel/models/{m2/autosar_templates → M2/AUTOSARTemplates}/ecuc_description_template.py +10 -6
- armodel/models/M2/MSR/AsamHdo/AdminData.py +21 -0
- armodel/models/M2/MSR/AsamHdo/BaseTypes.py +77 -0
- armodel/models/{m2_msr.py → M2/MSR/AsamHdo/ComputationMethod.py} +44 -28
- armodel/models/{global_constraints.py → M2/MSR/AsamHdo/Constraints/GlobalConstraints.py} +7 -4
- armodel/models/M2/MSR/AsamHdo/Constraints/__init__.py +1 -0
- armodel/models/M2/MSR/AsamHdo/SpecialData.py +63 -0
- armodel/models/{m2/msr/asam_hdo/units.py → M2/MSR/AsamHdo/Units.py} +6 -3
- armodel/models/M2/MSR/AsamHdo/__init__.py +1 -0
- armodel/models/M2/MSR/CalibrationData/CalibrationValue.py +30 -0
- armodel/models/M2/MSR/CalibrationData/__init__.py +1 -0
- armodel/models/{m2/msr/data_dictionary/auxillary_objects.py → M2/MSR/DataDictionary/AuxillaryObjects.py} +4 -2
- armodel/models/M2/MSR/DataDictionary/Axis.py +145 -0
- armodel/models/M2/MSR/DataDictionary/CalibrationParameter.py +37 -0
- armodel/models/{m2/msr/data_dictionary/data_def_properties.py → M2/MSR/DataDictionary/DataDefProperties.py} +19 -9
- armodel/models/{record_layout.py → M2/MSR/DataDictionary/RecordLayout.py} +26 -25
- armodel/models/M2/MSR/DataDictionary/__init__.py +1 -0
- armodel/models/{annotation.py → M2/MSR/Documentation/Annotation.py} +8 -8
- armodel/models/{m2/msr/documentation/block_elements.py → M2/MSR/Documentation/BlockElements.py} +2 -2
- armodel/models/M2/MSR/Documentation/TextModel/LanguageDataModel.py +17 -0
- armodel/models/{multilanguage_data.py → M2/MSR/Documentation/TextModel/MultilanguageData.py} +21 -30
- armodel/models/M2/MSR/Documentation/TextModel/__init__.py +2 -0
- armodel/models/M2/MSR/Documentation/__init__.py +3 -0
- armodel/models/M2/MSR/__init__.py +1 -0
- armodel/models/M2/__init__.py +1 -0
- armodel/models/__init__.py +6 -23
- armodel/models/fibex/can_communication.py +3 -2
- armodel/models/fibex/fibex_4_multiplatform.py +5 -3
- armodel/models/fibex/fibex_core/core_communication.py +9 -3
- armodel/models/fibex/fibex_core/core_topology.py +7 -3
- armodel/models/fibex/lin_communication.py +5 -1
- armodel/models/rpt_scenario.py +2 -2
- armodel/models/sw_component.py +19 -14
- armodel/models/timing.py +3 -3
- armodel/parser/abstract_arxml_parser.py +8 -4
- armodel/parser/arxml_parser.py +85 -62
- armodel/parser/connector_xlsx_parser.py +5 -3
- armodel/report/connector_xls_report.py +1 -1
- armodel/tests/test_armodel/models/test_ar_object.py +2 -1
- armodel/tests/test_armodel/models/test_ar_package.py +20 -8
- armodel/tests/test_armodel/models/test_ar_ref.py +7 -5
- armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -1
- armodel/tests/test_armodel/models/test_common_structure.py +11 -5
- armodel/tests/test_armodel/models/test_data_dictionary.py +2 -2
- armodel/tests/test_armodel/models/test_data_prototype.py +7 -3
- armodel/tests/test_armodel/models/test_datatype.py +21 -7
- armodel/tests/test_armodel/models/test_general_structure.py +12 -2
- armodel/tests/test_armodel/models/test_implementation.py +3 -2
- armodel/tests/test_armodel/models/test_m2_msr.py +4 -2
- armodel/tests/test_armodel/models/test_port_interface.py +16 -6
- armodel/tests/test_armodel/models/test_port_prototype.py +1 -1
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +1 -1
- armodel/tests/test_armodel/parser/test_sw_components.py +2 -2
- armodel/tests/test_armodel/parser/test_system.py +30 -0
- armodel/writer/abstract_arxml_writer.py +5 -2
- armodel/writer/arxml_writer.py +100 -67
- {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/METADATA +366 -356
- armodel-1.6.3.dist-info/RECORD +148 -0
- {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/WHEEL +1 -1
- armodel/lib/data_analyzer.py +0 -34
- armodel/models/ar_package.py +0 -641
- armodel/models/ar_ref.py +0 -25
- armodel/models/calibration.py +0 -119
- armodel/models/common_structure.py +0 -272
- armodel/models/communication.py +0 -17
- armodel/models/data_def_properties.py +0 -16
- armodel/models/data_dictionary.py +0 -59
- armodel/models/data_prototype.py +0 -103
- armodel/models/ecuc_parameter_def_template.py +0 -0
- armodel/models/end_to_end_protection.py +0 -67
- armodel/models/fibex/fibex_core.py +0 -341
- armodel/models/fibex/lin_topology.py +0 -7
- armodel/models/implementation.py +0 -135
- armodel/models/internal_behavior.py +0 -63
- armodel/models/m2/autosar_templates/common_structure/constants.py +0 -0
- armodel/models/m2/autosar_templates/common_structure/implementation.py +0 -21
- armodel/models/m2/autosar_templates/generic_structure/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/data_type/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/port_interface.py +0 -236
- armodel/models/m2/msr/__init__.py +0 -0
- armodel/models/m2/msr/asam_hdo/__init__.py +0 -0
- armodel/models/m2/msr/data_dictionary/__init__.py +0 -0
- armodel/models/m2/msr/documentation/__init__.py +0 -0
- armodel/models/mode_declaration.py +0 -8
- armodel/models/port_interface.py +0 -165
- armodel/models/port_prototype.py +0 -6
- armodel/models/service_mapping.py +0 -11
- armodel/models/system_template/__init__.py +0 -0
- armodel/models/system_template/network_management.py +0 -7
- armodel/models/system_template/transport_protocols.py +0 -7
- armodel/models/unit.py +0 -14
- armodel-1.6.2.dist-info/RECORD +0 -142
- /armodel/models/{m2 → M2/AUTOSARTemplates/SWComponentTemplate}/__init__.py +0 -0
- /armodel/models/{m2/autosar_templates → M2/AUTOSARTemplates}/__init__.py +0 -0
- {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/LICENSE +0 -0
- {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/entry_points.txt +0 -0
- {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/top_level.txt +0 -0
armodel/cli/arxml_dump_cli.py
CHANGED
|
@@ -2,13 +2,16 @@ import getopt
|
|
|
2
2
|
import sys
|
|
3
3
|
import logging
|
|
4
4
|
|
|
5
|
-
from ..models.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
from ..models import
|
|
5
|
+
from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswOverview import BswModuleDescription
|
|
6
|
+
|
|
7
|
+
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import PPortPrototype, PortPrototype, RPortPrototype
|
|
8
|
+
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import DataTypeMappingSet
|
|
9
|
+
from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswBehavior import BswInternalBehavior, BswModuleEntity
|
|
10
|
+
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.DataElements import VariableAccess
|
|
11
|
+
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ARPackage import ARPackage
|
|
12
|
+
from ..models import AUTOSAR, SwComponentType
|
|
9
13
|
from ..models import SwcInternalBehavior, ImplementationDataType
|
|
10
|
-
from ..models import
|
|
11
|
-
from ..models import PortPrototype, RPortPrototype, PPortPrototype
|
|
14
|
+
from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswInterfaces import BswModuleEntry
|
|
12
15
|
from ..models import SenderReceiverInterface, ClientServerInterface
|
|
13
16
|
from ..parser import ARXMLParser
|
|
14
17
|
|
|
@@ -87,7 +90,7 @@ def show_sw_component(indent: int, sw_component: SwComponentType):
|
|
|
87
90
|
def show_sender_receiver_interface(indent: int, sr_interface: SenderReceiverInterface):
|
|
88
91
|
print("%s%s" % (" " * indent, sr_interface.short_name))
|
|
89
92
|
for data_element in sr_interface.getDataElements():
|
|
90
|
-
print("%sData Element:%s (%s) " % (" " * (indent + 2), data_element.short_name, data_element.
|
|
93
|
+
print("%sData Element:%s (%s) " % (" " * (indent + 2), data_element.short_name, data_element.getTypeTRef().getValue()))
|
|
91
94
|
|
|
92
95
|
def show_client_server_interface(indent: int, cs_interface: ClientServerInterface):
|
|
93
96
|
print("%s%s" % (" " * indent, cs_interface.short_name))
|
armodel/cli/arxml_format_cli.py
CHANGED
|
@@ -5,7 +5,7 @@ import sys
|
|
|
5
5
|
import os.path
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
from ..models.
|
|
8
|
+
from ..models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
|
|
9
9
|
from ..parser.arxml_parser import ARXMLParser
|
|
10
10
|
from ..writer import ARXMLWriter
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ import sys
|
|
|
5
5
|
import os.path
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
from ..models.
|
|
8
|
+
from ..models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
|
|
9
9
|
from ..parser.arxml_parser import ARXMLParser
|
|
10
10
|
from ..parser.connector_xlsx_parser import ConnectorXlsReader
|
|
11
11
|
|
armodel/lib/sw_component.py
CHANGED
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
|
|
3
3
|
from typing import List
|
|
4
4
|
|
|
5
|
-
from ..models.
|
|
5
|
+
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ARPackage import ARPackage
|
|
6
6
|
from ..models import AUTOSAR, AtomicSwComponentType, CompositionSwComponentType
|
|
7
7
|
|
|
8
8
|
class SwComponentAnalyzer:
|
armodel/lib/system_signal.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from typing import List
|
|
3
3
|
|
|
4
|
-
from ..models.
|
|
4
|
+
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ARPackage import ARPackage
|
|
5
5
|
|
|
6
|
-
from ..models.
|
|
6
|
+
from ..models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
|
|
7
7
|
from ..models.fibex.fibex_core.core_communication import SystemSignal
|
|
8
8
|
|
|
9
9
|
class SystemSignalAnalyzer:
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
from typing import Dict, List
|
|
2
2
|
|
|
3
|
-
from .
|
|
4
|
-
from .common_structure.implementation_data_types import ImplementationDataType
|
|
3
|
+
from .SWComponentTemplate.Datatype.Datatypes import ApplicationDataType
|
|
5
4
|
|
|
6
|
-
from
|
|
5
|
+
from ..MSR.AsamHdo.BaseTypes import SwBaseType
|
|
7
6
|
|
|
8
|
-
from
|
|
7
|
+
from .GenericStructure.GeneralTemplateClasses.Identifiable import CollectableElement
|
|
8
|
+
from .GenericStructure.GeneralTemplateClasses.ARPackage import ARPackage
|
|
9
|
+
from .CommonStructure.ImplementationDataTypes import ImplementationDataType
|
|
10
|
+
from .GenericStructure.GeneralTemplateClasses.Identifiable import Referrable
|
|
11
|
+
from .SWComponentTemplate.Datatype.Datatypes import DataTypeMap
|
|
9
12
|
|
|
10
13
|
class AbstractAUTOSAR(CollectableElement):
|
|
11
14
|
def __init__(self):
|
armodel/models/{bsw_module_template.py → M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py}
RENAMED
|
@@ -1,13 +1,52 @@
|
|
|
1
|
+
from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.IncludedDataTypes import IncludedDataTypeSet
|
|
2
|
+
from ..CommonStructure.SwcInternalBehavior.ModeDeclarationGroup import IncludedModeDeclarationGroupSet
|
|
3
|
+
from ..GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
4
|
+
from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean, ARFloat, ARNumerical
|
|
5
|
+
from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
6
|
+
from ..CommonStructure.InternalBehavior import ReentrancyLevelEnum
|
|
7
|
+
from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import TimeValue
|
|
8
|
+
from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
|
|
9
|
+
from ..CommonStructure.InternalBehavior import ExecutableEntity
|
|
10
|
+
from ..GenericStructure.GeneralTemplateClasses.Identifiable import Referrable
|
|
1
11
|
from abc import ABCMeta
|
|
2
|
-
from typing import
|
|
12
|
+
from typing import List
|
|
13
|
+
from armodel.models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import InternalBehavior
|
|
3
14
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
class BswModuleCallPoint(Referrable):
|
|
16
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
17
|
+
super().__init__(parent, short_name)
|
|
18
|
+
|
|
19
|
+
self.contextLimitationRefs = [] # type: List[RefType]
|
|
9
20
|
|
|
10
|
-
|
|
21
|
+
def getContextLimitationRefs(self):
|
|
22
|
+
return self.contextLimitationRefs
|
|
23
|
+
|
|
24
|
+
def addContextLimitationRef(self, value):
|
|
25
|
+
self.contextLimitationRefs.append(value)
|
|
26
|
+
return self
|
|
27
|
+
|
|
28
|
+
class BswVariableAccess(Referrable):
|
|
29
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
30
|
+
super().__init__(parent, short_name)
|
|
31
|
+
|
|
32
|
+
self.accessedVariableRef = None # type: RefType
|
|
33
|
+
self.contextLimitationRefs = [] # type: List[RefType]
|
|
34
|
+
|
|
35
|
+
def getAccessedVariableRef(self):
|
|
36
|
+
return self.accessedVariableRef
|
|
37
|
+
|
|
38
|
+
def setAccessedVariableRef(self, value):
|
|
39
|
+
self.accessedVariableRef = value
|
|
40
|
+
return self
|
|
41
|
+
|
|
42
|
+
def getContextLimitationRefs(self):
|
|
43
|
+
return self.contextLimitationRefs
|
|
44
|
+
|
|
45
|
+
def addContextLimitationRef(self, value):
|
|
46
|
+
self.contextLimitationRefs.append(value)
|
|
47
|
+
return self
|
|
48
|
+
|
|
49
|
+
class BswModuleEntity(ExecutableEntity, metaclass = ABCMeta):
|
|
11
50
|
def __init__(self, parent: ARObject, short_name: str):
|
|
12
51
|
if type(self) == BswModuleEntity:
|
|
13
52
|
raise NotImplementedError("BswModuleEntity is an abstract class.")
|
|
@@ -15,23 +54,49 @@ class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
|
15
54
|
|
|
16
55
|
self.accessedModeGroupRefs = [] # type: List[RefType]
|
|
17
56
|
self.activationPointRefs = [] # type: List[RefType]
|
|
57
|
+
self.callPoints = [] # type: List[BswModuleCallPoint]
|
|
58
|
+
self.dataReceivePoints = [] # type: List[BswVariableAccess]
|
|
59
|
+
self.dataSendPoints = [] # type: List[BswVariableAccess]
|
|
18
60
|
self.implementedEntryRef = None # type: RefType
|
|
61
|
+
self.issuedTriggerRefs = [] # type: List[RefType]
|
|
19
62
|
self.managedModeGroupRefs = [] # type: List[RefType]
|
|
20
|
-
|
|
63
|
+
self.schedulerNamePrefixRef = None # type: List[RefType]
|
|
64
|
+
|
|
21
65
|
def getAccessedModeGroupRefs(self):
|
|
22
66
|
return self.accessedModeGroupRefs
|
|
23
67
|
|
|
24
|
-
def
|
|
68
|
+
def addAccessedModeGroupRef(self, value):
|
|
25
69
|
self.accessedModeGroupRefs.append(value)
|
|
26
70
|
return self
|
|
27
71
|
|
|
28
72
|
def getActivationPointRefs(self):
|
|
29
73
|
return self.activationPointRefs
|
|
30
74
|
|
|
31
|
-
def
|
|
75
|
+
def addActivationPointRef(self, value):
|
|
32
76
|
self.activationPointRefs.append(value)
|
|
33
77
|
return self
|
|
34
78
|
|
|
79
|
+
def getCallPoints(self):
|
|
80
|
+
return self.callPoints
|
|
81
|
+
|
|
82
|
+
def addCallPoint(self, value):
|
|
83
|
+
self.callPoints.append(value)
|
|
84
|
+
return self
|
|
85
|
+
|
|
86
|
+
def getDataReceivePoint(self):
|
|
87
|
+
return self.dataReceivePoints
|
|
88
|
+
|
|
89
|
+
def addDataReceivePoint(self, value):
|
|
90
|
+
self.dataReceivePoints.append(value)
|
|
91
|
+
return self
|
|
92
|
+
|
|
93
|
+
def getDataSendPoints(self):
|
|
94
|
+
return self.dataSendPoints
|
|
95
|
+
|
|
96
|
+
def addDataSendPoint(self, value):
|
|
97
|
+
self.dataSendPoints.append(value)
|
|
98
|
+
return self
|
|
99
|
+
|
|
35
100
|
def getImplementedEntryRef(self):
|
|
36
101
|
return self.implementedEntryRef
|
|
37
102
|
|
|
@@ -39,20 +104,38 @@ class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
|
39
104
|
self.implementedEntryRef = value
|
|
40
105
|
return self
|
|
41
106
|
|
|
42
|
-
def
|
|
43
|
-
self.
|
|
107
|
+
def getIssuedTriggerRefs(self):
|
|
108
|
+
return self.issuedTriggerRefs
|
|
109
|
+
|
|
110
|
+
def addIssuedTriggerRefs(self, value):
|
|
111
|
+
self.issuedTriggerRefs(value)
|
|
112
|
+
return self
|
|
44
113
|
|
|
45
|
-
def getManagedModeGroupRefs(self)
|
|
114
|
+
def getManagedModeGroupRefs(self):
|
|
46
115
|
return self.managedModeGroupRefs
|
|
47
116
|
|
|
117
|
+
def addManagedModeGroupRef(self, value):
|
|
118
|
+
self.managedModeGroupRefs = value
|
|
119
|
+
return self
|
|
120
|
+
|
|
121
|
+
def getSchedulerNamePrefixRef(self):
|
|
122
|
+
return self.schedulerNamePrefixRef
|
|
123
|
+
|
|
124
|
+
def setSchedulerNamePrefixRef(self, value):
|
|
125
|
+
self.schedulerNamePrefixRef = value
|
|
126
|
+
return self
|
|
127
|
+
|
|
128
|
+
|
|
48
129
|
class BswCalledEntity(BswModuleEntity):
|
|
49
130
|
def __init__(self, parent: ARObject, short_name: str):
|
|
50
131
|
super().__init__(parent, short_name)
|
|
51
132
|
|
|
133
|
+
|
|
52
134
|
class BswSchedulableEntity(BswModuleEntity):
|
|
53
135
|
def __init__(self, parent: ARObject, short_name: str):
|
|
54
136
|
super().__init__(parent, short_name)
|
|
55
137
|
|
|
138
|
+
|
|
56
139
|
class BswInterruptEntity(BswModuleEntity):
|
|
57
140
|
def __init__(self, parent: ARObject, short_name: str):
|
|
58
141
|
super().__init__(parent, short_name)
|
|
@@ -70,6 +153,7 @@ class BswInterruptEntity(BswModuleEntity):
|
|
|
70
153
|
raise ValueError("Invalid interrupt category <%s> of %s" % (value, self.short_name))
|
|
71
154
|
self._interrupt_category = value
|
|
72
155
|
|
|
156
|
+
|
|
73
157
|
class BswEvent(Identifiable, metaclass=ABCMeta):
|
|
74
158
|
def __init__(self, parent: ARObject, short_name: str):
|
|
75
159
|
if type(self) == BswEvent:
|
|
@@ -78,16 +162,19 @@ class BswEvent(Identifiable, metaclass=ABCMeta):
|
|
|
78
162
|
|
|
79
163
|
self.startsOnEventRef = None # type: RefType
|
|
80
164
|
|
|
165
|
+
|
|
81
166
|
class BswOperationInvokedEvent(BswEvent):
|
|
82
167
|
def __init__(self, parent: ARObject, short_name: str):
|
|
83
168
|
super().__init__(parent, short_name)
|
|
84
169
|
|
|
170
|
+
|
|
85
171
|
class BswScheduleEvent(BswEvent, metaclass=ABCMeta):
|
|
86
172
|
def __init__(self, parent: ARObject, short_name: str):
|
|
87
173
|
if type(self) == BswScheduleEvent:
|
|
88
174
|
raise NotImplementedError("BswScheduleEvent is an abstract class.")
|
|
89
175
|
super().__init__(parent, short_name)
|
|
90
176
|
|
|
177
|
+
|
|
91
178
|
class BswModeSwitchEvent(BswScheduleEvent):
|
|
92
179
|
def __init__(self, parent: ARObject, short_name: str):
|
|
93
180
|
super().__init__(parent, short_name)
|
|
@@ -104,10 +191,11 @@ class BswModeSwitchEvent(BswScheduleEvent):
|
|
|
104
191
|
raise ValueError("Invalid activation <%s> of BswModeSwitchEvent <%s>" % (value, self.short_name))
|
|
105
192
|
self._activation = value
|
|
106
193
|
|
|
194
|
+
|
|
107
195
|
class BswTimingEvent(BswScheduleEvent):
|
|
108
196
|
def __init__(self, parent: ARObject, short_name: str):
|
|
109
197
|
super().__init__(parent, short_name)
|
|
110
|
-
|
|
198
|
+
|
|
111
199
|
self.period = None # type: ARFloat
|
|
112
200
|
|
|
113
201
|
@property
|
|
@@ -116,24 +204,28 @@ class BswTimingEvent(BswScheduleEvent):
|
|
|
116
204
|
return int(self.period.value * 1000)
|
|
117
205
|
return None
|
|
118
206
|
|
|
207
|
+
|
|
119
208
|
class BswDataReceivedEvent(BswScheduleEvent):
|
|
120
209
|
def __init__(self, parent: ARObject, short_name: str):
|
|
121
210
|
super().__init__(parent, short_name)
|
|
122
211
|
|
|
123
212
|
self.data_ref = None # type: RefType
|
|
124
213
|
|
|
214
|
+
|
|
125
215
|
class BswInternalTriggerOccurredEvent(BswScheduleEvent):
|
|
126
216
|
def __init__(self, parent: ARObject, short_name: str):
|
|
127
217
|
super().__init__(parent, short_name)
|
|
128
218
|
|
|
129
219
|
self.event_source_ref = None # type: RefType
|
|
130
220
|
|
|
221
|
+
|
|
131
222
|
class BswModeSwitchAckRequest(ARObject):
|
|
132
223
|
def __init__(self):
|
|
133
224
|
super().__init__()
|
|
134
225
|
|
|
135
226
|
self.timeout = None # type: ARFloat
|
|
136
227
|
|
|
228
|
+
|
|
137
229
|
class BswModeSenderPolicy(ARObject):
|
|
138
230
|
def __init__(self):
|
|
139
231
|
super().__init__()
|
|
@@ -149,7 +241,7 @@ class BswModeSenderPolicy(ARObject):
|
|
|
149
241
|
|
|
150
242
|
def getProvidedModeGroupRef(self) -> RefType:
|
|
151
243
|
return self._provided_mode_group_ref
|
|
152
|
-
|
|
244
|
+
|
|
153
245
|
def setQueueLength(self, length: any):
|
|
154
246
|
if isinstance(length, ARNumerical):
|
|
155
247
|
self._queue_length = length
|
|
@@ -158,10 +250,11 @@ class BswModeSenderPolicy(ARObject):
|
|
|
158
250
|
self._queue_length.setValue(length)
|
|
159
251
|
else:
|
|
160
252
|
raise ValueError("Unsupported type <%s>" % type(length))
|
|
161
|
-
|
|
253
|
+
|
|
162
254
|
def getQueueLength(self) -> ARNumerical:
|
|
163
255
|
return self._queue_length
|
|
164
256
|
|
|
257
|
+
|
|
165
258
|
class BswInternalBehavior(InternalBehavior):
|
|
166
259
|
def __init__(self, parent: ARObject, short_name: str):
|
|
167
260
|
super().__init__(parent, short_name)
|
|
@@ -197,7 +290,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
197
290
|
|
|
198
291
|
def getBswSchedulableEntities(self) -> List[BswSchedulableEntity]:
|
|
199
292
|
return list(filter(lambda a: isinstance(a, BswSchedulableEntity), self.elements.values()))
|
|
200
|
-
|
|
293
|
+
|
|
201
294
|
def getBswModuleEntities(self) -> List[BswModuleEntity]:
|
|
202
295
|
return list(filter(lambda a: isinstance(a, BswModuleEntity), self.elements.values()))
|
|
203
296
|
|
|
@@ -210,7 +303,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
210
303
|
|
|
211
304
|
def getBswModeSwitchEvents(self) -> List[BswModeSwitchEvent]:
|
|
212
305
|
return list(filter(lambda a: isinstance(a, BswModeSwitchEvent), self.elements.values()))
|
|
213
|
-
|
|
306
|
+
|
|
214
307
|
def createBswTimingEvent(self, short_name: str) -> BswTimingEvent:
|
|
215
308
|
if (short_name not in self.elements):
|
|
216
309
|
event = BswTimingEvent(self, short_name)
|
|
@@ -240,138 +333,20 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
240
333
|
|
|
241
334
|
def getBswInternalTriggerOccurredEvents(self) -> List[BswInternalTriggerOccurredEvent]:
|
|
242
335
|
return list(filter(lambda a: isinstance(a, BswInternalTriggerOccurredEvent), self.elements.values()))
|
|
243
|
-
|
|
336
|
+
|
|
244
337
|
def getBswEvents(self) -> List[BswEvent]:
|
|
245
338
|
return list(filter(lambda a: isinstance(a, BswEvent), self.elements.values()))
|
|
246
|
-
|
|
339
|
+
|
|
247
340
|
def addIncludedModeDeclarationGroupSet(self, group_set: IncludedModeDeclarationGroupSet):
|
|
248
341
|
self.included_mode_declaration_group_sets.append(group_set)
|
|
249
342
|
|
|
250
343
|
def getIncludedModeDeclarationGroupSets(self) -> List[IncludedModeDeclarationGroupSet]:
|
|
251
344
|
return self.included_mode_declaration_group_sets
|
|
252
|
-
|
|
345
|
+
|
|
253
346
|
def addIncludedDataTypeSet(self, type_set: IncludedDataTypeSet):
|
|
254
347
|
self.included_data_type_sets.append(type_set)
|
|
255
348
|
|
|
256
349
|
def getIncludedDataTypeSets(self) -> List[IncludedDataTypeSet]:
|
|
257
350
|
return self.included_data_type_sets
|
|
258
351
|
|
|
259
|
-
|
|
260
|
-
'''
|
|
261
|
-
Root element for the description of a single BSW module or BSW cluster. In case it
|
|
262
|
-
describes a BSW module, the short name of this element equals the name of the
|
|
263
|
-
BSW module.
|
|
264
|
-
|
|
265
|
-
**attributes**:
|
|
266
|
-
module_id : MODULE-ID
|
|
267
|
-
implemented_entry_refs : PROVIDED-ENTRYS
|
|
268
|
-
'''
|
|
269
|
-
def __init__(self, parent: ARObject, short_name: str):
|
|
270
|
-
super().__init__(parent, short_name)
|
|
271
|
-
|
|
272
|
-
# MODULE-ID
|
|
273
|
-
self.module_id = None # type: ARPositiveInteger
|
|
274
|
-
# PROVIDED-ENTRYS
|
|
275
|
-
self._implementedEntryRefs = [] # type: List[RefType]
|
|
276
|
-
|
|
277
|
-
self.providedModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
278
|
-
self.requiredModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
279
|
-
|
|
280
|
-
def addImplementedEntry(self, entry_ref: RefType):
|
|
281
|
-
self._implementedEntryRefs.append(entry_ref)
|
|
282
|
-
|
|
283
|
-
def getImplementedEntries(self) -> List[RefType]:
|
|
284
|
-
return self._implementedEntryRefs
|
|
285
|
-
|
|
286
|
-
#@property
|
|
287
|
-
#def category(self) -> str:
|
|
288
|
-
# return ARElement.getCategory(self)
|
|
289
|
-
|
|
290
|
-
#@category.setter
|
|
291
|
-
#def category(self, value:str):
|
|
292
|
-
# if value is None:
|
|
293
|
-
# return
|
|
294
|
-
# if value not in ("BSW_MODULE", "BSW_CLUSTER", "LIBRARY"):
|
|
295
|
-
# raise ValueError("Invalid category <%s> of BswModuleDescription <%s>" % (value, self.short_name))
|
|
296
|
-
# ARElement.setCategory(self, value)
|
|
297
|
-
|
|
298
|
-
def createProvidedModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
299
|
-
if (short_name not in self.elements):
|
|
300
|
-
prototype = ModeDeclarationGroupPrototype(self, short_name)
|
|
301
|
-
self.elements[short_name] = prototype
|
|
302
|
-
self.providedModeGroups[short_name] = prototype
|
|
303
|
-
return self.elements[short_name]
|
|
304
|
-
|
|
305
|
-
def getProvidedModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
306
|
-
return sorted(self.providedModeGroups.values(), key=lambda v: v.short_name)
|
|
307
|
-
|
|
308
|
-
def createRequiredModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
309
|
-
if (short_name not in self.elements):
|
|
310
|
-
prototype = ModeDeclarationGroupPrototype(self, short_name)
|
|
311
|
-
self.elements[short_name] = prototype
|
|
312
|
-
self.requiredModeGroups[short_name] = property
|
|
313
|
-
return self.elements[short_name]
|
|
314
|
-
|
|
315
|
-
def getRequiredModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
316
|
-
return sorted(self.requiredModeGroups.values(), key=lambda v: v.short_name)
|
|
317
|
-
|
|
318
|
-
def createBswInternalBehavior(self, short_name: str) -> BswInternalBehavior:
|
|
319
|
-
'''
|
|
320
|
-
Create the INTERNAL-BEHAVIORS tag
|
|
321
|
-
'''
|
|
322
|
-
if (short_name not in self.elements):
|
|
323
|
-
prototype = BswInternalBehavior(self, short_name)
|
|
324
|
-
self.elements[short_name] = prototype
|
|
325
|
-
return self.elements[short_name]
|
|
326
|
-
|
|
327
|
-
def getBswInternalBehaviors(self) -> List[BswInternalBehavior]:
|
|
328
|
-
return list(filter(lambda a: isinstance(a, BswInternalBehavior), self.elements.values()))
|
|
329
|
-
|
|
330
|
-
class BswModuleEntry(ARElement):
|
|
331
|
-
def __init__(self, parent: ARObject, short_name: str):
|
|
332
|
-
super().__init__(parent, short_name)
|
|
333
|
-
|
|
334
|
-
self.service_id = None # type: ARNumerical
|
|
335
|
-
self.is_reentrant = None # type: ARBoolean
|
|
336
|
-
self.is_synchronous = None # type: ARBoolean
|
|
337
|
-
self.call_type = None # type: ARLiteral
|
|
338
|
-
self._execution_context = None # type: ARLiteral
|
|
339
|
-
self._sw_service_impl_policy = None # type: ARLiteral
|
|
340
|
-
|
|
341
|
-
@property
|
|
342
|
-
def execution_context(self):
|
|
343
|
-
return self._execution_context
|
|
344
|
-
|
|
345
|
-
@execution_context.setter
|
|
346
|
-
def execution_context(self, value):
|
|
347
|
-
if value.upper() not in ("HOOK", "INTERRUPT-CAT-1", "INTERRUPT-CAT-2", "TASK", "UNSPECIFIED"):
|
|
348
|
-
raise ValueError("Invalid execution context <%s> of BswModuleEntry <%s>" % (value, self.short_name))
|
|
349
|
-
self._execution_context = value
|
|
350
|
-
|
|
351
|
-
@property
|
|
352
|
-
def sw_service_impl_policy(self):
|
|
353
|
-
return self._sw_service_impl_policy
|
|
354
|
-
|
|
355
|
-
@sw_service_impl_policy.setter
|
|
356
|
-
def sw_service_impl_policy(self, value):
|
|
357
|
-
if value.upper() not in ("INLINE", "INLINE-CONDITIONAL", "MACRO", "STANDARD"):
|
|
358
|
-
raise ValueError("Invalid SwServiceImplPolicy <%s> of BswModuleEntry <%s>" % (value, self.short_name))
|
|
359
|
-
self._sw_service_impl_policy = value
|
|
360
|
-
|
|
361
|
-
def __str__(self) -> str:
|
|
362
|
-
result = []
|
|
363
|
-
result.append("short_name : %s" % self.short_name)
|
|
364
|
-
if self.service_id != None:
|
|
365
|
-
result.append("service_id : %d" % self.service_id)
|
|
366
|
-
if self.is_reentrant != None:
|
|
367
|
-
result.append("is_reentrant : %s" % self.is_reentrant)
|
|
368
|
-
if self.is_synchronous != None:
|
|
369
|
-
result.append("is_synchronous : %s" % self.is_synchronous)
|
|
370
|
-
if self.call_type != None:
|
|
371
|
-
result.append("call_type : %s" % self.call_type)
|
|
372
|
-
if self.execution_context != None:
|
|
373
|
-
result.append("execution_context : %s" % self.execution_context)
|
|
374
|
-
if self.sw_service_impl_policy != None:
|
|
375
|
-
result.append("sw_service_impl_policy : %s" % self.sw_service_impl_policy)
|
|
376
|
-
|
|
377
|
-
return "\n".join(result)
|
|
352
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
2
|
+
from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, RefType
|
|
3
|
+
from ..CommonStructure.Implementation import Implementation
|
|
4
|
+
from typing import List
|
|
5
|
+
|
|
6
|
+
class BswImplementation(Implementation):
|
|
7
|
+
def __init__(self, parent: ARObject, short_name: str) -> None:
|
|
8
|
+
super().__init__(parent, short_name)
|
|
9
|
+
|
|
10
|
+
self.ar_release_version = None # type: ARLiteral
|
|
11
|
+
self.behavior_ref = None # type: RefType
|
|
12
|
+
self.preconfiguredConfigurationRef = [] # type: List[RefType]
|
|
13
|
+
self.recommendedConfigurationRef = [] # type: List[RefType]
|
|
14
|
+
self.vendorApiInfix = None # type: str
|
|
15
|
+
self._vendorSpecificModuleDefRef = [] # type: List[RefType]
|
|
16
|
+
|
|
17
|
+
def addVendorSpecificModuleDefRef(self, ref: RefType):
|
|
18
|
+
self._vendorSpecificModuleDefRef.append(ref)
|
|
19
|
+
|
|
20
|
+
def getVendorSpecificModuleDefRefs(self):
|
|
21
|
+
return self._vendorSpecificModuleDefRef
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
2
|
+
from ..GenericStructure.GeneralTemplateClasses.Identifiable import ARElement
|
|
3
|
+
from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean, ARLiteral, ARNumerical
|
|
4
|
+
|
|
5
|
+
class BswModuleEntry(ARElement):
|
|
6
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
7
|
+
super().__init__(parent, short_name)
|
|
8
|
+
|
|
9
|
+
self.service_id = None # type: ARNumerical
|
|
10
|
+
self.is_reentrant = None # type: ARBoolean
|
|
11
|
+
self.is_synchronous = None # type: ARBoolean
|
|
12
|
+
self.call_type = None # type: ARLiteral
|
|
13
|
+
self._execution_context = None # type: ARLiteral
|
|
14
|
+
self._sw_service_impl_policy = None # type: ARLiteral
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def execution_context(self):
|
|
18
|
+
return self._execution_context
|
|
19
|
+
|
|
20
|
+
@execution_context.setter
|
|
21
|
+
def execution_context(self, value):
|
|
22
|
+
if value.upper() not in ("HOOK", "INTERRUPT-CAT-1", "INTERRUPT-CAT-2", "TASK", "UNSPECIFIED"):
|
|
23
|
+
raise ValueError("Invalid execution context <%s> of BswModuleEntry <%s>" % (value, self.short_name))
|
|
24
|
+
self._execution_context = value
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def sw_service_impl_policy(self):
|
|
28
|
+
return self._sw_service_impl_policy
|
|
29
|
+
|
|
30
|
+
@sw_service_impl_policy.setter
|
|
31
|
+
def sw_service_impl_policy(self, value):
|
|
32
|
+
if value.upper() not in ("INLINE", "INLINE-CONDITIONAL", "MACRO", "STANDARD"):
|
|
33
|
+
raise ValueError("Invalid SwServiceImplPolicy <%s> of BswModuleEntry <%s>" % (value, self.short_name))
|
|
34
|
+
self._sw_service_impl_policy = value
|
|
35
|
+
|
|
36
|
+
def __str__(self) -> str:
|
|
37
|
+
result = []
|
|
38
|
+
result.append("short_name : %s" % self.short_name)
|
|
39
|
+
if self.service_id != None:
|
|
40
|
+
result.append("service_id : %d" % self.service_id)
|
|
41
|
+
if self.is_reentrant != None:
|
|
42
|
+
result.append("is_reentrant : %s" % self.is_reentrant)
|
|
43
|
+
if self.is_synchronous != None:
|
|
44
|
+
result.append("is_synchronous : %s" % self.is_synchronous)
|
|
45
|
+
if self.call_type != None:
|
|
46
|
+
result.append("call_type : %s" % self.call_type)
|
|
47
|
+
if self.execution_context != None:
|
|
48
|
+
result.append("execution_context : %s" % self.execution_context)
|
|
49
|
+
if self.sw_service_impl_policy != None:
|
|
50
|
+
result.append("sw_service_impl_policy : %s" % self.sw_service_impl_policy)
|
|
51
|
+
|
|
52
|
+
return "\n".join(result)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from ..BswModuleTemplate.BswBehavior import BswInternalBehavior
|
|
2
|
+
from ..CommonStructure.ModeDeclaration import ModeDeclarationGroupPrototype
|
|
3
|
+
from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
4
|
+
from ..GenericStructure.GeneralTemplateClasses.Identifiable import ARElement
|
|
5
|
+
from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARPositiveInteger, RefType
|
|
6
|
+
from typing import Dict, List
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BswModuleDescription(ARElement):
|
|
10
|
+
'''
|
|
11
|
+
Root element for the description of a single BSW module or BSW cluster. In case it
|
|
12
|
+
describes a BSW module, the short name of this element equals the name of the
|
|
13
|
+
BSW module.
|
|
14
|
+
|
|
15
|
+
**attributes**:
|
|
16
|
+
module_id : MODULE-ID
|
|
17
|
+
implemented_entry_refs : PROVIDED-ENTRYS
|
|
18
|
+
'''
|
|
19
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
20
|
+
super().__init__(parent, short_name)
|
|
21
|
+
|
|
22
|
+
# MODULE-ID
|
|
23
|
+
self.module_id = None # type: ARPositiveInteger
|
|
24
|
+
# PROVIDED-ENTRYS
|
|
25
|
+
self._implementedEntryRefs = [] # type: List[RefType]
|
|
26
|
+
|
|
27
|
+
self.providedModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
28
|
+
self.requiredModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
29
|
+
|
|
30
|
+
def addImplementedEntry(self, entry_ref: RefType):
|
|
31
|
+
self._implementedEntryRefs.append(entry_ref)
|
|
32
|
+
|
|
33
|
+
def getImplementedEntries(self) -> List[RefType]:
|
|
34
|
+
return self._implementedEntryRefs
|
|
35
|
+
|
|
36
|
+
#@property
|
|
37
|
+
#def category(self) -> str:
|
|
38
|
+
# return ARElement.getCategory(self)
|
|
39
|
+
|
|
40
|
+
#@category.setter
|
|
41
|
+
#def category(self, value:str):
|
|
42
|
+
# if value is None:
|
|
43
|
+
# return
|
|
44
|
+
# if value not in ("BSW_MODULE", "BSW_CLUSTER", "LIBRARY"):
|
|
45
|
+
# raise ValueError("Invalid category <%s> of BswModuleDescription <%s>" % (value, self.short_name))
|
|
46
|
+
# ARElement.setCategory(self, value)
|
|
47
|
+
|
|
48
|
+
def createProvidedModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
49
|
+
if (short_name not in self.elements):
|
|
50
|
+
prototype = ModeDeclarationGroupPrototype(self, short_name)
|
|
51
|
+
self.elements[short_name] = prototype
|
|
52
|
+
self.providedModeGroups[short_name] = prototype
|
|
53
|
+
return self.elements[short_name]
|
|
54
|
+
|
|
55
|
+
def getProvidedModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
56
|
+
return sorted(self.providedModeGroups.values(), key=lambda v: v.short_name)
|
|
57
|
+
|
|
58
|
+
def createRequiredModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
59
|
+
if (short_name not in self.elements):
|
|
60
|
+
prototype = ModeDeclarationGroupPrototype(self, short_name)
|
|
61
|
+
self.elements[short_name] = prototype
|
|
62
|
+
self.requiredModeGroups[short_name] = property
|
|
63
|
+
return self.elements[short_name]
|
|
64
|
+
|
|
65
|
+
def getRequiredModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
66
|
+
return sorted(self.requiredModeGroups.values(), key=lambda v: v.short_name)
|
|
67
|
+
|
|
68
|
+
def createBswInternalBehavior(self, short_name: str) -> BswInternalBehavior:
|
|
69
|
+
'''
|
|
70
|
+
Create the INTERNAL-BEHAVIORS tag
|
|
71
|
+
'''
|
|
72
|
+
if (short_name not in self.elements):
|
|
73
|
+
prototype = BswInternalBehavior(self, short_name)
|
|
74
|
+
self.elements[short_name] = prototype
|
|
75
|
+
return self.elements[short_name]
|
|
76
|
+
|
|
77
|
+
def getBswInternalBehaviors(self) -> List[BswInternalBehavior]:
|
|
78
|
+
return list(filter(lambda a: isinstance(a, BswInternalBehavior), self.elements.values()))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import *
|