armodel 1.1.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.
@@ -1,10 +1,10 @@
1
1
  from typing import List
2
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,12 @@ 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]
113
125
 
114
126
  def createSwcBswMapping(self, short_name: str) -> SwcBswMapping:
115
127
  if (short_name not in self.elements):
@@ -128,6 +140,9 @@ class ARPackage(Identifiable, CollectableElement):
128
140
 
129
141
  def getSwComponentTypes(self) -> List[SwComponentType]:
130
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()))
131
146
 
132
147
  def getAtomicSwComponentTypes(self) -> List[AtomicSwComponentType]:
133
148
  return list(filter(lambda a : isinstance(a, AtomicSwComponentType), self.elements.values()))
@@ -155,6 +170,12 @@ class ARPackage(Identifiable, CollectableElement):
155
170
 
156
171
  def getBswImplementations(self) -> List[BswImplementation]:
157
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()))
158
179
 
159
180
  def getSwcBswMappings(self) -> List[SwcBswMapping]:
160
181
  return list(filter(lambda a: isinstance(a, SwcBswMapping), self.elements.values()))
@@ -220,6 +241,8 @@ class AUTOSAR (ARObject, CollectableElement):
220
241
  raise ValueError("%s is not ImplementationDataType." % data_type)
221
242
 
222
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
223
246
  self._appl_impl_type_maps[data_type_map.application_data_type_ref.value] = data_type_map.implementation_data_type_ref.value
224
247
  self._impl_appl_type_maps[data_type_map.implementation_data_type_ref.value] = data_type_map.application_data_type_ref.value
225
248
 
@@ -1,4 +1,5 @@
1
- import re
1
+ #from __future__ import annotations
2
+
2
3
  from abc import ABCMeta
3
4
  from typing import List
4
5
 
@@ -6,6 +7,8 @@ from .general_structure import ARObject, ARElement, Identifiable
6
7
  from .data_dictionary import SwDataDefProps
7
8
  from .ar_ref import RefType
8
9
 
10
+ import re
11
+
9
12
  class ValueSpecification(ARObject, metaclass=ABCMeta):
10
13
  def __init__(self):
11
14
  if type(self) == ValueSpecification:
@@ -139,11 +142,17 @@ class MemorySection(Identifiable):
139
142
 
140
143
  @alignment.setter
141
144
  def alignment(self, value:str):
142
- if value in ("UNKNOWN", "UNSPECIFIED", "BOOLEAN", "PTR"):
143
- self._alignment = value
144
- elif re.match(r'\d+', value):
145
+ match = False
146
+ if value in ("UNKNOWN", "UNSPECIFIED", "BOOLEAN", "PTR"):
145
147
  self._alignment = value
148
+ match = True
146
149
  else:
150
+ m = re.match(r'^\d+', value)
151
+ if m:
152
+ self._alignment = value
153
+ match = True
154
+
155
+ if not match:
147
156
  raise ValueError("Invalid alignment <%s> of memory section <%s>" % (value, self.short_name))
148
157
 
149
158
 
@@ -74,14 +74,15 @@ class BswImplementation(Implementation):
74
74
  self.ar_release_version = ""
75
75
  self.revision_label_string = "" # 1
76
76
  self.behavior_ref = None # type: RefType
77
- self.preconfigured_configuration_refs = [] # type: List[RefType]
78
- self.recommended_configuration_refs = [] # type: List[RefType]
77
+ self.preconfigured_configuration_ref = None # *
78
+ self.recommended_configuration_ref = None # *
79
79
  self.vendor_api_infix = "" # 0..1
80
- self.vendor_specific_module_def_refs = [] # List[RefType]
80
+ self.vendor_specific_module_def_ref = None # *
81
81
 
82
- def addVendorSpecificModuleDefRef(self, vendor_specific_module_def_ref: RefType):
83
- self.vendor_specific_module_def_refs.append(vendor_specific_module_def_ref)
84
-
85
- def getVendorSpecificModuleDefRefs(self) -> List[RefType]:
86
- return self.vendor_specific_module_def_refs
82
+ class SwcImplementation(Implementation):
83
+ def __init__(self, parent: ARObject, short_name: str) -> None:
84
+ super().__init__(parent, short_name)
87
85
 
86
+ self.behavior_ref = None # type: RefType
87
+ self.per_instance_memory_size = None
88
+ self.required_rte_vendor = ""
@@ -125,16 +125,13 @@ class ARXMLParser:
125
125
  return None
126
126
 
127
127
  def readChildRefElementList(self, element, key) -> List[RefType]:
128
- list_element = element.find("./xmlns:%sS" % key, self.nsmap)
128
+ child_elements = element.findall("./xmlns:%s" % key, self.nsmap)
129
129
  results = []
130
- if list_element != None:
131
- child_elements = list_element.findall("./xmlns:%s" % key, self.nsmap)
132
- for child_element in child_elements:
133
- ref = RefType()
134
- ref.dest = child_element.attrib['DEST']
135
- ref.value = child_element.text
136
- results.append(ref)
137
-
130
+ for child_element in child_elements:
131
+ ref = RefType()
132
+ ref.dest = child_element.attrib['DEST']
133
+ ref.value = child_element.text
134
+ results.append(ref)
138
135
  return results
139
136
 
140
137
  def readAutosarVariableInImplDatatype(self, element, accessed_variable_ref: AutosarVariableRef):
@@ -197,8 +194,10 @@ class ARXMLParser:
197
194
  mode_group.type_tref = self.readChildRefElement(parent.short_name, child_element, "TYPE-TREF")
198
195
 
199
196
  def readCanEnterExclusiveAreaRefs(self, element, entity: ExecutableEntity):
200
- for ref in self.readChildRefElementList(element, "CAN-ENTER-EXCLUSIVE-AREA-REF"):
201
- entity.addCanEnterExclusiveAreaRef(ref)
197
+ child_element = element.find("./xmlns:CAN-ENTER-EXCLUSIVE-AREA-REFS", self.nsmap)
198
+ if child_element != None:
199
+ for ref in self.readChildRefElementList(child_element, "CAN-ENTER-EXCLUSIVE-AREA-REF"):
200
+ entity.addCanEnterExclusiveAreaRef(ref)
202
201
 
203
202
  def readExecutableEntity(self, element, entity: ExecutableEntity):
204
203
  self.readCanEnterExclusiveAreaRefs(element, entity)
@@ -266,8 +265,10 @@ class ARXMLParser:
266
265
  self.readBswScheduleEvent(child_element, event)
267
266
 
268
267
  def readDataTypeMappingRefs(self, element, behavior: InternalBehavior):
269
- for ref in self.readChildRefElementList(element, "DATA-TYPE-MAPPING-REF"):
270
- behavior.addDataTypeMappingRef(ref)
268
+ child_element = element.find("./xmlns:DATA-TYPE-MAPPING-REFS", self.nsmap)
269
+ if child_element != None:
270
+ for ref in self.readChildRefElementList(child_element, "DATA-TYPE-MAPPING-REF"):
271
+ behavior.addDataTypeMappingRef(ref)
271
272
 
272
273
  def readInternalBehavior(self, element, behavior: InternalBehavior):
273
274
  for child_element in element.findall("./xmlns:EXCLUSIVE-AREAS/xmlns:EXCLUSIVE-AREA", self.nsmap):
@@ -280,17 +281,14 @@ class ARXMLParser:
280
281
  for child_element in element.findall("./xmlns:INTERNAL-BEHAVIORS/xmlns:SWC-INTERNAL-BEHAVIOR", self.nsmap):
281
282
  short_name = self.readShortName(child_element)
282
283
  behavior = parent.createSwcInternalBehavior(short_name)
283
- logging.debug("readSwInternalBehavior %s" % behavior.full_name)
284
+ logging.debug("readBswInternalBehavior %s" % behavior.full_name)
284
285
 
285
286
  # read the internal behavior
286
287
  self.readInternalBehavior(child_element, behavior)
287
288
 
288
289
  self.readRunnableEntities(child_element, behavior)
289
290
  self.readOperationInvokedEvents(child_element, behavior)
290
- self.readInitEvents(child_element, behavior)
291
291
  self.readTimingEvents(child_element, behavior)
292
- self.readDataReceivedEvent(child_element, behavior)
293
- self.readSwcModeSwitchEvent(child_element, behavior)
294
292
  self.readInternalTriggerOccurredEvent(child_element, behavior)
295
293
  self.readExplicitInterRunnableVariables(child_element, behavior)
296
294
 
@@ -374,28 +372,32 @@ class ARXMLParser:
374
372
 
375
373
  def readImplementation(self, element, impl: Implementation):
376
374
  self.readCodeDescriptor(element, impl)
377
- impl.programming_language = self.readChildElement(impl.short_name, element, "PROGRAMMING-LANGUAGE")
375
+ impl.programming_language = self.readChildOptionalElement(element, "PROGRAMMING-LANGUAGE")
378
376
  self.readResourceConsumption(element, impl)
379
- impl.sw_version = self.readChildElement(impl.short_name, element, "SW-VERSION")
377
+ impl.sw_version = self.readChildOptionalElement(element, "SW-VERSION")
380
378
  impl.swc_bsw_mapping_ref = self.readChildOptionalRefElement(element, "SWC-BSW-MAPPING-REF")
381
379
  impl.vendor_id = self.readChildOptionalElementNumberValue(element, "VENDOR-ID")
382
- if (impl.vendor_id == None):
383
- self._raiseError("Vendor id of <%s> is required" % impl.short_name)
384
-
385
- def readVendorSpecificModuleDefs(self, element, impl: BswImplementation):
386
- for ref in self.readChildRefElementList(element, "VENDOR-SPECIFIC-MODULE-DEF-REF"):
387
- impl.addVendorSpecificModuleDefRef(ref)
388
380
 
389
381
  def readBswImplementation(self, element, parent: ARPackage):
390
382
  for child_element in element.findall("./xmlns:ELEMENTS/xmlns:BSW-IMPLEMENTATION", self.nsmap):
391
383
  short_name = self.readShortName(child_element)
392
- impl = parent.createBswImplementation(short_name)
393
- logging.debug("readImplementation %s" % impl.short_name)
384
+ impl = parent.createBswImplementation(short_name)
385
+ logging.debug("readBswImplementation %s" % impl.short_name)
394
386
 
395
387
  self.readImplementation(child_element, impl)
388
+
396
389
  impl.ar_release_version = self.readChildElement(parent.short_name, child_element, "AR-RELEASE-VERSION")
397
390
  impl.behavior_ref = self.readChildRefElement(parent.short_name, child_element, "BEHAVIOR-REF")
398
- self.readVendorSpecificModuleDefs(child_element, impl)
391
+
392
+ def readSwcImplementation(self, element, parent: ARPackage):
393
+ for child_element in element.findall("./xmlns:ELEMENTS/xmlns:SWC-IMPLEMENTATION", self.nsmap):
394
+ short_name = self.readShortName(child_element)
395
+ impl = parent.createSwcImplementation(short_name)
396
+ logging.debug("readSwcImplementation %s" % impl.short_name)
397
+
398
+ self.readImplementation(child_element, impl)
399
+
400
+ impl.behavior_ref = self.readChildRefElement(parent.short_name, child_element, "BEHAVIOR-REF")
399
401
 
400
402
  def readDataReceivePointByArguments(self, element, parent: RunnableEntity):
401
403
  self._readVariableAccesses(element, parent, "DATA-RECEIVE-POINT-BY-ARGUMENTS")
@@ -463,7 +465,7 @@ class ARXMLParser:
463
465
  for child_element in element.findall("./xmlns:RUNNABLES/xmlns:RUNNABLE-ENTITY", self.nsmap):
464
466
  short_name = self.readShortName(child_element)
465
467
  runnable = parent.createRunnableEntity(short_name)
466
- runnable.can_be_invoked_concurrently = self.readChildElement(short_name, child_element, "CAN-BE-INVOKED-CONCURRENTLY")
468
+ runnable.can_be_invoked_concurrently = self.readChildOptionalElement(child_element, "CAN-BE-INVOKED-CONCURRENTLY")
467
469
  runnable.symbol = self.readChildElement(short_name, child_element, "SYMBOL")
468
470
 
469
471
  self.readDataReceivePointByArguments(child_element, runnable)
@@ -477,7 +479,7 @@ class ARXMLParser:
477
479
  self.readInternalTriggeringPoint(child_element, runnable)
478
480
 
479
481
  def readRTEEvent(self, element, event: RTEEvent):
480
- event.start_on_event_ref = self.readChildRefElement(event.short_name, element, "START-ON-EVENT-REF")
482
+ event.start_on_event_ref = self.readChildOptionalRefElement(element, "START-ON-EVENT-REF")
481
483
 
482
484
  def readOperationIRef(self, element, parent: OperationInvokedEvent):
483
485
  child_element = element.find("./xmlns:OPERATION-IREF", self.nsmap)
@@ -504,7 +506,7 @@ class ARXMLParser:
504
506
  for child_element in element.findall("./xmlns:EVENTS/xmlns:INIT-EVENT", self.nsmap):
505
507
  short_name = self.readShortName(child_element)
506
508
  event = parent.createInitEvent(short_name)
507
- logging.debug("readInitEvents %s" % event.short_name)
509
+
508
510
  self.readRTEEvent(child_element, event)
509
511
 
510
512
  def readTimingEvents(self, element, parent: SwcInternalBehavior):
@@ -523,7 +525,7 @@ class ARXMLParser:
523
525
  for child_element in element.findall("./xmlns:EVENTS/xmlns:DATA-RECEIVED-EVENT", self.nsmap):
524
526
  short_name = self.readShortName(child_element)
525
527
  event = parent.createDataReceivedEvent(short_name)
526
- logging.debug("DataReceivedEvent %s" % event.short_name)
528
+
527
529
  self.readRTEEvent(child_element, event)
528
530
  self.readRVariableInAtomicSwcInstanceRef(child_element, event)
529
531
 
@@ -605,8 +607,10 @@ class ARXMLParser:
605
607
  array_sub_element = data_type.getImplementationDataTypeElements()[0]
606
608
  if (array_sub_element.category == ImplementationDataType.CATEGORY_TYPE_REFERENCE):
607
609
  data_type.setArrayElementType(array_sub_element.sw_data_def_props.implementation_data_type_ref.value)
610
+ elif (array_sub_element.category == ImplementationDataType.CATEGORY_TYPE_VALUE): # TODO: fix
611
+ continue
608
612
  else:
609
- self._raiseError("The catetory <%s> of array sub-element does not support." % array_sub_element.category)
613
+ self._raiseError("The category <%s> of array sub-element <%s> does not support." % (array_sub_element.category, data_type.short_name))
610
614
 
611
615
  def readSwDataTypes(self, element, parent: ARPackage):
612
616
  for child_element in element.findall("./xmlns:ELEMENTS/xmlns:SW-BASE-TYPE", self.nsmap):
@@ -625,7 +629,7 @@ class ARXMLParser:
625
629
  def readReceiverComSpec(self, element, com_spec: ReceiverComSpec):
626
630
  #FIXME: readchildElement
627
631
  com_spec.data_element_ref = self.readChildOptionalRefElement(element, "DATA-ELEMENT-REF")
628
- com_spec.handle_out_of_range = self.readChildElement("", element, "HANDLE-OUT-OF-RANGE")
632
+ com_spec.handle_out_of_range = self.readChildOptionalElement(element, "HANDLE-OUT-OF-RANGE")
629
633
  com_spec.uses_end_to_end_protection = self.readChildOptionalElementBooleanValue(element, "USES-END-TO-END-PROTECTION")
630
634
 
631
635
  def readNonqueuedReceiverComSpec(self, element, parent: RPortPrototype):
@@ -658,7 +662,7 @@ class ARXMLParser:
658
662
  def readSenderComSpec(self, element, com_spec: SenderComSpec):
659
663
  # FIXME:
660
664
  com_spec.data_element_ref = self.readChildOptionalRefElement(element, "DATA-ELEMENT-REF")
661
- com_spec.handle_out_of_range = self.readChildElement("", element, "HANDLE-OUT-OF-RANGE")
665
+ com_spec.handle_out_of_range = self.readChildOptionalElement(element, "HANDLE-OUT-OF-RANGE")
662
666
  com_spec.uses_end_to_end_protection = self.readChildOptionalElementBooleanValue(element, "USES-END-TO-END-PROTECTION")
663
667
 
664
668
  def readNonqueuedSenderComSpec(self, element, parent: PPortPrototype):
@@ -695,7 +699,6 @@ class ARXMLParser:
695
699
  for child_element in element.findall("./xmlns:ELEMENTS/xmlns:APPLICATION-SW-COMPONENT-TYPE", self.nsmap):
696
700
  short_name = self.readShortName(child_element)
697
701
  sw_component = parent.createApplicationSwComponentType(short_name)
698
- logging.debug("Read ApplicationSwComponentTypes <%s>" % sw_component.short_name)
699
702
  self.readAtomicSwComponentType(child_element, sw_component)
700
703
 
701
704
  def readComplexDeviceDriverSwComponentTypes(self, element, parent: ARPackage):
@@ -704,6 +707,12 @@ class ARXMLParser:
704
707
  sw_component = parent.createApplicationSwComponentType(short_name)
705
708
  self.readAtomicSwComponentType(child_element, sw_component)
706
709
 
710
+ def readSensorActuatorSwComponentType(self, element, parent: ARPackage):
711
+ for child_element in element.findall("./xmlns:ELEMENTS/xmlns:SENSOR-ACTUATOR-SW-COMPONENT-TYPE", self.nsmap):
712
+ short_name = self.readShortName(child_element)
713
+ sw_component = parent.createSensorActuatorSwComponentType(short_name)
714
+ self.readAtomicSwComponentType(child_element, sw_component)
715
+
707
716
  def readServiceSwComponentTypes(self, element, parent: ARPackage):
708
717
  for child_element in element.findall("./xmlns:ELEMENTS/xmlns:SERVICE-SW-COMPONENT-TYPE", self.nsmap):
709
718
  short_name = self.readShortName(child_element)
@@ -790,8 +799,10 @@ class ARXMLParser:
790
799
  parent.addArgumentDataPrototype(prototype)
791
800
 
792
801
  def readPossibleErrorRefs(self, element, parent: ClientServerOperation):
793
- for ref in self.readChildRefElementList(element, "POSSIBLE-ERROR-REF"):
794
- parent.addPossibleErrorRef(ref)
802
+ child_element = element.find("./xmlns:POSSIBLE-ERROR-REFS", self.nsmap)
803
+ if child_element != None:
804
+ for ref in self.readChildRefElementList(child_element, "POSSIBLE-ERROR-REF"):
805
+ parent.addPossibleErrorRef(ref)
795
806
 
796
807
  def readOperations(self, element, parent: ClientServerInterface):
797
808
  for child_element in element.findall("./xmlns:OPERATIONS/xmlns:CLIENT-SERVER-OPERATION", self.nsmap):
@@ -839,7 +850,7 @@ class ARXMLParser:
839
850
  for child_element in element.findall("./xmlns:ELEMENTS/xmlns:COMPU-METHOD", self.nsmap):
840
851
  short_name = self.readShortName(child_element)
841
852
  compu_method = parent.createCompuMethod(short_name)
842
- compu_method.category = self.readChildElement(short_name, child_element, "CATEGORY")
853
+ compu_method.category = self.readChildOptionalElement(child_element, "CATEGORY")
843
854
  self.readCompuInternalToPhys(child_element, compu_method)
844
855
 
845
856
  def readSwcBswRunnableMappings(self, element, parent: SwcBswMapping):
@@ -877,13 +888,14 @@ class ARXMLParser:
877
888
  self.readEcuAbstractionSwComponents(child_element, ar_package)
878
889
  self.readApplicationSwComponentTypes(child_element, ar_package)
879
890
  self.readComplexDeviceDriverSwComponentTypes(child_element, ar_package)
891
+ self.readSensorActuatorSwComponentType(child_element, ar_package)
880
892
  self.readServiceSwComponentTypes(child_element, ar_package)
881
893
  self.readCompositionSwComponentTypes(child_element, ar_package)
882
894
  self.readBswModuleDescription(child_element, ar_package)
883
895
  self.readBswModuleEntry(child_element, ar_package)
884
896
  self.readSwcBswMappings(child_element, ar_package)
885
897
  self.readBswImplementation(child_element, ar_package)
886
-
898
+ self.readSwcImplementation(child_element, ar_package)
887
899
 
888
900
  def load(self, filename, document: AUTOSAR):
889
901
  tree = ET.parse(filename)
@@ -1,145 +1,154 @@
1
- Metadata-Version: 2.1
2
- Name: armodel
3
- Version: 1.1.0
4
- Summary: the python arxml parser
5
- Home-page: http://github.com/melodypapa/py-armodel
6
- Author: melodypapa
7
- Author-email: melodypapa@outlook.com
8
- License: MIT
9
- Keywords: AUTOSAR ARXML
10
- Platform: UNKNOWN
11
- Classifier: Development Status :: 1 - Planning
12
- Classifier: Environment :: Console
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Operating System :: OS Independent
16
- Requires-Python: >=3.5
17
- Description-Content-Type: text/markdown
18
- Provides-Extra: pytest
19
- Requires-Dist: pytest-cov ; extra == 'pytest'
20
-
21
- # 1. py-armodel
22
-
23
- ## 1.1. Purpose
24
-
25
- To support AUTOSAR model with python
26
-
27
- ## 1.2. Reference Documents
28
- 1. AUTOSAR_TPS_XMLSchemaProductionRules.pdf
29
- 2. AUTOSAR_TPS_ARXMLSerializationRules.pdf
30
-
31
- |Version|Documentation|Travis CI|Coverage Status|Pypi|
32
- |--|--|--|--|--|
33
- |[![GitHub version](https://badge.fury.io/gh/melodypapa%2Fpy-armodel.svg)](https://badge.fury.io/gh/melodypapa%2Fpy-armodel)|[![Documentation Status](https://readthedocs.org/projects/py-armodel/badge/?version=latest)](https://py-armodel.readthedocs.io/en/latest)|[![](https://www.travis-ci.com/melodypapa/py-armodel.svg?branch=main)](https://www.travis-ci.com/melodypapa/py-armodel)|[![Coverage Status](https://coveralls.io/repos/github/melodypapa/py-armodel/badge.svg?branch=main)](https://coveralls.io/github/melodypapa/py-armodel?branch=main)|[![PyPI version](https://badge.fury.io/py/armodel.svg)](https://badge.fury.io/py/armodel)|
34
-
35
- ## 1.3. How to create the distribution and upload to pypi
36
- 1. Run `python setup.py bdist_wheel` to generate distribution
37
- 2. Run `twine check dist/*` to check the validation of distribution
38
- 3. Run `twine upload dist/*` to upload to pypi repository
39
- 4. Check the website https://pypi.org/project/armodel/ to find out it works or not
40
-
41
- And more details can be found at https://packaging.python.org/
42
-
43
- ## 1.4. How to perform Unit test
44
-
45
- * Run `pip install pytest pytest-cov` to install pytest.
46
- * Run `pytest --cov=armodel --cov-report term-missing` to verify all the functionality.
47
-
48
- ## 1.5. How to create a distribution and wheel
49
-
50
- * Run `python setup.py sdist bdist_wheel --universal`
51
-
52
- ## 1.6. How to create the document
53
-
54
- 1. Run `pip install sphinx` to install the necessary document
55
-
56
- ## 1.7. Heritage
57
-
58
- ```
59
- - ARObject
60
- - Referrable
61
- - MultilanguageReferrable
62
- - Identifiable
63
- - PackageableElement
64
- - ARElement
65
- - AtpType
66
- - AutosarDataType
67
- - PortInterface
68
- - DataInterface
69
- - NvDataInterface
70
- - ParameterInterface
71
- - SenderReceiverInterface
72
- - BswModuleEntry
73
- - Implementation
74
- - BswImplementation
75
- - AtpFeature
76
- - AtpPrototype
77
- - AtpPrototype
78
- - DataPrototype
79
- - AutosarDataPrototype
80
- - VariableDataPrototype
81
- - ApplicationCompositeElementDataPrototype
82
- - ApplicationArrayElement
83
- - ApplicationRecordElement
84
- - AtpStructureElement
85
- - BswModuleDescription
86
- - ExecutableEntity
87
- - SwcBswMapping
88
- - ValueSpecification
89
- - ConstantReference
90
- ```
91
-
92
- ## 1.8. CLI usages
93
-
94
- ### 1.8.1. arxml-dump
95
-
96
- **Dump all the arxml data to screen**
97
-
98
- `arxml-dump --arxml arg -h`
99
-
100
- --arxml arg The file name of arxml data
101
-
102
- -h show the help information
103
-
104
- ### 1.8.2. Example for arxml-dump
105
-
106
- **Dump the arxml data from test1.arxml and test2.arxml**
107
-
108
- `arxml-dump --arxml test1.arxml --arxml test2.arxml`
109
-
110
- ## 1.9. API
111
-
112
- ### 1.9.1. Constructor
113
-
114
- ```
115
- ARXMLParser(options={"warning": True})
116
- ```
117
-
118
- ## 1.10. Change notes:
119
-
120
- **Version 0.1.1**
121
-
122
- Add the ARRAY category support for ImplementationDataType
123
-
124
- **Version 0.1.2**
125
-
126
- Add the AsynchronousServerCallPoint support for ARXML
127
-
128
- **Version 0.1.3**
129
-
130
- Fix the attribute intervalType of **Limit** is empty issue.
131
-
132
- **Version 1.0.0**
133
-
134
- 1. Add the logging support
135
- 2. Add the <warning> option to disable exception raised.
136
- 3. Add the BswMD support
137
-
138
- **Version 1.1.0**
139
-
140
- 1. Add the InitEvent support. (Issue #5)
141
- 2. Add the DataReceiveEvent support. (Issue #5)
142
- 3. Add the SwcModeSwitchEvent support. (Issue #5)
143
- 4. Add the number format alignment supporting for MemorySection
144
- 5. Add the more features supporting for BswImplementation
145
-
1
+ Metadata-Version: 2.1
2
+ Name: armodel
3
+ Version: 1.2.0
4
+ Summary: the python arxml parser
5
+ Home-page: http://github.com/melodypapa/py-armodel
6
+ Author: melodypapa
7
+ Author-email: melodypapa@outlook.com
8
+ License: MIT
9
+ Keywords: AUTOSAR ARXML
10
+ Platform: UNKNOWN
11
+ Classifier: Development Status :: 1 - Planning
12
+ Classifier: Environment :: Console
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Python: >=3.5
17
+ Description-Content-Type: text/markdown
18
+ Provides-Extra: pytest
19
+ Requires-Dist: pytest-cov ; extra == 'pytest'
20
+
21
+ # 1. py-armodel
22
+
23
+ ## 1.1. Purpose
24
+
25
+ To support AUTOSAR model with python
26
+
27
+ ## 1.2. Reference Documents
28
+ 1. AUTOSAR_TPS_XMLSchemaProductionRules.pdf
29
+ 2. AUTOSAR_TPS_ARXMLSerializationRules.pdf
30
+
31
+ |Version|Documentation|Travis CI|Coverage Status|Pypi|
32
+ |--|--|--|--|--|
33
+ |[![GitHub version](https://badge.fury.io/gh/melodypapa%2Fpy-armodel.svg)](https://badge.fury.io/gh/melodypapa%2Fpy-armodel)|[![Documentation Status](https://readthedocs.org/projects/py-armodel/badge/?version=latest)](https://py-armodel.readthedocs.io/en/latest)|[![](https://www.travis-ci.com/melodypapa/py-armodel.svg?branch=main)](https://www.travis-ci.com/melodypapa/py-armodel)|[![Coverage Status](https://coveralls.io/repos/github/melodypapa/py-armodel/badge.svg?branch=main)](https://coveralls.io/github/melodypapa/py-armodel?branch=main)|[![PyPI version](https://badge.fury.io/py/armodel.svg)](https://badge.fury.io/py/armodel)|
34
+
35
+ ## 1.3. How to create the distribution and upload to pypi
36
+ 1. Run `python setup.py bdist_wheel` to generate distribution
37
+ 2. Run `twine check dist/*` to check the validation of distribution
38
+ 3. Run `twine upload dist/*` to upload to pypi repository
39
+ 4. Check the website https://pypi.org/project/armodel/ to find out it works or not
40
+
41
+ And more details can be found at https://packaging.python.org/
42
+
43
+ ## 1.4. How to perform Unit test
44
+
45
+ * Run `pip install pytest pytest-cov` to install pytest.
46
+ * Run `pytest --cov=armodel --cov-report term-missing` to verify all the functionality.
47
+
48
+ ## 1.5. How to create a distribution and wheel
49
+
50
+ * Run `python setup.py sdist bdist_wheel --universal`
51
+
52
+ ## 1.6. How to create the document
53
+
54
+ 1. Run `pip install sphinx` to install the necessary document
55
+
56
+ ## 1.7. Heritage
57
+
58
+ ```
59
+ - ARObject
60
+ - Referrable
61
+ - MultilanguageReferrable
62
+ - Identifiable
63
+ - PackageableElement
64
+ - ARElement
65
+ - AtpType
66
+ - AutosarDataType
67
+ - PortInterface
68
+ - DataInterface
69
+ - NvDataInterface
70
+ - ParameterInterface
71
+ - SenderReceiverInterface
72
+ - BswModuleEntry
73
+ - Implementation
74
+ - BswImplementation
75
+ - AtpFeature
76
+ - AtpPrototype
77
+ - AtpPrototype
78
+ - DataPrototype
79
+ - AutosarDataPrototype
80
+ - VariableDataPrototype
81
+ - ApplicationCompositeElementDataPrototype
82
+ - ApplicationArrayElement
83
+ - ApplicationRecordElement
84
+ - AtpStructureElement
85
+ - BswModuleDescription
86
+ - ExecutableEntity
87
+ - SwcBswMapping
88
+ - ValueSpecification
89
+ - ConstantReference
90
+ ```
91
+
92
+ ## 1.8. CLI usages
93
+
94
+ ### 1.8.1. arxml-dump
95
+
96
+ **Dump all the arxml data to screen**
97
+
98
+ `arxml-dump --arxml arg -h`
99
+
100
+ --arxml arg The file name of arxml data
101
+
102
+ -h show the help information
103
+
104
+ ### 1.8.2. Example for arxml-dump
105
+
106
+ **Dump the arxml data from test1.arxml and test2.arxml**
107
+
108
+ `arxml-dump --arxml test1.arxml --arxml test2.arxml`
109
+
110
+ ## 1.9. API
111
+
112
+ ### 1.9.1. Constructor
113
+
114
+ ```
115
+ ARXMLParser(options={"warning": True})
116
+ ```
117
+
118
+ ## 1.10. Change notes:
119
+
120
+ **Version 0.1.1**
121
+
122
+ Add the ARRAY category support for ImplementationDataType
123
+
124
+ **Version 0.1.2**
125
+
126
+ Add the AsynchronousServerCallPoint support for ARXML
127
+
128
+ **Version 0.1.3**
129
+
130
+ Fix the attribute intervalType of **Limit** is empty issue.
131
+
132
+ **Version 1.0.0**
133
+
134
+ 1. Add the logging support
135
+ 2. Add the <warning> option to disable exception raised.
136
+ 3. Add the BswMD support
137
+
138
+ **Version 1.1.0**
139
+
140
+ 1. Add the InitEvent support. (Issue #5)
141
+ 2. Add the DataReceiveEvent support. (Issue #5)
142
+ 3. Add the SwcModeSwitchEvent support. (Issue #5)
143
+
144
+ **Version 1.2.0**
145
+
146
+ 1. Add the SwcImplementation support (Issue #9)
147
+ 2. Add the integer value for memory section alignment (Issue #9)
148
+ 3. Remove the required attributes for the Implementation according to the AUTOSAR standard 23R-11. (Issue #9)
149
+ 4. Change the START-ON-EVENT-REF to optional according to the AUTOSAR standard 23R-11. (Issue #9)
150
+ 5. Change the HANDLE-OUT-OF-RANGE to optional according to the AUTOSAR standard 23R-11. (Issue #9)
151
+ 6. Add the SensorActuatorSwComponentType support (Issue #9)
152
+ 7. Change the CATEGORY of COMPU-METHOD to optional.
153
+ 8. Change the CAN-BE-INVOKED-CONCURRENTLY to optional.
154
+
@@ -3,25 +3,25 @@ armodel/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  armodel/cli/arxml_dump_cli.py,sha256=VBOTkrpj59kt2hM62iNVcDYGch_A2WL5_vFpbmC9ucI,9932
4
4
  armodel/models/__init__.py,sha256=ijDu-Ra2ZjEJNy88Y5ZsPqxAt05_reQsQti-_X4gD3o,402
5
5
  armodel/models/ar_object.py,sha256=gbo71ZPQ61-OhiPpHFbKtE2JA-8vOzXrd9T_0hh4GfA,341
6
- armodel/models/ar_package.py,sha256=Z_tcjcJ6lAqp4yDjFkaYFZAuVbXSxoe1cPNBPN4zt4o,11921
6
+ armodel/models/ar_package.py,sha256=OPoNGaAhTBf30elxc1dvJMyU6CpMUmvs0SUwaYoEtVs,13275
7
7
  armodel/models/ar_ref.py,sha256=RZT6URQ91YgmRk1oUTC-0UPnwn61MgEzmII7UKwQXUM,3548
8
8
  armodel/models/bsw_module_template.py,sha256=k_CZWtTipKtVFjIx08uRqadSubVtBJ-NhUlocfoA0a0,11778
9
- armodel/models/common_structure.py,sha256=GJFTTwvAZgt9aLY63A3Vynp-tZt65-8Oy4k5YBMYfB8,6559
9
+ armodel/models/common_structure.py,sha256=DSnuhhYdpDW-klOCZNg8zULuhFBdk7k601YQsPg5IT4,6745
10
10
  armodel/models/data_dictionary.py,sha256=xSQzXkLQyOJiLIsczlAzGBnrrvHFVv2_-OfVyN6_MSE,867
11
11
  armodel/models/data_prototype.py,sha256=pyIahyJh4KaikMfHikHiKzbGai1JnkrzDZpkVLvb6iU,2096
12
12
  armodel/models/datatype.py,sha256=BEc8y3mcQZEvwteFUtJyPYBIwnHJcs9fIyxLgnMK5rk,5802
13
13
  armodel/models/ecuc_parameter_def_template.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  armodel/models/general_structure.py,sha256=syJTAAo3DIBE6O0nB8Whm4OEnNyN4uVIAJZPA8t3ukY,4480
15
- armodel/models/implementation.py,sha256=iGm5aS1L2sA9eP0jeDFkkIURvr6zzHOCaTtL59G48Yg,3875
15
+ armodel/models/implementation.py,sha256=jfatA90Ww51kMqnUsbx6q4JRRRIRFCQXVg88J44RNoA,3850
16
16
  armodel/models/m2_msr.py,sha256=Gk-h-4jSnOkWlfJJcI1-1YvSQvBqkUJZxlzikwgAsec,2165
17
17
  armodel/models/port_interface.py,sha256=UDCvj78k3sfG4IJX4FWQj6LUV2mWw6Nt0plMnLsQfZk,6026
18
18
  armodel/models/port_prototype.py,sha256=Pqp5euv_RDfTlsEqvBkpAreBFMJlovuU49cJsYD4d3Q,7215
19
19
  armodel/models/sw_component.py,sha256=LUmof9nZnN7krpIScS72R6YqTzzpkIFkIvHJoklYXgw,20503
20
20
  armodel/parser/__init__.py,sha256=whzCLvAstuSlm6scgcCId7AUxSX8z8PV8AIKSNWMkGo,37
21
- armodel/parser/arxml_parser.py,sha256=qjzZ9eeG6dGo5yt4Si007PVmaRlI6D8ulZthH5JjUFk,55261
22
- armodel-1.1.0.dist-info/LICENSE,sha256=rceTpGhsmmN1M0k1KO0HRS11iCjen-2y56ZEqgo43wo,1088
23
- armodel-1.1.0.dist-info/METADATA,sha256=zTaCxzE_4Cb1THE3btuz04QuzRNaJw6bjVMcAUhDqlU,4359
24
- armodel-1.1.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
25
- armodel-1.1.0.dist-info/entry_points.txt,sha256=ofkww3HejFuRvGlQSANqFbTEcf0LUXX2FmXZovba9m0,68
26
- armodel-1.1.0.dist-info/top_level.txt,sha256=AEATYsqAuRpr0XGa_ThW7-o4WLlA5e3PEgD0QJhzmoA,8
27
- armodel-1.1.0.dist-info/RECORD,,
21
+ armodel/parser/arxml_parser.py,sha256=NgIbfrXL2EoT5po1kvaxdpxnYOJCXk0TBlmgae-OfdQ,55951
22
+ armodel-1.2.0.dist-info/LICENSE,sha256=rceTpGhsmmN1M0k1KO0HRS11iCjen-2y56ZEqgo43wo,1088
23
+ armodel-1.2.0.dist-info/METADATA,sha256=MVqrzP9E8YfO9sA92XWqRNhwt-7CFPDyeg6-lX9ywUg,4998
24
+ armodel-1.2.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
25
+ armodel-1.2.0.dist-info/entry_points.txt,sha256=ofkww3HejFuRvGlQSANqFbTEcf0LUXX2FmXZovba9m0,68
26
+ armodel-1.2.0.dist-info/top_level.txt,sha256=AEATYsqAuRpr0XGa_ThW7-o4WLlA5e3PEgD0QJhzmoA,8
27
+ armodel-1.2.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: bdist_wheel (0.41.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5