主要内容

本页采用了机器翻译。点击此处可查看英文原文。

ParameterTable

为仪表盘用户界面创建参数表

自 R2021b 起

说明

hParamTable = slrealtime.ui.control.ParameterTable(hFigure) 为仪表板 uifigure 图形创建可编辑的参数表显示。显示屏显示了在实时应用中已选定用于流式传输的可调参数。当仪表盘应用程序运行时,ParameterTable 组件提供了一个右键菜单,允许您选择要添加或从显示中移除的参数。

当 ECU 页面与 XCP 页面的选择不匹配时,该不匹配状态将禁用 App Designer 中的 ParameterTable 组件和 ParameterTuner 组件。您可通过在实时应用程序中协调 ECU 页面与 XCP 页面的选择来启用这些组件的操作。使用 getECUPagesetECUPagegetXCPPagesetXCPPage 函数。或者,使用资源管理器中的 Enable Parameter Table 按钮。此按钮为上下文敏感按钮,当资源管理器检测到页面选择不匹配时会显示。

有关控制属性的信息,请参阅 slrealtime.ui Properties。若计划在默认目标计算机之外的其他计算机上使用该应用程序,则必须为该控件设置 TargetSource 属性。

示例

示例

全部折叠

创建参数表并调整表格位置。在 Parameters 属性中使用工作区变量时,BlockPath 为工作区变量的空值,而 ParameterName 的值即为工作区变量的名称。

hFig = uifigure(); 
% Create parameter table component 
hPTable = slrealtime.ui.control.ParameterTable(hFig); 
hPTable.Parameters = struct( ... 
  'BlockPath', {'testmodel/Constant1', '', ...
         'testmodel/Constant5', '', ... 
         'testmodel/str1', 'testmodel/str2', ...
         'testmodel/multi-line block name', ... 
         'testmodel/Constant6'}, ... 
  'ParameterName', {'Value', 'model_wksp_var', ...
           'Value', 'base_wksp_var', 'String', ... 
           'String', 'Value', 'Value'}); 
% Change position of the component 
hPTable.Position = [0 0 200 200]; 
% Customize 
hPTable.TableBackgroundColor = [0 0 1]; % 'blue' 
hPTable.TableForegroundColor = [1 1 0]; % 'yellow'

输入参数

全部折叠

hFigure 参量标识了您要向其添加 UI 组件的 uifigure

示例: hFig = uifigure()

数据类型: function_handle

输出参量

全部折叠

hParamTable 参数是您创建的参数表组件的句柄。

版本历史记录

在 R2021b 中推出

全部展开