Declaration Editor

The Declaration Editor lists all signals that are used in TPT to observe or stimulate a SUT. Get an overview of the different signal types, see Declarations - Signal types.

Declaration Editor

The menu bar, the toolbar, the signal table and the various tabs located in the editor are described below.

Menu bar

File

Import interface / declarations (Ctrl+I)

Opens the Import Interface dialog. Interface information from different sources can be imported, see Import interface.

Export interface / declarations (Ctrl+O)

The declarations from the Declaration Editor can be exported to the following file formats: TPTAIF, XML, XLSX.

The XLSX file must contain the columns Name, Type, and Data Type.

Import equivalence class sets

Equivalence class sets can be imported. The imported file must be stored to an XLS/ XLSX file, see Export and import equivalence class sets.

Export equivalence class sets

Equivalence class sets can be exported to an XLSX file format, see Export and import equivalence class sets.

View

Refresh (F5)

Updates the declarations in the Declaration Editor.

Tools

Type Editor (Ctrl+T)

Opens the Type Editor. In the Type Editor you can create custom data types for signals, see How to create custom data types.

Unit Editor (Ctrl+U)

Opens the Unit Editor. In the Unit Editor, you can create and customize units, see Unit Editor.

Mapping Editor (Ctrl+Shift+M)

Opens the Mapping Editor. If the attributes of the variables for the test differ from the attributes of the variables of the system under test you can specify a mapping, see Declarations - Mappings.

Equivalence Class Sets Editor (Ctrl+E)

Opens the Edit Equivalence Class Set dialog, see Create an equivalence class set.

Rename Selection

Opens the Rename Signals dialog, see Declaration Editor - Edit declarations.

Toolbar

Toolbar in the Declaration Editor

Signal types

Click one of the Add icons to create a signal type. When you create a new channel, for example channel and you select it and click Create new channel, then TPT creates a new channel with the name channel_001. It uses the same name but increases the number by 1. The new channel has the same data type and the same default value as channel. This also applies to parameters, measurements, constants, and assessment variables.

To delete a signal, select it in the signal table and click Delete selected item .

Refactoring

Enables or disables the refactoring feature (shortcut Ctrl+R). By default, this feature is enabled . To disable it by default, go to Options|Preferences|General settings and deselect the Refactor on signal name checkbox.

Whenever you change the name of a declaration and this feature is enabled, the complete TPT model will be refactored. All source code locations where the old name appears as an identifier are replaced by the new name.

Refactoring will have no effect in the MATLAB view, the Dashboard script, the Custom Script Execution of the platform settings, the Custom Script of the Execution Configuration dialog, on the Defines dialog in the Requirements view, and not on comments and strings.

Thus, when you use a signal in a function that requires to place an expression in strings, like TPT.eval(), this function would fail after the refactoring. Use the replace function of the global or local search, see Search.

To prevent functions that share the same name as a signal from being renamed during refactoring, use the Search feature of TPT and give the functions unique names

Refactoring is also possible during interface import, see Import interface.

Expand/collapse a selection

Expands or collapses the elements of non-primitive data types, see (1) in Figure " Toolbar in the Declaration Editor".

Mapping

A mapping can be selected from the drop-down list to edit its content for individual signals, see Declarations - Mappings and see (2) in Figure " Toolbar in the Declaration Editor".

Value representation

Change value representation (decimal, binary, hexadecimal), see (3) in Figure " Toolbar in the Declaration Editor".

Select unused declarations

Click on Select unused to automatically select signals which are not used in the project.

Select unused declarations

Test model only

Click to select all channels and parameters that are not used in your test model.

Test model incl. assessments

Click to select all channels and parameters not used in the test model and all measurements and assessment variables.

Filter/search settings

To filter the signals depending on their types, click on the corresponding icon. Additionally, you can filter the signals depending on their channel mode by clicking on the arrow icon, see Figure " Mode list".

Mode list

To filter and search the signals depending on their names, enter a term in the text field, see (1) in Figure " Mode list". To activate the use of regular expressions for search and filter, select Regular Expressions. For example, the term ^L.*(g|y)$ will search a signal that begins with an L and ends with an g or an y. The search is not case-sensitive.

The selected settings (Regular Expressions, Filter, Search) are retained, see Figure " Toolbar in the Declaration Editor".

Signal table

The signal table shows all declared TPT signals. The signal names can be copied from the Declaration Editor by right-clicking on a line and selecting Copy Name (shortcut Ctrl+ ALT+C).

Names can be copied; use the right-click on a name

By default, the declarations are sorted by name. It is possible to sort any column by clicking on the corresponding heading in the table header row. To display additional columns, click the icon. With the option Pack All Columns and Pack Selected Column you can refresh the column width to adapt to the content length.

Additional columns

When you have selected a mapping, use the icon to select the mapping flavor columns to be displayed; notice also the Show All Mapping Columns option.

All Scaling Flavor columns are selected

Click inside a column's field to edit its content. For more information, see Declaration Editor - Edit declarations.

Tabs view

By default, the tabs view section displays the General and Equivalence Class Set tabs, see Declaration Editor - Edit declarations and Create an equivalence class set.

For each mapping flavor in your mapping, a new tab is displayed. These tabs are only shown when you select a mapping from the Mapping drop-down list.