armodel 1.7.3__py3-none-any.whl → 1.7.5__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/file_list_cli.py +70 -0
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +2 -1
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +1 -1
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +6 -7
- armodel/models/M2/AUTOSARTemplates/DiagnosticExtract/DiagnosticContribution.py +47 -0
- armodel/models/M2/AUTOSARTemplates/DiagnosticExtract/__init__.py +0 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +73 -3
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +37 -1
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +17 -1
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AutosarVariableRef.py +31 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/DataElements.py +4 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/InstanceRefsUsage.py +17 -32
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/RTEEvents.py +4 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +7 -1
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +47 -15
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DiagnosticConnection.py +58 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetCommunication.py +244 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetTopology.py +281 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/NetworkEndpoint.py +328 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/ServiceInstances.py +522 -11
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Lin/LinCommunication.py +114 -6
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Lin/LinTopology.py +94 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py +151 -6
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +140 -12
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +31 -6
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/Timing.py +7 -12
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/NetworkManagement.py +135 -13
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/TransportProtocols.py +25 -1
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +4 -3
- armodel/models/M2/MSR/AsamHdo/BaseTypes.py +0 -1
- armodel/models/M2/MSR/DataDictionary/RecordLayout.py +1 -1
- armodel/models/__init__.py +6 -0
- armodel/parser/abstract_arxml_parser.py +2 -0
- armodel/parser/arxml_parser.py +561 -62
- armodel/tests/test_armodel/models/test_ar_ref.py +2 -2
- armodel/writer/abstract_arxml_writer.py +1 -3
- armodel/writer/arxml_writer.py +702 -223
- {armodel-1.7.3.dist-info → armodel-1.7.5.dist-info}/METADATA +47 -2
- {armodel-1.7.3.dist-info → armodel-1.7.5.dist-info}/RECORD +43 -34
- {armodel-1.7.3.dist-info → armodel-1.7.5.dist-info}/entry_points.txt +1 -0
- {armodel-1.7.3.dist-info → armodel-1.7.5.dist-info}/LICENSE +0 -0
- {armodel-1.7.3.dist-info → armodel-1.7.5.dist-info}/WHEEL +0 -0
- {armodel-1.7.3.dist-info → armodel-1.7.5.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import pkg_resources
|
|
3
|
+
import logging
|
|
4
|
+
import sys
|
|
5
|
+
import os.path
|
|
6
|
+
|
|
7
|
+
from ..parser import FileListParser
|
|
8
|
+
|
|
9
|
+
def format_filename(filename, type: str):
|
|
10
|
+
path, file = os.path.split(filename)
|
|
11
|
+
base, ext = os.path.splitext(file)
|
|
12
|
+
return os.path.join(path, base + "_" + type + ext)
|
|
13
|
+
|
|
14
|
+
def main():
|
|
15
|
+
version = pkg_resources.require("armodel")[0].version
|
|
16
|
+
|
|
17
|
+
ap = argparse.ArgumentParser()
|
|
18
|
+
ap.description = "Parse the folder to generate ARXML file list. <%s>" % version
|
|
19
|
+
ap.add_argument("-v", "--verbose", required= False, help= "Print debug information", action= "store_true")
|
|
20
|
+
ap.add_argument("--absolute", required= False, help="Absolute path or relative Path", action= "store_true")
|
|
21
|
+
ap.add_argument("Input", help = "The path contains ARXML file", nargs='+')
|
|
22
|
+
ap.add_argument("Output", help = "The text contains ARXML file list.")
|
|
23
|
+
|
|
24
|
+
args = ap.parse_args()
|
|
25
|
+
|
|
26
|
+
logger = logging.getLogger()
|
|
27
|
+
|
|
28
|
+
formatter = logging.Formatter('[%(levelname)s] : %(message)s')
|
|
29
|
+
|
|
30
|
+
stdout_handler = logging.StreamHandler(sys.stderr)
|
|
31
|
+
stdout_handler.setFormatter(formatter)
|
|
32
|
+
|
|
33
|
+
base_path = os.path.dirname(args.Output)
|
|
34
|
+
log_file = os.path.join(base_path, 'armodel_file_list.log')
|
|
35
|
+
|
|
36
|
+
if os.path.exists(log_file):
|
|
37
|
+
os.remove(log_file)
|
|
38
|
+
|
|
39
|
+
file_handler = logging.FileHandler(log_file)
|
|
40
|
+
file_handler.setFormatter(formatter)
|
|
41
|
+
|
|
42
|
+
logger.setLevel(logging.DEBUG)
|
|
43
|
+
file_handler.setLevel(logging.DEBUG)
|
|
44
|
+
|
|
45
|
+
if args.verbose:
|
|
46
|
+
stdout_handler.setLevel(logging.DEBUG)
|
|
47
|
+
|
|
48
|
+
else:
|
|
49
|
+
stdout_handler.setLevel(logging.INFO)
|
|
50
|
+
|
|
51
|
+
logger.addHandler(file_handler)
|
|
52
|
+
logger.addHandler(stdout_handler)
|
|
53
|
+
|
|
54
|
+
try:
|
|
55
|
+
file_parser = FileListParser()
|
|
56
|
+
file_parser.parse(args.Input)
|
|
57
|
+
|
|
58
|
+
with open(args.Output, "w") as f_out:
|
|
59
|
+
for filename in file_parser.get_file_list():
|
|
60
|
+
if args.absolute:
|
|
61
|
+
f_out.write("%s\n" % os.path.realpath(filename))
|
|
62
|
+
else:
|
|
63
|
+
f_out.write("%s\n" % os.path.relpath(filename))
|
|
64
|
+
|
|
65
|
+
except Exception as e:
|
|
66
|
+
#print(e)
|
|
67
|
+
raise e
|
|
68
|
+
|
|
69
|
+
if __name__ == "__main__":
|
|
70
|
+
main()
|
|
@@ -91,7 +91,7 @@ class InternalBehavior(Identifiable, metaclass=ABCMeta):
|
|
|
91
91
|
self.constantMemories.append(prototype)
|
|
92
92
|
return self.getElement(short_name)
|
|
93
93
|
|
|
94
|
-
def
|
|
94
|
+
def getConstantMemories(self) -> List[ParameterDataPrototype]:
|
|
95
95
|
return self.constantMemories
|
|
96
96
|
|
|
97
97
|
def addDataTypeMappingRef(self, ref: RefType):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from abc import ABCMeta
|
|
2
2
|
from typing import List
|
|
3
|
-
|
|
3
|
+
from ....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef
|
|
4
|
+
from ....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.AutosarVariableRef import AutosarVariableRef
|
|
4
5
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
5
6
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
6
7
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Identifier, RefType, AREnum, Boolean, ARLiteral, DiagRequirementIdString, Integer, PositiveInteger, RefType, String, TimeValue
|
|
@@ -10,8 +11,8 @@ class RoleBasedDataAssignment(ARObject):
|
|
|
10
11
|
super().__init__()
|
|
11
12
|
|
|
12
13
|
self.role = None # type: ARLiteral
|
|
13
|
-
self.usedDataElement = None # type:
|
|
14
|
-
self.usedParameterElement = None # type:
|
|
14
|
+
self.usedDataElement = None # type: AutosarVariableRef
|
|
15
|
+
self.usedParameterElement = None # type: AutosarParameterRef
|
|
15
16
|
self.usedPimRef = None # type: RefType
|
|
16
17
|
|
|
17
18
|
def getRole(self):
|
|
@@ -615,10 +616,8 @@ class DiagnosticEventInfoNeeds(DiagnosticCapabilityElement):
|
|
|
615
616
|
def __init__(self, parent: ARObject, short_name: str):
|
|
616
617
|
super().__init__(parent, short_name)
|
|
617
618
|
|
|
618
|
-
# type: PositiveInteger
|
|
619
|
-
self.
|
|
620
|
-
# type: PositiveInteger
|
|
621
|
-
self.udsDtcNumber = None
|
|
619
|
+
self.obdDtcNumber = None # type: PositiveInteger
|
|
620
|
+
self.udsDtcNumber = None # type: PositiveInteger
|
|
622
621
|
|
|
623
622
|
def getObdDtcNumber(self):
|
|
624
623
|
return self.obdDtcNumber
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from .....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import NameToken, RefType
|
|
4
|
+
from .....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
5
|
+
from .....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DiagnosticServiceTable(ARElement):
|
|
9
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
10
|
+
super().__init__(parent, short_name)
|
|
11
|
+
|
|
12
|
+
self.diagnosticConnectionRefs = [] # type: List[RefType]
|
|
13
|
+
self.diagnosticServiceInstanceRefs = [] # type: List[RefType]
|
|
14
|
+
self.ecuInstanceRef = None # type: RefType
|
|
15
|
+
self.protocolKind = None # type: NameToken
|
|
16
|
+
|
|
17
|
+
def getDiagnosticConnectionRefs(self):
|
|
18
|
+
return self.diagnosticConnectionRefs
|
|
19
|
+
|
|
20
|
+
def addDiagnosticConnectionRef(self, value):
|
|
21
|
+
if value is not None:
|
|
22
|
+
self.diagnosticConnectionRefs.append(value)
|
|
23
|
+
return self
|
|
24
|
+
|
|
25
|
+
def getDiagnosticServiceInstanceRefs(self):
|
|
26
|
+
return self.diagnosticServiceInstanceRefs
|
|
27
|
+
|
|
28
|
+
def addDiagnosticServiceInstanceRef(self, value):
|
|
29
|
+
if value is not None:
|
|
30
|
+
self.diagnosticServiceInstanceRefs.append(value)
|
|
31
|
+
return self
|
|
32
|
+
|
|
33
|
+
def getEcuInstanceRef(self):
|
|
34
|
+
return self.ecuInstanceRef
|
|
35
|
+
|
|
36
|
+
def setEcuInstanceRef(self, value):
|
|
37
|
+
if value is not None:
|
|
38
|
+
self.ecuInstanceRef = value
|
|
39
|
+
return self
|
|
40
|
+
|
|
41
|
+
def getProtocolKind(self):
|
|
42
|
+
return self.protocolKind
|
|
43
|
+
|
|
44
|
+
def setProtocolKind(self, value):
|
|
45
|
+
if value is not None:
|
|
46
|
+
self.protocolKind = value
|
|
47
|
+
return self
|
|
File without changes
|
|
@@ -11,11 +11,12 @@ from .....M2.MSR.AsamHdo.Constraints.GlobalConstraints import DataConstr
|
|
|
11
11
|
from .....M2.MSR.AsamHdo.ComputationMethod import CompuMethod
|
|
12
12
|
from .....M2.MSR.DataDictionary.AuxillaryObjects import SwAddrMethod
|
|
13
13
|
from .....M2.MSR.DataDictionary.RecordLayout import SwRecordLayout
|
|
14
|
+
from .....M2.AUTOSARTemplates.BswModuleTemplate.BswImplementation import BswImplementation
|
|
14
15
|
from .....M2.AUTOSARTemplates.BswModuleTemplate.BswOverview import BswModuleDescription
|
|
15
16
|
from .....M2.AUTOSARTemplates.BswModuleTemplate.BswInterfaces import BswModuleEntry
|
|
16
17
|
from .....M2.AUTOSARTemplates.CommonStructure.Implementation import Implementation
|
|
17
18
|
from .....M2.AUTOSARTemplates.CommonStructure.FlatMap import FlatMap
|
|
18
|
-
from .....M2.AUTOSARTemplates.
|
|
19
|
+
from .....M2.AUTOSARTemplates.DiagnosticExtract.DiagnosticContribution import DiagnosticServiceTable
|
|
19
20
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
20
21
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import CollectableElement, Identifiable, Referrable
|
|
21
22
|
from .....M2.AUTOSARTemplates.GenericStructure.LifeCycles import LifeCycleInfoSet
|
|
@@ -23,11 +24,14 @@ from .....M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import Appl
|
|
|
23
24
|
from .....M2.AUTOSARTemplates.CommonStructure.ModeDeclaration import ModeDeclarationGroup
|
|
24
25
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import DataTypeMappingSet
|
|
25
26
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndProtectionSet
|
|
27
|
+
from .....M2.AUTOSARTemplates.SystemTemplate.DiagnosticConnection import DiagnosticConnection
|
|
26
28
|
from .....M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanCommunication import CanFrame
|
|
27
29
|
from .....M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Multiplatform import Gateway
|
|
28
|
-
from .....M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import DcmIPdu, ISignal, ISignalGroup, ISignalIPdu, ISignalIPduGroup, NPdu, NmPdu, SecuredIPdu, SystemSignal, SystemSignalGroup
|
|
30
|
+
from .....M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import DcmIPdu, GeneralPurposeIPdu, GeneralPurposePdu, ISignal, ISignalGroup, ISignalIPdu, ISignalIPduGroup, MultiplexedIPdu, NPdu, NmPdu, SecureCommunicationPropsSet, SecuredIPdu, SystemSignal, SystemSignalGroup, UserDefinedIPdu, UserDefinedPdu
|
|
29
31
|
from .....M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import CanCluster, LinCluster
|
|
30
32
|
from .....M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinCommunication import LinUnconditionalFrame
|
|
33
|
+
from .....M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import EthernetCluster
|
|
34
|
+
from .....M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetCommunication import SoAdRoutingGroup
|
|
31
35
|
from .....M2.AUTOSARTemplates.CommonStructure.SwcBswMapping import SwcBswMapping
|
|
32
36
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcImplementation import SwcImplementation
|
|
33
37
|
from .....M2.AUTOSARTemplates.CommonStructure import ConstantSpecification
|
|
@@ -36,7 +40,7 @@ from .....M2.AUTOSARTemplates.ECUCDescriptionTemplate import EcucModuleConfigura
|
|
|
36
40
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ClientServerInterface, ModeSwitchInterface, ParameterInterface, PortInterfaceMappingSet, SenderReceiverInterface, TriggerInterface
|
|
37
41
|
from .....M2.AUTOSARTemplates.SystemTemplate import System
|
|
38
42
|
from .....M2.AUTOSARTemplates.SystemTemplate.NetworkManagement import NmConfig
|
|
39
|
-
from .....M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import CanTpConfig
|
|
43
|
+
from .....M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import CanTpConfig, DoIpTpConfig
|
|
40
44
|
|
|
41
45
|
class ReferenceBase(ARObject):
|
|
42
46
|
def __init__(self):
|
|
@@ -476,6 +480,72 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
476
480
|
map = PortInterfaceMappingSet(self, short_name)
|
|
477
481
|
self.addElement(map)
|
|
478
482
|
return self.getElement(short_name)
|
|
483
|
+
|
|
484
|
+
def createEthernetCluster(self, short_name: str) -> EthernetCluster:
|
|
485
|
+
if (short_name not in self.elements):
|
|
486
|
+
cluster = EthernetCluster(self, short_name)
|
|
487
|
+
self.addElement(cluster)
|
|
488
|
+
return self.getElement(short_name)
|
|
489
|
+
|
|
490
|
+
def createDiagnosticConnection(self, short_name: str) -> DiagnosticConnection:
|
|
491
|
+
if (short_name not in self.elements):
|
|
492
|
+
cluster = DiagnosticConnection(self, short_name)
|
|
493
|
+
self.addElement(cluster)
|
|
494
|
+
return self.getElement(short_name)
|
|
495
|
+
|
|
496
|
+
def createDiagnosticServiceTable(self, short_name: str) -> DiagnosticServiceTable:
|
|
497
|
+
if (short_name not in self.elements):
|
|
498
|
+
cluster = DiagnosticServiceTable(self, short_name)
|
|
499
|
+
self.addElement(cluster)
|
|
500
|
+
return self.getElement(short_name)
|
|
501
|
+
|
|
502
|
+
def createMultiplexedIPdu(self, short_name: str) -> MultiplexedIPdu:
|
|
503
|
+
if (short_name not in self.elements):
|
|
504
|
+
cluster = MultiplexedIPdu(self, short_name)
|
|
505
|
+
self.addElement(cluster)
|
|
506
|
+
return self.getElement(short_name)
|
|
507
|
+
|
|
508
|
+
def createUserDefinedIPdu(self, short_name: str) -> UserDefinedIPdu:
|
|
509
|
+
if (short_name not in self.elements):
|
|
510
|
+
cluster = UserDefinedIPdu(self, short_name)
|
|
511
|
+
self.addElement(cluster)
|
|
512
|
+
return self.getElement(short_name)
|
|
513
|
+
|
|
514
|
+
def createUserDefinedPdu(self, short_name: str) -> UserDefinedPdu:
|
|
515
|
+
if (short_name not in self.elements):
|
|
516
|
+
cluster = UserDefinedPdu(self, short_name)
|
|
517
|
+
self.addElement(cluster)
|
|
518
|
+
return self.getElement(short_name)
|
|
519
|
+
|
|
520
|
+
def createGeneralPurposeIPdu(self, short_name: str) -> GeneralPurposeIPdu:
|
|
521
|
+
if (short_name not in self.elements):
|
|
522
|
+
cluster = GeneralPurposeIPdu(self, short_name)
|
|
523
|
+
self.addElement(cluster)
|
|
524
|
+
return self.getElement(short_name)
|
|
525
|
+
|
|
526
|
+
def createGeneralPurposePdu(self, short_name: str) -> GeneralPurposePdu:
|
|
527
|
+
if (short_name not in self.elements):
|
|
528
|
+
cluster = GeneralPurposePdu(self, short_name)
|
|
529
|
+
self.addElement(cluster)
|
|
530
|
+
return self.getElement(short_name)
|
|
531
|
+
|
|
532
|
+
def createSecureCommunicationPropsSet(self, short_name: str) -> SecureCommunicationPropsSet:
|
|
533
|
+
if (short_name not in self.elements):
|
|
534
|
+
cluster = SecureCommunicationPropsSet(self, short_name)
|
|
535
|
+
self.addElement(cluster)
|
|
536
|
+
return self.getElement(short_name)
|
|
537
|
+
|
|
538
|
+
def createSoAdRoutingGroup(self, short_name: str) -> SoAdRoutingGroup:
|
|
539
|
+
if (short_name not in self.elements):
|
|
540
|
+
cluster = SoAdRoutingGroup(self, short_name)
|
|
541
|
+
self.addElement(cluster)
|
|
542
|
+
return self.getElement(short_name)
|
|
543
|
+
|
|
544
|
+
def createDoIpTpConfig(self, short_name: str) -> DoIpTpConfig:
|
|
545
|
+
if (short_name not in self.elements):
|
|
546
|
+
cluster = DoIpTpConfig(self, short_name)
|
|
547
|
+
self.addElement(cluster)
|
|
548
|
+
return self.getElement(short_name)
|
|
479
549
|
|
|
480
550
|
def getApplicationPrimitiveDataTypes(self) -> List[ApplicationPrimitiveDataType]:
|
|
481
551
|
return list(sorted(filter(lambda a: isinstance(a, ApplicationPrimitiveDataType), self.elements.values()), key= lambda o:o.short_name))
|
armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py
CHANGED
|
@@ -431,6 +431,15 @@ class RefType(ARObject):
|
|
|
431
431
|
self.value = value
|
|
432
432
|
return self
|
|
433
433
|
|
|
434
|
+
def getShortValue(self):
|
|
435
|
+
if self.value is None:
|
|
436
|
+
raise ValueError("Invalid value of RefType")
|
|
437
|
+
m = re.match(r'\/[\w\/]+\/(\w+)', self.value)
|
|
438
|
+
if m:
|
|
439
|
+
return m.group(1)
|
|
440
|
+
return self.value
|
|
441
|
+
|
|
442
|
+
|
|
434
443
|
class TRefType(RefType):
|
|
435
444
|
def __init__(self):
|
|
436
445
|
super().__init__()
|
|
@@ -458,4 +467,31 @@ class ArgumentDirectionEnum(AREnum):
|
|
|
458
467
|
ArgumentDirectionEnum.IN,
|
|
459
468
|
ArgumentDirectionEnum.INOUT,
|
|
460
469
|
ArgumentDirectionEnum.OUT
|
|
461
|
-
))
|
|
470
|
+
))
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
class Ip4AddressString(ARLiteral):
|
|
474
|
+
'''
|
|
475
|
+
This is used to specify an IP4 address. Notation: 255.255.255.255
|
|
476
|
+
|
|
477
|
+
Tags
|
|
478
|
+
* xml.xsd.customType=IP4-ADDRESS-STRING
|
|
479
|
+
* xml.xsd.pattern=(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|ANY
|
|
480
|
+
* xml.xsd.type=string
|
|
481
|
+
'''
|
|
482
|
+
def __init__(self):
|
|
483
|
+
super().__init__()
|
|
484
|
+
|
|
485
|
+
class Ip6AddressString(ARLiteral):
|
|
486
|
+
'''
|
|
487
|
+
This is used to specify an IP6 address. Notation: FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
|
|
488
|
+
Alternative notations, short-cuts with duplicate colons like ::, etc. or mixtures using colons and dots, are
|
|
489
|
+
not allowed.
|
|
490
|
+
|
|
491
|
+
Tags:
|
|
492
|
+
* xml.xsd.customType=IP6-ADDRESS-STRING
|
|
493
|
+
* xml.xsd.pattern=[0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){7,7}|ANY
|
|
494
|
+
* xml.xsd.type=string
|
|
495
|
+
'''
|
|
496
|
+
def __init__(self):
|
|
497
|
+
super().__init__()
|
|
@@ -3,7 +3,7 @@ from typing import List
|
|
|
3
3
|
from ....M2.MSR.DataDictionary.DataDefProperties import SwDataDefProps
|
|
4
4
|
from ....M2.AUTOSARTemplates.CommonStructure import ValueSpecification
|
|
5
5
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
6
|
-
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import AREnum, ARLiteral, ARNumerical, ARPositiveInteger
|
|
6
|
+
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import AREnum, ARLiteral, ARNumerical, ARPositiveInteger, Boolean
|
|
7
7
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean
|
|
8
8
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
|
|
9
9
|
from ....M2.AUTOSARTemplates.SWComponentTemplate.PortInterface.InstanceRefs import ApplicationCompositeElementInPortInterfaceInstanceRef
|
|
@@ -175,7 +175,16 @@ class ModeSwitchReceiverComSpec(RPortComSpec):
|
|
|
175
175
|
def __init__(self):
|
|
176
176
|
super().__init__()
|
|
177
177
|
|
|
178
|
+
self.enhancedModeApi = None # type: Boolean
|
|
178
179
|
self.modeGroupRef = None # type: RefType
|
|
180
|
+
self.supportsAsynchronousModeSwitch = None # type: Boolean
|
|
181
|
+
|
|
182
|
+
def getEnhancedModeApi(self):
|
|
183
|
+
return self.enhancedModeApi
|
|
184
|
+
|
|
185
|
+
def setEnhancedModeApi(self, value):
|
|
186
|
+
self.enhancedModeApi = value
|
|
187
|
+
return self
|
|
179
188
|
|
|
180
189
|
def getModeGroupRef(self):
|
|
181
190
|
return self.modeGroupRef
|
|
@@ -183,6 +192,13 @@ class ModeSwitchReceiverComSpec(RPortComSpec):
|
|
|
183
192
|
def setModeGroupRef(self, value):
|
|
184
193
|
self.modeGroupRef = value
|
|
185
194
|
return self
|
|
195
|
+
|
|
196
|
+
def getSupportsAsynchronousModeSwitch(self):
|
|
197
|
+
return self.supportsAsynchronousModeSwitch
|
|
198
|
+
|
|
199
|
+
def setSupportsAsynchronousModeSwitch(self, value):
|
|
200
|
+
self.supportsAsynchronousModeSwitch = value
|
|
201
|
+
return self
|
|
186
202
|
|
|
187
203
|
class NvRequireComSpec(RPortComSpec):
|
|
188
204
|
def __init__(self):
|
armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AutosarVariableRef.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
2
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import ArVariableInImplementationDataInstanceRef, VariableInAtomicSWCTypeInstanceRef
|
|
3
|
+
|
|
4
|
+
class AutosarVariableRef(ARObject):
|
|
5
|
+
def __init__(self):
|
|
6
|
+
super().__init__()
|
|
7
|
+
|
|
8
|
+
self.autosarVariableIRef = None # type: VariableInAtomicSWCTypeInstanceRef
|
|
9
|
+
self.autosarVariableInImplDatatype = None # type: ArVariableInImplementationDataInstanceRef
|
|
10
|
+
self.localVariableRef = None
|
|
11
|
+
|
|
12
|
+
def getAutosarVariableIRef(self):
|
|
13
|
+
return self.autosarVariableIRef
|
|
14
|
+
|
|
15
|
+
def setAutosarVariableIRef(self, value):
|
|
16
|
+
self.autosarVariableIRef = value
|
|
17
|
+
return self
|
|
18
|
+
|
|
19
|
+
def getAutosarVariableInImplDatatype(self):
|
|
20
|
+
return self.autosarVariableInImplDatatype
|
|
21
|
+
|
|
22
|
+
def setAutosarVariableInImplDatatype(self, value):
|
|
23
|
+
self.autosarVariableInImplDatatype = value
|
|
24
|
+
return self
|
|
25
|
+
|
|
26
|
+
def getLocalVariableRef(self):
|
|
27
|
+
return self.localVariableRef
|
|
28
|
+
|
|
29
|
+
def setLocalVariableRef(self, value):
|
|
30
|
+
self.localVariableRef = value
|
|
31
|
+
return self
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import AutosarVariableRef
|
|
1
2
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.AccessCount import AbstractAccessPoint
|
|
2
|
-
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef
|
|
3
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef
|
|
3
4
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
4
5
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
5
6
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral
|
|
@@ -9,8 +10,8 @@ class ParameterAccess(AbstractAccessPoint):
|
|
|
9
10
|
def __init__(self, parent: ARObject, short_name: str):
|
|
10
11
|
super().__init__(parent, short_name)
|
|
11
12
|
|
|
12
|
-
self.accessedParameter = None
|
|
13
|
-
self.swDataDefProps = None
|
|
13
|
+
self.accessedParameter = None # type: AutosarParameterRef
|
|
14
|
+
self.swDataDefProps = None # type: SwDataDefProps
|
|
14
15
|
|
|
15
16
|
def getAccessedParameter(self):
|
|
16
17
|
return self.accessedParameter
|
armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/InstanceRefsUsage.py
CHANGED
|
@@ -86,36 +86,6 @@ class VariableInAtomicSWCTypeInstanceRef(AtpInstanceRef):
|
|
|
86
86
|
self.targetDataPrototypeRef = value
|
|
87
87
|
return self
|
|
88
88
|
|
|
89
|
-
class AutosarVariableRef(ARObject):
|
|
90
|
-
def __init__(self):
|
|
91
|
-
super().__init__()
|
|
92
|
-
|
|
93
|
-
self.autosarVariableIRef = None # type: VariableInAtomicSWCTypeInstanceRef
|
|
94
|
-
self.autosarVariableInImplDatatype = None # type: ArVariableInImplementationDataInstanceRef
|
|
95
|
-
self.localVariableRef = None
|
|
96
|
-
|
|
97
|
-
def getAutosarVariableIRef(self):
|
|
98
|
-
return self.autosarVariableIRef
|
|
99
|
-
|
|
100
|
-
def setAutosarVariableIRef(self, value):
|
|
101
|
-
self.autosarVariableIRef = value
|
|
102
|
-
return self
|
|
103
|
-
|
|
104
|
-
def getAutosarVariableInImplDatatype(self):
|
|
105
|
-
return self.autosarVariableInImplDatatype
|
|
106
|
-
|
|
107
|
-
def setAutosarVariableInImplDatatype(self, value):
|
|
108
|
-
self.autosarVariableInImplDatatype = value
|
|
109
|
-
return self
|
|
110
|
-
|
|
111
|
-
def getLocalVariableRef(self):
|
|
112
|
-
return self.localVariableRef
|
|
113
|
-
|
|
114
|
-
def setLocalVariableRef(self, value):
|
|
115
|
-
self.localVariableRef = value
|
|
116
|
-
return self
|
|
117
|
-
|
|
118
|
-
|
|
119
89
|
class ParameterInAtomicSWCTypeInstanceRef(AtpInstanceRef):
|
|
120
90
|
def __init__(self):
|
|
121
91
|
super().__init__()
|
|
@@ -165,5 +135,20 @@ class AutosarParameterRef(ARObject):
|
|
|
165
135
|
def __init__(self):
|
|
166
136
|
super().__init__()
|
|
167
137
|
|
|
168
|
-
|
|
169
|
-
self.
|
|
138
|
+
# type: ParameterInAtomicSWCTypeInstanceRef
|
|
139
|
+
self.autosarParameterIRef = None
|
|
140
|
+
self.localParameterRef = None # type: RefType
|
|
141
|
+
|
|
142
|
+
def getAutosarParameterIRef(self):
|
|
143
|
+
return self.autosarParameterIRef
|
|
144
|
+
|
|
145
|
+
def setAutosarParameterIRef(self, value):
|
|
146
|
+
self.autosarParameterIRef = value
|
|
147
|
+
return self
|
|
148
|
+
|
|
149
|
+
def getLocalParameterRef(self):
|
|
150
|
+
return self.localParameterRef
|
|
151
|
+
|
|
152
|
+
def setLocalParameterRef(self, value):
|
|
153
|
+
self.localParameterRef = value
|
|
154
|
+
return self
|
|
@@ -172,3 +172,7 @@ class InternalTriggerOccurredEvent(RTEEvent):
|
|
|
172
172
|
def setEventSourceRef(self, value):
|
|
173
173
|
self.eventSourceRef = value
|
|
174
174
|
return self
|
|
175
|
+
|
|
176
|
+
class BackgroundEvent(RTEEvent):
|
|
177
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
178
|
+
super().__init__(parent, short_name)
|
armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from typing import List
|
|
2
|
-
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagnosticCommunicationManagerNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, EcuStateMgrUserNeeds, NvBlockNeeds, RoleBasedDataAssignment, ServiceNeeds
|
|
2
|
+
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagnosticCommunicationManagerNeeds, DiagnosticEventInfoNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, EcuStateMgrUserNeeds, NvBlockNeeds, RoleBasedDataAssignment, ServiceNeeds
|
|
3
3
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
4
4
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Identifier, RefType
|
|
5
5
|
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import ServiceDependency
|
|
@@ -73,6 +73,12 @@ class SwcServiceDependency(ServiceDependency):
|
|
|
73
73
|
self.addElement(needs)
|
|
74
74
|
return self.getElement(short_name)
|
|
75
75
|
|
|
76
|
+
def createDiagnosticEventInfoNeeds(self, short_name: str) -> DiagnosticEventInfoNeeds:
|
|
77
|
+
if (short_name not in self.elements):
|
|
78
|
+
needs = DiagnosticEventInfoNeeds(self, short_name)
|
|
79
|
+
self.addElement(needs)
|
|
80
|
+
return self.getElement(short_name)
|
|
81
|
+
|
|
76
82
|
def createCryptoServiceNeeds(self, short_name: str) -> CryptoServiceNeeds:
|
|
77
83
|
if (short_name not in self.elements):
|
|
78
84
|
needs = CryptoServiceNeeds(self, short_name)
|
|
@@ -228,7 +228,7 @@ class SwcInternalBehavior(InternalBehavior):
|
|
|
228
228
|
self.events = [] # type: List[RTEEvent]
|
|
229
229
|
self.exclusiveAreaPolicies = [] # type: List[SwcExclusiveAreaPolicy]
|
|
230
230
|
self.explicitInterRunnableVariables = [] # type: List[VariableDataPrototype]
|
|
231
|
-
self.handleTerminationAndRestart = None
|
|
231
|
+
self.handleTerminationAndRestart = None # type: str
|
|
232
232
|
self.implicitInterRunnableVariables = [] # type: List[VariableDataPrototype]
|
|
233
233
|
self.includedDataTypeSets = [] # type: List[IncludedDataTypeSet]
|
|
234
234
|
self.includedModeDeclarationGroupSets = [] # type: List[IncludedModeDeclarationGroupSet]
|
|
@@ -242,8 +242,33 @@ class SwcInternalBehavior(InternalBehavior):
|
|
|
242
242
|
self.supportsMultipleInstantiation = None # type: Boolean
|
|
243
243
|
self.variationPointProxies = [] # type: VariationPointProxy
|
|
244
244
|
|
|
245
|
+
def getArTypedPerInstanceMemories(self) -> List[VariableDataPrototype]:
|
|
246
|
+
return self.arTypedPerInstanceMemories
|
|
247
|
+
|
|
248
|
+
def createArTypedPerInstanceMemory(self, short_name: str) -> VariableDataPrototype:
|
|
249
|
+
if (short_name not in self.elements):
|
|
250
|
+
prototype = VariableDataPrototype(self, short_name)
|
|
251
|
+
self.addElement(prototype)
|
|
252
|
+
self.arTypedPerInstanceMemories.append(prototype)
|
|
253
|
+
return self.getElement(short_name)
|
|
254
|
+
|
|
245
255
|
def getExplicitInterRunnableVariables(self) -> List[VariableDataPrototype]:
|
|
246
256
|
return self.explicitInterRunnableVariables
|
|
257
|
+
|
|
258
|
+
def createExplicitInterRunnableVariable(self, short_name: str) -> VariableDataPrototype:
|
|
259
|
+
if (short_name not in self.elements):
|
|
260
|
+
prototype = VariableDataPrototype(self, short_name)
|
|
261
|
+
self.addElement(prototype)
|
|
262
|
+
self.explicitInterRunnableVariables.append(prototype)
|
|
263
|
+
return self.getElement(short_name)
|
|
264
|
+
|
|
265
|
+
def getHandleTerminationAndRestart(self):
|
|
266
|
+
return self.handleTerminationAndRestart
|
|
267
|
+
|
|
268
|
+
def setHandleTerminationAndRestart(self, value):
|
|
269
|
+
self.handleTerminationAndRestart = value
|
|
270
|
+
return self
|
|
271
|
+
|
|
247
272
|
|
|
248
273
|
def getImplicitInterRunnableVariables(self) -> List[VariableDataPrototype]:
|
|
249
274
|
return self.implicitInterRunnableVariables
|
|
@@ -342,34 +367,31 @@ class SwcInternalBehavior(InternalBehavior):
|
|
|
342
367
|
if (not isinstance(self.elements[short_name], RTEEvent)):
|
|
343
368
|
raise ValueError("Invalid Event Type <%s> of <%s>" % type(self.elements[short_name]), short_name)
|
|
344
369
|
return self.elements[short_name]
|
|
370
|
+
|
|
371
|
+
|
|
345
372
|
|
|
346
|
-
|
|
347
|
-
if (short_name not in self.elements):
|
|
348
|
-
prototype = VariableDataPrototype(self, short_name)
|
|
349
|
-
self.elements[short_name] = prototype
|
|
350
|
-
self.explicitInterRunnableVariables.append(prototype)
|
|
351
|
-
return self.elements[short_name]
|
|
373
|
+
|
|
352
374
|
|
|
353
375
|
def createImplicitInterRunnableVariable(self, short_name: str) -> VariableDataPrototype:
|
|
354
376
|
if (short_name not in self.elements):
|
|
355
377
|
prototype = VariableDataPrototype(self, short_name)
|
|
356
|
-
self.
|
|
378
|
+
self.addElement(prototype)
|
|
357
379
|
self.implicitInterRunnableVariables.append(prototype)
|
|
358
|
-
return self.
|
|
380
|
+
return self.getElement(short_name)
|
|
359
381
|
|
|
360
382
|
def createPerInstanceMemory(self, short_name: str) -> PerInstanceMemory:
|
|
361
383
|
if (short_name not in self.elements):
|
|
362
384
|
memory = PerInstanceMemory(self, short_name)
|
|
363
|
-
self.
|
|
385
|
+
self.addElement(memory)
|
|
364
386
|
self.perInstanceMemories.append(memory)
|
|
365
|
-
return self.
|
|
387
|
+
return self.getElement(short_name)
|
|
366
388
|
|
|
367
389
|
def createPerInstanceParameter(self, short_name: str) -> ParameterDataPrototype:
|
|
368
390
|
if (short_name not in self.elements):
|
|
369
391
|
prototype = ParameterDataPrototype(self, short_name)
|
|
370
|
-
self.
|
|
392
|
+
self.addElement(prototype)
|
|
371
393
|
self.perInstanceParameters.append(prototype)
|
|
372
|
-
return self.
|
|
394
|
+
return self.getElement(short_name)
|
|
373
395
|
|
|
374
396
|
def getVariableDataPrototypes(self) -> List[VariableDataPrototype]:
|
|
375
397
|
return sorted(filter(lambda c: isinstance(c, VariableDataPrototype), self.elements.values()), key=lambda e: e.short_name)
|
|
@@ -377,14 +399,24 @@ class SwcInternalBehavior(InternalBehavior):
|
|
|
377
399
|
def createRunnableEntity(self, short_name: str) -> RunnableEntity:
|
|
378
400
|
if (short_name not in self.elements):
|
|
379
401
|
runnable = RunnableEntity(self, short_name)
|
|
380
|
-
self.
|
|
381
|
-
return self.
|
|
402
|
+
self.addElement(runnable)
|
|
403
|
+
return self.getElement(short_name)
|
|
382
404
|
|
|
383
405
|
def getRunnableEntities(self) -> List[RunnableEntity]:
|
|
384
406
|
return sorted(filter(lambda c: isinstance(c, RunnableEntity), self.elements.values()), key=lambda r: r.short_name)
|
|
385
407
|
|
|
386
408
|
def getRunnableEntity(self, short_name) -> RunnableEntity:
|
|
387
409
|
return self.elements[short_name]
|
|
410
|
+
|
|
411
|
+
def getSharedParameters(self) -> List[ParameterDataPrototype]:
|
|
412
|
+
return self.sharedParameters
|
|
413
|
+
|
|
414
|
+
def createSharedParameter(self, short_name: str) -> ParameterDataPrototype:
|
|
415
|
+
if (short_name not in self.elements):
|
|
416
|
+
memory = ParameterDataPrototype(self, short_name)
|
|
417
|
+
self.addElement(memory)
|
|
418
|
+
self.sharedParameters.append(memory)
|
|
419
|
+
return self.getElement(short_name)
|
|
388
420
|
|
|
389
421
|
def getSupportsMultipleInstantiation(self):
|
|
390
422
|
return self.supportsMultipleInstantiation
|