Table of Contents Previous Chapter 3 Tutorial: A First Example
Welcome to SDT!
SDT stands for SDL Design Tool. SDT is a state-of-the-art tool for designing and specifying systems, in particular real-time systems. SDT supports the Specification and Description Language (SDL) as recommended by ITU (the Z.100 recommendation), as well as the definition of Message Sequence Charts (the Z.120 recommendation).
This tutorial assumes that you are already familiar with SDL and have some brief notions about Message Sequence Charts. We will demonstrate, using a simple SDL system as example, the basic functionality that is available in the SDT tool set. You will practice various "hands-on" exercises that will get you more familiar with the SDT tools.
In order to learn how to use SDT, read through this entire chapter. As you read, you should perform the steps on your computer system as they are described.
The purpose of this tutorial is to familiarize the reader with the user interface and the essential functionality in the SDT tools. This tutorial is designed as a guided tour through SDT, where a number of hands-on exercises should be performed on your computer as you read this chapter.
We have on purpose selected a simple example that should be easy to understand. It is assumed that you have a basic knowledge about SDL --- this chapter is not a tutorial on SDL.
This chapter addresses the following groups:
- Persons with no or little experience of previous versions of SDT
- SDT users with experience of SDT 2.3 that want to learn the new user interface concepts in SDT 3.02.
Once you have practised on the exercises that are contained in this tutorial, you may want to practise with the next tutorial which is presented in chapter 4, Tutorial: An SDL-92 Example. That tutorial addresses issues that require a deeper knowledge about SDL-92 and its object oriented extensions.
The example that has been chosen in this tutorial is a simplified version of the "Demon game", which is a well known example in the SDL community, since it is, among other things, used as example in the SDL recommendation.
The SDL definition of the Demon game may be found in SDL-GR form later in this chapter (see "Appendix A: The SDL-GR Definition of the DemonGame" on page 209). The definition of the behavior of the Demon game is probably not the simplest way of describing the game, but it has been selected since it is good for demonstrating the facilities of simulation and validation in SDT.
Seen from the environment, the behavior of the system is as follows. The system accepts four different types of signals, Newgame, Endgame, Probe, and Result, where the first two signals are used to start and end a game. Only one game at a time can be played, that is, Newgame signals will be ignored when a game is in progress and Endgame will be ignored if there is no game in progress.
The game in itself is very simple. A "demon," which in the system is represented by the process Demon, changes the status of the system every now and then between winning and losing. This is represented by the states Winning and Losing in the process Game. The user is to guess when the status is winning. If the user probes (outputs the signal Probe), when the status is winning, he wins one point. If the user probes when the status is losing he loses one point. The system responds to a Probe signal by either a Win or a Lose signal. To see the current score the user can issue a Result signal, which will be answered by a Score signal containing an integer parameter giving the current score.
You should create a dedicated directory for the purpose of this tutorial. In the remainder of this chapter, we will assume that this directory is identified by ~/demon_game
Your first task is to start the SDT environment:
- Change directory to the demon_game directory:
cd ~/demon_game
- Now, type:
sdt
----------------------------------------------------------------
Note:
If the command sdt is not found, you first have to set up your
$path variable correctly. Consult your system manager or the per
son that is responsible for the SDT environment at your site.
----------------------------------------------------------------
After a few seconds, SDT responds by displaying the Organizer window. The Organizer is the main tool from which you have access to the tools that constitute the SDT environment.
Figure\x11 11 : The Organizer Window.
-----
(fig)
-----
The Organizer also displays the SDT Welcome window, where you may read information about SDT. The window is always placed on top of the Organizer window and disappears as soon as you perform any action in the Organizer (you may also click the Close button).
Figure\x11 12 : The SDT Welcome Window.Figure legend: The text that is displayed
onyour computer may differ from the one in the picture above. Please spend a few
momentsreading it, since it may contain essential information from your system
manageror the person that is responsible for the SDT environment at your site.
-----
(fig)
-----
You are now ready to start working with SDT.
- To set up and save preferences
- The basics of the graphical user interface in SDT, operated from the mouse and the keyboard. You will learn to:
- Use graphical lists
- Use pull-down menus
- Use pop up menus
- Use quick buttons
- Use the status bar
- Use option menus
- Use text fields
- Use slide bars
- Use keyboard accelerators.
Before starting creating your first SDL diagram, you should set up some preference parameters to match your computer environment. These parameters affect the default behavior of the SDT tools and should be adjusted to convenient values in order to have SDT function properly (most options in SDT may be set as preferences). When SDT is installed, the factory settings are used as preference settings. Your system manager may have already prepared the SDT environment; good advice is to check this anyway.
At least the following should be checked:
- The help preferences
- The printer preferences
- The drawing area size
- The platform mode.
To view and possibly change the preference parameters:
- From the Organizer's Tools menu, select the Preference Manager command. To select a command: point on the Tools menu, click the left mouse button, locate the Preference Manager menu choice and click on it. After a few seconds, the Preference Manager window is displayed:
Figure\x11 13 : The Preference Manager Window.
-----
(fig)
-----
Your next task will be to check and, if required, modify a few preferences.
SDT supports a context-sensitive Help facility that you may use at any moment to request help on a window, on a command, on a dialog etc., without having to leave the SDT environment.
A simple SDT Help Viewer is included in the SDT distribution to make sure you always can use the Help facility. However, you may take advantage of extended functionality and features by using other Help viewers. In this case, the Help facility requires that your computer environment supports either FrameMaker\xaa , FrameViewer, FrameBuilder, NCSA Mosaic or Netscape.(1).
We recommend you if possible to use the FrameMaker version because of its overall better impression. The information that the different viewers provide is however equivalent.
To set up the Help Preferences:
- Locate the icon titled Help. You may need to scroll the window downwards to find the icon.
- The icon represents a list structure that is collapsed (meaning that it has a substructure which is invisible, indicated with the small triangle below the rectangle). To make the tree visible, you must expand it with a double-click on the icon, i.e. click twice with the left mouse button in rapid succession while pointing on the icon.
- Alternatively, click on the icon with the right mouse button --- a pop up menu appears --- and select the Expand command.
- Four preference parameters are displayed. Start by locating the preference parameter HelpViewer. The first item to the right of the icon shows the current value. (The next item, within parentheses, denotes the currently saved value).
If you scroll the window to the right, you will see an explanatory text.
Figure\x11 14 : The Current and Saved Value, Followed by an
Explanatory Text.
-----
(fig)
-----
- To change the option: select the HelpViewer icon. Click the option menu that appears at the bottom of the window and select the appropriate value (you may need to ask your system manager if you do not know what viewer to use). You may also note that the tool shows that the parameter has been changed and needs to be saved for future sessions by filling the icon with a gray pattern.
- SDT is the value for the Help Viewer included in the SDT distribution. You should not select the value Cello, since it is a Help viewer intended to be used on PC systems only.
- Depending on your choice of viewer, you should now check that the command SDT uses when starting the Help Viewer is correct, according to your computer environment. Locate and select the icon titled FrameMakerCommand, MosaicCommand, or NetscapeCommand. Here again, the right column shows the current value. If the current command is not correct, change its value.
- There is no start command needed for the SDT Help Viewer.
- If you use Netscape, you still have to start Netscape manually prior to using the Help facility in SDT.
- To change the command: The bottom of the window shows a text field. Place the cursor into the text field and change the contents to the value of your choice (if required, ask your system manager).
- You may now collapse the Help node, i.e. the reverse operation to expand. To do this, double-click the icon.
You have now learned how to work with graphical lists in SDT. Graphical lists are used extensively throughout the tools; They may hold as many levels as required (the Preference Manager uses three levels of indentation, as seen on the screen).
Some tools also support a vertical tree as an alternative to a graphical list. The functionality is identical, only the presentation differs. You will acquaintance yourself with a graphical tree later in this tutorial.
In this tutorial, you will learn how to print diagrams. Before you start printing from SDT, you should check and, if needed, set up your print preferences in accordance to your computer environment.
To set up the Print preferences:
- Locate the Print icon. Expand it.
- Locate the PrinterCommand parameter. Adjust it to an adequate value (if required, ask your system manager). You may specify any suitable operating system command, for instance sending the resulting PostScript printouts to a printer queue or previewing the PostScript file in a pre-viewer such as Ghostview(2).
- Locate the PaperFormat parameter. SDT supports a number of predefined paper sizes on the option menu (A4, A3, US Letter and US Legal). You may also specify an arbitrary UserDefined value, in which case you need to specify the parameters UserDefinedWidth and UserDefinedHeight; these values are expressed in millimeters.
- Adjust, if required, the parameters MarginUpper, MarginLower, MarginLeft and MarginRight. These parameters govern how much space will be reserved for the margins on the printed pages; you may use this space for including headers and footers in your printouts.
- To adjust these parameters, select them and drag the slider for a coarse adjustment. Terminate by clicking left or right of the slide bar to adjust in steps of 1 millimeter at the time.
- Adjust, if required, the parameter Landscape to on or off (this parameter specifies the orientation, landscape or portrait).
When editing SDL diagrams, SDT creates pages that are assigned a predefined size. You should specify the default size to match the size of the printer pages that you defined in the previous exercise.
- Locate the SDL Editor icon, expand it and inspect the parameters PageWidth and PageHeight.
- If required, adjust these parameters to suitable values.
When running SDT, you may enable support for mixed platforms, meaning that a system can be used on both UNIX and PC platforms. You should make sure this support is turned off during this tutorial.
- Locate the SDT icon, expand it and inspect the parameter MixedPlatform.
- If required, turn the parameter off by selecting it and clicking the radio buttons that appear at the bottom of the window.
---------------------------------------------------------------
Note:
If you change this parameter, you must exit and restart SDT di
rectly after having saved the Preferences (which is described
next). To exit SDT, select Exit from the Organizer's File menu.
---------------------------------------------------------------
You should now save your preference settings for future SDT sessions. To do this, select the Save command from the File menu.
- Alternatively, you may click the quick button for Save. Quick buttons are located in a tool bar which may be found immediately beneath the menu bar; quick buttons are mouse accelerators for frequent commands and are available in all SDT tools, not only in the Preference Manager.
- You may "preview" the functionality that a quick button provides by pressing the mouse while pointing on the quick button; the status bar (situated at the bottom of the window) displays an explanatory text. Make sure you do not release the mouse button until you have moved the mouse outside the quick button.
- Another possibility is to type the keyboard accelerator for the Save command, by pressing the <CTRL> key and hitting S. This is indicated immediately to the right of the menu choice Save (c-S).
Your preferences are now saved on file for the current (and for future) SDT sessions. Close the Preferences window by selecting the Exit command from the File menu.
This concludes your Preference session. You may of course at any moment go back to the Preference Manager and adjust other parameters.
You are now ready to create your first SDL diagrams with SDT 3.02.
- To create an SDL structure
- To add a system root node
- To create a system diagram
- To add a page
- To edit a system diagram
- To save a diagram on file
- To save a diagram structure on a system file
- To work with dialogs (modal and modeless)
- To work with tree structures.
You should now go back to the Organizer. You will create an SDL system, working in a top-down fashion:
- Select the New command from the File menu. A dialog is issued, the New System dialog, prompting you to specify the name and type of system to create.
Figure\x11 15 : Creating a New System.
-----
(fig)
-----
- You may note that the cursor changes to the shape of a question mark as soon as it points on the parent Organizer window. This convention has been adopted in SDT to indicate that a dialog must be closed before any other operation is allowed to take place in the tool. Dialogs that need to be answered before proceeding further are called modal dialogs.
- Specify the root diagram type as System.
- If the diagram type needs to be changed, click the option menu.
- Specify the name of the root diagram name as DemonGame (the default name, Untitled disappears).
- You may need to point and possibly click with the cursor on the text field to set the focus on it.
- Click the New button.
The dialog disappears and the Organizer window is updated to show an area titled Diagram Structure, containing, so far, the root node --- system DemonGame.
Figure\x11 16 : The Root Node.
-----
(fig)
-----
Beneath the Diagram Structure, you may find another area titled Associated Documents, so far empty. This area will be used for other documents than those building up the Diagram Structure for the current system, DemonGame. You will have the opportunity to practice on the Associate Documents Area later in this tutorial.
You have so far created an Organizer Diagram Structure, consisting of one reference to an SDL system diagram (the referred diagram does however not yet exist).
Your next task is to create the diagram:
- Make sure the SDL system diagram icon is selected (this is indicated by the dark selection squares surrounding the icon, as in Figure 16).
- From the Edit menu, select the menu choice Edit Diagram.
- You may also press the right mouse button while pointing on the icon --- a popup menu appears --- and select the command Edit Diagram.
- Another way to edit the diagram is to double-click the icon with the left mouse button.
- A dialog is issued, informing you that the diagram is unconnected (meaning that there is no physical connection to a file; this makes sense since the diagram does not exist).
Figure\x11 17 : Prompting to Connect a Diagram to a File.
-----
(fig)
-----
- Since you are to create a new diagram, make sure the New radio button is turned on and click the Edit button.
- A new dialog appears, prompting you to specify an SDL page to add to your diagram (SDT requires SDL diagrams to contain at least one page; you may add as many pages as required)
Figure\x11 18 : Prompting to Add a Page
-----
(fig)
-----
- Type in a suitable page name (we assume that you enter the name 1, as in Figure 18) and click the OK button.
After a few seconds, SDT responds by displaying the SDL Editor window, showing the upper left corner of page 1 of the system diagram DemonGame.
Figure\x11 19 : The SDL Editor Window.
-----
(fig)
-----
The SDL Editor is the tool you use when editing the contents of the diagrams. The SDL Editor is also used for building the diagram structure that is displayed in the Organizer window.
Your next task is to fill in the contents of the diagram. Figure 20 shows the appearance of the diagram when completed and printed on paper. As you can see, the diagram consists of two block reference symbols (GameBlock and DemonBlock), a channel conveying the signals between the blocks (C3) and two channels conveying the signals to and from the environment (C1 and C2). There is also a text symbol where the signal declarations may be found.
Figure\x11 20 : The System Diagram.
-----
(fig)
-----
The next pages describe in detail how you proceed to add the symbols and texts to the diagram.
Before you start editing, you may want to resize the editor window. You may also hide and show various sub-windows using the command Window Options from the View menu.
Figure\x11 21 : The Window Options.
-----
(fig)
-----
- You may also hide and show the text window and the symbol menu by clicking on the provided quick buttons. You will however need these windows within soon.
- Start editing the diagram by inserting the block reference symbols.
------------------------------------------------------------------
Note: Undoing last operation
If you happen to perform a command or operation that you wish not
had taken place, you should immediately select the Undo command
from the Edit menu.
------------------------------------------------------------------
To place a block reference symbol:
- Click on the block symbol in the symbol menu (located to the extreme right of the window).
- Move the mouse into the drawing area and click to position the symbol. No overlap between symbols is allowed.
- Once you have placed the symbol, type the name of the block: DemonBlock
- When you enter text, you may take advantage of the text window, situated below the drawing area. You may also type in text directly without moving the cursor to the text window, in which case the text is simply appended to the symbol.
- You may also note that the Organizer diagram structure is automatically updated to reflect the insertion of the diagram reference symbol.
To move a block:
- Point to it and drag the block to the desired location, i.e. move the pointer while keeping the mouse button down and let go off the mouse button when the new location is reached. (Remember, no overlap with other blocks is allowed).
After you place the blocks where you want them, you may resize them as follows:
- Point to one of the symbol's corners, and drag. You must be fairly close to the corner. If this method fails, first select the symbol with a click and then repeat the procedure while pointing to a selection square.
- When you are satisfied with the new size, release the button.
To draw a channel from block DemonBlock to Block GameBlock:
- Select the DemonBlock symbol. A "handle" appears.
Figure\x11 22 : A "Handle".
-----
(fig)
-----
- Drag the handle (i.e. press the mouse button while pointing on the handle, and start moving the mouse while keeping the mouse button pressed).
- As soon as mouse motion has begun the editor responds by drawing a line; from now on you may release the button while moving the mouse.
- Move the mouse until it points to the GameBlock symbol. Release the mouse button; the channel is connected at both ends.
- You may move the channel's endpoints individually by dragging them. Select the channel first if the endpoint is difficult to "hit" with the mouse.
The SDL Editor creates two text attributes associated to the channel. These text fields are displayed as selection rectangles which you use when entering the name of the channel and the list of the signals the channel is to convey.
Figure\x11 23 : The Channel's Text Attributes.
-----
(fig)
-----
To fill in the name of the channel C3:
- You may type it directly immediately after the channel has been drawn.
To fill in the signal Bump into the signal list text field:
- Click on the text field surrounded with two brackets `[ ]'.
- Type in the name of the signal. Note that the brackets are adjusted automatically to fit the size of the text.
- You may move the text attributes to new locations, if desired. Simply drag them with the mouse.
To draw a channel from a block to the environment (e.g. C2):
- Select the block.
- Start by dragging the handle, and terminate by clicking on the frame symbol (the rectangle that encloses the diagram, see Figure 26 on page 66).
- Fill in the name and signals. You may note that an additional text object is created close to the frame symbol; this text object is a graphical connection point that you would use if the diagram was, for instance, a block diagram. But, on system diagrams, simply leave its contents empty.
Figure\x11 24 : The Connection Point.
-----
(fig)
-----
To draw a channel from the environment to a block (e.g. C1):
- Start by drawing the channel from the block to the environment, as you just learned.
- Make sure the channel is selected.
- Then, select the command Redirect from the Edit menu. Fill in the name and signals the usual way.
The diagram also contains a text symbol with the required signal declarations.
- Pick the text symbol in the symbol menu, insert it into the drawing area and fill in the contents as shown in Figure 20.
- When the contents of the text symbol are changed, the editor automatically resizes the text symbol to fit the text. You may resize it by dragging the lower right corner, or toggle between its minimized and maximized sizes by double-clicking the symbol. Try this.
If the text window is too small to bring all the text in view, you may resize it by dragging the sash up or down; the sash is the small square situated to the right and above the text window menu bar; the text window is a pane of the SDL Editor window.
Figure\x11 25 : The SDL Editor's Sash.
-----
(fig)
-----
Figure\x11 26 : Other Symbols.
-----
(fig)
-----
The package reference symbol is used to refer to included SDL packages; this simple example does not however include any packages. Just leave the symbol empty.
The kernel heading symbol is automatically assigned its contents by the tool to reflect the type and the name of the diagram being edited. This symbol is editable; this topic is however beyond the scope of this small example, so you should not alter its contents.
The additional heading symbol is not defined further according to Z.100. In SDT, it looks like a dashed text symbol. The symbol is editable and may be resized the same way as you learned for resizing text symbols, but it cannot be moved. Its intended use in SDT is, among others, to define inheritance and specialization and to specify formal parameters. You will not use this symbol in this tutorial.
The frame symbol is added automatically by the editor. It surrounds the objects that are contained in your diagram. You may want to resize the frame symbol to create a more compact diagram; simply drag any corner to do this.
-----------------------------------------------------
Note:
The frame symbol is not the same as the paper border!
-----------------------------------------------------
The page numbering symbol is updated automatically by the editor to reflect the name of the page and the total number of pages. It is not editable.
In this exercise, you will practise on the commands that store SDL diagrams on files.
- You should now have two SDT windows on the screen, the Organizer window and the SDL Editor window.
- To find the Organizer window, you may at any time issue the command Show Organizer from the SDL Editor's Tools menu. (The command is available in most SDT tools.)
- Before you save anything, open the Organizer's View Options dialog from the View menu.
- Turn the Diagram File Names toggle button on and click the Apply button. This makes the file names visible in the Organizer.
Figure\x11 27 : The Organizer's View Options.
-----
(fig)
-----
- To close the View Options dialog, click the Done button. This kind of dialog is modeless, meaning that it remains open until you decide it is longer needed and close it. You are not forced to close a modeless dialog to continue working with the tool, in opposite to modal dialogs, such as the New dialog which you used for creating a new system (see Figure 15 on page 57).
- Look at the resulting Organizer view. The icon is drawn with a gray pattern, which shows that the diagram is modified and not saved. The text to the right of the icon reads [unconnected] which is a convention adopted in SDT to show that a diagram has no current binding to a file.
Figure\x11 28 : A Modified, Unconnected Diagram.Figure legend: The diagram
substructureis also visible on the screen. The picture shows only one diagram symbol for
thesake of simplicity.
-----
(fig)
-----
- Now, save the SDL diagram by selecting the Save menu choice from the from the SDL Editor's File menu.
- To locate the SDL Editor window from the Organizer, you may double-click the icon for the system diagram again, which simply raises the SDL Editor window.
- A file selection dialog is displayed. This is a generic dialog that SDT issues whenever you are prompted to specify a file (to open, to save etc.). The title of the dialog shows the nature of the operation, SDT Save in this case.
Figure\x11 29 : A File Selection Dialog.
-----
(fig)
-----
There are two other diagram icons, which are [unconnected] These represent the references to the block diagrams that you added when editing the system diagram.
You have, so far, saved the system diagram. You should also save the Organizer's view options and diagram structure for future sessions. If you look at the window title, you notice an ending asterisk. This asterisk denotes that the Organizer's view or structure information has been modified and needs to be saved.
Figure\x11 32 : The Organizer Window Title.
-----
(fig)
-----
The Organizer saves its view, along with a number of options, on a dedicated file called the system file(3). System files are used as a means to maintain the consistency of an SDL structure and provide immediate access to the diagrams that are defined in the structure.
To facilitate reusing the system file for future SDT sessions, we suggest that you specify the Organizer's Source Directory before saving the system file (basically, the directory where SDT will look for existing diagrams, and save newly created diagrams).
To specify the Source Directory:
- From the File menu, select the menu choice Set Directories.
- The Set Directories dialog is issued. Type in the name of your working directory as Source Directory or, alternatively, click on the folder button to display a Directory Selection dialog where you specify the directory of your choice (see Figure 33).
Figure\x11 33 : Specifying the Source Directory.
-----
(fig)
-----
To save the system file:
- Select the Save command from the File menu. The Organizer responds by issuing the Save dialog.
Figure\x11 34 : The Organizer's Save Dialog.
-----
(fig)
-----
- The tool suggests a file name to store the information on: demongame.sdt (system files are by default assigned the extension .sdt). Accept the suggestion by clicking the Save button.
Once a system file has been created, the diagram structure and the Organizer options are saved for future sessions. You may Open an existing system file from the Organizer's File menu.
For the purpose of this tutorial, you have learned how to save individual diagrams and how to save the system file. There are however other handy ways to save everything with one single command. Two of these methods are listed below.
- You may click the Save All button in the Organizer's Save dialog (see Figure 34).
- You may click the quick button for Save on the Organizer's tool bar. This button orders a global and silent save of all diagrams (no prompting will be issued unless special cases need the user's attention), including the diagram structure. (The SDL Editor's quick button for Save saves the current diagram only.)
- To print one SDL diagram
- To adjust print options
- To scale a printout.
You have now drawn your first SDL diagram. It may be convenient to print the diagram before proceeding with the remaining exercises. We assume that your computer environment includes a PostScript printer. If not, you may skip this exercise.
To print the diagram:
- Raise the SDL Editor window.
- Select the Print command from the File menu.
- You may instead click the quick button for Print.
- The Print dialog is issued.
Figure\x11 35 : The Print Dialog.
-----
(fig)
-----
- If you have set up your preferences adequately, the dialog should be preset with the correct options. If not, you need to check and possibly modify at least the:
- To invoke the Analyzer
- To set analysis options
- To work with the Organizer Log window
- To locate and correct syntax errors.
You should now check the syntax of the system diagram you created before proceeding further by creating the remaining diagrams. To do this, you will use the Analyzer tool, a back-end tool which is fully integrated with the Organizer.
- Select the SDL system diagram icon in the Organizer Diagram Structure. Then, from the Organizer's Generate menu, select the Analyze command.
- If you had (perhaps accidentally) modified any diagram, the Organizer first prompts you to save modified diagrams (by issuing the Save dialog, see Figure 34 on page 72) --- in which case you should click the Save All button to make sure everything is OK.
- Once the Save before Analyze dialog is closed, the Organizer issues the Analyzer options dialog.
Figure\x11 37 : The Analyzer Options Dialog.
-----
(fig)
-----
- Adjust the options in accordance to Figure 37, i.e.
- Macro expansion off
- Syntactic analysis on
- Semantic analysis off
- Adjust, if required, the error limit slider bar to a reasonable value. This parameter defines how many errors and warnings the Analyze will report before aborting the analysis.
- Click the Analyze button. First, SDT asks you to confirm the analysis of a system that contains diagrams not connected to files:
Figure\x11 38 : Confirming to Analyze a System with Unconnected Diagrams.
-----
(fig)
-----
- The Analyzer now starts processing the input with the options as specified in the options dialog. After a few seconds, the Organizer status bar should read something with the essence "Analyzer ready", possibly appended with extra information.
- Raise the Organizer Log window, if required, and look at the results. (Use the Organizer Log command from the Organizer's Tools menu to show the window).
The diagnostics that are reported by the Analyzer are appended to the Organizer Log (together with other important messages). Look at the tail of the log for the report summary, which should look something like:
--------------------------------------------------
Number of errors: <diagram dependent>
+ Analysis completed
(You may need to scroll down the Organizer Log window to bring the tail into view.)
The number of errors shows how many syntactic errors that were detected in the diagram (if no errors were found, then this line is missing in its whole). For the purpose of this exercise, you may need to introduce a syntactic error into the diagram. You may for instance remove one of the separating commas in a signal list. Save everything and repeat this exercise.
Your Organizer log should now report an error looking something like:
#SDTREF(SDL,/home/tord/demon_game/demongame.ssy(1),1
31(25,50),3,8)
ERROR 312 Syntax error in rule SIGNALLIST, symbol Name
found but one of the following expected:
, ; comment
Result Endgame;
?
Let us spend a few moments on explaining the contents of this error.
- The first part (#SDTREF...) is a reference to the source diagram, page, symbol, line number and finally a position within a line of text where the error was found. All references produced by the Analyzer adhere to this format in its whole or partially; the reference may in some circumstances be less precise than in the example above, depending on the Analyzer's ability to locate the exact source of error.
- The second part (ERROR 312...) contains the error number and an explanatory text, telling you, in this case that a comma, a semicolon or a comment was expected.
- The last part (Result Endgame) along with the `?' character shows more specifically where the error occurred, in this case the comma should be inserted between the signals Result and Endgame.
To display the diagram and symbol where the error was found, you may use a handy facility:
- Select, by dragging the mouse, the lines of text containing the error message.
Figure\x11 39 : Selecting the Error Message.
-----
(fig)
-----
- Select the command Show Error form the Organizer Log window's Tools menu.
- Alternatively, you may click the Show error quick button.
- The symbol where the error was found is immediately selected in the SDL Editor. The more information the reference holds, the more precise the selection. Correct the error.
- Correct possible remaining errors in a similar fashion.
- Repeat the analysis until the Analyzer does not report any errors longer. If you feel uncertain about how to interpret and correct the errors, look at the printout for the system diagram for a reference (see Figure 20 on page 61).
- You may clear the Organizer Log window at any time, for instance between subsequent passes to make it easier to read the contents of the log. Use the Clear Log command from the Edit menu for this.
You have now designed your first SDL diagram with SDT 3.02. SDT has also verified that the diagram is syntactically correct according to the Z.100 recommendation. Congratulations!
- To create and draw a block diagram
- To request signal dictionary support
- To work with multiple diagrams using the SDL Editor
- To open new windows on a page
- To work with multiple SDL Editor windows
- To perform syntax check on a block diagram.
In this exercise, you will create a block diagram, starting from the Organizer.
- Locate the Organizer window and double-click the icon named GameBlock. In a similar fashion as when creating the system diagram, you will get the Edit Diagram dialog (see Figure 17 on page 59). Make sure the New option is on and click the Edit button. Next, the Add Page dialog is issued.
Figure\x11 40 : Prompting to Add a Page.
-----
(fig)
-----
- This appearance dialog is slightly different from when adding a page to a system diagram. Specify the page name (1, for instance) and make sure the Process Interaction page button is on. Click OK.
- The SDL Editor opens a window on page 1 of the newly created block diagram. The block diagram editor window is similar to the system diagram window; only the symbol menu differ.
Figure 41 shows the appearance of the finished block GameBlock when printed. As you may see, the diagram contains two process reference symbols, five signal routes, three connection points and a text symbol with a signal declaration.
Figure\x11 41 : The Block GameBlock.
-----
(fig)
-----
You should now draw the block diagram as depicted in Figure 41. You add the symbols and lines in a similar fashion as when editing the system diagram. Please spend a few minutes on reading the next pages before starting drawing the diagram, in order to familiarize yourself with the new concepts that are introduced and how you manage them.
When you add a process reference symbol, you should specify the number of instances by appending the text directly after the name of the process reference symbol. The number of instances is the text between parentheses `( )'.
Signal routes are drawn in a similar way as channels. When you select a process reference symbol, two "handles" are displayed.
Figure\x11 42 : The Two Handles of a Process Reference Symbol.
-----
(fig)
-----
- The left handle is used for drawing signal routes, in a similar fashion as channels.
- The right handle is used for drawing create requests. It is not used in this tutorial.
When you draw a signal route to / from the frame symbol, you should not only fill in the name and signal list, but also take advantage of the graphical connection points to establish connections between the signal routes and the parent system diagram, i.e. connecting the signal routes to the channels.
Figure\x11 43 : Graphical Connection PointFigure legend: The figure depicts a
signalroute (R1) in the block diagram and the referencing system diagram with the
connectedchannel (C1).
----------
(fig)(fig)
----------
To edit a connection point:
- Simply select it and enter its textual contents.
Now, draw the diagram as described in the following steps:
- Start by adding the process symbol Main(1,1) and draw a signal route from the environment to the process. Enter the name of the signal route: R1.
- Select the signal list text field. You are now to specify the name of the signals to be conveyed on the signal route R1. SDT has the ability to assist you in reusing the signals that are already defined in the SDL structure (i.e. defined in the system diagram, since you are working in a top-down fashion!). To request signal dictionary support:
- Select the command Signal Dictionary from the Windows menu. After a while, the Signal Dictionary window is displayed.
Figure\x11 44 : The Signal Dictionary Window.Figure legend: The exact appearance
ofthe window depends on the graphical capabilities available on your terminal.
Theremay or may not be additional SDL-like symbols located at the extreme left of
thewindow.
-----
(fig)
-----
----------------------------------------------------------------------
Note:
To function properly, the Signal Dictionary utility requires that the
input SDL diagrams (in this case system DemonGame) are syntac
tically correct. If not, you need to go back to the previous exercise
(see "Correcting Analysis Errors" on page 79) and run the Analyzer
in order to correct any errors.
----------------------------------------------------------------------
- Look at the left list in the Signal Dictionary window. The first section starts with the separator Up. This section includes the signals that are available by looking one level up in the diagram structure (i.e. in the parent diagram, system DemonGame).
Figure\x11 45 : The Up Separator.
-----
(fig)
-----
- In this section, the first item identifies the system DemonGame, as expected.
Figure\x11 46 : The Item Symbolizing the System DemonGame.
-----
(fig)
-----
- Since you are editing a signal route from the system diagram to the block diagram, you should look for all icons symbolizing channels from the parent diagram.
Figure\x11 47 : The Icon Symbolizing a Channel from the Parent Diagram to the
CurrentDiagram.
-----
(fig)
-----
- You should find exactly one channel that matches the criteria: C1. The remaining channels are either internal (C3) or are not directed into the current diagram (C2).
- Beneath the channel all the signals that it conveys are listed. Click on the signal named Newgame.
Figure\x11 48 : Selecting a Signal.
-----
(fig)
-----
- From the Edit menu, select the command Insert. The signal list in the SDL Editor is immediately updated.
- Alternatively, you may double-click the signal in the list.
----------------------------------------------------------------------
Note: Undoing the operation
If you happen to insert the signal into the wrong text field (such as
the signal route name), you may select the Undo command from the
Signal Dictionary's Edit menu. (The SDL Editor's Text Window has
no Undo facility).
----------------------------------------------------------------------
- Insert the required comma and a newline.
- Double-click the signal Endgame.
- The Signal Dictionary also gives a suggestion about how to fill in the connection point: C1.
- Add the process reference symbol: Game(0,1).
- Draw a signal route from Game to the frame symbol.
- When you are to enter the signal list for R4, you do not need to enter the signals one by one as for R1, since the channel C2 is not split up into multiple signal routes, as for C1 that becomes R1 and R2 (see your printout or Figure 20 on page 61). Instead, you may insert all signals with one single operation:
You are now somewhat familiar with the Signal Dictionary utility. Fill in the remaining parts of the diagram using your preferred method. When done, you may close the Signal Dictionary window (use the Close command from the File menu).
You may at any time open a Signal Dictionary window when editing a diagram. Feel free to use it as much as feels meaningful.
Once you are finished with the block GameBlock, save everything, for instance by clicking on the Organizer's Save quick button.
You have now created two SDL diagrams. Both diagrams are currently opened by the SDL Editor; however only the diagram currently being edited is visible in a window.
The SDL Editor provides a menu named Diagrams where all diagrams and pages currently opened by the editor are listed.
- Click on the Diagrams menu. It should now contain two menu choices:
Figure\x11 50 : The Diagrams Menu.
-----
(fig)
-----
Each of these menu choices correspond to a diagram and page currently opened by the SDL Editor. The file the diagram is stored on is also displayed to the right of the diagram name.
Now, bring the diagram for the system DemonGame into view:
- Locate the menu choice name
System DemonGame/1/.../demongame.ssy(4)
- Select this menu choice. The system diagram is instantly displayed. (The block diagram is now hidden.)
So far, you have only worked with one single window on a page. The SDL Editor allows you to open new windows on the same diagram, which makes it possible to work on multiple views on a page. This is also called instantiating a window.
To open a new window on a page:
- Make sure the page whose window is to be instantiated is the page currently in view in the SDL Editor. If not, use the Diagrams menu.
- From the Window menu, select the command New Window. A new window showing the current page is instantly displayed.
Figure\x11 51 : Two Windows on the Same Page.
-----
(fig)
-----
- You may now use any window to work on the page. Any change causes both windows to be simultaneously updated. Try this, for instance by moving a symbol!
- You probably need one window only for this tutorial, since the diagrams you are working on in this tutorial are small, on purpose. Close any of the two windows with the Close Window command from the Windows menu.
Save everything. The resulting Organizer View should now look like:
Figure\x11 52 : The Resulting Organizer View.
-----
(fig)
-----
You may now want to use SDT's Analyzer to check the syntax of the block diagram you just created.
To analyze the block GameBlock, do as follows:
- Select the icon for the block GameBlock to specify the block as input to the Analyzer.
- Select the command Analyze.
- Proceed as for the system diagram, i.e.
With a syntactically correct block GameBlock, the Analyzer should report three warnings about unconnected diagrams. Again, do not bother about these errors.
- To create a diagram from an existing copy
- To save a diagram on a new file
You created the block GameBlock from the Organizer, with the double-click facility. You may also use the function from within the SDL Editor, by double-clicking on diagram reference symbols.
To create the block DemonBlock:
- If the system diagram not currently visible, open the system diagram (DemonGame) in an SDL Editor window (use the Diagrams menu for this).
- Locate the block reference symbol DemonBlock. Double-click on the reference symbol. A dialog is issued, the same as when double-clicking on an Organizer icon.
Figure\x11 53 : Prompting to Create the Block DemonBlock.Figure legend: See step
3 and 4 on page 92 for how to use the dialog.
-----
(fig)
-----
You will now create the diagram by using a copy of an existing file. The SDT installation contains a number of SDL examples, among which the diagrams that build up the DemonGame example may be found. These diagrams are by default stored in a subdirectory to the SDT installation directory. The name of the directory should be $sdtrelease/examples/demongame
Your next task is to specify the location of the file that contains the block DemonBlock. This file is named demonblock.sbk
--------------------------------------------------------------------------
Note:
You may need to contact your system manager to find out the exact
location of this directory. If you fail in finding the directory with the
DemonGame example, do not give up! You may always create the
remaining diagrams with the New option, and design them with the
SDL Editor in a hand-drawn fashion, as you learned in the previous
exercises.
--------------------------------------------------------------------------
- Make sure the Copy existing file button is turned on.
- Then, either:
- Type in the file name, including the directory path,
or
- Click on the folder button to the right of the text field. A file selection dialog (with the title SDT Select Diagram File) is displayed.
Figure\x11 54 : Selecting a Directory.
-----
(fig)
-----
- The right list shows the directory structure, starting from the root node of your file system. The indentation levels reflect the depth in the directory structure.
- To navigate in the directory structure, double-click on a directory. As you do so, the substructure of the directory is displayed. Double-click until you have located the directory where the diagrams are stored.
- Select the file demonblock.sbk that appears in the left list and click OK.
-----------------------------------------------------------------------
Note: Accessing files on other disks
The possibility to change to the [root] directory using SDT's file
selection dialog may or may not work properly, depending on your
computer system.
You may need to type in a leading slash, followed by a name, then
click OK in order to access files that are stored on another disk than
the one you are currently working on (try first to double-click the
[root] directory). (fig)
-----------------------------------------------------------------------
- Close the Edit Diagram dialog by clicking on the Edit button. After a few seconds, the SDL Editor shows the diagram in a window. The diagram when printed should look like Figure 55.
Figure\x11 55 : The Block DemonBlock.
-----
(fig)
-----
- Now, save the diagram from the SDL Editor (use the Save quick button). A file selection dialog is displayed, with the suggested file name demonblock.sbk.
Figure\x11 56 : Suggesting a File Name for the Block DemonBlock.
-----
(fig)
-----
- Accept the suggestion by clicking the OK button. Next picture shows the resulting Organizer's Diagram Structure.
Figure\x11 57 : The Resulting Organizer List.
-----
(fig)
-----
You have now created the structural elements of your SDL system. This structure needs now to be completed with the implementation, i.e. the process flow charts that describe the behavior of the system.
In the previous exercises, you have learned how to create new diagrams, either from the Organizer or from the SDL Editor, so we will not focus on these details any more. Feel free to double-click icons in the Organizer or in the SDL Editor, or to use the Organizer Edit Diagram command, depending on your preference.
In the next exercise, you will instead learn how to use the SDL Editor for drawing process diagrams. Let us start with the process Demon, which is depicted in Figure 58.
Figure\x11 58 : The Process Demon.
-----
(fig)
-----
On the next pages, you will find suggestions about how to use the SDL Editor to draw the diagram.
- To add symbols with the double-click facility
- To work with the clipboard functions
- To insert symbols in a flow
- To request grammar help.
- When creating the diagram (using for instance the double-click facility on the Demon symbol), make sure that the New button is on. When SDT prompts you to add a page, make sure that you specify a page with the type set to Graph Page.
Figure\x11 59 : Specifying Page Type to Graph Page.
-----
(fig)
-----
- When the SDL Editor responds by displaying the (empty) diagram, you notice that the appearance of the symbol menu is different; it now contains the symbols that are allowed on a flow diagram (such as a process diagram).
Figure\x11 60 : The SDL Editor Window on Flow Diagrams.
-----
(fig)
-----
The diagram consists of two of branches of symbols. When you append symbols to a branch, the editor may automatically interconnect the symbols with flow lines.
You may select to enter the text into each symbol once the symbol has been inserted, or insert all symbols and then edit the text, or a mix of both methods. Now, edit the diagram according to the instructions below.
To create the left branch:
- Select the start symbol in the symbol menu and place it in the drawing area at a suitable location.
- When you are to edit the task symbol containing the statement that sets the timer, let us assume, for the purpose of this exercise, that you do not have the grammar for the set statement in mind.
The SDL Editor provides a context-sensitive facility, the Grammar Help window, that assists you in entering correct SDL expressions. You will now use it in order to fill in a correct set expression. Select the command Grammar Help from the Windows menu. The SDL Editor responds by displaying the Grammar Help window.
Figure\x11 61 : The Grammar Help Window.
-----
(fig)
-----
- The left list shows a number of "use cases", each of them identified with their name. The first one is the GRAMMAR for the selected object.
- The top of the right list shows a number of references to the Z.100 definition.
- Beneath the Z.100 references are listed the formal textual (SDL-PR) expressions that are legal to add to the symbol. (The formal expressions need of course to be replaced by the actual values that are used in your context).
- The use case you are to use is the set of a timer, so locate the item titled Set. Click on it with the mouse.
- Insert the formal text into the task symbol by selecting the Insert command from the Edit menu. The task symbol is immediately updated.
- You may also double-click the Set item in the list.
- Now, change the generic names Expr and TimerName to their actual values (1 and T, respectively).
- Double-click a state symbol and enter the text: Generate
To create the right branch:
- Copy the newly added state symbol to the clipboard. You find the clipboard commands, e.g. Copy, on the Edit menu or on the pop up menu that is activated with the right mouse button.
- Paste the state symbol (use the Paste command on the pop up menu). Following Paste, you should specify the location of the new symbol; move the mouse until you point to a suitable location and terminate with a click with the left mouse button.
- Append an input symbol with a double-click. Enter the text: T
- Append the output symbol Bump with a double-click and enter the text.
- Copy the task symbol with the text SET (NOW + 1, T) to the clipboard. But, do not paste right now.
- Point to the output symbol Bump. Press the right mouse button and select the Insert Paste command. This pastes and connects the task symbol.
- Terminate the branch by double-clicking a state symbol and typing a hyphen (-).
- Finally, add a text symbol and type in the declaration of the timer T.
- If desired, resize the frame symbol.
- Save the diagram. This concludes the editing of the process Demon.
First, create the process diagram Game the usual way. In this exercise, you will learn some other editing functions:
This is how you may proceed to edit the process diagram illustrated in Figure 64:
- Insert the start symbol, the following task symbol and the state symbol Losing.
- You will now insert two input symbols in parallel. To do this, first make sure the state symbol is selected. Then, press the <SHIFT> key and double-click two input symbols (the <SHIFT> key must be kept pressed while doing this).
- Release the <SHIFT> key, and select the left input symbol.
- Fill in the name of the input symbol, Probe, and complete the left branch.
- Select the right input symbol, fill in the name (Bump) and complete the branch without bothering about the subbranch, starting with the input of the signal Probe in the state Winning.
- Select the Probe input symbol in the left branch. On the Edit menu, use the Select Tail command to extend the selection to the end of the branch.
- Copy the selection and Paste it. Move the selection (which appears as a set of symbols) to a suitable place and paste it with a click with the left mouse button. If Paste fails (because of insufficient space or overlap), an alert sound is issued --- try again.
- Change the text in the input symbol from Lose to Win.
- To interconnect the state symbol Winning with the input symbol Probe: select the state symbol --- a handle appears ---
Figure\x11 65 : The Selected State and its Handle.
-----
(fig)
-----
drag the handle while pressing the mouse and release the mouse when it points to the input Probe symbol. A line is drawn between the symbols.
Figure\x11 66 : The Two Branches are Connected.
-----
(fig)
-----
- Conclude the diagram by drawing the remaining parts and saving the diagram.
Figure\x11 67 : Remaining Parts to Edit.
-----
(fig)
-----
The process Main is the last diagram to create and edit. If you find this tedious, you may skip this exercise and create the diagram as a copy from the files that are enclosed in the SDT distribution (how to do this is described in section "Creating a Block Diagram From a Copy" on page 91). Figure 68 shows the appearance of the diagram to create.
Figure\x11 68 : The Process Main.
-----
(fig)
-----
When you are ready with the diagram, Save everything. The diagram structure in the Organizer Window should now look like this:
Figure\x11 69 : The Resulting Diagram Structure.
-----
(fig)
-----
In this tutorial, you have only browsed through a minor part of the available functionality. You may for instance customize the Organizer to display the information using different view options.
- To work with vertical trees
- To expand and collapse the diagram structure
- To display directories and pages
- To print the entire system.
Bring up the View Options dialog (see Figure 27 on page 68), click on the Vertical Tree radio button and click on Apply. The Organizer window changes its presentation mode:
Figure\x11 70 : A Vertical Tree Structure.
-----
(fig)
-----
You may make parts of the diagram structure invisible (and visible again) with the Expand and Collapse commands from the View menu. (Expand is available on collapsed nodes only (indicated by the small triangle), while Collapse is available on expanded nodes that have a substructure).
Apply the Indented List mode again.
Turn the Diagram Directories and Pages toggle buttons on. Apply the options, the result becomes a list where the file names are shown with the directories, and where SDL pages are made visible.
Figure\x11 71 : Directories and Pages are Displayed.
-----
(fig)
-----
The Organizer lets you print all diagrams that are included in the system with a single command. You may also include a table of contents:
- Click the quick button for Print. This issues the Organizer's Print dialog.
- Turn the Table of contents toggle button on and click on Print to order a global printout of all SDL diagrams, including a table of contents.
Figure\x11 72 : Including a Table of Contents.
-----
(fig)
-----
You have now created and printed your first complete SDL system with SDT 3.02. Your next task is to check the complete system with respect to SDL syntax and semantics.
- To perform syntactic and semantic analysis on the whole system
- To generate files containing definitions and cross references.
To analyze the system, you should also enable the semantic checker. To do this:
- Select the system diagram icon.
- Use the Analyze command from the Generate menu.
- Adjust the analyzer options according to Figure 73:
Figure\x11 73 : Including Semantic Analysis.
-----
(fig)
-----
- Also specify to have the Analyzer generate a file with cross references, by turning the toggle button Generate a cross reference file on. You will need this file in a later exercise in this tutorial.
- The semantic Analyzer has some other options, each one of these individually activated with a toggle button. They have no impact on this tutorial.
- Click the Analyze button.
- When the Organizer status bar reads "Analyzer ready", look at the Organizer Log for any errors reported by the Analyzer.
- If required, correct the errors and repeat the procedure. How to locate errors in the source SDL diagrams was described in a previous exercise, see "Looking for Analysis Errors" and "Correcting Analysis Errors" on page 79.
- The tail of the Organizer log should contain the following output when the system is syntactically and semantically correct:
+ Analysis started
GR to PR conversion started
GR to PR conversion completed
Syntactic analysis started
Syntactic analysis completed
Semantic analysis started
Semantic analysis completed
+ Analysis completed
Terminate this exercise by saving everything. You may also want to print the diagrams again (see "Printing the System" on page 107 for how to do this).
Besides its functionality as an SDL tool, SDT also support the Z.120 recommendation, also known as Message Sequence Charts (MSC).
In this tutorial we will demonstrate some application areas of MSCs.
- First, a MSC may be used for describing the requirements on the dynamic behavior of a system, viewed as a "black box" which receives external stimuli (corresponding to SDL signals issued from the environment) and respond by sending SDL signals to the environment.
- MSCs may also help the user to understand a problem, by offering a way of presenting, in graphical form, some cases which have been identified, before proceeding with the design in SDL.
- Generating MSCs as the result of a simulation of a system also provides a mean to understand the dynamic behavior and verify it against the expected behavior.
- Finally, MSCs can be input to a Validator where you can verify that the scenario that the MSC is describing may actually occur and under what circumstances.
- To add MSCs to the diagram structure
- To associate SDL diagrams and MSCs
- To create MSCs
- To edit MSCs.
To create an MSC, you use the Organizer, where the MSC will be managed as an Associated Document. In this exercise, we will create an MSC where you will describe the dynamic behavior of the system DemonGame. You will also use this MSC as a reference when simulating and validating the system (this is done in later exercises).
To create an MSC:
- From the Edit menu, select the command Add Diagram. A dialog is issued, prompting you to specify a diagram name and type.
Figure\x11 74 : Specifying the Name and Type of the Diagram to Add.
-----
(fig)
-----
Adjust the dialog options as in Figure 74:
- Specify As Associated Document
- Set Diagram Type to MSC Diagram
- Change the name to DemonGame.
- Click the Add button. An MSC icon appears in the Organizer's Associated Documents Area; the lower part of your Organizer Window should now like Figure 75.
Figure\x11 75 : The Organizer Structure with an MSC Added.
-----
(fig)
-----
- The MSC you have inserted into the Organizer is intended to describe the behavior of the system; it is associated with the system diagram. SDT allows you to make this association visible in the Organizer. Make sure the MSC icon is selected and order the Associate Document command from the Edit menu. A dialog is displayed.
Figure\x11 76 : Associating an MSC with an SDL diagram.
-----
(fig)
-----
- Select the system DemonGame item in the list.
- Click the OK button.
- Check the Organizer's View Options (the command is available on the View menu). If required, turn the options Associated Documents and Associated Document Links on and click Apply.
- Look at the resulting Organizer structure. In addition to the MSC icon in the Associated Documents Area, an MSC Link Icon appears, connected to the system diagram icon. If you select it, the Organizer's status bar informs you about the link to the actual MSC.
Figure\x11 77 : Association Between the System Diagram and the Associated MSC
-----
(fig)
-----
MSCs are created in a similar way as you created SDL diagrams (remember how you double-clicked an SDL diagram icon, created a new diagram, specified the diagram type and name and let the tool connect the newly created diagram to a file).
- When you have associated an MSC to an SDL diagram, you may choose to double-click either the MSC icon or the (dashed) MSC link icon. Do this now; a dialog is issued.
- See Figure 78 for how to specify the dialog options.
Figure\x11 78 : Specifying a New MSC.
-----
(fig)
-----
- Close the dialog by clicking the Edit button. After a few seconds, the MSC Editor window is displayed. It looks similar to the SDL Editor window, but provides of course a different symbol menu and different set of commands and quick buttons.
Figure\x11 79 : The MSC Editor Window.
-----
(fig)
-----
Your next task is to use the MSC Editor to create the following diagram:
Figure\x11 80 : The MSC for the System DemonGame.
-----
(fig)
-----
The MSC basically consists of four instances (the vertical lines starting with a rectangle), a number of messages (the horizontal lines ending with an arrow), a create process (the dashed horizontal line), a timer (the symbol starting with an hourglass and ending with an arrow) and two condition symbols (with the shape of a hexagon). You also find a text symbol, containing a textual comment in it and two comment symbols (with the same appearance as SDL comment symbols).
We suggest that you draw the MSC as follows:
- Start by entering a text symbol and fill in its contents. (This is done in the same way as with the SDL Editor).
- Then, insert the three instances with the instance name env, Main and Demon:
- Once the instances are added, insert the message Newgame:
- Select the message symbol in the symbol menu.
- Click once on the instance axis env to define the source of the message.
- Click a second time on the instance axis Main to specify the end of the message.
- Type in the name of the message (Newgame).
- If you are not satisfied with the placement of a message, you may move it up or down by dragging the mouse. You may also move only the source or endpoint of the message along the instance axis.
- The instance Game is dynamically created. To add Game, you use the create process symbol. You insert it in a similar fashion as a message:
- Select the create process symbol in the symbol menu.
- Specify the location of the source of the create process symbol by clicking once on the source instance axis (Main).
- Specify the location of the instance head by clicking a second time. A process create and an instance head with its axis are inserted.
- Fill in the instance kind and instance name fields.
- If desired, you may move the instance head symbol.
- Continue by adding the first condition symbol to the instance axis Game:
- Select the condition symbol in the symbol menu, move the mouse to point to the instance axis. Insert the symbol with a second mouse click and fill in the name of the condition: Losing.
- The condition symbol may be moved vertically along the instance axis.
- Add a comment symbol and connect it to the condition symbol, by dragging the handle and drawing a line that you attach to the condition symbol with an extra mouse click. Also type in the comment text.
- Add a timer to the instance axis Demon:
- Select the timer symbol in the symbol menu.
- Click once on the instance axis to specify the base of the timer symbol.
- Click a second time on the same instance axis to locate the end of the timer (the end must reside below the source).
- Terminate by entering the name of the timer: T
- You may drag the source or endpoint to resize the timer symbol, if required. You may also drag the symbol to move it up or down.
- Add the second condition and its comment symbol.
- Add the remaining messages. The message Score also contains a parameter with the value 1. To enter the parameter value, select the lower of the two selection rectangles and type in the text.
Figure\x11 82 : The Text Attributes Associated to a Message.
-----
(fig)
-----
- Conclude the editing of the MSC by adding a process stop symbol.
- Select the symbol in the symbol menu.
- Place it by a click on the instance axis Game, below the last message.
- Before leaving the MSC editor, you should save the MSC. When saving the newly created diagram, the editor suggests the file name demongame.msc
Figure\x11 83 : Default File Name for the MSC.
-----
(fig)
-----
- Accept the suggested file name by clicking the OK button.
In this exercise, you will practice on the Cross Reference Viewer. The Cross-Reference Viewer is a dedicated tool that presents a graphical view of the definitions and references to SDL entities available in an SDL system. It manages virtually all SDL information related to a system and has a number of facilities for navigating back to the source SDL diagrams.
A prerequisite to this exercise is an up-to-date file containing the definitions and cross-references, which must be generated as a secondary result of the semantic analysis of the system (see page 109).
If you have changed any of the SDL diagrams since the last analysis of the system, you should regenerate the file.
- To start the Cross Reference Viewer
- To look for definitions
- To look for references.
- You start the tool with the Cross Ref Viewer command from the Organizer's Tools menu. As an alternative, you may click the quick button for the Cross Reference Viewer. Do this now!
In response to a click on the quick button, the Analyzer first generates a cross-reference file to make sure you are working on an updated version.
Then, after a few seconds, SDT responds by displaying the Cross Reference Viewer window, where the contents of the file are shown in a graphical list.
Figure\x11 84 : The Cross reference Viewer Window.
-----
(fig)
-----
- The first definitions are predefined in the SDT environment (PACKAGE predefined). They are not of interest for the purpose of this tutorial.
In the next exercise, you will use the Cross Reference Viewer to identify all possible situations where a signal may be sent or received. We will also look for the definition of the signal.
Let us look for the definition of the signal Bump.
- Click on the quick button for Search. A dialog prompts you to specify a text string:
Figure\x11 85 : Searching for a Text.
-----
(fig)
-----
- Type in the name Bump and click the Search button. The Cross Reference Viewer window is immediately scrolled to make a signal icon with the name Bump visible.
- Also, a second window, titled SDT References, appears on top of the Cross Reference Viewer. Arrange the two windows to make both visible (you may need to resize them as well).
Figure\x11 86 : The Two Windows Arranged.
-----
(fig)
-----
- The upper window (titled SDT Cross Reference Viewer) shows the icon for the definition of the signal Bump. (Note the text in the status bar.) To the right of the icon is a text that tells that the signal is referred 6 times in all.
- Make sure the icon is selected.
- From the SDT Cross Reference Viewer window Tools menu, select the command Show Definition.
After a short while, an SDL Editor window is displayed on the diagram for the system DemonGame. A text symbol, containing the declaration (i.e. the definition) of the signal is selected. Furthermore, the text cursor is positioned on the line of text in which the signal has been located (see Figure 87).
Figure\x11 87 : The Definition of the Signal is Displayed.
-----
(fig)
-----
The lower window (titled SDT References) shows the icons for the SDL entities in which the signal has been referred. The information displayed in Figure 86 should be interpreted as:
- The signal is conveyed on one channel,
- The signal may be input in two states,
- The signal is output in one place,
- The signal is conveyed on two signal routes.
To conclude this exercise, you will now locate the places where the signal is output and input. Let us start with the inputs.
- Select the input icon.
- Select the Tools menu. It should contain three menu choices; their order of appearance is Show Reference 1, Show Reference 2 and Show Entity List.
- Select the first menu choice - an input symbol is selected in an SDL Editor window, showing the diagram for the process Game. Select the second menu choice - the second input symbol is selected, also in process game. These are the places where the signal may be input.
- Double-click the output icon. An output symbol is selected in an SDL Editor window.
You should now have learned how to use the basic functions in SDT for creating, managing, editing, printing SDL diagrams as well as Message Sequence Charts. You should also have practiced on syntactic and semantic checks on your SDL diagrams. Finally, you should have acquaintanced yourself with the Cross Reference Viewer.
Your next task will be to "animate" your first SDL system by simulating it. A number of exercises are prepared in the next part of the tutorial, starting on page 127.
Footnotes
- (1)
- FrameMaker / FrameViewer / FrameBuilder is a desktop publishing environment, developed and marketed by Frame Technology Corporation. The SDT manuals are created with FrameMaker. NCSA Mosaic and Netscape are Internet information browsers and World Wide Web clients. NCSA Mosaic was developed at the National Center for Supercomputing Applications at the University of Illinois, Urbana-Champaign. Netscape is developed by the Netscape Communications Corporation.
- (2)
- Ghostview: An X11 user interface for ghostscript. 1992 Timothy O. Theisen.
- (3)
- A system file may contain information related to any kind of SDL structure, not necessarily an SDL system. The term system file is a general term.
- (4)
- The exact appearance of the menu choice depends on the directory structure you are working on.
Table of Contents Next Chapter