ApplicationArrayElement
XML tag |
<ELEMENT> |
Module |
autosar.datatype |
Inherits |
Describes the properties of the elements in an ApplicationArrayDataType.
Usage
import autosar
def setup():
ws = autosar.workspace(version="4.2.2")
dataTypePackage = ws.createPackage('ApplicationTypes', role='DataType')
dataConstraintPackage = dataTypePackage.createSubPackage('DataConstrs', role='DataConstraint')
compuMethodPackage = dataTypePackage.createSubPackage('CompuMethods', role='CompuMethod')
dataTypePackage.createSubPackage('Units', role='Unit')
compuMethod = compuMethodPackage.createCompuMethodRational('Percent_CompuMethod',
scaling=4/10, offset=0, unit="Percent", forceFloat=True)
dataConstraint = dataConstraintPackage.createInternalDataConstraint('Percent_DataConstraint', 0, 250)
dataTypePackage.createApplicationPrimitiveDataType('PercentSetting_T',
dataConstraint = dataConstraint.ref, compuMethod=compuMethod.ref)
return ws
ws = setup()
PercentSetting_T = ws.find('PercentSetting_T', role='DataType')
element = autosar.datatype.ApplicationArrayElement(typeRef = PercentSetting_T.ref, arraySize=5)
Constructor
- datatype.ApplicationArrayElement([name = None, ][typeRef = None, ][arraySize = None, ][sizeHandling = None, ][sizeSemantics = 'FIXED-SIZE', ]category = 'VALUE'[, parent = None][, adminData = None])
- 参数
name (None, str) – ShortName.
typeRef (None, str) – Type reference.
arraySize (None, int) – Array size.
sizeHandling (None, str) – Size handling.
sizeSemantics (None, str) – Size semantics.
category (None, str) – Category.
parent (None, ApplicationArrayDataType) – Parent datatype.
adminData (None, AdminData.) – Optional AdminData.
sizeHandling
Value |
Description |
---|---|
|
Size handling not set |
|
All elements of the variable size array may have different sizes. |
|
All elements of the variable size array have the same size. |
|
The size of the variable size array is determined by the size of the contained array element. |
sizeSemantics
Value |
Description |
---|---|
|
Size semantics not set |
|
The array has a fixed number of elements equal to the arraySize attribute |
|
The size of the array can vary at run-time. The arraySize attribute sets the upper bound. |
Attributes
For inherited attributes see autosar.element.Element.
Name |
Type |
Description |
---|---|---|
typeRef |
None, str |
Type reference |
arraySize |
None, int |
<MAX-NUMBER-OF-ELEMENTS> |
sizeHandling |
None, str |
<ARRAY-SIZE-HANDLING> |
sizeSemantics |
None, str |
<ARRAY-SIZE-SEMANTICS> |