![]() |
![]() |
![]() |
![]() |
![]() |
Working with Diagrams
This section describes the methods you use when performing the following tasks on SDL diagrams:
- Creating a Diagram
- Including a Diagram
- Opening a Diagram
- Saving a Diagram
- Saving a Copy of an SDL Diagram
- Closing a Diagram
- Printing a Diagram
- Displaying an Opened Diagram
- Reorganizing a Diagram.
- Transforming the Type of a Diagram
Creating a Diagram
You can create diagrams from within other diagrams. When created, they form part of the current active system in the SDL Editor, and their presence is instantly reflected in the Organizer. This is achieved by inserting SDL diagram reference symbols.
You can also create diagrams as separate unrelated new entities. They will however not be incorporated in the Organizer.
Creating a Related Diagram from Another Diagram
- Open the SDL diagram from where to start.
- Insert the SDL reference symbol.
- Assign the symbol a name.
- Deselect the reference symbol. The Organizer's diagram structure is updated accordingly.
- Double-click the newly added reference symbol. You should specify what action to perform, either:
- Save both the parent and the child diagram later on in your editing session, to make changes permanent.
Example in an Organizer Structure
As an example, in the Organizer structure in Figure 368, a system is shown with only one block diagram.
Suppose the system diagram is being edited. We now add a new block reference symbol, name it Block_B and deselect it. The Organizer diagram structure becomes:
The SDL Suite shows, with the [unconnected] identifier, that the newly added reference symbol is not yet connected to any physical file.
Now, double-click the Block_B symbol. Specify whether you want to create a new file or to connect the newly created block to an existing file.
Make sure the Show in Editor radio button is on and click OK. In some cases a new dialog appears, where you are to specify the name and type of the first SDL page to add to the diagram (an SDL diagram must contain at least one SDL page).
Assign a page name (see Adding a Page) and click OK.
A new block diagram with the name Block_B is created. The SDL Editor responds by issuing a window showing this diagram. Also, the Organizer's diagram structure is updated, showing the new diagram icon, inserted at the corresponding place in the SDL hierarchy.
Figure 370 shows the result:
Creating an Unrelated New Diagram
- Select New from the File menu of the SDL Editor. A dialog will be opened.
- Enter the name of the new diagram in the Diagram Name field. The name should be in keeping with SDL naming conventions.
- Choose the type of diagram from the diagram type menu.
- Click New. In some cases a new dialog box is shown where you can add a page, as each diagram must have at least one page. See the section Adding a Page for this.
Including a Diagram
Including a Diagram into the SDL Hierarchy
When you have created a diagram, it needs to be brought into the SDL hierarchy to be available for future selection in the Organizer. Otherwise, you will only be able to open it from the SDL Editor.
- Create the diagram using the New command from the SDL Editor. Save the diagram on file.
- Open the diagram that will have a reference to the newly created diagram.
- In the diagram you just opened, add a diagram reference symbol with a type and name that matches the newly created diagram. A new icon appears in the Organizer structure.
- With the Organizer Connect command, connect the new icon with the file on which the diagram is stored. See Connect.
Once a reference symbol is placed in the newly created page of the new diagram in the SDL Editor, the Organizer is updated to reflect this. This indicates that the SDL hierarchy is updated.
Including a Diagram into the Organizer
If a diagram is not managed by the Organizer (i.e. not contained in the Organizer structure) you must first include it into the Organizer, before you can start the SDL Editor.
- Select the place in the Organizer where you want to add the SDL diagram. It will be added as a new root diagram after a selected document or chapter, or at the top level of a selected module.
- Select the Organizer's Add Existing command from the Edit menu. A file selection dialog will be opened.
- Select a SDL diagram file.
Opening a Diagram
There are several ways you can open a diagram for editing, depending on where you are and what you need to access.
Lock Files and Read-Only Mode
When you open a diagram or document file, i.e. a.ssy, a lock file a.ssy.lck is created. If another user tries to open the same diagram or document file before you close it, a dialog will appear informing the other user that the file is in use.
There are two choices in the dialog:
- Open the file in read-only mode.
- Reset the lock and open the file in read-write mode. (This alternative should only be used if the existing lock file is obsolete.)
The read-write mode is the normal editing mode. In read-only mode, you are not allowed to make any changes to the diagram.
You will also enter read-only mode if you open a diagram file that you do not have write permission for. The read-only mode is indicated by the words read-only in the window title.
If you want to edit a diagram that is in read-only mode, here are two alternative actions:
- Change the file access rights in the file system to give you write permission for the diagram file. Then change from read-only mode to read-write mode with the Revert Diagram operation.
- Use File >Save As to save the diagram in a new file with write permission.
Opening a Diagram File from the SDL Editor
- Select Open from the File menu or click the quick-button for Open. A file selection dialog is opened.
- Select a file in the files list and click OK. If the file is already opened by the SDL Editor, a message is issued.
The status bar at the bottom the SDL Editor provides information about the diagram type and name stored on the file which is selected in the file list.
Opening a Diagram from the Organizer
You can open a diagram in different ways:
- Select an SDL diagram icon or the text line next to it in the Organizer. Select Edit from the Organizer's Edit menu.
- Double-click on an SDL diagram icon in the Organizer.
Opening a Diagram - via Organizer - to Show Analyzer Reports
When analysis has been performed, you can show the source of Analyzer error reports in an SDL Editor.
- Select Show Error from the View menu in the Organizer Log Window. An SDL Editor window is opened with the source of error (i.e. an SDL symbol) selected.
Opening a Diagram via a Reference Symbol
You can open a diagram from the SDL Editor by double-clicking on a reference symbol, or by using the Navigate command.
- Locate the SDL reference symbol referring to the diagram you want to open.
- Double-click the symbol or select it and choose the Navigate command from the Tools menu. The diagram is opened.
Opening a Diagram from the Simulator
If you have performed a GR trace in the SDL Simulator, invoking the Show-Next-Symbol or Show-Previous-Symbol simulator commands will display either the next symbol to be executed or the previously executed symbol in a diagram in an SDL Editor window.
Opening a New (Nonexisting) SDL Diagram
To open a new SDL diagram, you either use an unconnected SDL diagram icon or add a new SDL diagram icon.
Opening an Unconnected SDL Diagram Icon
To open an existing but unconnected SDL diagram icon:
- Select an unconnected SDL diagram icon in the Organizer.
- Double-click the SDL diagram icon. A dialog is opened.
- Make sure the Show in editor option is set. Click OK. A new, empty diagram is opened.
Opening a New SDL Diagram Icon
To add a new SDL diagram icon to the Organizer and opening that icon:
- Select the place in the Organizer where you want to add the SDL diagram. The diagram will be added as a new root diagram after a selected document or chapter, or at the top level of a selected module.
- From the Organizer's Tools menu, select the Editors > SDL Editor command. A new SDL diagram icon is added to the Organizer structure, and the new diagram is opened in the SDL Editor.
- Alternatively, select the Organizer's Add New command from the Edit menu. A dialog is opened. Select a SDL diagram type, enter a name in the New document name field and click OK. The Add Page dialog is displayed, see Adding a Page.
Opening an Existing SDL Page
To open a specific page, the SDL pages must be visible in the Organizer diagram structure.
- To display page icons in the Organizer, select the Organizer's View Options command from the View menu. In the dialog, make sure Page symbols is highlighted and click Apply.
- Select the icon representing the SDL page in the Organizer.
- Double-click the SDL page icon. The SDL diagram page is displayed.
Saving a Diagram
There are several ways to save a diagram. The effect is saving any changes made to either one specific diagram, or all diagrams modified during the current session.
Saving a Diagram in the SDL Editor
Saving All Diagrams in the SDL Editor
You can make a global save of all the diagrams that are open in the current session and have been modified.
Saving a Copy of an SDL Diagram
You can save the diagram being edited into another file. You may either continue working with the original file or with the newly created copy.
Continue Working with the New Copy
- Select Save As from the File menu. A file selection dialog is issued.
- Click OK. The SDL diagram is copied to the specified file, the file containing the original is closed, and the window where you made the save remains open for editing the newly created file.
Continue Working with the Original
- Select Save a Copy As from the File menu. A file selection dialog is issued.
- Click OK. The SDL diagram is saved on the specified file, and the window where you made the save remains open for editing.
Closing a Diagram
Closing a diagram also means closing all instances of all windows displaying any page contained in that diagram.
Printing a Diagram
You can print an entire SDL diagram or a selection of pages or objects contained in the diagram. You print multiple SDL diagrams from the Organizer.
See The Print Dialogs in the SDL Suite and in the Organizer.
Displaying an Opened Diagram
You can open the diagram that is currently read by the SDL Editor. (The diagram that you would like to see may reside in a window which is not on top of the screen.)
The Diagrams menu shows all SDL diagrams and pages (up to a maximum of the last nine to have been used). If more than nine pages are open, a tenth menu choice, List All, provides access to a list dialog where all diagrams and pages are listed.
Reorganizing a Diagram
The SDL Editor can reorganize the layout of an SDL diagram, for instance if you run out of space on any of the pages that build up the diagram.
- Display the diagram you want to reorganize.
- Select Tidy Up from the Tools menu. A dialog is opened.
- Click Tidy Up. The SDL Editor reorganizes the diagram (this may take some time, depending on how complex your diagram is).
- Check the diagram before continuing working with it (you can undo the operation from the Edit menu).
Transforming the Type of a Diagram
A useful operation when e.g. transforming to a more object-oriented version of the SDL system is to change the SDL88 diagrams into type diagrams and make instantiations of these types. The following shows some examples how to perform such an operation and similar ones where you want to change the type of a diagram or want to work with an SDL structure that is almost a copy of an already existing hierarchy.
Example 1
Assume that the system S consists of block B, which contains process P. The exercise to solve is to transform the block into a block type BT and put this into a package P and instantiate the block B from BT.
There is no direct command to accomplish this task in the SDL Suite; instead there are many solutions, more or less complicated and time consuming. The proposed one is easy to use and will take advantage of the possibility to cut and paste complete sub-hierarchies, thereby eliminating loosing file connections and the need for making manual connections to existing files.
Solution: Open the system S, add a new block type symbol and name it BT. Open the block B and change the kernel heading from "block B" to "block type BT". Note that the sub-hierarchy in the Organizer, previously below B, has now been moved to BT. In system S, change the text in the block symbol to "B:BT" to make it an instance of BT and cut the block type symbol to the clipboard. Create a package diagram named P and paste the block type into this diagram.
To make the new system complete you need to add the text "use P;" in the package reference symbol in system S, define the gates inside the block type BT and use these gates to connect the existing channels for the block B. If needed, you can change the filename of the block type with the Save As command in the SDL Editor to use a filename that resembles the block type name and also use the file name extension that conforms to the SDL Suite conventions.
Example 2
This is a variant of example 1. Assume we want to keep the original diagram but want to have a new block type BT in package P that is a copy of the existing B.
Solution: In package P place a new block type symbol and name it BT. Double click on it and in the appearing Edit dialog tick the Copy existing file option and use the file connected to the existing block diagram B. Click Continue in the warning about recommended file name extension. In the opened diagram, change the kernel heading to "block type BT".
For all diagram references in BT (in the example there is only one), use the Connect command in the Organizer to connect them to the existing files. In the Connect dialog be sure to use the Expand Substructure option to get automatic connections for possible sub-hierarchies.
As an alternative to connecting the diagram references you can copy the reference symbols from block B and paste them into block type BT, then you will get automatically all the connections for sub-hierarchies below the pasted references.
Note that in either case you will use the same file connection for process P in our example for both the original process and also for the process P referenced in the block type, meaning that if you change the contents of this file you will change both the behavior of the block B and the block type BT, which might lead to unexpected results. If you want unique file connections you should take a copy of the existing file, for example copy P.spr to P1.spr, and reconnect one of the processes to this new file instead.
Example 3
The SDL system consists of system S, block B, process P and procedure subPr inside P. You want to transform most of the process including its procedure subPr into a new procedure Pr defined in the system S.
Solution: This solution is similar to the solution to example 2. Open the system diagram S and place a procedure reference symbol named Pr. Double click it and open a copy of the existing file connected to process P. Edit the kernel heading to contain the text "procedure Pr". Save the procedure as a new file. Connect all referenced procedures inside Pr or copy the procedure references from the process P to get all the sub-hierarchy file connections. Finally edit process P and procedure Pr to make them useful in their new context.
The symbol is dashed and the change is immediately reflected in the Diagram Structure (this is only true if the Dashed Diagram option is on in the Organizer's View Options).
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |