Document Templates : DGL Statements : Output Statements : Include Plots Statement

Include Plots Statement

Statement Syntax:

stm_plot (plot_parameters) ;

This statement is used to include any chart in the document. It generates the specified plot with the indicated parameters (e.g., plot size, output device, etc.). The plot_parameters are specified in the order given below.

The output is designated for a particular device (one of the output devices defined in Rational Statemate). The destination of the plot output is specified by one of the parameters. If its destination is left unspecified, it is included as part of the output segment file. This is done by using an empty string for the output file parameter.

The plot function returns a status which can be one of: stm_success, stm_unknown_plotter, stm_can_not_open_file, stm_id_not_found, stm_id_out_of_range, stm_plot_failure, stm_illegal_parameter, stm_not_enough_memory, stm_empty_chart, stm_unresolved.

Whether you are plotting Statecharts, Activity-charts, Module-charts, or Block Diagrams, the parameters are the same:

stm_plot (id, file, width, height, with_label, with_name, with_note, device, title_position, title, do_rotate, with_file_header, actual_height)
id - is the ID number of a Rational Statemate chart to be plotted.
file - is a STRING with the name of the file destination to which the plot is written. The operating system pathname conventions are followed. You may specify a full pathname to any directory for which you have write access. If a simple filename is specified, the plot is written to your Workarea. If the parameter is left empty (‘’), the plot is included as part of the output file.
width - is a numeric argument of type FLOAT that indicates the maximum possible width of the plot (in inches).
height - is a numeric argument of type FLOAT that indicates the maximum possible height of the plot (in inches).
with_label - is a BOOLEAN parameter which indicates whether arrow labels are (TRUE) or are not (FALSE) printed in the plot.
with_name - is a BOOLEAN parameter indicating whether box names are (TRUE) or are not (FALSE) printed in the plot.
with_note - is a BOOLEAN parameter indicating whether notes are (TRUE) or are not (FALSE) printed in the plot.
Note:
device is a STRING argument that indicates the plotting device. This may indicate a supported formatting language if the plot is to be handled by a formatting processing system that has its own graphics language. To configure a new plotter or printer (for example, a paper type), select Utilities > Output Devices from the main Rational Statemate menu.
title_position is a STRING parameter indicating where to place the plot title. This parameter accepts one of the following values:
stm_plt_none - the title is not included.
stm_plt_top - the title is placed a the top of the plot.
stm_plt_bottom - the title is placed a the bottom of the plot.
title is a STRING argument that specifies what title will be printed with the plot.
do_rotate is a BOOLEAN parameter where TRUE indicates landscape and FALSE indicates portrait.
with_file_header is a BOOLEAN parameter where TRUE indicates that a header is to be added at the beginning of the file. (Use this if you do not want the plot as part of the document.)
actual_height is a numeric argument of type FLOAT that indicates the actual height (in inches) of the plotted output.

The following is an example of how a plot is generated in DGL. A template contains the following statements:

VARIABLE
 CHART ch_id;
INTEGER status;
FLOAT real_ht;
.
ch_id:= stm_r_ch(’XL25’,status);
stm_plot(ch_id,’/sam/p_xl25’,5.0,7.0,true,true,false,
         ’POSTSCRIPT’,stm_plt_top,’SystemXL25’,true,true         ,real_ht);
.

This produces a plot for the chart XL25 that is limited to a maximum size of 5 inches by 7 inches, prints labels and box names and does not print notes.

Output to the file specified by the path /sam/p_xl25.

This file is in Postscript format, as defined for device called ‘POSTSCRIPT’ in Utilities > Output Devices from the main Rational Statemate menu.

The file will have the appropriate header for the output device.

The plot will be printed in landscape orientation.

A title “system XL25 is printed at the top of the plot; the actual height is returned by the variable real_ht.