Package

XML tag

<AR-PACKAGE>

Module

autosar.package

Inherits

An AUTOSAR package is a container for elements. Elements can be basically anything that are not packages.

Usage

import autosar

ws = autosar.workspace("3.0.2")
package = ws.createPackage('DataTypes', role = 'DataType')

Attributes

Name

Type

Description

name

str

Name of the package

elements

list[Elements]

List of elements

subPackages

list[Package]

List of sub-packages

role

str

Package role

Package Roles

Constant

Main container for Constants

ComponentType

Main container for Components

CompuMethod

Main Container for Computational Methods

DataType

Main container for Data Types

ModeDclrGroup

Main Container for Mode Declaration Groups

PortInterface

Main Container for Port Interfaces

Unit

Main Container for Units

Public Methods

Data Types:

Method Description

createIntegerDataType

Package.createIntegerDataType(name[, min=None][, max=None][, valueTable=None][, offset=None][, scaling=None][, unit=None][, adminData=None])

Creates a new IntegerDataType object add appends it to this package.

参数
  • name (str) – (short)Name of new datatype

  • min (int) – Lower limit

  • max (str) – Upper limit

  • valueTable (list) – Value table

  • offset (int or float) – Scaling offset

  • scaling (int or float) – Scaling factor

  • unit (str) – Unit name

  • adminData – Optional AdminData

createArrayDataType

Package.createArrayDataType(name, typeRef, arraySize[, elementName=None][, adminData=None])

Creates a new array data type and appends it to current package

参数
  • name (str) – (short)Name of new datatype

  • typeRef (str) – Reference to data type (used as the type for array element)

  • arraySize (int) – Number of elements in the array

  • adminData – Optional AdminData

createRecordDataType

Package.createRecordDataType(name, elements[, adminData=None])

Creates a new array data type and appends it to current package

参数
  • name (str) – (short)Name of new datatype

  • elements (list) – Elements in the record

  • adminData – Optional AdminData