ApplicationArrayElement

XML tag

<ELEMENT>

Module

autosar.datatype

Inherits

autosar.element.Element

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

None

Size handling not set

"ALL-INDICES-DIFFERENT-ARRAY-SIZE"

All elements of the variable size array may have different sizes.

"ALL-INDICES-SAME-ARRAY-SIZE"

All elements of the variable size array have the same size.

"INHERITED-FROM-ARRAY-ELEMENT-TYPE-SIZE"

The size of the variable size array is determined by the size of the contained array element.

sizeSemantics

Value

Description

None

Size semantics not set

"FIXED-SIZE"

The array has a fixed number of elements equal to the arraySize attribute

"VARIABLE-SIZE"

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>