-
Select and activate the class to edit.
-
From the
Behavior Authoring section of the
action bar,
click
Modelica Editor
.
The Modelica text of the class appears in a new tab in the Modelica
Editor.
Note:
If a Modelica Editor is already open, the new tab
appears in that editor, otherwise a new Modelica
Editor appears, containing the new tab.
- Optional:
For the tab, you can right-click the tab header and do any of:
- Close to close the tab.
- Detach in New Window to open a new
Modelica Editor and display the tab in that
editor.
-
Select your display mode:
- Edit
Modelica
: displays and allows editing of editable Modelica text in
an expandable/collapsed code format.
By default, this mode is selected.
-
Show Formatted Modelica
: displays the full Modelica text with mathematical
notation and hyperlinks for easy navigation. No editing can be done in this
mode.
- Show
Used Classes
: displays the used classes. While you are in this
read-only mode, you cannot view the formatted text, and other options are
disabled.
- Show Flat Modelica
: displays Modelica text
after evaluation of component structure and inheritance. No editing can be
done in this mode.
Displaying a class as Flat Modelica text is useful,
for example, when investigating a model where the concept of replaceable
classes is heavily used (like large models using replaceable classes for
many media calculations).
Flat Modelica is available for:
- Models
- Blocks
- Media packages
- Connectors
- Partial models
- Functions
- Type and other short
class definitions
- Attributes of inherited
classes (for example buses).
If the class selected is not supported, Used Classes is displayed.
If the evaluation to Flat Modelica is not successful, an error message is
displayed.
-
Select if the
Modelica Editor should change content depending
on selections other than opening another class.
This command works in Toggle mode.
- To select that the content should only change when you open
another class, from the header of the
Modelica Editor, click
Ignore Selection
to activate
this selection.
The icon is changed to
to indicating
pinning, that is, that other selections than opening another class are ignored.
This is the default selection.
- To select that the content should change also when you, for
example, select a variable in the
Variable Browser or a component in the
Component Browser, click
Ignore Selection
to activate
this selection.
The icon is changed to
to
indicating unpinned state, that is, other selections than opening another class
also changes the content of the
Modelica Editor.
-
In the
Edit Modelica
mode, edit the Modelica text.
If the padlock after the class path is red and closed the
class is either not active or write-protected. Click the padlock. If it turns
green and open , you
can now edit the class.
Changed unsaved text is indicated by a star in the tab
header.
-
Click Apply All to add this information to the active
class without closing the Modelica Editor.
If you click OK, you also close the
Modelica Editor.
- Optional:
In a
Show Formatted Display
mode, navigate through Modelica paths using hyperlinks.
- Optional:
In a
Show Used Classes
mode, right-click and select
Settings to access a number of additional,
temporary, options. To switch back to the text editor, click
Show Modelica Text
.
-
To display another class in the active tab in the Modelica Editor:
- In the
Modelica Editor, expand the list to select a
class previously displayed, or a subclass then click
Display
.
- Type the path of
a class as text in the box then click
Display
.
- Use the blue
arrows
to navigate through the previous and next class.
Notes:
- A red padlock appears after the class path to indicate that the displayed class
is not the active class, so it cannot be edited.
- To open a new tab with a new class, perform Step 1 and Step 2
above.
-
Click to
activate the class.
Note:
A green open padlock
indicates that the class is editable. However, the class can only be edited
in the Edit Modelica
mode.
If the class is not write-protected, the symbol
turns green and open , you
can now edit the Modelica text of this class.
-
Click OK to save the changes and close the
Modelica Editor.
|