Get model elements for the category of model code mappings
returns the elements in the model code mappings of the specified category as an array of
objects.modelElementsFound
= find(myCodeMappingObj
,category
)
returns the elements in the model code mappings of the specified category that match
specified property and value criteria.modelElementsFound
= find(myCodeMappingObj
,category
,Name,Value
)
In the model code mappings for model
myConfigModel
, find model workspace parameters.
cm = coder.mapping.api.get('myConfigModel'); inportBlkHandles = find(cm,'ModelParameters');
Auto
For model myConfigModel
, find
Inport blocks that have storage class set to Auto
. For
each Inport block found, change the storage class setting to Model
default
.
cm = coder.mapping.api.get('myConfigModel'); inportBlkHandles = find(cm,'Inports','StorageClass','Auto'); setInport(cm,inportBlkHandles,'StorageClass','Model default');
Model default
For model myConfigModel
, find functions that are
configured to use the model default setting for memory sections. For each function found,
change the memory section setting to None
.
cm = coder.mapping.api.get('myConfigModel'); functionObjects = find(cm,'Functions','MemorySection','Model default'); setFunction(cm,funcitonObjects,'MemorySection','None');
myCodeMappingObj
— Code mapping objectCodeMapping
objectCode mapping object returned by a call to function
coder.mapping.api.get
.
Example: myCM
category
— Model element categoryDataStores
| ExportedFunctions
| ExternalParameterObjects
| Inports
| ModelParameters
| Outports
| PartitionFunctions
| PartitionUpdateFunctions
| PeriodicFunctions
| PeriodicUpdateFunctions
| ResetFunctions
| Signals
| SimulinkFunctions
| States
Category of model elements that you search for in the model code mappings.
Example: 'Inports'
Specify optional comma-separated pairs of Name,Value
arguments.
Name
is the argument name and Value
is the
corresponding value. Name
must appear inside quotes. You can specify
several name and value pair arguments as Name1,Value1,…,NameN,ValueN
. The
order of the name and value pair arguments does not matter.
'StorageClass'
— Name of storage classAuto
| Bitfield
| CompileFlag
| Const
| ConstVolatile
| Define
| Dictionary default
| ExportedGlobal
| ExportToFile
| FileScope
| GetSet
| ImportedDefine
| ImportedExtern
| ImportedExternPointer
| ImportFromFile
| Localizable
| Model default
| Struct
| Volatile
| storage class nameData element storage class to include in code mappings search criteria. The name of a predefined storage class or storage class that is defined in the Embedded Coder Dictionary associated with the model. Values that you can specify vary depending on the category that you specify.
'Identifier'
— Code identifierName that the code generator uses to identify a data element in generated code.
Applies to storage classes other than Auto
.
Data Types: char
| string
'DefinitionFile'
— C source fileFile name for a C source file that contains definitions for global data read by
data elements and external code. Applies to storage classes Const
,
ConstVolatile
, ExportToFile
, and
Volatile
.
Data Types: char
| string
'FunctionCustomizationTemplate'
— Name of function customization templateName of a function customization template for a model that is defined in the Embedded Coder Dictionary.
Data Types: char
| string
'FunctionName'
— Name of entry-point functionName of an entry-point function generated for a model.
Data Types: char
| string
'GetFunction'
— Name of get functionName of a get
function that a data element calls in the
generated code. Applies to storage class GetSet
.
Data Types: char
| string
'HeaderFile'
— C header fileFile name for a C header file that contains declarations for global data read by
data elements and external code. Applies to storage classes Const
,
ConstVolatile
, Define
,
ExportToFile
, GetSet
,
ImportedDefine
, ImportFromFile
, and
Volatile
.
Data Types: char
| string
'MemorySection'
— Name of memory section Name of a memory section for a model that is defined in the Embedded Coder Dictionary.
Data Types: char
| string
'Owner'
— Owner of global dataName of the model that owns global data used by other models in the same model
hierarchy. The code generated for the owner model includes the global data definition.
Applies to storage classes Const
, ConstVolatile
,
ExportToFile
, and Volatile
.
Data Types: char
| string
'PreserveDimensions'
— Boolean flag indicating whether to preserve dimensions of multidimensional arraysTrue
| False
When model configuration parameter Array layout is set to
Row-major
, a flag that indicates whether to preserve
dimensions of a data element that is represented in generated code as a
multidimensional array. Applies to storage classes Const
,
ConstVolatile
, , ExportToFile
,
FileScope
, ImportFromFile
,
Localizable
, and Volatile
.
Data Types: logical
'SetFunction'
— Name of set functionName of a set
function that a data element calls in the
generated code. Applies to storage class GetSet
.
Data Types: char
| string
'StructName'
— Name of structureName that the code generator uses to identify the structure for a data element in
the generated code. Applies to storage classes Bitfield
and
Struct
.
Data Types: char
| string
'storageClassPropertyName'
— Value of storage class propertyStorage class property defined in the model Embedded Coder Dictionary. Values that you can specify vary depending on the storage class definition.
modelElementsFound
— Model elements foundModel elements found, returned as an array or string vector of objects. Each object identifies a model element of the specified category. If you specify additional search criteria, the array or string vector includes objects for model elements of the specified category that meet the additional search criteria. The object returned for an element depends on the category that you specify.
Category | Type of Object Returned |
---|---|
Inports, Outports, and States | Block handle |
Signals | Port handle |
DataStores | Block handle |
ModelParameters | Model parameter name |
ExportedFunctions, Functions, PartitionFunctions, PartitionUpdateFunctions, PeriodicFunctions, PeriodicUpdateFunctions, ResetFunctions, and SimulinkFunctions, | Function |
1. Если смысл перевода понятен, то лучше оставьте как есть и не придирайтесь к словам, синонимам и тому подобному. О вкусах не спорим.
2. Не дополняйте перевод комментариями “от себя”. В исправлении не должно появляться дополнительных смыслов и комментариев, отсутствующих в оригинале. Такие правки не получится интегрировать в алгоритме автоматического перевода.
3. Сохраняйте структуру оригинального текста - например, не разбивайте одно предложение на два.
4. Не имеет смысла однотипное исправление перевода какого-то термина во всех предложениях. Исправляйте только в одном месте. Когда Вашу правку одобрят, это исправление будет алгоритмически распространено и на другие части документации.
5. По иным вопросам, например если надо исправить заблокированное для перевода слово, обратитесь к редакторам через форму технической поддержки.