Main Content

set

R2026b

Set property of AUTOSAR element

Description

set(arProps,elementPath,property,value) sets the specified property of the AUTOSAR element at elementPath to value. For properties that reference other elements, value is a path. To set XML packaging options, specify elementPath as 'XmlOptions'.

example

Examples

collapse all

For an AUTOSAR model, set the IsService property for sender-receiver interface Interface1 to true, indicating that the port interface is used for AUTOSAR services.

Model = 'autosar_swc_expfcns';
openExample(Model);
arProps = autosar.api.getAUTOSARProperties(Model);
set(arProps,'Interface1','IsService',true);
isService = get(arProps,'Interface1','IsService')
isService =
  logical
   1

For an AUTOSAR model, set the symbol property for runnable Runnable1 to 'test_symbol'.

Model = 'autosar_swc_expfcns';
openExample(Model);
arProps = autosar.api.getAUTOSARProperties(Model);
compQName = get(arProps,'XmlOptions','ComponentQualifiedName');
runnables = find(arProps,compQName,'Runnable','PathType','FullyQualified');
runnables(2)
ans =
  1×1 cell array
    {'/pkg/swc/ASWC/IB/Runnable1'}
get(arProps,runnables{2},'symbol')
ans =
    'Runnable1'
set(arProps,runnables{2},'symbol','test_symbol')
get(arProps,runnables{2},'symbol')
ans =
    'test_symbol'

Input Arguments

collapse all

AUTOSAR properties information for a model, previously returned by arProps = autosar.api.getAUTOSARProperties(model), where model is a handle, character vector, or string scalar representing the model name.

Path to an AUTOSAR element to set a property for, specified as a character vector or string scalar. To set XML packaging options, specify 'XmlOptions'.

Example: 'Input'

AUTOSAR element property to set a value for, specified as a character vector or string scalar. The property must be a valid property of the AUTOSAR element specified by elementPath.

Example: 'IsService'

Value to set for the specified property. For properties that reference other elements, specify a path.

Version History

Introduced in R2013b

expand all