Main Content

InstrumentManager

Create instrument manager component for App Designer components in instrument panel UI

Since R2021b

Description

example

hInstManager = slrealtime.ui.tool.InstrumentManager(hFigure) creates an instrument manager component that manages instruments for App Designer components, which you add to an instrument panel uifigure figure.

The instrument manager component manages a collection of Instrument objects that are used by the instrument panel and provides the features of Simulink Real-Time app components. When an instrument panel switches target computers, the managed instruments are removed from the previous target computer and added to the new target computer.

For information about instrument manager properties, see slrealtime.ui Properties.

Examples

collapse all

Create an instrument manager component and add instruments to it for App Designer components.

% Create figure 
hFig = uifigure(); 
hAxes = uiaxes(hFig); 
hGauge = uigauge(hFig); 
% Create some slrealtime.Instruments 
hInstAxes = slrealtime.Instrument(); 
hInstAxes.connectLine(hAxes, 'SineWave'); 
hInstGauge = slrealtime.Instrument(); 
hInstGauge.connectScalar(hGauge, 'BlockPath', 1); 
% Create InstrumentManager object and add instruments 
hInstMgr = slrealtime.ui.tool.InstrumentManager(hFig); 
hInstMgr.Instruments = [hInstAxes hInstGauge];

To remove instruments from the hIstMgr.Instruments array, you can use any array modification method. For example, this operation removes both instruments from the hInstMgr.Instruments array.

hInstMgr.Instruments = [];

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 hInstManager argument is the handle to the instrument manager component that manages instruments for the App Designer components.

Version History

Introduced in R2021b