Main Content

slmetric.dashboard.Widget Class

Namespace: slmetric.dashboard

(To be removed) Object for holding Actual/Potential Reuse, System Interface, or System Info widgets

The Metrics Dashboard user interface, metricdashboard function, slmetric package API, and corresponding customizations will be removed in a future release. For more information, see Migrating from Metrics Dashboard to Model Maintainability Dashboard.

Description

You can add, remove, or modify slmetric.dashboard.Widget objects in the Metrics Dashboard. The types of slmetric.dashboard.Widget objects are Actual Reuse/Potential Reuse, System Interface, or System Info widgets.

Construction

For slmetric.dashboard.Layout, slmetric.dashboard.Container, or slmetric.dashboard.Group objects, use the addWidget or removeWidget methods to add or remove slmetric.dashboard.Widget objects from the Metrics Dashboard.

The Metrics Dashboard layout is divided into 12 columns of equal size. Use the slmetric.dashboard.Widget methods to specify widget size.

Properties

expand all

By default, the LibraryReuse widget title is Library Reuse, the SystemInfo widget title is blank, and the GlocalInterface widget title is System Interface. This property is read/write.

Data Types: char

Type of slmetric.dashboard.Widget object that you want to add, remove, or modify in the Metrics Dashboard. This property is read-only.

Data Types: char

Methods

getHeight(To be removed) Obtain height of Metrics Dashboard widget
getMetricIDs(To be removed) Obtain metric identifier for Metrics Dashboard widget
getPosition(To be removed) Obtain widget position within Metrics Dashboard
getSeparators(To be removed) Determine whether there are lines on sides of Metrics Dashboard widget
getWidths(To be removed) Obtain widths of Metrics Dashboard widget
setHeight(To be removed) Specify height of Metrics Dashboard widget
setPosition(To be removed) Set widget position within Metrics Dashboard
setSeparators(To be removed) Specify lines on Metrics Dashboard widget sides
setWidths(To be removed) Specify multiple widths for Metrics Dashboard widget

Examples

collapse all

Create a Metrics Dashboard with the three types of slmetric.dashboard.Widget objects.

Open the model vdp by entering:

openExample('simulink_general/VanDerPolOscillatorExample')

To begin, create a new slmetric.dashboard.Configuration object.

config = slmetric.dashboard.Configuration.new('Name','default');

Obtain the slmetric.dashboard.Layout object from the slmetric.dashboard.Configuration object.

layout = getDashboardLayout(config);

Add the three slmetric.dashboard.Widget objects to the slmetric.dashboard.Layout object.

addWidget(layout,'LibraryReuse');
addWidget(layout,'SystemInfo');
addWidget(layout,'GlocalInterface');

Save the configuration object. This command serializes the API information to an XML file.

save(config,'FileName','DashboardConfig.xml');

Set the active configuration.

slmetric.dashboard.setActiveConfiguration(fullfile(pwd,'DashboardConfig.xml'));

Open the Metrics Dashboard for the model vdp.

metricsdashboard vdp

The Metrics Dashboard contains the three slmetric.dashboard.Widget objects.

Click the All Metrics button to run all metrics.

Version History

Introduced in R2018b

collapse all

R2022a: Metrics Dashboard will be removed

The Metrics Dashboard user interface, metricdashboard function, slmetric package API, and corresponding customizations will be removed in a future release. For more information, see Migrating from Metrics Dashboard to Model Maintainability Dashboard.