Main Content

ParameterTable

Create parameter table for instrument panel UI

Since R2021b

Description

example

hParamTable = slrealtime.ui.control.ParameterTable(hFigure) creates an editable parameter table display for an instrument panel uifigure figure. The display shows the tunable parameters that have been selected for streaming in the real-time application. When the instrument panel app is running, the ParameterTable component provides a right-click menu that lets you select parameters to add to or remove from the display.

When the ECU page and XCP page selections do not match, the mismatch disables the App Designer ParameterTable component and ParameterTuner component. You can enable operation of these components by coordinating ECU page and XCP page selection in the real-time application. Use the getECUPage, setECUPage, getXCPPage, and setXCPPage functions. Or, use the explorer Enable Parameter Table button. This button is context sensitive and appears when explorer detects a page selection mismatch.

For information about control properties, see slrealtime.ui Properties. If deploying an app, it is important to set the TargetSource property for this control.

Examples

collapse all

Create a parameter table and adjust the position of the table. When using workspace variables in the Parameters property, the BlockPath is empty for the workspace variable, and the ParameterName value is the name of the workspace variable.

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'

Input Arguments

collapse all

The hFigure argument identifies the uifigure to which you are adding the UI component.

Example: hFig = uifigure()

Data Types: function_handle

Output Arguments

collapse all

The hParamTable argument is the handle to the parameter table component that you create.

Version History

Introduced in R2021b

expand all