get
Get property of AUTOSAR element
Description
returns the value of the specified property of the AUTOSAR element at
pValue
= get(arProps
,elementPath
,property
)elementPath
.
Examples
Get Value of IsService
Property of Sender-Receiver Interface
For a model, get the value of the
IsService
property for the sender-receiver
interface Interface1
. The variable
IsService
returns false
(0),
indicating that the sender-receiver interface is not a service.
hModel = 'autosar_swc_expfcns'; openExample(hModel); arProps = autosar.api.getAUTOSARProperties(hModel); isService = get(arProps,'Interface1','IsService')
isService = logical 0
Get Component Qualified Name and Runnable Symbol Name
For an AUTOSAR model, to prepare for setting the
symbol
property for runnable
Runnable1
to test_symbol
, get
the AUTOSAR component qualified name and the existing runnable symbol
name.
hModel = 'autosar_swc_expfcns'; openExample(hModel); arProps = autosar.api.getAUTOSARProperties(hModel); 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
arProps
— AUTOSAR properties information for a model
handle
AUTOSAR properties information for a model, previously returned by
.
arProps
=
autosar.api.getAUTOSARProperties(model
)
is a
handle, character vector, or string scalar representing the model
name.model
Example: arProps
elementPath
— Path to AUTOSAR element
character vector | string scalar
Path to the AUTOSAR element for which to return the value of a property.
Example: 'Input'
property
— Element property
character vector | string scalar
Property for which to return a value, among valid properties of the AUTOSAR element.
Example: 'IsService'
Output Arguments
pValue
— Property value or path
value of property | path to composite property or property that references other
properties
Variable that returns the value of the specified AUTOSAR property. For composite properties or properties that reference other properties, the return value is the path to the property.
Example: ifPaths
Version History
Introduced in R2013b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)