WOLFRAM SYSTEMMODELER TUTORIAL

Model CenterGraphical Views

Introduction | Class Browser | Class Window | Graphical Views | Modelica Text View | Component Browser | Variable Views | Reliability View | Messages View | Kernel Command View | Documentation Center | Functional Mock-up Interface | Keyboard Shortcuts | Kernel Commands

The graphical views, i.e. the Diagram View and the Icon View, and the Component Browser are synchronized to give a consistent view of a class. When a component is selected in the icon or diagram view it also becomes selected in the Component Browser and vice versa.

It is possible to view balloon help (onscreen information) for a component or connection in graphical views by moving the mouse cursor over the item and holding it still for a short period of time. For components, the component type, name, and description (if available) are shown. For connections, the name of the connected components and connection description (if available) are shown.

1.gif

Viewing balloon help for a connection in the Diagram View.

Selecting Objects

A single object in the Icon View or Diagram View is selected by clicking it once with the left mouse button. When an object is selected, a green selection outline appears, and unless the class is read only, selection handles appear as well. If the selection handles appear in red, this indicates that the object is inherited from another class and it is not possible to modify the object in any other way than by changing the values of its variables and parameters. To remove or modify other properties of an inherited object, open the class window of the class from which the object is inherited. Base classes are easily accessible by right-clicking on an empty area of the graphical view. In the popup menu that appears when right-clicking, choose Open Base Class and the name of the class to edit. Base classes are also accessible from the Component Browser; see the section describing the Component Browser.

There is a total of nine selection handles, except for components whose class has the preserve aspect ratio property set, in which case they have five selection handles.

Eight of the selection handles have the shape of a square and one has the shape of a circle with a dot in it. The square-shaped selection handles are used to resize an object, change the shape of the object, or rotate an object. The circular selection handle defines the origin point of the object, which is used as the center of rotation when an object is rotated, as well as the center of flip operations. The circular selection handle moves along with the object when moved or transformed. To move the circular selection handle independently of the object by using the mouse, place the mouse cursor on top of it and hold down the Shift key and left mouse button while moving the mouse.

To select multiple objects, click the pointer tool and then drag a rectangle around all the objects that you want to select, or hold down the Shift key and then click to select other objects one at a time. It is also possible to select all objects by choosing Select All from the Edit menu.

An entire selection can be canceled by clicking on an empty area of the view. To cancel the selection of one object when several are selected, hold down the Shift key and click the object.

Adding Components

To add a component to a model, open the class window of the model and drag the component from the Class Browser to the Diagram View of the class window.

If the component is a connector it will also appear in the Icon View once it is dropped onto the Diagram View. All non-protected connectors are visible in both the Icon View and the Diagram View. A protected connector is only visible in the Diagram View.

The initial size of the component is determined by the component icon settings of the class the component is representing. See this section for information on how to change this property.

Connecting Components

The Connection Line Tool in the Graphic Tools toolbar is used when connecting components.

2.gif

The Connection Line Tool in the Graphic Tools toolbar.

To connect two components, select the Connection Line Tool and place the mouse cursor over a connector. When the cursor is close enough it will change in appearance (the icon in the form of a plus sign becomes thicker) and information about the connection will be displayed in the status bar at the bottom of the main window.

3.gif

Information in the status bar when connecting components.

Press and hold down the left mouse button, move the cursor to the other connector, and release the mouse button to complete the connection. The connection line will be drawn as a right-angle connection line. Note that once the cursor gets close enough to the connector, and the plus sign of the mouse cursor becomes thick, the information in the status bar is also updated to show the name of the second connector in the connect equation.

4.gif

The status bar when making a legal connection.

If the connection is illegal, the shape of the mouse cursor will change to indicate this (black circle with a black line across it) and the connection will not be possible to complete. Information is also displayed in the status bar.

The status bar when attempting to create an illegal connection.

Connection lines, when created, are given a color matching the border color of the source connector. To change this behavior, see this section. If you have models with existing connection lines that you wish to color according to their respective source connector, you can do this by selecting the connection lines and choosing Color Connection Line from the Shape menu, or right-click the connection line and choose Color Connection Line from the popup menu.

Creating a customized connection line with multiple segments is just as simple, but instead of releasing the mouse button when the mouse cursor is over a connector, release it when the mouse cursor is anywhere else. Press the mouse button for each new line segment you want to create and complete the connection by pressing the mouse button while the mouse cursor is over a connector. To turn a customized connection line into a standard connection line, select the line and choose Reset Connection Line from the Shape menu, or right-click the connection line and choose Reset Connection Line from the popup menu.

If you connect two components, Model Center makes sure the components remain connected when you rearrange the components.

Selected connection lines can be turned into a curved connection line by right-clicking one of them and choosing Curved Connection Line from the popup menu.

In the case that one of the connectors has sub-connectors, a dialog box for selecting what connectors to connect is displayed.

6.gif

Choosing sub-connectors in the Add Connection dialog box.

In the figure above, a connection from the part.subControlBus connector to the controlBus.subControlBus connector is created. The connectors have several nested connectors, all of which are displayed in the drop-down lists.

The icons shown next to the name of the connectors indicate what type of connector it is.

7.gif

From left to right; standard connector, expandable connector, Real connector, Integer connector, Boolean connector, record connector.

When choosing the connectors of the connection it is important that the two connectors are compatible. The icons assists you in accomplishing this.

By definition, all variables in an expandable connector are sub-connectors, and variables can be added to an expandable connector without having to declare them in the class of the expandable connector. Such a variable, without a declaration, becomes a virtual connector, and its type is inferred from the connector it is connected to. To introduce a new variable when creating a connection, choose the item that ends with <Add Variable> of the expandable connector of your choice.

A connector visualized in the Diagram View can also be an array of connectors or part of an array of components. When a connection is created between arrays and sub-connectors are involved, the dialog will let you edit the indices of the components that are declared as arrays. By default, a colon is used for the array indices, which means all indices of the dimensions will be connected.

When a connection is created between connectors that do not contain sub-connectors, a dialog box for specifying just the indices of the arrays is displayed.

8.gif

Specifying array indices in the Add Connection dialog.

By default, a colon is specified for the array indices, which means all indices of the dimensions will be connected. For arrays with the same number of dimensions and dimension sizes, this creates a connection between all the connectors. If the number of dimensions and the number of dimension sizes do not match, the indices need to be manually specified, or the resulting connection will be invalid.

Adding Graphic Items

Graphic items can be added using the Graphic Tools toolbar. There are six types of graphic items: line, rectangle, ellipse, polygon, text, and bitmap. Bitmap items can also be added to the Icon or Diagram views by drag and drop of an image file onto the view. It is possible to create arcs and pies using an ellipse item by editing its properties after it has been added. For more information on how to edit the properties of graphic items, see this section.

9.gif

The Graphic Tools toolbar.

For instance, to draw a line, select the line tool and place the mouse cursor at the point where you want the line to begin. Press the left mouse button and hold it down while moving the mouse cursor to the point where you want the first segment of the line to end and release the mouse button. If you want a line consisting of a single segment only, press the left mouse button once without moving the mouse cursor. If you want to add more segments to the line, move the mouse cursor to the point where you want the segment to end and press the mouse button. When you no longer want to add more segments, press the left mouse button once again without moving the mouse cursor.

At any time during the process of adding the line, you can press the right mouse button to cancel the operation.

Line items and polygon items have a smooth attribute to give them smooth edges. This attribute can be set already at drawing time by holding down the Shift key when creating the first point of the line or polygon. The Shift key can be released once the first point has been specified.

10.gif

Drawing a line with smooth edges by holding down the Shift key.

Holding down the Shift key while creating a rectangle, ellipse, or text will restrict the new shape to equal-length sides.

Removing Objects

Select the objects to remove and choose Edit Delete or click the Delete button. This will remove the object from the model. If a component with connections to other components is removed, the connections in the class in which the component is declared will be removed as well.

Note that classes extending the class in which the removed component was declared are not modified in any way. Connections to or from an inherited component that is removed in its base class become unresolvable.

Transforming Components into a New Class

A model with a large amount of components is often hard to overview and understand. Such models benefit from being divided up into one or more hierarchical levels by encapsulating groups of components into new components. This is tedious work to do manually, but quick and straightforward to do in Model Center.

Start by identifying groups of components that by themselves describe some entity that is easily understood. Continue by selecting all the components in one of these groups and choose Transform into New Class from the Edit menu.

11.gif

Transforming a group of logical components into a new class.

You will be asked to give the new class a name and description (optional), as well as to specify a location for the new class. Click the OK button to close the dialog box and start the transformation process. Once completed, the selected components will have been replaced by a single component, an instance of the class you named in the dialog box. If you open the class you will see that the class contains all of the replaced components along with a set of automatically created connectors that define the interface of the class. You may wish to edit the class to rearrange its connectors and to create some graphics for its icon.

The Transform into New Class dialog box.

Adding Inheritance Relationships

One way to add an inheritance relationship to an existing class is to use the Class Properties dialog box and add the class to the list of extended classes. Another way, which is more convenient, is to simply drag the class to extend from the Class Browser, while holding down the Ctrl key, and drop it on one of the graphical views of the class. When the mouse button is released, a popup menu will appear in which you may choose to extend the class, create the component, or create the component and show its properties.

The popup menu that appears when dragging and dropping a component onto a graphical view while holding down the Ctrl key.

Renaming Components

A component can be renamed by right-clicking it, choosing Rename from the popup menu, and editing the name in the Component Properties dialog box. It is also possible to rename a component by selecting it and pressing the F2 key.

When renaming a component from the Component Properties dialog box, all references to the renamed component, for instance in connect equations, will be updated automatically in all currently loaded classes. When the renaming operation is completed, a list of all classes that were modified due to references to the renamed component is shown.

Duplicating Objects

At times you may wish to create several objects with identical or nearly identical properties. This can be a tedious task if the object is a complex shape or a component with many parameters. Instead of creating and customizing each object individually, it is only necessary to create one of the objects and then duplicate it as many times as desired. To duplicate an object, select it and choose Duplicate from the Edit menu or right-click an object and choose Duplicate from the popup menu.

Copying Objects

Objects can easily be copied or moved from one view to another. Begin with selecting the objects you wish to copy. Once the objects are selected, choose Copy (or Cut to move) from the Edit menu, or right-click an object and use the popup menu. Switch to the class and view where you want the objects to be pasted and choose Edit Paste, or right-click anywhere on the view and choose Paste from the popup menu. You can paste the objects any number of times and to any number of views.

Moving Objects within the View

Select the objects to be moved and point the mouse cursor toward one of them. Once in position, the mouse cursor will change to a four-headed arrow. Now drag the objects to where you want them. Be careful not to point to a selection handle when you move an object as this will resize the object instead.

An object can also be moved by editing its properties in a dialog box. Right-click an object and choose Properties from the menu.

If the object is a component or connection line, switch to the Placement view of the properties dialog box. To specify a new position for the object, edit the value of the Origin attribute. Note that for connector components you will be able to edit the position in both the Icon View and the Diagram View as connectors are visualized in both of these views.

14.gif

The Placement view of the Component Properties dialog box.

Resizing Objects

Objects in the graphical views are resized using their selection handles. Select the object to resize and drag one of its square selection handles until the object is the desired size. Rectangular graphic items (rectangles, ellipses, text, and bitmaps) and components can be resized proportionally by dragging one of their corner handles.

Depending on the preserve aspect ratio setting of the class a component represents, a component may only have five selection handles (four corner handles and one center handle) of the nine selection handles visible, restricting the resizing of the component to only proportional resizing. See this section for more information about the preserve aspect ratio property.

An object can also be resized by editing its properties in a dialog box. Right-click an object and choose Properties from the menu.

If the object is a component or connection line, click the Placement tab in the properties dialog box. To resize the object, edit the Left, Top, Right and Bottom attributes, or the points that define the item if the object is a line or polygon. For connector components you will be able to edit the size in both the Icon View and the Diagram View as connectors are visualized in both of these views.

If the object is a graphic item, edit the points that define the item in the properties dialog box to resize the item.

Flipping Objects

Most objects in the Icon View and Diagram View can be flipped horizontally or vertically by selecting the object and choosing Shape Rotate or Flip Flip Horizontal or Shape Rotate or Flip Flip Vertical.

Objects can also be flipped using the Flip Horizontal and Flip Vertical tools found on the Layout toolbar.

15.gif

The Flip Horizontal and Flip Vertical buttons on the Layout toolbar.

An object is always flipped around its origin point, which is the circular selection handle visible when the object is selected. To move the origin point independently of the object, place the mouse cursor on top of the selection handle and hold down the Shift key and the left mouse button while moving the mouse. The origin point can also be specified in the properties dialog box of the object.

Rotating Objects

To rotate an object 90 degrees counterclockwise, choose Shape Rotate or Flip Rotate Left or use the Rotate Left tool on the Layout toolbar. To rotate an object 90 degrees clockwise, choose Shape Rotate or Flip Rotate Right or use the Rotate Right tool on the Layout toolbar.

16.gif

The Rotate Left and Rotate Right buttons.

All objects can also be rotated freely using their selection handles. Select the object and drag one of its square selection handles while holding down the Shift key.

Finally the rotation of an object can also be specified by editing the rotation attribute in the properties dialog box. For components and connection lines, the rotation attribute can be found in the Placement view of the properties dialog.

The rotation of an object is always performed around its origin point, which is the circular selection handle visible when the object is selected. To move the origin point independently of the object, place the mouse cursor on top of the selection handle and hold down the Shift key and the left mouse button while moving the mouse. The origin point can also be specified in the properties dialog box of the object.

Changing Stacking Order of Graphic Items

The stacking order of graphic items is the order in which graphic items overlap other graphic items in the graphical views. The first item added to a graphical view will be at the back of the stack and the item most recently added will be at the front.

To change a graphic item's position in the stacking order, select the item and choose one of the commands available from the Shape Order menu:

  • Choose Bring to Front to bring the graphic item to the front.
  • Choose Send to Back to send the graphic item to the back.
  • Choose Bring Forward to bring the graphic item forward one level.
  • Choose Send Backward to send the graphic item backward one level.

The Bring to Front and Bring to Back operations are also available on the toolbar.

17.gif

The Bring to Front and Send to Back buttons in the Layout toolbar.

Note that the stacking order applies to graphic items only and not to components or connections. Components are always drawn on top of all other graphic items and connections are drawn on top of both graphic items and components.

Showing Attributes of a Component in Its Icon

The name, description, and parameter values of a component can be shown in its icon by adding a Text item in the Icon View of the component's class window. To show the name of the component, set the text of the Text item to %name. The description of the component can be shown by setting text to %comment, and any of the component's parameter values are shown by setting the text to % followed by the parameter name.

18.gif

Adding a Text item to show the value of parameter R in a resistor model.

For information on how to add a Text item to a class, see the section on adding graphic items.

Editing the Properties of Components

To edit the properties of a component, open the properties dialog box for the component by right-clicking it and choosing Properties from the popup menu, or by selecting it and choosing Properties from the Edit menu.

The dialog box has three views:

  • General. Provides the possibility of renaming the component and changing its description. This view also contains type information about the component.
  • Attributes. This view lets you edit the attributes of the component.
  • Placement. If the component is visible in one of the graphical views, it has a placement annotation describing its placement and transformations in that view. This annotation can be edited directly from the Placement view of the properties dialog box.

19.gif

The General view of the Component Properties dialog box.

The sections of each view in the dialog box are described in the following sections.

  • General: Component. Specifies the name and description of the component. It contains the following fields:
  • Name. The name of the component.
  • Description (optional). A short description of the component.
  • Declared in. The name of the class in which the component is declared.
  • General: Type. Describes the type of the component in terms of:
  • Name. The name of the component's declared type.
  • Class specialization. The class specialization of the component's declared type. Available only if the type of the component is a class.
  • Description. The description of the component's declared type.
  • Change Component Type. This button is used to change the type of the component. See this section for information on changing types of components.
  • General: Array. Specifies the dimensions of the component. Leave this section unchecked for non-arrays:
  • Dimensions. The number of dimensions of the component array.
  • Sizes. The dimension sizes. If the number of dimensions exceeds four, a single text box is shown where the dimension sizes are separated using a comma.
  • Attributes: Properties. Specifies the properties of the component. The following properties can be assigned to components:
  • Final. Prevents modifications of the component.
  • Protected. Access to the component is restricted to the class in which it is declared and to classes inheriting that class. Clear this checkbox to make the component accessible from all classes.
  • Replaceable. Allows modifications of the component in the form of redeclarations. See this section for information on how to change the type of a component by using redeclaration modifications.
  • Flow. Applies only to components declared in connector classes. The flow property specifies whether the sum of the quantity should sum to zero when connected. Select this checkbox for components specifying a flow quantity such as current, fluid, force, etc. Clear this checkbox for components specifying potential (non-flow) quantities, such as voltage, pressure, position, etc.
  • Stream. Applies only to components declared in connector classes. A stream variable describes a quantity that is carried by a flow variable. The value of the stream variable is the specific property inside the component close to the boundary, assuming that matter flows out of the component into the connection point.
  • Attributes: Variability. Specifies the variability of the component, with respect to simulation time.
  • Unspecified (default). Continuous for variables of type Real. Discrete for components of type Boolean, Integer, String, and enumeration.
  • Discrete. Discrete components are piecewise constant with respect to simulation time and may only be changed by events during simulation.
  • Constant. Constants can never change once defined.
  • Parameter. Parameters may change before simulation but remain constant during simulation.
  • Attributes: Causality. Specifies the causality of the component. The causality of a component does not have to be explicitly specified unless the component is an input or output to a block or function.
  • None (default). No explicitly specified causality.
  • Input. The component is an input to a class.
  • Output. The component is an output to a class.
  • Attributes: Dynamic Reference. Specifies the dynamic reference property of the component.
  • Inner. Enable access to the component in nested scopes.
  • Outer. Make the component reference an inner component with the same name in an enclosing scope.
  • Placement: Icon View. Specifies the position, size, and rotation of connector components in the Icon View. This section is disabled for non-connector components as only connector components are visualized in the Icon View.
  • Placement: Diagram View. Specifies the position, size, and rotation of components in the Diagram View.

Editing the Properties of Connections

The properties of a connection can be edited by right-clicking the connection and choosing Properties from the popup menu or by selecting the connection and choosing Edit Properties.

20.gif

The General view of the Connection Properties dialog box.

The Connection Properties dialog box has two views, a General view and a Graphics view. The General view provides you with information about the connectors of the connection and the connection's declaration class. It also lets you edit the description of the connection. The Graphics view lets you edit the appearance and placement of the connection in the Diagram View.

The color of a connection line can either be specified in the Connection Properties dialog box or be derived from the source connector of the connection. To color one or more connection lines using the border color of their respective source connectors, select the lines and choose Color Connection Line from the Shape menu, or right-click one of the lines and choose Color Connection Line from the popup menu.

Editing the Properties of Graphic Items

When a graphic item is created, it is automatically given default values for all its attributes. For instance, the border color of an ellipse is always set to black. All attributes of a graphic item can be edited by selecting the graphic item and choosing Properties from the Edit menu, or by right-clicking the item and choosing Properties from the popup menu. A third option of how to open the properties dialog box is to double-click the graphic item.

21.gif

The Line Properties dialog box.

Most of the common properties of graphic items can also be edited by using the tools in the formatting toolbar.

22.gif

Tools to update common properties of graphic items.

The tools operate on the selected graphic items. Configure the tools by clicking their arrows. Any selected items are affected immediately by any changes made by the tools. Apply the current setting of a tool to the selected graphic items by clicking the tool's icon.

To remove points from a line or polygon, select the item in the graphical view, place the mouse pointer next to the point that should be removed and press the - key on your keyboard. Similarly, to add a point to a line or polygon, select the item, place the mouse pointer where you want the point to be added and press the + key on your keyboard.

Editing the Dynamic Graphics of Graphic Items

When simulating a class in Mathematica through the Wolfram SystemModeler Link, it is possible to show an animated view of the diagram, with graphic items changing properties such as size, color, visibility, or position depending on variable values at a given time point in the simulation. These dynamic properties can be configured in the Properties dialog of graphical primitives. This dialog can be opened by right-clicking the item and choosing Properties from the popup menu. In the resulting dialog, select the Dynamic Graphics tab. The dialog shows all properties in a list. The properties that are colored gray do not have a dynamic setting, and therefore show the static view, which is what is normally used in the diagram view. By double-clicking on the value of a property, the static value can be edited to any Modelica expression, referencing variable and parameter names from the class. This screen shot shows how the extent of a rectangle depends on the variable h.

23.gif

The Dynamic Graphics tab of a Rectangle Properties dialog box.

Showing Components

One step involved when configuring components in a hierarchical class is the process of identifying the components. You may use the component browser's tree structure to expand the internals of a component, but the presentation of these internals, which is simply a list of component names, makes the identification hard as you need to know the name of the component.

Identification is a lot easier by viewing the internals of a component graphically. This is possible by right-clicking a component and selecting Open Component from the popup menu. Double-clicking a component gives the same result. The class window will enter component mode, where the component is graphically visualized in the context of the class. The component mode makes it possible to visualize the internals of components at any level in the component hierarchy of a class.

In component mode you can select components in the graphical views and configure them using the variable and parameter views at the bottom of the application. All changes made will be stored as a component modification in the top-level class. Keep in mind that as you are visualizing a component and not a class, no changes can be made in the graphical views.

24.gif

Showing the internals of component axis6 in MultiBody example RobotR3.fullRobot.

When in component mode, the name of the visualized component is shown at the top of the class window, along with a small toolbar with buttons for Back, Forward, Up, Open Class, and Exit component mode.

The Exit component mode button will let you exit component mode and return to the graphical view of the class. Clicking the model name in the shown bar will also exit component mode. If a hierarchical component is visualized, such as in the screen shot above, you can step up in the component hierarchy by clicking the hierarchical parts of the component name or by using the Up button. The Back and Forward buttons are used to navigate back and forth in the component browsing history. Finally, Open Class will exit the component mode and open the diagram view of the component you are currently browsing.

The toolbar of the class window when in Component Mode.

Opening Base Classes

If a class extends one or several other classes, you may want to open one of them. Instead of finding the correct class in the Class Browser, you can right-click an empty location in the graphical view and choose Open Base Class and then the name of the class to open from the popup menu.

Opening a base class from the popup menu.

The Component Browser can also be used to open base classes; for more information on how to use the Component Browser, see the section describing the component browser.

Zooming In and Out

When working with a detailed icon or diagram, you may want a closer view of certain objects to make it easier to work with them.

To quickly zoom in or out on any icon or diagram, do any of the following:

  • Press Ctrl+Shift and click the location that you want to see more closely.
  • Press Ctrl+Shift and right-click a location that you want to see from farther away.

If you have a mouse with a wheel, zoom in and out by holding down Ctrl as you rotate the wheel forward or backward.

To specify a certain zoom level, use the zoom drop-down menu in the class view toolbar and select one of the predefined levels, or click the zoom toolbar box to type your own zoom level. If you enter a zoom level of your own, press Return or Enter to confirm the input.

27.gif

The zoom box on the Class View toolbar.

Panning and Scrolling

It is possible to pan any icon or model within a graphical view by using the mouse. Press and hold the Ctrl key. The mouse cursor will change into an open hand. Press and hold the left mouse button and drag the model to the desired location.

If you have a mouse with a wheel, you can scroll up and down within a graphical view by rotating the wheel forward or backward. To scroll left and right, hold the Shift key while rotating the wheel.

Grid

A grid helps you position objects visually in the Icon View and Diagram View of a class, and can also be used to snap objects; see the section on snapping.

The grid spacing can be set individually for the Icon View and Diagram View for every class, and is saved along with the class definition when the class is saved.

To edit the grid spacing for the Icon View or Diagram View of the active class window, choose Page Setup from the File menu, or right-click on an empty part of the graphical view and choose Page Setup. In the page setup dialog box, select either the Icon Layer view or the Diagram Layer view and edit the values for the horizontal and vertical spacing in the Grid section. To edit the grid spacing for the visible view of the active class window, choose Grid from the Tools menu. Here you can also choose to draw the grid on top of all objects, making it easier to align objects.

The grid can be toggled on and off by choosing View Grid. A global switch for turning on or off the grid can be found by choosing Tools Options. Under the category Graphical Class Views the Show grid item has a drop-down menu for grid settings. The default setting is to show the grid When view is editable, which means that the grid is invisible for all read-only classes. It is also possible to choose Always or Never.

See this section for information on how to change default grid settings for the graphical layers.

Snap

The snap function helps you position and align objects. Snapping pulls objects to grid lines when objects are being moved, to orthogonal angles when objects are being rotated, and so on. You can control the type of snapping and the snap strength from the Snap dialog box, which can be reached from the Tools menu. Custom snap settings are applied to the visible view of the active class window and will remain active until you choose to exit the Model Center.

28.gif

The Snap dialog box.

By default, all objects snap to grid lines when the objects are created or moved. The origin points of an object are by default also snapped to the grid as well as the center of the object. The points of a line or polygon object also snap to neighboring points and components are snapped to orthogonal angles while being rotated.

You may not always want to snap objects, for instance if you want an object to be rotated close to an orthogonal angle. To disable a certain type of snapping, uncheck it in the Snap dialog box.

On Drop Action

It is possible to specify an action to be performed when a class is dropped in any of the two graphical views of a class window while holding the Ctrl key. The default action is to show a context menu of all possible actions. To change this action, open the Options dialog box by choosing Options from the Tools menu, and go to the Graphical Class Views section. The on drop action applies to all class windows. The setting is automatically saved when closing the dialog and restored the next time Model Center is started.

29.gif

Specifying an on drop action for the graphical views.

Window Layout Management

SystemModeler has a number of different window layouts described below. These layouts can be reached from View Window Layout.

The Custom window layout is defined by the user in terms of properties such as grid visibility, window placement and sizes and the level of detail setting. These properties are restored when toggling between the custom view and any of the other views.

The Library Developer layout is targeted to users doing library development, showing the tools and views typically used by an advanced user.

30.gif

A DCMotor model shown in the Library Developer window layout.

The Modeler layout is targeted to users creating new models using existing libraries. This layout is suitable for drag-and-drop development of new models.

31.gif

A DCMotor model shown in the Modeler window layout.

The Presenter layout is very scaled down for use in presentations. It hides many of the views and toolbars, giving a clean view of the model itself.

32.gif

A DCMotor model shown in the Presenter window layout.

The visible items in any window layout can still be adjusted through the View menu. Choose View Level of Detail to specify if component labels and/or parameters should be visible in the graphical layer, View Toolbars to choose which toolbars to enable, and View Grid to toggle grid visibility on and off.

Resizing Graphical Layers

To resize the icon layer or diagram layer of a class, click anywhere on its border to show its selection handles and then drag the handles until the page is the desired size.

The size of the icon layer and diagram layer can also be set from the page setup dialog box by editing the coordinate systems.

To edit the coordinate systems of the class in the active class window, choose Page Setup from the File menu, or right-click on an empty part of the class window and choose Page Setup from the popup menu. Choose whether to edit the properties of the icon layer or diagram layer by clicking the Icon Layer or Diagram Layer tab. The settings are saved along with the class definition when the class is saved.

33.gif

Editing the icon layer properties of a class in the Page Setup dialog box.

For all classes except connectors, the default size of the diagram layer is 297×210 mm, which corresponds to the size of a landscape A4 sheet, and the size of the icon layer is 200×200 mm. For connector classes, the default size of the diagram layer is 200×200 mm, as a square is the most common shape of a connector. Also, by default the coordinate systems of both layers have their origin (0,0) at the center of the page.

See this section for information on how to change the default page properties of the graphical layers.

Changing the Initial Component Size for a Class

The initial size of the component of a class when dropped in the Icon View or Diagram View can be specified in the Page Setup dialog box. For all classes except connectors, the icon layer of the class is used to represent the class when it appears as a component in the Diagram View of another model. For connector classes, however, the icon layer is used as a representation in the Icon View, while the diagram layer is used as a representation in the Diagram View.

To edit the property of the class in the active class window, choose Page Setup from the File menu, or right-click on an empty part of the class window and choose Page Setup from the popup menu. Choose whether to edit the property of the icon layer or diagram layer (available for connector classes only) by selecting the Icon Layer or Diagram Layer tab. The initial component icon size for the chosen graphical layer is specified by a scale factor in the Component section of the dialog box. The initial size of a component icon is the scale factor multiplied with the width and height of the graphical layer.

34.gif

The Component section of the Page Setup dialog box.

It is also possible to preserve the aspect ratio of component icons representing the chosen layer of the class by checking the Preserve aspect ratio box. The settings are saved along with the class definition when the class is saved.

See this section for information on how to change the default page properties of the graphical layers.

Changing Default Page Properties for Graphical Layers

The default page properties for the icon layer and diagram layer can be changed in the Graphical Class Views section of the Options dialog box. To open the dialog box, choose Options from the Tools menu.

35.gif

Editing the default diagram layer properties for non-connector classes.

The default page properties are used when new Modelica classes are created. Changing the default page properties does not affect existing classes. The default page properties are automatically saved when closing the dialog box and restored the next time Model Center is started.

Changing the Default Color of Connection Lines

When a connection line is created, its initial color is determined by a setting available in the Graphical Class Views section of the Options dialog box. To open the Options dialog box, choose Options from the Tools menu.

36.gif

The Default Connection Line Color section of the Options dialog box.

By default, the initial color of a connection line is derived from the source connector of the connection.

Changing the Appearance of Component Text

Text belonging to a component in the graphical views, such as the component name and parameters, is rendered using a fixed font size. If text does not fit its given boundaries, it is by default compressed by elision and expanded only on mouseover.

Both the font size and elision behavior may be changed in the Graphical Class Views section of the Options dialog box. To open the Options dialog box, choose Options from the Tools menu.

37.gif

The Display section with the Component Text properties of the Options dialog box.

Printing

You can print the contents of the visible graphical view by choosing File Print. The contents of the view will automatically be scaled to fit the selected paper size if necessary.

Copy View as Image

The contents of the graphical view can be copied to the clipboard as an image by right-clicking anywhere in the view and choosing Copy View as Image. The image is a representation of the graphical view rendered to show the complete class.

Introduction | Class Browser | Class Window | Graphical Views | Modelica Text View | Component Browser | Variable Views | Reliability View | Messages View | Kernel Command View | Documentation Center | Functional Mock-up Interface | Keyboard Shortcuts | Kernel Commands