Table of Contents Previous Chapter 3 Editing MSC Diagrams

3 Editing MSC Diagrams

Generating MSC-PR (Textual Format)

The MSC Editor normally stores the MSCs using SDT's binary storage format. You can however save an MSC using the Z.120 MSC-PR format. (MSC-PR can also be read by the MSC Editor, see "Opening an MSC-PR File" on page 169).

To generate MSC-PR:

  1. Make sure the MSC currently being displayed is the one you want to generate MSC-PR from.
  2. Select the Generate MSC PR command from the Edit menu. A dialog is issued:
    Figure 134 : Generating MSC-PR. 
    -----
    (fig)  
           
    -----
    
  3. Specify a file where to store the generated MSC-PR.
  4. Make sure the Event oriented radio button is turned on.
    -----------------------------------------------------------------
    Note:  Instance oriented MSC-PR                                    
    Instance oriented MSC-PR can only be written by SDT. They can      
    not be read back into SDT using the current version of the MSC     
    Editor. (Event-oriented MSC-PR can however be both written and     
    read back).                                                        
    You may want to create instance-oriented MSC-PR if the reader or   
    the tool the file is sent to requires instance oriented MSC-PR.    
    -----------------------------------------------------------------
    

Generating an SDL-PR Stub From an Instance

The MSC Editor allows you to produce a stub of an SDL-PR(1) process or procedure description from one MSC instance at the time. The basic intention is to provide a means to reuse MSCs that constitute the specification of the dynamic behavior of a part of an SDL system. For a more detailed description of the translation scheme, see "MSC to SDL Translation Table" on page 1347 in chapter 25, The MSC Editor.

You can also add test cases to the SDL-PR code generated from an MSC; the test cases make it possible to detect that the dynamic behavior of an SDL system does not comply with the originating MSC. See "Test Case Extensions" on page 1348 in chapter 25, The MSC Editor.

To generate SDL-PR code for an instance:

  1. Select the instance from which you want to produce SDL-PR.
  2. Operate the Generate SDL command from the Tools menu. A dialog appears:
    Figure 135 : Generating SDL-PR from an Instance. 
    -----
    (fig)  
           
    -----
    
  3. Click the Process or the Procedure radio button, depending on the type of SDL diagram you want to produce.
  4. The default name of the SDL process or procedure coincides with the name of the instance. If required, type in a new name.
  5. Type in the name of the file where to store the resulting SDL-PR.
  6. Click Generate to order the MSC Editor to produce the SDL-PR file.
  7. To visualize the results as an SDL-GR diagram, convert the PR file to GR using the Organizer's Convert to GR command.

Editing Text

If you select an object in the MSC Editor window, the text window is updated to contain the text associated with that object. This is explained in detail in "Selecting an Object that has Associated Objects" on page 190.

If you select more than one text object, the text window is not updated.

Each line (exception from the last line) in the text window is terminated by a carriage return, and may consist of any number of legal characters.

The main text editing functions you can do are:

Resizing the Text Window

You can resize the text window pane by dragging the sash, the small square at the upper right of the text window, up or down as shown in Figure 136. The smallest possible size makes it impossible to view text within the text area. However, the drawing area will be correspondingly larger. A largest possible size covers the entire MSC Editor window, leaving no room for the drawing area. The text window can only be resized vertically.

Figure 136 : Resizing the Text Window. 
-----
(fig)  
       
-----

Hiding and Showing the Text Window

You can hide and show the text window with the Window Options command from the View menu.

To hide or show the text window:

Selecting a Portion of Text

You can select a portion of text displayed in the text window by performing either of the following sequences of operations:

Selecting by Dragging

  1. Point to the beginning or the end of the portion of text to be selected within the text window.
  2. Drag the I-beam pointer to the other end of the text to be selected. If the pointer is moved beyond the limit of the text window, the window will automatically scroll. The selected text is highlighted as you move the mouse.
  3. Release the mouse button.
    Figure 137 : Some Selected Text. 
    -----
    (fig)  
           
    -----
    

Selecting by Clicking

  1. Point to the beginning or the end of the text to be selected and click.
  2. Move the I-beam pointer to the other end of the text to be selected.
  3. Press <Shift> and click.

Selecting a Word

You can select a single word, delimited by white space, by double-clicking it.

Selecting a Line of Text

You can select one line of text by triple-clicking it.

Basic Text Editing Functions

Delayed Updating of the Drawing Area

When you alter the content of the text window, both the text window and corresponding text in the drawing area will be updated, the drawing area after a slight time delay.

In addition, any attempt to enter an illegal character will always result in an audible warning.

Functionality

The standardized text editing functions include:

Searching and Replacing Text

You can search for, and possibly replace, text in an MSC diagram or in a number of MSCs that are managed by the Organizer.

Searching for Text in an MSC

To search for text in the current MSC:

  1. Make sure the window showing the MSC where to search is open and active.
    --------------------------------------------------------------------
    Note:                                                                 
    2.  Make sure all textual objects that you want to search in are vis  
    ible (i.e. instance name, instance kind, instance composition,        
    message name and message parameters). If required, adjust the         
    Diagram Options.                                                      
    --------------------------------------------------------------------
    
  2. Select the command Show Organizer from the Tools menu. This not only raises the Organizer window but also sets the selection on the diagram currently being edited.
  3. Select the Search command from the Organizer's Tools menu.
    ---------------------------------------------------------------------
    (fig)  
  4. Alternatively, click the Organizer quick button for Search. ---------------------------------------------------------------------
  5. Specify the text to be found in the Search for text field.
  6. Click the Search button. The object where the next occurrence of text will be selected and the text window updated accordingly.
  7. When the Search dialog is no longer needed, close it by clicking Done.

Searching and Replacing Text

To search and replace text:

  1. Open the Search dialog as when Searching for Text in an MSC (see above).
  2. Specify the text to be found in the Search for text field.
  3. Specify the text to be replaced with in the Replace with text field.
  4. Click the Search button to find the first occurrence.
  5. If the text is found, the object where the next occurrence of text will be selected and the text window updated accordingly. You may select from the following options:
  6. When the Search dialog is no longer needed, close it by clicking Done.

Copying, Cutting and Pasting Text

The text window provides clipboard functions for copying, cutting and pasting text between different symbols, lines and text attributes (these functions do not interfere with the clipboard functions for Cutting, Copying and Pasting Objects).

Copying Text

To copy a portion of text:

  1. Select the text to be copied (see "Selecting a Portion of Text" on page 239).
  2. Select the Copy menu choice from the Edit menu of the text window. The selected text is copied to the text clipboard buffer, awaiting further instructions, typically Paste.

Cutting Text

To cut a portion of text:

  1. Select the text to be cut (see "Selecting a Portion of Text" on page 239).
  2. Select the Cut menu choice from the Edit menu of the text window. The selected text is removed from the text window and is copied to the text clipboard buffer, awaiting further instructions, typically Paste.

Pasting Text

To paste a portion of text:

  1. First copy or cut some text (see "Copying Text" and "Cutting Text", above). You cannot paste any text if the text clipboard is empty.
  2. Select, if required, the object where to paste the text. Place the I-beam cursor where to paste the text. Any text that is selected in the text window will be replaced when pasting.
  3. Select the Paste menu choice from the Edit menu of the text window. The contents of the text clipboard are pasted into the text window.

Changing Fonts on Text Objects

You may change the font faces and font sizes used in the textual objects displayed by the MSC Editor. All textual objects use the same font faces and font sizes, meaning that they cannot be changed individually and cannot be changed during an MSC Editor session.

The font faces which are available depend on the target system on which you are running SDT.

Font management is performed in a similar way as in the SDL Editor. We refer to "Changing Fonts on Text Objects" on page 145 in chapter 2, Editing SDL Diagrams.

Scrolling and Scaling

The viewport allows you to view a portion of the diagram that you are working on within the MSC Editor. That diagram is currently displayed in the drawing area. Any portion of the diagram located outside the limits of the viewport is out of view, unless you scroll the viewport to display that area.

The MSC Editor uses any scale of your choice when displaying the page in the viewport.

Manual Scrolling

The viewport can be scrolled vertically and horizontally by using the scrollbars.

Automatic Scrolling

An automatic scrolling feature is provided. It automatically scrolls the viewport when you move the mouse pointer beyond the current limits of the viewport. This function is activated in following situations:

The automatic scrolling function works at two different speeds. If you move the mouse pointer so that it is close to the edge of the viewport, the viewport is scrolled slowly. If you move the mouse pointer outside of the current viewport boundaries, then it is scrolled more quickly. The scrolling stops when you release the mouse button, or move the mouse pointer back into the current viewport.

Scaling the View

Scaling the view can be done either by specifying a scale to use or by zooming in and out.

To specify a scale:

  1. Select the Set Scale command from the View menu.
  2. A dialog is issued, where you have the following options:
    Figure 139 : Adjusting the Scale. 
    -----
    (fig)  
           
    -----
    
To zoom in or out:

Tracing a Simulation in a Message Sequence Chart

This section describes the functionality behind tracing a simulation in a Message Sequence Chart.

General

The Message Sequence Chart Editor can also used as a graphical trace tool, which enables the automatic generation of a Message Sequence Chart from a simulation. The results of the simulation will be presented in an MSC Editor window, in which each event of interest will be appended to the chart in order to build up a chart which reflects the history of the simulation.

The commands that start up the logging of MSC events, set up the scope of trace, stop the logging of events, and so on, are given to the simulator monitor. See chapter 7, Simulating a System.

Defining the Scope of Trace

First, the scope of trace should, if necessary, be set to the unit which is currently of interest. This is done with the command Set-MSC-Trace.

The graphical trace is then started with a dedicated command from the simulator monitor. See StartInteractiveMSCLog in chapter 32, The Simulator. In response to this command, the following events take place:

  1. In the Organizer, a reference to a Message Sequence Chart is added. The name is selected in order to guarantee unique names.
  2. An instance of the Message Sequence Chart Editor window is activated on the newly created MSC.
  3. The current status for the simulation is presented by displaying all SDL process instances that exist at the time when the command Start-Interactive-MSC-Log is typed.

Mapping Between SDL and MSC

The mapping rules which govern how SDL events are transformed into MSC symbols, lines and textual elements are summarized in the following table:

---------------------------------------------------
SDL concept              MSC Concept                 
---------------------------------------------------
Signal                   Message                     
·  Output                ·  Sending                  
·  Input                 ·  Consumption              
Signal to self           Message to self             
·  Output                ·  Sending                  
·  Input                 ·  Consumption              
Timer                    Timer                       
·  Set                   ·  Set                      
·  Reset                 ·  Reset                    
·  Implicit Reset        ·  Implicit reset(a)        
·  Input                 ·  Time-out                 
Create a process         Process Create              
--                       Instance End                
Stop a process           Stop                        
Environment              Environment(b)              
System 
Instance
<system name> <instance kind> Substructure
Instance
<system name> <instance kind> Block
Instance
<block name> <instance kind> Process
Instance
<process name>
<instance kind>
<instance number> <instance name> - Coregion - Sub Message Sequence Chart State Condition(c) Task Action(d) Comment Comment ---------------------------------------------------
(a)
See "Implicit Reset" on page 251.
(b)
The system's environment is denoted by 1:env
(c)
The mapping is only completely valid for a condition connected to only one instance. A condition connected to several instances expresses a logical AND-combination of the states of the processes corresponding to those instances.
(d)
The action symbol corresponds to a task symbol containing informal text. This translation is, however, not supported when generating an MSC from a simulation.

Generating the MSC

When running the simulation, each SDL event of interest (in the scope of MSC Trace) that takes place will cause the corresponding MSC symbol to be drawn immediately in the drawing area of the MSC Editor.

Drawing Conventions

Layout

Default layouting algorithms are used. Each event causes the insertion point to be translated downwards with one vertical spacing unit, keeping the intuitive feeling of absolute order between events. An event could be, for instance, the output or the input of an SDL signal. However, if an output event is immediately followed by an input event, no translation will take place.

Auto-Resizing of MSC

The Message Sequence Chart Editor will automatically enlarge the MSC size when the MSC has grown so that it reaches the bottom or right of the Drawing Area. The MSC is enlarged according to a preference parameter.

Messages

A distinction is made between the reception and the consumption of messages:

Create of Process

Process Stop

Timers

Implicit Reset

The implicit reset timer status is a non-ITU addition to the MSC Editor. An implicitly reset timer is immediately set again to its original parameters after reset. It is illustrated in the same way as a reset timer, but the status information is reflected in the Info dialog (see "Requesting Detailed Information on an Object" on page 194).

Instances

The Environment Instance

All interchange of information between the SDL system and its environment is displayed by sending / receiving messages to or from an instance with the name 1:env. This instance is normally placed at the left of the drawing area.

The Void Instance

Graphically, in the Message Chart Editor, the concept conditional trace (see "Scope of Trace for Generation of Message Sequence Charts" on page 1831 in chapter 32, The Simulator) is illustrated as sending or receiving messages to / from an instance with the name Void. The purpose of the Void instance is to document that a message exchange actually took place without focusing on the sending / receiving instance.

The Instance Name and Instance Kind Text Fields

The ITU recommendation Z.120 allows several ways of using the two text fields Instance Name and Instance Kind. This was discussed earlier in "Adding an Instance Head Symbol" on page 201.

When generating a Message Sequence Chart, the SDL Process Name and the internal instance number managed by the simulator monitor are concatenated to build up one (MSC) Instance Name. The SDL diagram type and diagram name are concatenated to build one Instance Kind.

Example 6 : Instance Name and Instance Kind in Simulation Trace   
Assume the simulation program contains an instance of the SDL diagram type = process with the diagram name = Demon and monitor instance number = 2 This would be displayed as the following instance:

Figure 141 : The Use of the Instance Text Fields in a Simulation. 
-----
(fig)  
       
-----
  

Terminating the Trace

Having terminated the trace (either by stopping the simulation or turning the MSC trace off), the user is responsible for saving the Message Sequence Chart(s) that are the results of the simulation.


Footnotes

(1)
SDL-PR is the textual form for the Z.100 definition.
(2)
The implicit reset concept exists in SDL. It means setting a timer that was already set.
 
Table of Contents Next Chapter