Main Content

slmetric.dashboard.Widget class

Package: slmetric.dashboard

Object for holding Actual/Potential Reuse, System Interface, or System Info widgets

Since R2018b

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 Obtain height of Metrics Dashboard widget
getMetricIDs Obtain metric identifier for Metrics Dashboard widget
getPosition Obtain widget position within Metrics Dashboard
getSeparatorsDetermine whether there are lines on sides of Metrics Dashboard widget
getWidths Obtain widths of Metrics Dashboard widget
setHeight Specify height of Metrics Dashboard widget
setPosition Set widget position within Metrics Dashboard
setSeparators Specify lines on Metrics Dashboard widget sides
setWidthsSpecify multiple widths for Metrics Dashboard widget

Examples

collapse all

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

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'));

For your model, open the Metrics Dashboard.

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