ApplicationArrayDataType

XML tag

<APPLICATION-ARRAY-DATA-TYPE>

Module

autosar.datatype

Inherits

autosar.datatype.ApplicationDataType

Implementation of application array data type.

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()
package = ws.findRolePackage('DataType')
PercentSetting_T = ws.find('PercentSetting_T', role='DataType')
package.createApplicationArrayDataType('SettingsArray_T',
    autosar.datatype.ApplicationArrayElement(typeRef = PercentSetting_T.ref, arraySize=5))
ws.saveXML('DataTypes.arxml')

Factory Methods

Constructor

datatype.ApplicationArrayDataType(name, element, variantProps=None, category='ARRAY', parent=None, adminData=None)
参数
  • name (str) – ShortName.

  • element (ApplicationArrayElement) – Array element.

  • variantProps – Variant properties.

  • category (None, str) – Category string.

  • parent (None, Package) – Parent package.

  • adminData (None, AdminData.) – Optional AdminData.

Attributes

For inherited attributes see autosar.datatype.ApplicationDataType.