Skip to main content

Model Navigation

In eTrice the source of the models is text based. For better comprehensibility there are also viewers for the structure and the behavior of structure classes. Further, the textual models can be structured hierarchically using the import statement.

So jumping between textual models and switching to and between diagrams and back to the textual representation is a frequent task. Therefore in this chapter we want to show the various possibilities to navigate the models.

From Model to Behavior to Structure

There are three global key bindings (cf. the eTrice main menu item):

  • Ctrl+Shift+Alt+M – jump to the textual model (determined by the current diagram selection)

  • Ctrl+Shift+Alt+B – jump to the behavior diagram of the current actor class (determined by the cursor or selection position)

  • Ctrl+Shift+Alt+S – jump to the structure of the current structure class (determined by the cursor or selection position)

Jumping from a diagram to the textual model using Ctrl+Shift+Alt+M will open (or bring to the front) an editor with the ROOM file and will select the textual representation of the element currently selected in the diagram in the text.

The other way round, the position of the cursor or selection in the ROOM file is relevant. If it is enclosed by an actor class then for Ctrl+Shift+Alt+B a state machine editor is opened. If it is a structure class and Ctrl+Shift+Alt+S is pressed then the structure editor is opened for this class.

As an alternative to the keyboard shortcuts the user can directly use the associated VSCode Commands via the VSCode Command Menu (Ctrl+Shift+P under section eTrice) or use the provided Code Lens Buttons above the ActorClass definition / the buttons on the top Left corner of the diagrams.

Switching from the behavior to the structure is performed on Ctrl+Shift+Alt+S and vice versa on Ctrl+Shift+Alt+B.

Model Navigation

Model file paths in import statements are links that can be clicked with the Ctrl key pressed.

An alternative is to use F12 (Go to Definition) with the cursor inside the file name.

In a similar way references to model elements can be navigated using F12 or Ctrl-Click, e.g. the protocol class of a port or the actor class of an actor reference or the data class of an attribute and many more.

The Outline is a means that allows fast navigation in a single model.

Shift+F12 searches references to model elements. E.g. “Go to References” for a selected actor class lists all locations in ROOM models and diagrams that refer to this actor class.

Using the outline, also imported elements can be browsed and navigated.

The behavior editor displays a hierarchical state machine. States can have a sub state graph and thus the hierarchy of states and state graphs forms a tree like structure. The eTrice behavior editor always shows only one level of the hierarchy. The editor switches to the sub state graph of a state by double clicking it. The path of the currently displayed state graph is indicated in the upper right corner using state names separated by slashes (/). A single slash indicates the top level. Double click into the empty space of a state graph will switch to the state graph one level up.

A click on a transition (or its label), a transition point or a choice point opens selects them in the diagram. Using the command openInTextEditor or pressing Ctrl+Shift+Alt+M will navigate to the textual representation of the element.

A double click on an ActorRef opens the structure diagram of the referenced actor class.