coder.Dictionary 类
命名空间: coder
描述
coder.Dictionary
类的对象表示 Embedded Coder 字典。使用该对象对 Embedded Coder 字典执行操作,例如加载定义包和访问字典的分区。
一个 coder.Dictionary
对象包含若干 coder.dictionary.Section
对象,后者表示 Embedded Coder 字典的类别。一个 coder.dictionary.Section
对象包含若干 coder.dictionary.Entry
对象,这些对象表示存储在 Embedded Coder 字典该分区中的定义。分区的名称标识该节包含的代码定义的类型。要访问 Embedded Coder 字典的各个分区,请使用 coder.Dictionary
对象。要访问该分区中的字典条目,请使用 coder.dictionary.Section
对象。
创建对象
函数 coder.dictionary.create
和 coder.dictionary.open
可创建一个 coder.Dictionary
对象。
方法
公共方法
getCodeInterfaceType | Determine whether coder.Dictionary object represents a service
interface configuration or data interface configuration |
getSection | Return coder.dictionary.Section object that represents Embedded
Coder Dictionary section |
getSections | Return coder.dictionary.Section objects of an Embedded Coder
Dictionary |
getDictionaryDefault | Return default service for service interface section or default property value for data interface category |
setDictionaryDefault | Set default service for service interface section or default property value for data interface category |
loadPackage | Load package of code definitions into Embedded Coder Dictionary |
unloadPackage | Unload package of code definitions from Embedded Coder Dictionary |
refreshPackage | Refresh package definitions in Embedded Coder Dictionary |
resetToDefault | Restore Embedded Coder Dictionary to default state |
get | Get property value of Embedded Coder Dictionary with service interface configuration |
set | Set property value for Embedded Coder Dictionary with service interface configuration |
valid | Determine whether coder.Dictionary object represents a valid
Embedded Coder Dictionary |
empty | 确定 Embedded Coder 字典是否为空 |
示例
在 Simulink 数据字典中创建 Embedded Coder 字典
创建包含 Embedded Coder 字典的数据字典。
dataDictionary = Simulink.data.dictionary.create('DataDictionary.sldd');
在数据字典中创建一个 Embedded Coder 字典,并使用 coder.Dictionary
对象来表示 Embedded Coder 字典。
coderDictionary = coder.dictionary.create(dataDictionary)
coderDictionary = Dictionary with Sections: StorageClasses: [1×1 coder.dictionary.Section] MemorySections: [1×1 coder.dictionary.Section] FunctionCustomizationTemplates: [1×1 coder.dictionary.Section]
Embedded Coder 字典包含三个 coder.dictionary.Section
对象,每个对象表示字典的一个分区。
创建服务接口配置
创建一个数据字典来包含 Embedded Coder 字典。
dataDictionary = Simulink.data.dictionary.create('DataDictionary.sldd');
在数据字典中创建一个 Embedded Coder 字典,并使用 coder.Dictionary
对象来表示 Embedded Coder 字典。指定接口配置类型为服务接口。
coderDictionary = coder.dictionary.create(dataDictionary,"ServiceInterface")
coderDictionary = Dictionary with properties and Sections: ServicesHeaderFileName: 'services.h' InitTermFunctions: [1×1 coder.dictionary.Section] PeriodicAperiodicFunctions: [1×1 coder.dictionary.Section] DataReceiverInterfaces: [1×1 coder.dictionary.Section] DataSenderInterfaces: [1×1 coder.dictionary.Section] DataTransferInterfaces: [1×1 coder.dictionary.Section] TimerInterfaces: [1×1 coder.dictionary.Section] ParameterTuningInterfaces: [1×1 coder.dictionary.Section] ParameterArgumentTuningInterfaces: [1×1 coder.dictionary.Section] MeasurementInterfaces: [1×1 coder.dictionary.Section] SubcomponentEntryFunctions: [1×1 coder.dictionary.Section] SharedUtilityFunctions: [1×1 coder.dictionary.Section] StorageClasses: [1×1 coder.dictionary.Section] DataMemorySections: [1×1 coder.dictionary.Section] FunctionMemorySections: [1×1 coder.dictionary.Section]
Embedded Coder 字典包含 coder.dictionary.Section
对象,其中每个对象表示字典中一个类别的服务接口、函数或代码定义。
版本历史记录
在 R2019b 中推出R2023b: 对服务接口配置的支持
访问使用服务接口配置的 Embedded Coder 字典的 coder.Dictionary
对象。以前,您只能访问使用数据接口配置的 Embedded Coder 字典的 coder.Dictionary
对象。现在,coder.Dictionary
类支持这两种接口配置类型的字典。
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)