set
Set property of AUTOSAR element
Description
set(
sets the specified property of the AUTOSAR element at
arProps
,elementPath
,property
,value
)elementPath
to value
. For properties
that reference other elements, value
is a path. To set XML
packaging options, specify elementPath
as
XmlOptions
.
Examples
Set IsService
Property for Sender-Receiver Interface
For an AUTOSAR model, set the IsService
property for sender-receiver interface Interface1
to
true
(1), indicating that the port interface is used for
AUTOSAR services.
hModel = 'autosar_swc_expfcns'; openExample(hModel); arProps = autosar.api.getAUTOSARProperties(hModel); set(arProps,'Interface1','IsService',true); isService = get(arProps,'Interface1','IsService')
isService = logical 1
Set Runnable Symbol Name
For an AUTOSAR model, set the symbol
property for runnable Runnable1
to
test_symbol
.
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 an AUTOSAR element
character vector | string scalar
Path to an AUTOSAR element for which to set a property. To set XML
packaging options, specify XmlOptions
,
Example: 'Input'
property
— Element property
character vector | string scalar
Property for which to set a value, among valid properties of the AUTOSAR element.
Example: 'IsService'
value
— Value of property
value of property | path to composite property or property that references other
properties
Value to set for the specified property. For properties that reference other elements, specify a path.
Example: true
Version History
Introduced in R2013bR2024a: Additional Property - Network Binding
The AUTOSAR property Network Binding is newly added for
AUTOSAR adaptive models. Use this property to switch the network binding option
between DDS
and SOME/IP
through which the
AUTOSAR adaptive applications communicate with each other.
R2023b: Auto Generation of Instance Specifier
The AUTOSAR property Instance Specifier for a port will be automatically generated. You can set a new value using the function but setting the Instance Specifier will be deprecated in a future release.
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)