Table of Contents Previous Chapter 2 Editing SDL Diagrams
If you select an object in the SDL Editor window, the text window is updated to contain the text associated with that object. This is explained in detail in "Selecting a Symbol that has Associated Objects" on page 72 and "Selecting a Line that has Associated Objects" on page 109.
If you select more than one text object, the text window is not updated.
Each line (except for the last line) in the text window is terminated by a carriage return, and may consist of any number of legal characters.
The SDL Editor also supports editing text outside the context of SDT, by transferring text to / from a file of your choice. This allows you to take advantage of your favorite text editor when editing for instance SDL text symbols holding a large amount of text.
The main text editing functions you can perform are:
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 64. 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 SDL Editor window, leaving no room for the drawing area. The text window can only be resized vertically.
Figure 64 : Resizing the Text Window.
-----
(fig)
-----
You can hide and show the text window with the Window Options command from the View menu.
To hide or show the text window:
You can select a portion of text displayed in the text window by performing either of the following sequences of operations:
- Point to the beginning or the end of the portion of text to be selected within the text window.
- 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.
- Release the mouse button.
Figure 65 : Some Selected Text.
-----
(fig)
-----
- Point to the beginning or the end of the text to be selected and click.
- Move the I-beam pointer to the other end of the text to be selected.
- Press <Shift> and click.
You can select a single word, delimited by white space, by double-clicking it.
You can select one line of text by triple-clicking it.
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.
The standardized text editing functions include:
- Positioning the cursor by clicking, or by using the arrow keys.
- Inserting characters after the current position of the I-beam pointer.
- Deleting the character preceding the I-beam pointer by pressing <Back Space>.
- Deleting the character following the I-beam pointer by pressing <Del>.
- Replacing a portion of text by selecting it and typing the new characters.
- Deleting a portion of text by selecting it and pressing <Back Space> or <Del>. (Remember, the <Del> and the <Back Space> keys have different functions according to Motif styleguide.)
You can search for, and possibly replace, text in a diagram or in a diagram structure that is managed by the Organizer.
To search for text in the current page:
- Make sure the window showing the diagram where to search is open and active.
- 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.
- Select the Search command from the Organizer's Tools menu.
---------------------------------------------------------------------
(fig)
- Alternatively, click the Organizer quick button for Search.
---------------------------------------------------------------------
- Specify the text to be found in the Search for text field.
- Click the Consider case button on to search on a case sensitive basis.
- Turn the Search substructure button on to specify that the scope of search should comprise the diagrams included in the substructure (the SDL structure which root is designated by the current diagram). If you turn the button off, the scope of search will only comprise the current diagram.
- Click the Search button to order search. The object where the next occurrence of text will be selected and the text window updated accordingly.
- You may use the SDL Editor to edit the contents of a diagram while the Search dialog is active. The Organizer is however locked as long as the Search dialog is open.
- The diagram that the tool is currently processing is displayed to the right of the Diagram field.
- When the Search dialog is no longer needed, close it by clicking Done.
To search and replace text:
- Open the Search dialog as when Searching for Text in a Diagram (see above).
- Specify the text to be found in the Search for text field.
- Specify the text to be replaced with in the Replace with text field.
- Click the Search button to find the first occurrence.
- If the text is found, the object where the next occurrence of text will be selected and the text window updated accordingly. You may use any of the following options:
- Search further by clicking Search repeatedly
- Replace the text by clicking Replace
- Replace and continue search with the Replace & Search button.
- Replace all occurrences with the Replace All button.
- When the Search dialog is no longer needed, close it by clicking Done.
SDT allows you to import and export text from / to a file. You can, for instance, import text from files that contain SDL-PR into text symbols and export the contents of text symbols to files.
You can import the contents of a text file into an object managed by the SDL Editor the following way:
- Select the object where to import the contents of file.
- Select the Import command from the text window's File menu. Import issues a Standard File Selection Dialog, where you should specify the file to import. The general properties of the file selection dialog are described in chapter 21, The SDT Graphical User Interface.
- The file filter is set to *.txt by default. Adjust the file filter to match the file you are to import from and click Filter to update the contents of the file list.
- Clicking OK replaces the contents of the text window with the contents of file that you have specified in the file selection dialog.
-----------------------------------------------------------------------
Caution!
Importing text from a file replaces existing text as well. There is no
Undo facility.
-----------------------------------------------------------------------
To export the contents of the text window into a file:
- Select the object which text to export to a file.
- Select the Export command from the text window's File menu. Export issues a Standard File Selection Dialog, where you should specify the file to export the text to.
- The file filter is set to *.txt by default. Adjust the file filter to match the file you are to export to and click Filter to update the contents of the file list.
- To export to a new file, type in the name of a new file.
- Clicking OK possibly creates a new file and replaces the contents of the file with the contents of the text window.
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 Symbols).
To copy a portion of text:
- Select the text to be copied (see "Selecting a Portion of Text" on page 124).
- 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.
To cut a portion of text:
- Select the text to be cut (see "Selecting a Portion of Text" on page 124).
- 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.
To paste a portion of text:
- First copy or cut some text (see "Copying Text" and "Cutting Text", above). You cannot paste any text if the text clipboard is empty.
- 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.
- 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.
To assist you in ensuring you enter the correct text in the selected text attribute to an object, there is a grammar help support function.
To open the grammar help window:
If you select the object you need assistance on, you will see the keywords and options available for use in given situations, and the corresponding reference to sections of the ITU Z.100 SDL Definition, followed by the grammar syntax of the meta language.
To request grammar help:
- Simply select the object of interest. The grammar help window contents are automatically updated to list the following:
- The nature of the selected object
- The grammar for that object
- The various "use cases".
This operation signifies inserting the contents of the grammar help window into the SDL Editor text window.
To insert the text related to a given "use case":
- Locate the "use case" of interest. The left part of the window provides a list of situations, named using some abbreviation that associates to the situation.
- Click on the item of interest to select it.
- Use the Insert command from the Edit menu. The contents of the right part of the window are inserted into the SDL Editor text window, at the current I-beam cursor position.
- An alternative is to double-click the item in the list.
- Finally, replace the formal notation with the appropriate values, variables, signals, etc. used in your diagram.
This operation signifies replacing the contents of the SDL Editor text window with the contents of the grammar help window.
The operation is very similar to Inserting Text, above.
To replace text:
- Proceed as when Inserting Text, above. But, instead of using the Insert command, use the Replace command from the Edit menu.
With SDT, a standard grammar help template file is provided. In addition to this, the SDL Editor allows you to use your own templates and to merge these with the standard templates.
To create grammar help definitions:
- Copy an existing grammar help file.
- Edit the file using any text editor (the grammar help file is an ASCII, human readable file). See "The Grammar Help File" on page 1244 in chapter 23, The SDL Editor for a description of the contents and syntax of the file.
To use another grammar template definitions:
To merge the current grammar template definitions with another one:
The grammar help window is closed by operating the Close menu choice from its File menu. The SDL Editor window is left unaffected.
Designing using SDL implies to large extent defining, sending and receiving signals. A signal dictionary assists you in reducing the time it takes to find out names and parameters for a signal that you already have used somewhere in a diagram. The signal dictionary also incorporates timers.
Messages from a Message Sequence Chart and signals from an external signal dictionary may be included into the SDL Editor's signal dictionary.
All functionality is provided in the signal dictionary window.
To open the signal dictionary window:
The signal dictionary window can take advantage of your computer's font capabilities to present the information in a graphical way, using SDL-like notation. This is the default mode.
If the information is presented in using strange characters, your terminal does not support the font family used by the signal dictionary window. You should use the textual mode.
To turn the mode to textual:
- Set the environment variable SDLENOGRAPHICS
- If you are to run several Signal Dictionary sessions in this mode, you may want to set the environment variable in a file that you will automatically source (e.g. .cshrc)
- Exit all SDT tools.
- Restart SDT to have the environment variable affect the behavior.
When you select an object where a reference or definition of a signal makes sense, the signal dictionary window is automatically updated to reflect the signals and signal conveyors(1) that are available according to what options you have selected.
The signal dictionary function responds when selecting the following objects (see page 1256 in chapter 23, The SDL Editor for more details):
- channel
- signal route
- connection point
- gate
- signal input
- signal output
- priority input
- save of signal
- text symbol
The signal dictionary is automatically updated each time you save an SDL diagram or an MSC that is referred to in the Organizer's Diagram Structure Area.
When modifying an SDL diagram, you may have unintentionally introduced SDL constructs that are incomplete and thus cause the signal dictionary to fail in providing signal information for that diagram.
Where the signal dictionary fails on a diagram, a bug symbol will appear after the diagram name in the signal list. Correct the source of error and save the diagram again. See page 1263 in chapter 23, The SDL Editor for a reference on signal dictionary errors.
The signal dictionary can be customized to fit your needs, by restricting or extending the amount of information that is presented through a set of options that you can activate or deactivate.
Depending on the method you are following when designing with SDL, you should activate the required options.
Next follows a guide for when to use the available options.
To enable an option:
- Activate the the Select menu.
- Toggle the appropriate option on by selecting it (an option which is enabled is indicated with an asterisk preceding the option name). Selecting the option once again disables it.
- Alternatively, select the Options menu choice and toggle the buttons of your choice on or off. When satisfied, click OK.
Figure 69 : Selecting the Signal Dictionary Options.
-----
(fig)
-----
------------------------------------------------------------------
Note:
The more options are enabled, the more information is computed by
the SDL Editor and the more time it takes.
------------------------------------------------------------------
Below follow a few general guidelines for enabling the various options, depending on the approach you are following when designing with SDL.
This expression means starting by designing the root diagram (e.g. the system diagram) and continuing with the block diagrams, next the process diagrams and so forth.
If you follow this approach, selecting the Up option will enable access to signals used one level up in the SDL hierarchy. This option is enabled by default.
- You may also type <ctrl-u> to toggle the option. Typing u brings the Up option into view (if enabled).
Following this method means starting with the diagrams at a deeper level (e.g. procedures) and working upwardly in the SDL hierarchy.
If you work bottom-up, select the Down option to enable access to signals used one level down in the SDL hierarchy. This option is enabled by default.
- You may also type <ctrl-d> to toggle the option. Typing d brings the Down option into view (if enabled).
If you look for entities that used locally in a diagram, select the This option. Remember, a diagram needs to be saved in order to update the signal dictionary.
- You may also type <ctrl-t> to toggle the option. Typing t brings the This option into view (if enabled).
- To find the definition of the signal in the This section, you may select an object in the drawing that uses the signal and type <ctrl-f>.
You can list all signals that are visible according to the SDL scope rules by turning the All option on. For instance, a signal that you declare on the system level will be available in all diagrams in the SDL hierarchy.
- You may also type <ctrl-a> to toggle the option. Typing a brings the All option into view (if enabled).
If you want to gain access to signals that you have declared in a package, you should enable the All option.
If you use the diagram type concept, you should enable the All option to gain access to the signals that are defined in the diagram types.
If you describe the dynamic behavior of an SDL diagram using the SDT Message Sequence Chart Editor, you may take advantage of this by turning the MSC option on.
----------------------------------------------------------------------
Note:
Messages used in an MSC will be available in the signal dictionary
only if the Organizer Diagram Structure Area refers to the MSC, i.e.
the MSC is linked into the diagram structure. It is not sufficient to
include the MSC in the Organizer's Associated Documents Area.
----------------------------------------------------------------------
You may import an external signal dictionary into SDT through The SDT PostMaster interface. In section "Load External Signal Definitions into the Information Server" on page 496, in chapter 10, How to Use the SDT Public Interface is described how you proceed to import a file with external signal definitions.
-------------------------------------------------------------------------
Note: Signal Dictionary and OO
If you are looking for a source diagram that is an SDL-92 type (sys
tem type, block type, process type or service type) and that you ac
cess through an instance of the type, the following conditions must
be respected in order to have the signal dictionary window list the
diagram and list all of the signals and signal conveyors that are used
in the diagram:
· The type diagram must be referred in the same diagram as
where it is instantiated. In the signal dictionary window, only
the type will be listed, not the instance. Figure 70 below shows
an example of this.
As a consequence of this, you will not be able to look into
the instance of a type that is defined in a package diagram
and used in the current SDL system.
· In the case the type is inherited from a supertype, the entities that
you are looking for must be defined in the child type.
The main cause of this limitation is that channels and signal routes
are connected to the instance, not to the type.
-------------------------------------------------------------------------
Figure 70 : The Type is Referred where Instantiated.Figure legend: The process
typeController is instantiated as Cl. The process instance Cl will be visualized
asthe process type Controller, and you can list signals conveyed on the gates A,
B,C, D and E.
-----
(fig)
-----
To locate the source diagram (i.e the diagram where the signal is used or where the signal conveyor is available):
- Locate the section of your choice (Up, This, Down, All, MSC and External) by scrolling up or down. The sections are listed in that order and the start of each section is identified with a separator with the corresponding name.
- Identify the source diagram by its type and name. Diagrams are listed alphabetically by their name. The diagram type is identified either by a graphical SDL-like symbol (see Figure 330 on page 1258 in chapter 23, The SDL Editor) in the left margin or by a text string that consists of the diagram type.
Once you have located the source diagram your next task is to insert the text belonging to the object you have selected in the target diagram (the diagram where the change is to be done).
This operation makes sense only on pages where the implementation is described, i.e. the flow pages.
- Locate the matching signal or timer in the signal list.
- Make sure the signal output, input, priority input or save symbol to be updated is selected in the target diagram.
- Select the signal or timer item in the signal list by clicking on it. Use the Insert or Replace commands from the Edit menu to update the symbol contents. The target symbol is updated with the signal name and its formal parameters.
Figure 72 : Selecting the Signal Display.
-----
(fig)
-----
- Alternatively, double-click the signal or timer.
- Update the signal's formal parameter type with a current parameter.
- Locate the signal conveyor that constitutes the corresponding item that interfaces to the channel, signal route or gate that you are update in the current diagram.
- Make sure the signal list is selected in the target diagram.
- Select the signal conveyor by clicking on it. Use the Insert or Replace commands from the Edit menu to update the signal list contents.
Figure 73 : Selecting the Gate B.
-----
(fig)
-----
- Alternatively, double-click the signal or timer.
- In the case of a bi-directional conveyor, you will see lines of text in the right window, each one corresponding to a signal list (as in Figure 73, above). You should copy each line of text to the corresponding signal list. Select the signal list in the SDL Editor and the line of your choice, then use the Insert or Replace commands to update the signal list.
When updating a text symbol, you are likely to declare signals and timers that you have referred to in the current diagram or referred to in the SDL hierarchy descending from the current diagram.
- You should make sure the Down and This options are selected.
- Remember to add a SIGNAL or TIMER statement in the text symbol, before the enumeration of signals.
- Locate all diagrams of interest. Look for signals / timers that you want to declare. Double-click each signal, and insert the necessary commas to create a syntactically correct declaration. Terminate the operation by inserting a semicolon.
When an object is selected in the SDL Editor's drawing area, typing <ctrl-f> looks for the first occurrence of the first word in the object and selects it in the This section.
The signal dictionary window is closed by operating the Close menu choice from its File menu. The SDL Editor window is left unaffected.
You may change the font faces and font sizes used in the textual objects displayed by the SDL 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 SDL Editor session.
The font faces which are available depend on the target system on which you are running SDT.
To modify the desired font size and font face, you must use the Preference Manager. See chapter 5, Managing Preferences.
When this setting is in effect, SDT will use the font face names given by the preference settings:
Editor*ScreenFontFamily:
Editor*PrintFontFamily:
to select font face names.
Note that in this way you can select different font names for displaying on the screen and for printing; it is up to you to make sure that the printer font you select is similar in appearance to the font you use when displaying.
If you leave the Editor*ScreenFontFamily preference setting empty you will edit your documents using the SDT Draft font, but print them using the font you specified with the Editor*PrintFontFamily setting.
Use the xlsfonts command to list installed fonts. Font names containing 0 for width and height are scalable.
Example 3 : How to Determine what Fonts are Available.
From the OS prompt, typing:
hostname% xlsfonts | grep "\-0\-O\-" | more
will return a list of accessible scalable fonts.
To use scalable fonts under X11R5 you must normally first connect to a font server.
Example 4 : How to Start the Font Server.
- Start the font server on any local host:
hostname% fs
- Connect the server to fs indicating which host the font server is running on (which can be the same host that the X server is running on):
hostname2% xset +fp tcp/<hostname>:7000
For further information see the X11R5 documentation or use man fs to read the manual page describing the font server you are running.
If the fonts look poor on the screen, a possible work-around is to disable the scaling option.
----------------------------------------------------
Note:
Disabling font scaling effectively disables WYSIWYG!
----------------------------------------------------
To do this, you should edit the SDT resource file.
- Locate the file SDT and open it in a text editor.
- Look for the line with the text: SDT*sdtUseScalableFonts
- Change the line to SDT*sdtUseScalableFonts: false
- Save the file and restart the SDT environment.
The viewport allows you to view a portion of the page that you are working on within the SDL Editor. That page is currently displayed in the drawing area. Any portion of the page located outside the limits of the viewport is out of view, unless you scroll the viewport to display that area.
The SDL Editor uses any scale of your choice when displaying the page in the viewport.
The viewport can be scrolled vertically and horizontally by using the scrollbars.
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:
- When you move an object
- When you append a symbol
- When you paste a symbol
- When you set line breakpoints on a line
- When you route a line
- When you draw a frame around symbols in order to select the symbols.
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 can be done either by specifying a scale to use or by zooming in and out.
To specify a scale:
- Select the Set Scale command from the View menu.
- A dialog is issued, where you have the following options:
Figure 74 : Adjusting the Scale.
-----
(fig)
-----
- Drag the slider to perform coarse adjustments, then click right or left on the slider bar for fine trim. Terminate by clicking the Scale button.
- Click the Overview button to adjust the scale so that the drawing area will fit into the SDL Editor's viewport. The smallest scale is 20%.
To zoom in or out:
Click the zoom in / zoom out quick button.
----------------------------------------
(fig)
The quick button for zoom out.
(fig) The quick button for zoom in.
----------------------------------------
Footnotes
- (1)
- The term signal conveyor denotes a communication path that conveys signals; a channel, signal route, a gate or connection point.
Table of Contents Next Chapter