rtw.connectivity.ConfigRegistry
寄存器连通性配置
描述
用MATLAB注册你的连通性配置®或仿真金宝app软件®.
创建
描述
config = rtw.connectivity.ConfigRegistry
对象的句柄rtw.connectivity.ConfigRegistry
对象。
要创建这个类:
对于MATLAB,使用
rtwTargetInfo.m
文件,你必须把它放在MATLAB搜索路径。在rtwTargetInfo.m
文件,一个调用registerTargetInfo
注册连通性配置。对于Si金宝appmulink,使用
sl_customization.m
文件,你必须把它放在MATLAB搜索路径。当Simu金宝applink启动时,它读取文件,并通过调用注册您的连通性配置registerTargetInfo
在文件中。
通过这个类的前两个属性,你可以指定你的连通性配置:
唯一的名称。
关联的连通性实现类,它是的子类
rtw.connectivity.Config
.
通过剩下的属性,你可以定义:
对于MATLAB,与连接性实现类兼容的代码。
对于Si金宝appmulink,与连接性实现类兼容的一组模型。
将这些性质的结合与MATLAB编码器™配置设置或Simulink模型参数决定兼容性。金宝app例如用Simulink,是否金宝appSystemTargetFile
,TemplateMakefile
,HardwareBoard
属性共同匹配相应的模型参数。
属性
例子
创建rtwTargetInfo.m
文件
以下代码是一个示例rtwTargetInfo.m
文件。完全按照所示使用函数语法。
函数rtwTargetInfo (tr)注册PIL连接配置:mypil。ConnectivityConfigtr.registerTargetInfo (@loc_createConfig);%局部函数函数config = loc_createConfig . config为连通性配置创建对象config = rtw.connectivity.ConfigRegistry;分配连接性配置名称配置。ConfigName =“我的公益诉讼案例”;将连接性配置与连接性关联% API实现配置。ConfigClass =“mypil。ConnectivityConfig”;为基于主机的PIL指定工具链配置。工具链= rtw.connectivity.Utils.getHostToolchainNames;通过HardwareBoard和TargetHWDeviceType属性,%为目标连通性配置定义兼容代码配置。HardwareBoard = {};配置。TargetHWDeviceType = {“通用->32位x86兼容”...“通用- >自定义”...“英特尔- > x86 - 64 (Windows64) ',...'英特尔->x86-64 (Mac OS X)',...'Intel->x86-64 (Linux 64)'};
该函数执行以下步骤:
类的实例
rtw.connectivity.ConfigRegistry
类。例如:config = rtw.connectivity.ConfigRegistry;
对象分配连接性配置名称
ConfigName
属性。例如:配置。ConfigName = '我的PIL示例';
将连接性配置与第1步中创建的连接性API实现关联起来。例如:
配置。ConfigClass = ' myypil . connectivityconfig ';
属性来定义此目标连通性配置的兼容代码
HardwareBoard
而且TargetHWDeviceType
对象的属性。例如:配置。HardwareBoard = {};%任何硬件板配置。TargetHWDeviceType = {“通用->32位x86兼容”...“通用- >自定义”……'Intel->x86-64 (Windows64)',…'英特尔->x86-64 (Mac OS X)',…'Intel->x86-64 (Linux 64)'};
创建sl_customization.m
文件
这段代码是一个sl_customization.m
文件。使用sl_customization.m
文件结构,并调用registerTargetInfo
函数如图所示。
函数sl_customization(cm) % sl_customization for PIL连通性配置:…% mypil。ConnectivityConfig %版权所有2008 The MathWorks, Inc. cm.registerTargetInfo(@loc_createConfig);% local function config = loc_createConfig config = rtw.connectivity.ConfigRegistry;配置。ConfigName = '我的PIL示例';配置。ConfigClass = ' myypil . connectivityconfig ';%只匹配ert。薄层色谱配置。SystemTargetFile = {'ert.tlc'}; % If you use a toolchain to build your generated code, % specify the config.Toolchain property to match your % Simulink model toolchain setting. Otherwise, for a % non-toolchain approach, match the TMF config.TemplateMakefile = {'ert_default_tmf' ... 'ert_unix.tmf', ... 'ert_vcx64.tmf', ... 'ert_lcc.tmf'}; % Match hardware boards and hardware device types config.HardwareBoard = {}; % Any hardware board config.TargetHWDeviceType = {'Generic->32-bit x86 compatible' ... 'Generic->Custom' ... 'Intel->x86-64 (Windows64)', ... 'Intel->x86-64 (Mac OS X)', ... 'Intel->x86-64 (Linux 64)'};
当Simulink启动时,必须配置该文件执行以下步骤:金宝app
的实例创建
rtw.connectivity.ConfigRegistry
类。例如:config = rtw.connectivity.ConfigRegistry;
属性分配连接性配置名称
ConfigName
属性。例如:配置。ConfigName = '我的PIL示例';
将连接性配置与连接性API实现(在步骤1中创建)关联起来。例如:
配置。ConfigClass = ' myypil . connectivityconfig ';
通过设置对象属性的这些属性,为这个目标连通性配置定义兼容的模型:
SystemTargetFile
工具链
或TemplateMakefile
HardwareBoard
TargetHWDeviceType
例如:
配置。SystemTargetFile = {'ert.tlc'};配置。TemplateMakefile = {'ert_default_tmf'…“ert_unix。tmf’,……“ert_vcx64。tmf’,……' ert_lcc.tmf '};配置。HardwareBoard = {};配置。TargetHWDeviceType = {'Generic->32-bit x86 compatible' ... 'Generic->Custom' ... 'Intel->x86-64 (Windows64)', ... 'Intel->x86-64 (Mac OS X)', ... 'Intel->x86-64 (Linux 64)'};
使用rtw.connectivity.ConfigRegistry
PIL连通性
有关如何在设置PIL连接中使用此对象的示例,请参见:
MATLAB,从命令行执行循环中处理器
对于仿真金宝app软件,为自定义目标配置循环中处理器(PIL)