SPROGS, SD4020 PDP15 Rapid Output Graphics System. Definition and implementation of the SPROGS system has taken place over a considerable period of time. People who contributed to the system for the ICL 1906A and PDP15 are: A C Dennis, A G England, A H Francis, J R Gallop, P R Hayes, F R A Hopgood, P M Nelson, A J Pitchers, D Ralphs, W D Shaw, R E Thomas, D C Toll
The Atlas Computer Laboratory possesses a number of graphical output devices, including a SD4020 microfilm recorder and a PDP15 computer with a VT04 refreshed display. It is expected that other graphical devices will become available in the future. To help the FORTRAN programmer, a set of subroutines, called SPROGS, has been written to interface the user to these devices. As well as providing the ability to draw lines, SPROGS provides a number of different character sets for text handling, and some high level routines for drawing contours, curves, histograms etc. The provision of a sequence list and the ability to use run-time variables give the producer of cine film output great flexibility in defining the form of a film sequence, and the library facility allows him to build up sets of files for use in later programs. More facilities are being developed for inclusion in later versions, and some indication of these will be given.
Currently, the main output device is the SD4020 microfilm recorder. This is capable of producing output on a continuous roll of plain paper, or on microfilm (16mm or 35mm). The plotting area is divided into frames (7.5" square, on the paper roll) and each square is divided into a 1024 × 1024 raster of points (roughly 0.007" apart on the paper roll). There are also a number of hardware characters which can be plotted on the raster. Orders exist for advancing the paper or film from frame to frame.
Output to the SD4020, however, takes time (for development, printing etc) before the user can view the finished product. For this reason, a lineprinter graphical device has been defined, which plots lines on the lineprinter using the character *. Each frame is divided into 120 × 120 points, with X spacing 0.1", Y spacing 0.167". This raster is much coarser than that on the SD4020, and can only give a rough picture, but should be sufficient to show a user if the picture he is expecting is approximately correct. Care should be taken however, to avoid vast quantities of output on this device.
Work is currently under way to connect the PDP15 to the 1906A. To the SPROGS programmer, it will look like another output device. This is one of the planned future extensions.
A macro has been provided on the 1906A to run FORTRAN programs in conjunction with the SPROGS system. The user can save any output in files and set up his own I/O streams before execution. Also available is a preprocessor to allow the SPROGS user a simpler, more readable format for his programs.
The following chapters describe the basic SPROGS system, showing how the user can select his own coordinate system, output lines and characters to one or many devices, define named picture files to ease the manipulation of objects being drawn, save basic device orders for speed of background drawing and merge different files together in the sequence list to produce a complete composite film. The appendices give details of the routines available, the SD4020 hardware, and the SPROGS character sets.
To aid readability, the initial word CALL has been removed from subroutine CALL statements, with the exception of the final example films. Apart from this, all examples are in standard FORTRAN.
Before any output is produced for a graphical device, it is necessary to define its position. For example, in order to draw a line, the two end points must be defined in terms of the units of the graphical device. The device may be such that the initial position is already known (the current pen position) and only the displacements are required. Alternatively, the absolute coordinates of the start and finish of the lines may be required.
The user, however, does not wish to be concerned with the unit system of a particular output device (1024 × 1024 in the case of the SD4020), but, instead, wishes to use units which are relevant to his particular problem. Consequently, an important part of any graphical system is the flexibility with which the user can define his own units and how they relate to the equivalent positions on the display area.
The user defines a line between two points (X,Y) and (A,B) in his own coordinate system, which has been defined by selecting an area known as a region. The system must decide whether the whole line is on the display area and, if not, calculate the part that is. In order to allow photographic effects such as wipes, there is also a need to mask certain parts of the output. The system is designed to be both flexible and, if desired, efficient.
Normally it is sufficient just to draw a line. Each line has certain parameters associated with it which define the type of line (for example, the intensity). The type of display may well influence the point where these are taken into account. In the SD4020, none of these parameters can be achieved by hardware and, consequently, they are dealt with by software at a higher level. For the moment, only how a simple line between (X,Y) and (A,B), which gets mapped onto the display area, is considered.
The routine:
RGLIM (R, XMIN, YMIN, XMAX, YMAX)
allows the user to set up his own coordinate system in region R, so that, when he selects this region and draws a line from (X,Y) to (A, B), the line coordinates will be interpreted in his own units. The region R can normally be considered as a rectangle whose bottom left-hand corner is (XMIN, YMIN) and whose top right-hand corner is (XMAX, YMAX) (but see RGPRM definition).
REGION (R)
selects region R. Hence, (using routine VEC to draw the line)
RGLIM (1.0, 0.0, 0.0, 10.0, 10.0) REGION (1.0) VEC (0.0, 10.0, 10.0, 0.0)
would draw a line from the top left-hand corner to the bottom right-hand corner of the region.
On entry to SPROGS, region 0 is selected, with limits (0.0, 1023.0, 1023.0, 0.0) corresponding exactly to the raster of the SD4020. (Thus, the bottom left-hand corner of the SD4020 raster is (0, 1023).) Note that there is no reason why XMIN and YMIN should be numerically less than XMAX and YMAX respectively.
It is possible to define one region 1n terms of another.
RGPLIM (R, P, XPMIN, YPMIN, XPMAX, YPMAX)
defines region R in terms of region P, such that XPMIN, YPMIN, YPMAX, YPMAX are normally the equivalent values of XMIN, YMIN, XMAX, YMAX in the units of region P (but see RGPRM definition).
When a line is drawn in a selected region, the coordinates of the line are converted from the units of the selected region to the units of the next region in the chain, and so on until the chain end is reached (see below). Thus, if region 0 is chosen as the basic output region for the SD4020 (see below), the following command sequence:
RGLIM (1.0, 0.0 , 0.0 , 10.0 , 10.0) RGPLIM (1.0, 0.0, 0.0, 1023.0, 1023.0, 0.0) REGION (1.0) VEC (0.0, 10.0, 10.0, 0.0)
will cause a line to be drawn from the top left-hand corner of the SD4020 frame to the bottom right-hand corner. The line coordinates will be converted from region 1 units to region 0 units, becoming 0.0, 0.0, 1023.0, 1023.0.
Changing the settings of XPMIN, YPMIN, XPMAX, YPMAX has the effect of moving region R, and all lines drawn in it, with respect to region P. Thus, replacing the RGPLIM call above by:
RGPLIM (1.0, 0.0 , 0.0 , 1023.0, 511.0, 512.0)
would cause the line to be drawn from top left to bottom right of a square occupying the bottom left hand quarter of the SD4020 frame. Normally, the point (X, Y) in region R will be converted to (X', Y') in region P where:
X' = XPMIN + (X-XMIN) (XPMAX-XPMIN) /(XMAX-XMIN) Y' = YPMIN + (Y-YMIN) (YPMAX-YPMIN) /(YMAX-YMIN)
However, other forms of conversion are possible.
The routine:
RGPRM (R, CNV, BSC, XMI, XMO, SWOUTP)
allows the user to select the required conversion to be performed by setting CNV. The allowable values are:
X" = (XPMIN+XPMAX+YPMIN+YPMAX)/2 - Y' Y" = (YPMIN+YPMAX-XPMIN-XPMAX)/2 + X'
X' = XPMIN+(X-XPMIN)*COS(XPMAX)-(Y-YPMIN)*SIN(XPMAX) Y' = YPMIN+(X-XPMIN)*SIN(XPMAX)+(Y-YPMIN)*COS(XPMAX)The value of YPMAX is ignored.
SPROGS is designed to run with a variety of output devices. A user can select one or more by:
DVOUT (DEVS)
where the bit settings of DEVS indicate which devices have been selected. Currently, the devices available are:
thus:
DVOUT (9.0)
will select SD4020 microfilm and lineprinter graphical.
Lineprinter graphical output draws lines on the lineprinter, plotting with the character * on a 120 × 120 grid. The plotting character changes to + where lines coincide.
Lineprinter output consists of a listing of the coordinates of lines (after transformation), and is mainly of use for debugging (see below).
If output is required to both microfilm and hardcopy on the SD4020, the user should use:
DVOUT (32.0)
rather than:
DVOUT (3.0)
since the latter will lead to excessive camera shutter movement which can damage the device.
As there are a number of different devices connected to SPROGS (and more will be added later), the user can specify which regions are to be treated as the basic output region for a given device. Initially, region 0 is selected to be the basic region for SD4020 microfilm and hardcopy. The routine:
RGPRM (R, CNV, BSC, XMI, XMO, SWOUTP)
allows the user to select region R as the basic output region for devices specified by the bit pattern in SWOUTP (set in the same way as DEVS in the description of DVOUT). The other arguments will be explained later.
A line drawn in a given region will have its coordinates converted through the region chain until a region is reached which is the basic output region for one of the currently selected devices. At this point, no conversion takes place. Instead, the current coordinates are sent to this device. If more than one device has been selected, and not all the selected devices have been satisfied, conversion continues down the chain until all output is complete.
Thus:
RGLIM (1.0, 0.0, 0.0, 10.0, 10.0) RGPLIM (1.0, 0.0, 0.0, 1023.0, 1023.0, 0.0) RGPLIM (0.0, 2.0, 0.0, 0.0, 119.0, 119.0) RGLIM (2.0, 0.0, 0.0, 119.0, 119.0) RGPRM (2.0, CNV, BSC, XMI, XMO, 8.0) DVOUT (40.0) REGION (1.0) VEC (0.0, 10.0, 10.0, 0.0)
will cause the line to be output from the top left to bottom right on both microfilm and hardcopy on the SD4020 and on the lineprinter in graphical mode.
Note that the above has assumed that the settings of the other parameters of region 0 are as initialised. The user can of course redefine any of these parameters. Note also that there is no inherent ordering in the region numbering system, the chain defined above being 1 to 0 to 2. Regions may be numbered from 0 to 29 inclusive.
A region can be considered as dividing the whole plotting area into two parts (inside and outside). In general, a line will be split into three by a region (two parts outside and one part inside) although it may be wholly inside, wholly outside or split only into two. SPROGS allows the user to control the visibility of each line segment by specifying the visibility conditions for inside segments and outside segments. For example, the region could be made to act as a window, by forcing all segments outside it to be invisible. Since each region in a chain can have separate visibility settings, differing effects can be obtained by causing the visibility to depend on the previous region.
At the start of a conversion through the region chain, the line being drawn is split into inside and outside segments. The parameters XMI, XMO in RGPRM define the visibility effect of the region. Possible settings are:
Thus lines which become invisible may revert to being visible aga1n later on in the chain.
Hence:
RGPRM (R, CNV, BSC, 1.0, 0.0, SWOUTP)
would mean that only visible interior line segments will remain visible. All invisible interior line segments and all exterior line segments (whether originally visible or not) will become invisible. This setting is often chosen for basic output regions since it is not possible to plot off the hardware frame.
Thus, the order of actions when transforming through the region chain is:
It can be seen that, for the last basic output region in a chain, the setting of RGPLIM is superfluous, and the settings of RGLIM only affect line visibility (by scissoring).
The argument BSC in RGPRM defines the basic shape of the region, and hence controls what scissoring is to take place. The normal shape of the region is rectangular, but two other shapes have been defined. The three settings are:
Note that BSC defines the meaning of the arguments of RGLIM. However, RGPLIM conversion will still make use of the values of XMIN,YMIN,XMAX and YMAX, independent of the region shape.
Normally, this would produce a definition loop. However; if a user defines a region by:
RGLIM (1.0, XMIN, YMIN, XMAX, YMAX) RGPLIM (1.0, 0.0, XPMIN, YPMIN, XPMAX, YPMAX)
and subsequently writes:
RGPLIM (1.0, 1.0, XMN, YMN, XMX, YMX)
this is equivalent to writing:
RGPLIM (1.0, 0.0, XPMN, YPMN, XPMX, YPMX)
where:
XPMN = XPMIN + (XMN - XMIN) (XPMAX - XPMIN) / (XMAX - XMIN) YPMN = YPMIN + (YMN - YMIN) (YPMAX - YPMIN) / (YMAX - YMIN) XPMX = XPMIN + (XMX - XMIN) (XPMAX - XPMIN) / (XMAX - XMIN) YPMX = YPMIN + (YMX - YMIN) (YPMAX - YPMIN) / (YMAX - YMIN)
(assuming CNV = 0.0 for this region)
If a negative region number is used in RGLIM, RGPLIM or RGPRM, the currently selected region is assumed. Thus:
REGION (2.0) RGLIM (-1.0, XMN, YMN, XMX, YMX)
will change the limits of region 2. Also, if any other arguments in RGPRM are negative, the current values of those arguments are retained. Thus:
RGPRM (R, -1.0, -1.0, 1.0, 0.0, -1.0)
will set the visibility markers for region R but leave the other arguments (CNV, BSC, and SWOUTP) unaltered.
Initially, region 0 is set up as the basic output region for the SD4020 and region 1 as the basic output region for lineprinter graphical. Various routines are provided to aid the user in oft-required region parameter settings.
LIMIT (XM, YM, XN, YN)
sets the region limits for the current region.
PLIMIT (P, XM, YM, XN, YN)
defines the current region in terms of region P.
VISO (XMI, XMO) VISOR (R, XMI, XMO)
sets the visibility markers for the current region or region R.
BASE (SWOUTP) BASER (R, SWOUTP)
sets the current region or region R as basic output region for the devices selected by SWOUTP.
SHAPE (CNV, BSC) SHAPER (R, CNV, BSC)
sets the shape parameters, CNV, BSC for the current region or region R (see Sections 2.3 and 2.5).
WINDOW
sets the current region visibility to 1.0 inside, 0.0 outside (outside invisible).
SHIELDsets the current region visibility to 0.0 inside, 1.0 outside (inside invisible).
DSALL
sets the current region visibility to 1.0 inside and out (no scissoring).
In terms of the routines previously defined:
LIMIT (XM,YM,XN,YN) = RGLIM (-1.0,XM,YM,XN,YN) PLIMIT (P,XM,YM,XN,YN) = RGPLIM (-1.0,P,XM,YM,XN,YN) VISO (XMI,XMO) = RGPRM (-1.0,-1.0,-1.0,XMI,XMO,-1.0) VISOR (R,XMI,XMO) = RGPRM (R,-1.0,-1.0,XMI,XMO,-1.0) BASE (SWOUTP) = RGPRM (-1.0,-1.0,-1.0,-1.0,-1.0,SWOUTP) BASER (R, SWOUTP) = RGPRM (R,-1.0,-1.0,-1.0,-1.0,SWOUTP) SHAPE (CNV,BSC) = RGPRM (-1.0,CNV,BSC,-1.0,-1.0,-1.0) SHAPER (R,CNV,BSC) = RGPRM (R,CNV,BSC,1.0,-1.0,-1.0) WINDOW = RGPRM (-1.0,-1.0,-1.0,1.0,0.0,-1.0) SHIELD = RGPRM (-1.0,-1.0,-1.0,0.0,1.0,-1.0) DSALL = RGPRM (-1.0,-1.0,-1.0,1.0,1.0,-1.0)
The following routines set up regions.
SDHARD
defines region 1 in terms of region 0, sets region 0 to be the basic output region for SD4020, sets limits of region 1 to (0,0,1023,1023), selects region 1 and SD4020 hardcopy output.
SDFILM
does the same as SDHARD but selects SD4020 microfilm output.
LPGRAF
sets region 1 to be the basic output region for lineprinter graphical output, with limits (0,0,119,119), selects region 1 and lineprinter graphical output.
OUTR (R,XN)
sets region R to be the basic output region for the devices specified by XN, and selects these devices.
The drawing opposite was produced by the following program. It shows how a complex region chain might be used.
RGLIM (6.0,10.0,10.0,60.0,50.0) RGPLIM (6.0,5.0,10.0,10.0,60.0,50.0) VISOR (6.0,0.0,3.0) C RGLIM (5.0,30.0,20.0,90.0,70.0) RGPLIM (5.0,4.0,30.0,20.0,90.0,70.0) VISOR (5.0,2.0,1.0) C RGLIM (4.0,20.0,30.0,70.0,60.0) RGPLIM (4.0,3.0,20.0,30.0,70.0,60.0) VISOR (4.0,1.0,2.0) C RGLIM (3.0,80.0,40.0,100.0,50.0) RGPLIM (3.0,2.0,80.0,40.0,100.0,50.0) VISOR (3.0,0.0,1.0) C RGLIM (2.0,50.0,55.0,60.0,75.0) VISOR (2.0,1.0,0.0) BASER (2.0,2.0) C DVOUT (2.0) REGION (6.0) DO 10 J=I,12 VEC (0.0,0.0,100.0,100.0) DO 10 1=5,100,5 XI=I VEC (0.0,XI,100.0-XI,100.0) VEC (XI,0.0,100.0,100.0-XI) 10 CONTINUE
A number of routines are provided within SPROGS to allow the user to output graphical information. For example,a user might wish to output a number of lines. To start with he needs to define to which region the units used in the display routine refer. All subsequent output will be in terms of the selected region's current unit system.
For each region a current display position is defined as (XPOS, YPOS). The current display position can be changed by the following routines:-
SETXY (X,Y) SETX (X) SETY (Y)
which set XPOS=X and YPOS=Y
Alternatively the display position can be moved relative to its current position by:
UPDXY (DX,DY) UPDX (DX) UPDY (DY)
The basic line drawing command is:
TODXY (DX,DY)
which draws a line between the points (XPOS,YPOS) and (XPOS+DX,YPOS+DY). In addition the current display position is changed to (XPOS+DX,YPOS+DY).
A frequent need is to move the current display position to one of the edges of the current region. The basic routine of this type is:
DRCTN (DIR) If DIR = 1.0, this sets XPOS = XMIN If DIR = 2.0, this sets YPOS = YMIN If DIR = 3.0, this sets XPOS = XMAX If DIR = 4.0, this sets YPOS = YMAX
where XMIN, YMIN, XMAX, YMAX are the coordinates defining the region boundary.
Most graphical output devices have a number of special hardware symbols which can be output at a specific position on the display area. For example, in the SD4020 a set of basic characters including the digits and upper case alphabet are available.
The basic routine for displaying a symbol is:
PLOT (X)
which outputs the hardware symbol represented by SPROGS character number X at the current display position. (See Appendix for SPROGS numbers. )
The display routines defined so far are not the only ones that are most likely to be used. The following second level routines are defined in terms of the earlier routines:
LEFT = DRCTN (1.0) DOWN = DRCTN (2.0) RIGHT = DRCTN (3.0) UP = DRCTN (4.0) VEC (X1, Y1, X2 , Y2) = SETXY (XI, YI) TODXY (X2-X1, Y2-Y1) TOXY(X,Y) = TODXY(X-XPOS, Y-YPOS) TODX(DX) = TODXY(DX,0.0) TODY(DY) = TODXY(0.0,DY) TOX(X) = TODXY(X-XPOS,0.0) TOY(Y) = TODXY(0.0,Y-YPOS)
It is desirable to have a simple means of expanding and rotating all subsequent output (apart from the options available in the current region). The current setting of expansion and rotation is independent of a particular region. It is just applied to the coordinates supplied by a display routine before the region conversion takes place.
The standard routine for defining expansion is:
EXPAN (EOX,EOY,EX,EY)
which causes all subsequent coordinates to be expanded about the origin (EOX,EOY) by EX in the X-direction and EY in the Y-direction. Thus a coordinate (X,Y), given in a display routine, will be equivalent to (X', Y') where:
X' = EOX + (X-EOX)*EX Y' = EOY + (Y-EOY)*EY
The routine for rotation is:
ROTN (ROX,ROY,RXY)
which rotates the coordinates about the origin (ROX,ROY) by an amount RXY radians in the anti-clockwise direction. Thus a coordinate (X,Y) will be changed to (X',Y') where:
X' = ROX + (X-ROX)*COS(RXY)-(Y-ROY)*SIN(RXY) y' = ROY + (X-ROX)*SIN(RXY)+(Y-ROY)*COS(RXY)
Note that a rotation caused by a call to ROTN is applied before any scissoring (cf rotation caused by a setting of RGPLIM with CNV = 2.0, which is applied after the scissoring).
If the origins for rotation and expansion are different, it is important that the order in which the two operations take place is specified. The standard order is rotation before expansion. The order is controlled by:
ERDR (XI) If XI=1.0, rotation before expansion 2.0, expansion before rotation
The standard method of drawing a line is to draw it solid once only at the standard intensity. A routine is provided to vary the intensity of a line. This applies to all subsequent lines drawn until some other call of the routine occurs.
INTNST (XINT)
changes the current setting of intensity to the new value XINT. XINT should be 0.0 or positive. If XINT = 0.0, the line is not drawn. Otherwise, the line is drawn 2**(XINT-I) times. Due to differences in the photographic properties of paper and film, it is not possible to say that XINT = 4.0 setting will produce a line 4 times as dark as XINT = 1.0. However, it should be possible to differentiate between the intensities produced by the low values of XINT. On the SD4020, XINT = 4.0 is a maximum setting. Note that if a whole film sequence is to be made darker, it is more economic to ask the SD4020 operators to change the camera's aperture setting.
THICK (X)
will cause all subsequent lines to be thickened, according to the value of X. On the SD4020, thick lines are produced by drawing extra lines parallel to the given line, at one raster intervals, so line thickening can be very expensive. If X is negative, ABS (X) lines are added each side of the given line. If X is positive, lines are added on either side of the given line until the line is X units thick in the current coordinate system. With this setting, changing the region coordinates will change the apparent line thickness. Not~ however that the thickness will be unaffected by EXPAN and the calculation to find the correct position of the extra lines will ensure that they are correct for the first base region in the chain. x=0.0 will reset lines to their normal thickness.
DOTTED (DOT,DOTYP)
will cause all subsequent lines to appear broken. DOT determines the length of the resulting visible segments, according to the setting of DOTYP:
Other values of DOTYP may be specified later.
A second level routine:
LNTYP (XINT,X,DOT,DOTYP)
is equivalent to:
INTNST (XINT) THICK (X) DOTTED (DOT,DOTYP)
Although it is not possible to change colour on the SD4020 directly, it is possible to obtain a finished film in colour by outputting separate film sequences for each required colour and using a photographic bureau to produce the required film. Also it is likely that future devices attached to SPROGS will have provision for colour output. Consequently, two routines have been introduced to enable colour films to be produced.
The routine:
COLOUR (X)
will indicate that all subsequent output is to be considered as having a colour set by X (this is a bit setting similar to that used in DVOUT). Thus X=5.0 indicates the first and third colours. The routine:
COLGL (Y)
indicates that output is only to be generated for lines whose colour matches one of those specified by the bit setting of Y.
For example, if a two colour film is to be produced, the user should write the appropriate orders, using COLOUR to indicate which lines are which (settings 1.0 and 2.0, say). These orders can then be obeyed twice, interspersed by a call to FLEMKS to separate the sequences (see Section 10.4 ), once with COLGL (1.0) and once with COLGL (2.0). The resulting two film sequences will be in step for the merging process. COLGL (3.0) will output both colours together (for test runs, or to obtain the background).
In order to complete the current display and initialise the display for the next output, the routine:
ADVFLM
is defined.
This routine causes the output on a particular frame to be concluded on the defined output devices. In the case of the SD4020 it will cause the film to be advanced in the microfilm or hardcopy cameras.
SPROGS allows a user to define his own display routines, which can be used in the same way as the system defined ones. However, the user is advised to follow the rules carefully, as malformed, display routines can cause havoc in the rest of the system.
The user must write two routines, one taking care of file storage (see Chapter 4) and the other dealing with the execution of the routine. He must then make SPROGS aware of this new routine, by calling:
NEWDSP (ANAME('DSPRTN'), XNO, XNI)
In the above, DSPRTN is the name of the first user routine, and will be the name by which the user refers to the display routine. XNO is the number of arguments expected by the routine, in the range 0.0 ≤ XNO ≤ 6.0. XNI is the desired display routine number, which must be in the range 82.0 ≤ XNO ≤ 89.0 (Appendix 3 indicates this bank of numbers as being available for use).
The execution routine must have the name:
DSPF * (A)
where * indicates the chosen display routine number. Thus, if XNI = 84.0, the corresponding execution routine must be:
DSPF84 (A)
A is an array containing the arguments for the routine. It must have dimension equal to XNO, except that if XNO = 0.0, A must still be present (with dimension 1).
The display routine itself has a very strict format:
SUBROUTINE DSPRTN (X,Y) DIMENSION A(2) A(1) = X A(2) = Y IF (IDSTST (XNI,A) ) 2,1,2 1 CALL DSPF * (A) 2 RETURN END
Note that:
>The user execution routine must not contain calls to DRAW, STSQLS or ADVFLM.
Example:
SUBROUTINE PLOTX (X,Y,Z) DIMENSION A(3) A(1) = X A(2) = Y A(3) = Z IF (IDSTST (85.0,A) ) 2,1,2 1 CALL DSPF85 (A) 2 RETURN END SUBROUTINE DSPF85 (A) DIMENSION A(3) CALL SETXY (A(1), A(2) ) CALL PLOT (A(3) ) RETURN END MASTER MAIN CALL STSPR CALL NEWDSP (ANAME('PLOTX'),3.0, 85.0) ............. CALL PLOTX (3.0, 4.0, 22.0) ............ END
Display routines have a special significance, in that they can be used in files (see Chapter 4) and can be used in conjunction with index variables (see Chapter 7). The facility described above should only be used by those who want to make use of these two features, otherwise normal FORTRAN subroutines are more efficient.
So far, we have defined how graphical output can be produced immediately, the call of a display routine causing output to be produced as a result of the call. A second mode of operation allowed in SPROGS is for calls of display routines to cause the commands to be stored in a file that will be obeyed at a later point. SPROGS files can also be used to store the basic orders for a particular output device, so that background information can be speedily produced. The user may have 256 distinct files. Full details of their flexibility will become apparent when the sequence list is described.
In its simplest form a file can be defined by the following:
STDF (ANAME('PICT')) VEC (X1, Y1, X2, Y2) FIDF (1.0)
The two routines STDF and FIDF define the start and finish of a file whose name is PICT. The point at which a file is defined will normally not be important as long as it is defined before it is used. The function ANAME converts the character string of the name (which may consist of up to 7 characters) into a real number packed form, in order to overcome the problems of manipulating text in FORTRAN. File names may consist of any characters. However, if the name is longer than four, only alphanumeric characters may be used, and the name must start with a letter.
To output this file at a later point 1n the program, call:
DRAW (ANAME('PICT'))
The result of the DRAW call is, in the simplest case, equivalent to replacing the DRAW call by the set of subroutine calls which made up the file.
It is likely that the amount of store required will be significant. For example:
STDF (ANAME('FAN')) DO 10 I = I1, 500 X = I VEC (0.0,0.0, X, 500.0) 10 CONTINUE FIDF (1.0)
This would store away the 500 vector orders in some form.
In the examples given above, the files just contain drawing routines (display routines which are designed to produce lines or plots on the output device). The file need not contain any information about the region in terms of which it is defined.
For example:
RGLIM(1.0,0.0,0.0,10.0,10.0) RGPLIM(1.0,0.0,0.0,1023.0,1023.0,0.0) RGLIM(2.0,0.0,0.0,500.0,500.0) RGPLIM(2,0,1.0,0.0,0.0,5.0,5.0) RGLIM(3.0,0.0,0.0,500.0,500.0) RGPLIM(3.0,1.0,5.0,5.0,10.0,10.0)
This defines regions 2 and 3 as the bottom left and top right areas of the display area. Both have the same limits.
The following routine calls:
REGION (2.0) DRAW (ANAME('FAN')) REGION (3.0) DRAW (ANAME('FAN'))
will produce the fan in two positions on the display area. Thus a single fan file can be used to produce a number of pictures of different sizes and shapes depending on the region selected when the DRAW routine is called.
The files described above have been absolute in the sense that the coordinates of the lines making up the file are defined even if the particular region selected will cause the output to vary. Consider the following:
STDF (ANAME('BOX')) TODXY (1.0,0.0) TODXY (0.0,1.0) TODXY (-1.0,0.0) TODXY (0.0,-1. 0) FIDF (1.0)
In this case, the box defined is relative to the display position when the file is output. For example:
SETXY (0.0,0.0) DRAW (ANAME('BOX')) SETXY (5.0,5.0) DRAW (ANAME('BOX'))
will produce two boxes having bottom left corners at (0,0) and (5,5) respectively.
One important point not mentioned so far is that the call of DRAW does not usually change the setting of the display position. On exit, the display position will be reset to its initial value. Also, the region selection, intensity, thickness, dotting, colour, rotation and expansion factors will be reset.
It is possible to have the display position left at its final value when the DRAW is completed. This is achieved by defining the file initially with the termination of the file being generated by:
FIDF (2.0)
Another value of the argument for FIDF has been defined overleaf, and others may be defined, to allow some subset of the system parameters (such as rotation factor, etc) not to be reset to their initial values on exit.
So far only files consisting of routines which produced graphical output have been considered. However it is possible to include in the file many of the orders defined so far.
For example, the following file is permanently linked with region 2:
STDF (ANAME('BOX')) REGION (2.0) FIDF (1.0)
Similarly, particular line parameters can be associated permanently with a file by:
STDF (ANAME('BOX')) INTNST (XINT) . . . . FIDF (1.0)
Again, the initial attributes will be reset after the draw has been completed.
However, one display routine, ADVFLM, has special significance when used in a file. For this reason, the term picture file will be used to describe a file that does not contain ADVFLM. A file containing one or more ADVFLM commands will be termed a film file.
There is no reason why a file should not be defined with subfiles. For example:
STDF (ANAME('BOXTRI')) SETXY (0.0,0.0) DRAW (ANAME('BOX')) SETXY (3.0,0.0) DRAW (ANAME('BOX')) SETXY (5.0,5.0) DRAW (ANAME('BOX')) FIDF(1.0)
In this case the file BOXTRI contains three calls of the subfile BOX as part of it. When the file BOXTRI is drawn, the result will be three boxes at different positions. Each subfile level will reset the attributes relevant at the previous higher level. In particular the current display position will be reset to its value on entry (but see Section 4.6).
The name of each file consists of two parts. The first is the file name as given in the STDF instruction. The second is the file number. In the examples given so far, the file number has always been set to 1. This is the assumed value if none is given. A different file number is achieved by:
NUMBR (3.0) STDF (ANAME('BOX')) . . . FIDF (1.0)
This defines the file as BOX/3. The number can be of great value when a group of similar files is required as these files can be differentiated by the numbering. To call a subfile with a particular number:
NUMBR (3.0) DRAW (ANAME('BOX'))
The routine number is associated with the next file called or defined. This action automatically resets the file number back to 1. Thus:
NUMBR (3.0) DRAW (ANAME('BOX')) DRAW (ANAME('FAN' ))
will output BOX/3 and FAN/1.
Sometimes, however, it is more convenient to leave the file number unaltered - for example, when defining characters (see below). If a file is defined with:
FIDF (3.0)
then neither the current display position nor the file number would be reset, either after the definition of the file, or its execution. Hence in the above example, defining file BOX with this setting of FIDF would cause FAN/3 to be drawn.
It is also possible to change the current file number by:
RLNUMB (XN)
which selects CURRENT NUMBER + XN. However, the file number is always constrained to be positive. This routine is useful when dealing with character fonts (see below).
As mentioned at the start of this chapter, it is possible to use the file structure to save basic device orders. The routine:
STSAV (ANAME('BSFILE'),DEV)
will cause all subsequent output to the single device specified by DEV (bit setting as for DVOUT) to be stored in the named file instead. Only one device may be selected in this way, and, as only one file of any type may be defined at anyone time, STDF may not be used while this file is open.
Saving is ended by the command:
FISAV
Subsequently, if the file is DRAWn, and device DEV is selected, the contents of the file is sent directly to the device. Since this does not involve the region chain, the use of basic files will greatly speed the duplication of constant information from one frame to the next. Currently, only SD4020 output may be stored in this way.
There is one restriction, however. No frame advance orders will be stored in a basic file. The use of ADVFLM will lead to a warning message, and the order will be ignored. Thus only one frame of information may be stored in a basic file.
This restriction is brought about by the special use of ADVFLM within files, which will be explained in the Chapter on the sequence list.
Whenever a file name is re-used, the space taken by the original file in the file store will be lost. If a lot of re-using of file names is employed, the SPROGS program will take up a considerable amount of store on the 1906A. To regain this space, the routine:
GARBGE
should be called (not during a file definition). The amount of space saved will be printed.
Apart from re-using a file name, files may be explicitly deleted by:
DLETE (ANAME('BOX'))
This routine must not be used during a file definition. The space saved is not regained until GARBGE has been called.
It is possible to save picture, film or basic files in a 1906A EDS file for subsequent access. Such libraries have a directory which can be listed, and items added to or deleted from it.
The user wishing to save files in a library must first create a 1906A EDS file (*ED or *DA) with 4 block buckets (see Section 11.6). The bucket size is important, since errors will result if any other size is specified. The file should be assigned at run time to an ED or DA channel via the SPROGS macro (see Appendix 12). If the library is to be written or erased, the qualifier (OVER) must be added to the ED assignment, for example:
#ED2 MYLIB(OVER)
The channel number chosen will be treated by SPROGS as the library number, which need not be the same from run to run. However, channels 11, 12 and 13 have a special use (see Chapter 6 on character fonts).
Before use, a library should be initialised by:
LIBINT (XLIBNO)
This routine will also erase all files on an existing library.
There are five display routines which control access to a library:
PUTLIB (ANAME('PICT'),FNO,XLIBNO)
writes the file called PICT, number FNO, to library XLIBNO, deleting any existing copy of the file already there.
GETLIB (ANAME('PICT'),FNO,XLIBNO)
sets up an entry in the file table, ready to read down file PICT, number FNO, from library XLIBNO. The file is not actually brought into the file store until it is used.
GALLIB (XLIBNO)
sets up all files 1n library XLIBNO.
ERSLIB (ANAME('PICT'),FNO,XLIBNO)
erases the file PICT, number FNO, from library XLIBNO.
LSTLIB (XLIBNO)
lists the directory on library XLIBNO.
PUTLIB will not affect the file in the filestore. ERSLIB will erase the filestore entry only if GETLIB or GALLIB has been called for that file, but the file itself has not yet been used.
In the previous chapter the idea of a picture file and film file (a file containing an ADVFLM) has been introduced. Little information has been given as to what will appear in the file and how efficient the recall of the filed information will be. This chapter outlines the method of storage control.
In Chapter 3, a list of some of the standard display routines with their meaning was given. It was shown that some are treated as fundamental routines in terms of which others can be expressed. Thus the basic line drawing routine is TODXY and a routine such as VEC can be expressed as a call of TODXY. If a routine such as VEC is called within a picture file definition, it is possible to store the equivalent of either a call of VEC or a call of TODXY.
In general, the more basic the routine call that is stored away, the more space that will be used but also the more efficient will be the recalling of the picture. Thus, for example, a call to a routine such as CIRCLE might either store a single call to CIRCLE or, alternatively, many calls to the routine TODXY defining the individual line segments making up the circle. However, although the storing of TODXY calls will give rise to a file which will execute faster, the file will be considerably longer. Also, a circle that will appear small on the display needs few lines to represent it, whereas a large circle needs many lines. Thus storing the call to CIRCLE might be more advantageous.
The previous examples have been introduced to show that there is a need to be able to define exactly what gets stored in the picture file. If one of the hardware output devices has a circle generator in the hardware, then it would be advantageous to force the storage of the CIRCLE call. The decision as to what is stored in the picture file is controlled by two variables called NPRYV, the global priority level, and LPRYV, the local priority level. In general, each display routine has a local priority level associated with it. The basic routines such as SETXY and TODXY have a local priority level of 1 assigned to them, while routines such as VEC have a local priority level of 2 associated with them. When a picture file is defined, the current value of NPRYV will either be assumed to be 100 or will be set prior to the call of STDF by calling:
PCPRY (P)
which would set the global priority level value, NPRYV, to P.
The basic action on calling a display routine is as follows:
Consider for example:
PCPRY (P) STDF (ANAME('BOX')) VEC (1.0,2.0,3.0,4.0) FIDF(1.0 )
If P has the value 2 then NPRYV and LPRYV are both equal to 2 and the picture file for BOX will consist of the call to VEC. However, if P is set to 1 then NPRYV is less than LPRYV. Consequently, VEC will be executed. This causes the following routines to be obeyed:
SETXY (1.0,2. 0) TODXY (3.0-1.0, 4.0-2.0)
In this case these two calls will be stored in the picture file for BOX.
The idea of a priority level thus gives the ability to choose what information gets stored in the picture file. Unless altered, the standard global priority level when defining a file is 100. The value of NPRYV is reset to -1 on completing each picture file definition. Thus with the standard global setting, all display routines are stored.
For most display routines a standard local priority level is assigned which is constant for all calls of that routine. A full list of these is given in the Appendices.
In some cases it is useful for a routine to be called with different local priority levels. The most used routine of this type is the routine DRAW. Unlike routines such as VEC, DRAW does not redefine the value of LPRYV. Instead,it uses the value assigned on entry. This will usually be 1 but can be reset if the routine LCPRY (P) is called before the call of DRAW. This will set the value of LPRYV to P.
Consider:
PCPRY (2.0) STDF (ANAME('BOX')) VEC (1.0,1.0,2.0,2.0) FIDF (1.0) PCPRY (P) STDF (ANAME('TWO')) LCPRY (Q) DRAW (ANAME('BOX')) LCPRY (R) DRAW (ANAME('BOX')) FIDF (1.0)
The first picture file BOX consists of a single call to VEC as it was defined with a global priority level of 2. The contents of the second picture file TWO will depend on P, Q and R. Setting Q and R equal to 1 is equivalent to not having the LCPRY calls at all (the assumed value of LPRYV is 1). In this case, if P is equal to 1, the picture file TWO will consist of two calls to the routine DRAW. One important point in this case is that, subsequently, BOX could be redefined which would automatically redefine the meaning of TWO. If P = 1, Q = 1 and R = 2 then the file TWO will consist of:
DRAW (ANAME ('BOX') VEC (1.0 , 1.0, 2.0, 2.0 )
Note that in this case, redefinition of BOX would alter the first part of TWO but not the second. Once BOX has been defined, however, it is not possible by use of LCPRY to cause the above call of VEC to be further reduced to SETXY,TODXY.
FIDF will reset the value of LPRYV to 1.
Mention has already been made of the PLOT routine to print a hardware character on a device. SPROGS also provides a number of character sets made up of vectors. These characters will, of course,respond to expansion and rotation commands.
Unlike other systems, characters are defined as picture files, and can be used in exactly the same way as other files. For example, the letter A is contained in a file called A, and is printed by:
DRAW (ANAME('A'))
After a character has been drawn, the current display position (XPOS, YPOS) is left at the end of the character and the current file number is not reset (that is, the character is defined with FIDF parameter 3.0). A user may redefine any of the basic characters, replacing the body of file A by any orders, and hence replace the character A used in any of the subsequent text handling routines.
To avoid unintentional redefinitions of characters, the user is advised to avoid single character file names for non-character files.
The characters are collected into groups of 64, called fonts. The representative file names refer to the first 64 characters in the SPROGS set (see Appendices). Note that punctuation characters are legal file names. Different fonts will be distinguished by different file numbers, thus:
NUMBR (1.0) DRAW (ANAME ('A' )) NUMBR (2.0) DRAW (ANAME ('A' ))
will output A from fonts 1 and 2. The characters in different fonts may be extensions of previous fonts , or different styles. For example, font 2 is an extension of font 1 including lower case letters, whereas font 3 is a different style of character.
Included with each font are three files which provide suitable control information for laying out the font. File NL gives a newline, file VT gives a backspace, linefeed for vertical text printing, and file BS gives a backspace.
Fonts are initialised by:
GETFNT (XN)
which will set up font number XN.
Thus:
GETFNT (1.0)
will initialise the standard upper case font. Before the font is used, however, the appropriate file number must be set since GETFNT leaves the selected file number as 1.
This routine sets up the appropriate system library on ED channel 11, 12 or 13, and uses GETLIB to read the characters into the file table. However, as mentioned earlier this does not cause the body of the characters to be read in until they are used.
When fonts 1 to 4 are initialised by GETFNT, the three characters @, ↑ and ← are not read into the file table (their places in the library are taken by the three special files mentioned earlier). If these characters are required, they must be read in by:
GETCHA (ANAME('CHAR'),XN)
which will read the character CHAR from font XN.
Thus:
GETCHA (ANAME('@'),4.0)
will retrieve @ from font 4. This routine may be used to read in any character from any font.
Each font will be defined with a basic size suitable to its complexity. It is possible to select suitable sizes by using the EXPAN routine (but see Section 6.7 on scaling of text). Note that, as lineprinter graphical resolution is much worse than SD4020, software characters will appear somewhat strange in small sizes.
To output a large amount of text, the routine:
TEXT (N,'STRING')
is available. This routine normally causes N calls to DRAW, one for each of the N characters in the specified string, together with calls to TEXSW to allow for scaling (see Section 6.7). Normally,all these characters will be taken from the same font, unless shift characters are used (see below). Alternatively, the user can produce his own mixed font by redefining files.
If the user wishes to output text in a vertical column, the routine:
VTEXT (N, 'STRING')
will act in the same way as text, but will DRAW file VT between each character. If he wishes, the user can redefine VT and hence angle text in any way, with the characters remaining upright. (Compare this with using ROTN, when the characters are rotated as well.)
It by In It is possible to specify shift characters which will be interpreted by TEXT,VTEXT as a change in file number, rather than as a DRAW. In this way, characters of different fonts can be mixed.
SHIFTU (XN)
Is a display routine which selects the character whose SPROGS number is XN as the upper shift character. Further use of this character in TEXT,VTEXT will cause the current file number + 1 to be selected. XN less than or equal to 0 will remove any upper shift character. XN may not be a letter, digit, plus sign, minus sign or full stop.
SHIFTD (XM)
similarly, causes the character whose SPROGS number is XM to be taken as select current file number - 1. The same restrictions apply as for SHIFTU. The current file number is not allowed to go below 1. If the same character is chosen for both shifts, only the lower shift is active.
The routine:
NLINES (XN)
will output XN newlines by drawing file NL the specified number of times.
The routine:
NPAGE
will throw to the top of a new page relative to the current region by calling:
ADVFLM UP DRAW (ANAME ('NL'))
Two routines are available to print a number on the current frame.
TYPEN (A,XI,XJ)
will print number A, using the current font and starting at the current position, in a format defined by XI,XJ as follows:
XI = 0.0 E format, field width XJ+7 XJ = 0.0 I format, field width XI+1 XI,XJ not = 0.0 F format, XI places before decimal point, XJ places after. Field width XI+XJ+2.
The format includes a space for positive numbers or a minus sign for negative ones.
VTYPEN (A,XI,XJ)
uses VTEXT instead of TEXT to print the characters, so the number will normally be printed vertically.
The currently available fonts are listed 1n the Appendices. More will be added later.
Characters in a font are defined on a small rectangular grid, and they can be scaled to the required size by using EXPAN. However, a user wishing to mix text and pictures would find the repeated use of EXPAN tiresome (to cope with the different scales required for the two types). The following display routines have therefore been added:
TEXPAN (EXT,EYT)
selects EXT,EYT as current text expansion factors. However, no expansion will take place unless:
TEXSW (XSW)
is used. If XSW = 2.0, the following scaling takes place for every relative display order that is executed from file.
XPOS' = XPOS + DX*EXT YPOS' = YPOS + DY*EYT
where (XPOS',YPOS') is the new current display position. The display routines affected by this are:
UPDXY UPDX UPDY TODXY TODX TODY
but only when they are executed from a file.
If XSW is not 2.0, no expansion takes place. This is the initial state.
The settings of EXT,EYT and XSW are preserved on entry to a file, and are reset to their previous values on exit.
The routine TEXSW will be called by the high level routines TEXT,VTEXT. Expansion will be switched on before any characters are drawn and switched off at the end of the text string. Users wishing to make use of this scaling when executing other files, or drawing a character file outside TEXT,VTEXT, must call TEXSW themselves.
Two other routines have been prov1ded to assist in choosing the correct scaling factor.
GVCHSZ (DX,DY)
sets DX,DY to the text expansion factors required to make the currently selected font, if DRAWn in the currently selected region, appear the same size as if the base region had been selected and the character DRAWn with the previously selected TEXPAN setting. (In this context, base region refers to the first such region encountered in the region chain.)
Thus:
TEXPAN (0.5,0.5) NUMBR (1.0) GVCHSZ (DX,DY) TEXPAN (DX,DY)
will set the text expansion factors so that subsequent font 1 characters, if the base region is destined for the SD4020, appear half their natural' S1ze (see Append1x 7 for natural font sizes: for the SD4020 font 1 characters will occupy 16/1023 of a frame. The above orders will cause characters to appear to occupy 8/1023 of a frame each.).
STCHSZ (DX,DY)
will set the text expansion factors (by calling TEXPAN) so that the current font will appear to be defined on a character grid of DX,DY in the current region units, as opposed to the standard size specified in Appendix 7. This routine DRAWs file VT to ascertain the size of the current font. It is intended for those who know how many characters they wish to fit into the current region.
Example 1.
NUMBR (1.0) TEXPAN (0.5,0.5) SHIFTU (ANAME('[')) SHIFTD (ANAME(']')) TEXT (6,'AB[C]D')
will produce the text string:
ABcD
in characters half the normal size.
Example 2.
If the current region has limits (0,0,10,10), each character 1n font 1, if unscaled, will more than cover the region by itself.
TEXPAN (EX,EX) with EX = 10*16/1023
w1ll cause the characters to appear in this region as they would 1n the basic SD4020 region.
Example 3.
The previous example could be done by:
GVCHSZ (DX,DY) TEXPAN (DX,DY)
The user would not need to bother with the actual values of DX and DY.
Example 4.
If a user wishes to fit 30 characters to a line, with current region limits (0,0,10,10), he can use:
STCHSZ (DX,DX) with DX = 10/30
So far, picture and film files have been defined in a fairly rigid form. By redefining the position of regions or changing the selected region, it has been possible to vary the result of the executed file. However, no major alterations have been possible. In order to add greater flexibility, index variables have been defined, so that references to them may be stored in a file, and values given at file execution time.
A set of 256 global variables is available to a user, each variable being capable of holding a single length floating point number. These variables can be given names using ANAME in the same way as files, but it is advisable to restrict the form of a global name to alphanumeric characters. These variables behave like index registers, in that they provide a means of indirection in the value of a display routine argument.
A set of functions, PRn(ANAME('XIND')), has been defined, one function for each possible argument position. Thus:
VEC (1.0, PR2(ANAME('XIND1')), 3.0, PR4(ANAME('XIND2')))
will draw a line between (I,XIND1) and (3,XIND2) where XIND1, XIND2 are the values currently held in the two specified index variables. The above format is necessary to keep within the definition of FORTRAN, but a simpler format is available if the preprocessor is used (see Chapter 13).
Global variables are used mainly with files.
Thus:
STDF(ANAME ('PICT')) SETXY (PR1(ANAME ('XIND1')), PR2(ANAME('XIND2'))) TODX (1.0) TODY (PR1(ANAME('XIND3'))) FIDF (1.0)
will define a picture file consisting of two lines, one horizontal of constant length, the other vertical of variable length. The left hand end of the horizontal line is determined by the values in XIND1,XIND2.
A set of display routines has been defined to perform arithmetic on global variables at run time.
Routine | Action |
---|---|
LOAD (ANAME('XIND'),VAL) | XIND=VAL |
ADD (ANAME('XIND'),VAL) | XIND=XIND+VAL |
SUB (ANAME('XIND'),VAL) | XIND=XIND-VAL |
MPY (ANAME('XIND'),VAL) | XIND=XIND*VAL |
DVD (ANAME('XIND'),VAL) | XIND=XIND/VAL |
POW (ANAME('XIND'),VAL) | XIND=XIND**VAL |
NEG (ANAME('XIND')) | XIND=-XIND |
In addition, the following arithmetic functions are available: | |
SINX (ANAME('XIND'),VAL) | XIND=SIN(VAL) |
COSX (ANAME('XIND'),VAL) | XIND=COS (VAL) |
LOGX (ANAME('XIND'),VAL) | XIND=ALOG(VAL) |
EXPX (ANAME('XIND'),VAL) | XIND=EXP(VAL) |
In the above, of course, either argument can be replaced by an index variable reference (PR) to add to the function capability.
LOAD (ANAME('XIND3'),0.0) LOAD (ANAME('XIND1'),1.0) LOAD (ANAME('XIND2'),1.0) DO 10 I = 1,50 ADD (ANAME('XIND3'),1.0) DRAW (ANAME('PICT')) ADVFLM 10 CONTINUE10
will draw lines between (1,1) and (2,1), and between (2,1) and (2,X+1) on the next 50 frames, with X increasing from 1 on the first frame to 50 on the last.
A number of display routines have been defined to give access to the current region parameters and the current X,Y position. These system variables are read in to the specified index variables.
Routine | Parameter |
---|---|
RDREG (ANAME('XR')) | current region number |
RDLIM (ANAME('X1'),ANAME ('Y1'),ANAME('X2'),ANAME('Y2')) | current region limits |
RDPLIM (ANAME('XR'),ANAME('XP1'),ANAME ('YP1'),ANAME('XP2'),ANAME('YP2')) | current RGPLIM limits |
RDSHAP (ANAME('XCNV'),ANAME('XBSC ')) | current region shape |
RDVISO (ANAME('XVI' ),ANAME( 'XVO')) | current region visibility |
RDBASE (ANAME('XSW')) | current region device setting |
RDXY (ANAME('XP'),ANAME('YP')) | current values of XPOS,YPOS |
It is possible to define a file, which contains data only, by using the display routine:
NULL (X)
Files containing only NULL commands are termed NULL files. It is possible to read data from NULL files using global variables, and use the data as arguments to display routines. The functions:
ARn (ANAME('F1'),ANAME ('FNO'),ANAME('NT'))
(one for each argument position like PRn), specify three global var1ables. The first two contain the file name and number of a NULL file, and the third is a pointer into the file. The filename is in its real number form.
Thus:
STDF (ANAME('PATH')) NULL (1.0) NULL (2.0) NULL (3.0) NULL (4.0) FIDF (1.0)
defines a NULL file, and the file:
STDF (ANAME('LINE')) SETXY (AR1(ANAME('FI'),ANAME('FNO'),ANAME('PNT')) ,0.0) TODXY (0.0,1.0) FIDF (1.0)
will, when executed, draw a line from a point whose X coordinate will be found in the file defined by F1,FNO at position PNT.
Thus:
LOAD (ANAME('F1'),ANAME('PATH')) LOAD (ANAME('FNO'),1,0) LOAD (ANAME('PNT'),0.0) DO 10 I=1,4 ADD (ANAME('PNT'),1.0) DRAW (ANAME('LINE')) 10 CONTINUE
will generate a series of lines, starting at (1.0),(2,0),(4,0) and (8,0) respectively.
Attempts to access beyond the bounds of the NULL file will always give the value 0.0.
Although not strictly related to index variables, it seems natural here to develop the idea of NULL files further. It is possible to give meaning to a NULL routine within a file by using:
NULSET (ANAME('DPRTN'))
where DPRTN is the text name of a display routine.
If NULL is used outside a file, an error will result. Inside a file, however, NULL will be treated as a call to routine DPRTN. If this routine requires more than one parameter, the system will take extra parameters from following NULLs, (or fill up with 0.0 if no more NULLs are present).
Thus:
NULSET (ANAME('TOXY')) DRAW (ANAME ('PATH'))
is equivalent to:
TOXY (1.0,1 .0) TOXY (4.0,8.0)
and:
NULSET (ANAME('VEC')) DRAW (ANAME('PATH'))
is equivalent to:
VEC (1.0,2.0,4.0,8.0)
DPRTN may not be NULL, FIDF or ADVFLM.
The user need not know anything about the way picture files are stored inside the machine. However, he can save storage space by requesting that the files should be packed. Such files will take less space, but will take slightly longer to access.
A file consists of a header followed by a file body. Each line in the body consists of a number representing the display routine stored, a marker to indicate the type of arguments following (whether they were PR or AR references) and the arguments themselves. Various modes of storage have been defined. (In the following, DSPRT will represent the display routine and PRMV will represent the type indicator. Two bits in PRMV are used for each argument.)
DSPRT, PRMV and the arguments will be stored as 48 bit real numbers. This is the default mode setting.
If the arguments are all to be treated as values (ie no PR or AR references are present), PRMV will be 0. In this mode, PRMV is not stored.
DSPRT, PRMV and the arguments will all be stored as 24 bit integers.
All arguments are assumed to be integers in the range -2048 to +2047, and are packed in 12 bits. If any argument are larger, only the lowest 12 bits are packed.
All arguments are assumed to be integers in the range -32 to +31 and are packed in 6 bits. If any arguments are larger, only the lowest 6 bits are packed.
DSPRT is packed into 12 bits. If, however, compressed mode is also selected, and DSPRT is less than 64, it will be packed into 6 bits.
If there are few arguments, PRMV will be small. In this case, PRMV will also be packed, in the same way as DSPRT.
The routine:
FMODE (XM)
will set the current mode required to XM. More than one mode may be selected. The bit settings of XM determine which modes are required (compare DVOUT definition). Thus FMODE (25.0) will select value, compressed and basic modes. FMODE will give an error if incompatible modes are selected together.
If every line of a file cannot be stored in the required mode without losing vital information (except for the truncation of reals to integers and the packing of arguments), the file will be stored in normal mode instead.
Note, however, that no check is made on argument packing. It is therefore possible to truncate a file name or index variable name on packing, and this will give rise to erroneous results when the file is DRAWn.
Normal graphical facilities are provided by the system described so far. Single frames and simple films can be produced. However, there is often a need to define independent parts of a film, or even independent movements. For example, a film sequence could be split into a constant background and a moving part, with the requirement that the background be repeated on all frames, or a camera zoom onto a subject might be required, with the zoom motion being independent of the subject itself. It is also helpful to allow one action to influence another, as when one object moves across the screen and another appears when the first has reached a specified point. The sequence list provides this facility, by allowing separately defined files to be merged.
The sequence list can be considered as a series of film files (ie files containing ADVFLM), which will be obeyed in parallel, using the ADVFLM orders to keep in step. In the simplest case, film files will be placed in the list and, when execution of the list begins, orders in the first file in the list are obeyed until an ADVFLM order is reached. That file is then suspended with certain system variables saved on a file stack (the same variables that are saved when a DRAW is obeyed) and the next file in the list is started. No frame advance order is issued to any output device until the last item in the list is obeyed. At this point, the advance frame order is issued and execution restarts at the first file in the list, with the system variables restored. Execution continues in this manner, with exhausted files being deleted from the list, until all files are exhausted. At this point, the conditions pertaining at the start of sequence execution are restored.
Consider the two files:
STDF (ANAME ('MOVE')) foreground frame 1 ADVFLM foreground frame 2 ADVFLM foreground frame 3 ADVFLM FIDF (1.0)
and:
STDF (ANAME ('STILL')) DRAW (ANAME ('BKGD')) ADVFLM DRAW (ANAME ('BKGD')) ADVFLM DRAV; (ANAME ('BKGD')) ADVFLM FIDF (1.0)
Placing these on the sequence list, and executing, would have the same effect as DRAWing the file:
STDF(ANAME('BOTH')) foreground frame 1 DRAW (ANAME('BKGD')) ADVFLM foreground frame 2 DRAW (ANAME('BKGD')) ADVFLM foreground frame 3 DRAW (ANAME ('BKGD')) ADVFLM FIDF (1.0)
The advantages of splitting simple files in this way are that the same background file can - be used with another foreground file, and the different function of foreground and background has been logically separated. The power of this technique will become apparent as more features are introduced.
There are two commands that add items to the sequence list:
ADSQLG (ANAME('PIC'),X,Y) ADSQLL (ANAME('PIC'),X,Y)
Both these commands are display routines, and so items can be added to the list while it is executing by including the commands in a file already on the list. The two commands identify the conditions required when the file is first obeyed. If ADSQLG is used, the conditions prevailing at the start of the sequence execution are restored prior to file PIC being started. ADSQLL will cause no restore, PIC being started with whatever conditions hold at the time execution of the file begins.
The bit setting in X determines the various conditions which apply to this item in the list. At the moment, only one condition is relevant.
The third argument, Y, is intended for use when local index variables are defined. It is currently ignored, but must be present.
Execution of a sequence list is initiated by the DRAW command already described or by:
STSQLS
The additional function of DRAW is effective only if no sequence execution is currently in progress, since there cannot be two sequence lists currently in operation. STSQLS has the same effect as DRAW without adding a file to the list.
DRAW (ANAME('FILE1')) is equivalent to ADSQLL (ANAME('FILE1'),0,0,0.0) STSQLS
Items are put into the list in order. Thus the sequence:
ADSQLG (ANAME('FILE1'),0.0,0.0) ADSQLL (ANAME('FILE2'),0.0,0.0) DRAW (ANAME('FILE3'))
will enter files FILE1 , FILE2, FILE3 onto the list and begin execution at FILE1 (_not at FILE3)). If FILE2, say, contained a command:
ADSQLL (ANAME('FILE4'),0.0,0.0)
this file would be added to the list following FILE3, when the command was obeyed.
It is possible to delete or suspend items in a sequence list, and resurrect suspended items, by commands contained in other items.
DLSQLS (ANAME('PIC'))
will delete the file PIC from the list. It is possible for an item to delete itself, when the effect will be the same as if:
FIDF (1.0)
had been encountered.
Note that in this and all other commands which reference a sequence list item, the file name is the name of the original file added to the list, and not the name of the file that is currently being obeyed in that item (for example, PIC might call JIM, which could contain an ADVFLM order. DLSQLS will always reference the item by the name PIC, which appeared in the ADSQLG,ADSQLS or DRAW command).
SPSQLS (ANAME('PIC'))
suspends the appropriate item, but does not delete it. Execution of the sequence list continues with that item being ignored. If an item suspends itself, an ADVFLM order will be simulated prior to the suspension.
RSSQLS (ANAME('PIC'))
brings back to life any suspended item. This item will continue to be obeyed when its turn comes aga1n in the circular scan of the list.
Note that neither deletions nor suspensions affect the order of items in a list.
For example, consider:
STDF (ANAME('SQRFLM')) DRAW (ANAME('SQ1')) ADVFLM SPSQLS (ANAME('BOX')) DRAW (ANAME ('SQ2') ) ADVFLM RSSQLS (ANAME('SQ2')) ADVFLM DLSQLS (ANAME('BOX')) DRAW (ANAME('SQ3')) ADVFLM FIDF (1.0) ADSQLG (ANAME('BOX')) DRAW (ANAME('SQRFLM'))
This sequence would cause the first frame in file BOX, and file SQ1, to appear on frame 1, SQ2 to appear on frame 2, the second frame in file BOX to appear on frame 3, and SQ3 to appear on frame 4.
Since it is possible to control a sequence item from outside itself, it is safe to provide a repetitive command.
REPEAT
will cause the file in which it appears to be started at the beginning again. This means that a background file could consist of:
STDF (ANAME ('STILL')) DRAW (ANAME('BKGD')) ADVFLM REPEAT FIDF (1.0)
Note, however, that this file will continue to execute unless some control is imposed from outside, and also that the REPEAT returns to the start of the file in which it appears, which may not necessarily be the head of the sequence list item.
The command:
STOPSQ
terminates execution of the sequence list. More details of other methods of termination are given in the next section.
The execution of the sequence list will terminate in the following cases.
So far, the only example of interaction between items has been the use of SPSQLS and RSSQLS. There are, however, other methods:
STDF (ANAME('CAM')) DO 10 I = 1,50 X = I RGLIM (1.0,X,X,50.0+X,50.0+X) ADVFLM 10 CONTINUE FIDF (l.0)will provide a camera pan independent of the subject defined in region 1.
In its simplest form, the display routine:
WHILE (VAL1,COND,VAL2)
which can only be used within a file, tests the two specified values according to the condition COND, and obeys the following display routine repeatedly while the condition holds. If the condition does not hold initially, the next display routine is skipped. VAL1 and VAL2 are real numbers. COND is a two-letter text string indicating the condition required:
'EQ' equals 'NE' not equals 'LT' less than 'LE' less than or equal 'GT' greater than 'GE' greater than or equal
This command can only be used within a file, and only makes sense if at least one of VAL1, VAL2 are references to index variables, but note that VAL2 is the third argument of WHILE, and PR3 should be used to indicate an index variable reference in this position.
Example:
WHILE (PR1(ANAME ('XIND')),'LE',5.0) DRAW (ANAME('PIC'))
will draw file PIC as long as the condition holds. It is assumed that somewhere in PIC there are commands to change the value of XIND.
WHILE (PR1(ANAME ('XIND')), 'NE' ,PR3(ANAME('LIM'))) DRAW (ANAME('PIC'))
Here, two index variables control the condition.
The display routine:
IFS (VAL1,COND,VAL2)
has the same effect as WHILE, without the following command being repeated if successful (thus providing a one-shot WHILE).
The power of WHILE or IFS can be increased by bracketing a group of commands as a single one using:
BEGINS, ENDS
For example:
STDF (ANAME('COUNT')) WHILE (PR1(ANAME('XIND')), 'LE' ,5.0) BEGINS ADVFLM ADD (ANAME('XIND'),1.O) ENDS STOPSQ FIDF (1.0)
would act as a counter to a sequence list, outputting ADVFLM orders until the counter reached the limit and then deleting the whole sequence.
Use of WHILE can greatly decrease the amount of store required for a file. For example, the file CAM, defined earlier, would have 50 RGLIM orders in it. It could be replaced by:
STDF (ANAME('CAM')) LOAD (ANAME ('XD'),1.0) LOAD (ANAME ('XD1'),51.0) WHILE (PR1(ANAME('XD')),'LE',50.0) BEGINS RGLIM (1.0, PR2(ANAME('XD')), PR3(ANAME('XD')), PR4(ANAME('XD1')),PR5(ANAME('XD1)'))) ADVFLM ADD (ANAME('XD'),1.0) ADD (ANAME ('XD1'),1.0) ENDS FIDF (1.0)
FILIST (X,XN)
will list the header and contents of the file called X, number XN. Thus file A will be listed by FILIST (ANAME('A'),1.0). However, listing will only take place if the file is present in store.
LSTALL
will list all the files currently defined. Basic files may also be listed.
Display routines give the basic ability to draw lines, etc. More complex facilities are provided by high level routines which, although not display routines themselves, call display routines to produce their effects. Examples of such routines that have been met so far are TEXT, VTEXT, NLINES and NPAGE.
Other routines are described in the Appendices, and include contour drawing, histograms, shading and curve plotting. More routines will be added later.
Two main facilities have been included to assist the user in debugging his SPROGS output.
As was mentioned above, one of the possible output devices is the lineprinter, which lists the coordinates output at that point, together with a visibility marker. Using RGPRM and DVOUT, it is possible to see the coordinates being generated at any stage of the region chain, and so discover, for example whether your blank output is due to all the coordinates being zero or just invisible!
The routine:
LPDBUG
will add lineprinter to the output device settings of the current region (thus making this region the basic output region for lineprinter as well), and select lineprinter output in addition to those devices currently selected.
A display routine:
STRACE (XM,XN)
allows tracing information to be printed on entry to each display routine,whether being executed directly or from file. The first parameter, XM, the trace number, sets the level of tracing required and the second parameter, XN, the trace frequency, sets the frequency of extra tracing. If XM = 3.0, a survey of the current state of the program is output. However, the global variables for the trace number and trace frequency are not altered. In all other cases, setting XM supersedes the previous setting. The table below describes the output for the different levels of tracing.
XM | XN | Tracing Output |
---|---|---|
0.0 | No tracing. This is the initial setting. | |
1.0 | 0.0 | Display routine names and arguments. |
1.0 | XN | As above, with the current region parameters output after every XN display routine calls. |
2.0 | 0.0 | Display routine names and arguments, together with the global variables IPRMV, NFLNO, NPRYV, LPRYV, NTRMLS and ISVCNT (respectively, the parameter type marker, file number, global priority, local priority, output device selection and basic file marker). If STDF, STSAV, FISAV or FIDF are called, some information about the file table is also output. If DVOUT is called, a list of currently selected devices is printed. |
2.0 | XN | As above, together with the current region parameters after every XN display routine calls. |
3.0 | The values of XPOS and YPOS (current display position), the current region chain and the current file store contents and the file stack. | |
4.0 | 0.0 | As for XM=2.0,together with information each time a file stack block is used. |
The display routine:
PRINV (ANAME ('XIND'))
will print the value contained in the index variable XIND, in floating point and text form, on the I/O stream associated with file listing. This will aid in keeping track of the value of such variables during complicated sequence list operations.
The SD4020 has a number of facilities which are not available on other output devices. The following collection of routines allows the user to make use of these features. The routines will only take effect if either SD4020 hardcopy or microfilm cameras are currently selected (with the exception of EXPRED).
EXPRED (A)
If A = 1.0, the SD4020 expand image mode is selected. In this mode, successive frames of 35 mm microfilm will abut. A = 0.0 will reduce the image to normal size (the default setting). This routine will be effective only if microfilm has been selected. If full images are required on 16 mm film, it is suggested that, instead of using this routine, the user instructs the SD4020 operators to use one of the alternative camera lenses.
This routine will also affect lineprinter graphical output. If A=1.0, the page throw between frames is suppressed, thus giving the same abut effect as for 35 mm film.
FLASH
This routine causes the form slide to be projected onto the current frame.
FLEMKS (ANO)
This routine writes ANO filemarks to the SD4020 tape, after first emptying the current buffer.
MF35MM
Normally, the 16 mm camera will be used if microfilm is selected. This routine sends a message to the SD4020 operator instruction stream requesting that the 35 mm camera be used instead. It has no effect if microfilm has not been selected. Note that the operators may not receive this message if spooling is being used (see Chapter 11).
TOPRIN (ANO)
It is possible to cause the actual orders being sent to the SD4020 tape to be printed as well. ANO = 1.0 will turn on the print, and ANO = 0.0 will turn it off. This should be used sparingly for debug purposes only, as it generates a lot of output.
TOTAPE (ANO)
This routine is also useful for debugging. ANO = 1.0 will prevent SD4020 instructions being sent to the tape, although they will be generated. ANO = 0.0 will restore the situation. Using this routine allows the testing for an SD4020 film program to proceed faster since no tape is written.
RUNOUT (X)
This will output X blank frames on SD4020 microfilm, if this device has been selected.
Currently, SPROGS appears to work at about 650 lines per second, using the optimising FORTRAN compiler. The function:
XMLTIM (A)
gives the current mill time usage in seconds so that a user can time his own program. Note that the argument A is dummy, since the time is returned as the value of the function.
From time to time, new facilities will be added to SPROGS. A record of the latest additions will be kept in file:
:SPROGS.SPROGSNEWS
which can be listed. This manual will be updated when there are sufficient changes to make it worthwhile.
Users who do not wish to select lineprinter graphical or SD4020 output during a run can call two routines to prevent the inclusion of the code for these devices at consolidation. This will decrease the store required for the run, but will cause an error if the devices are in fact used.
NOLPG omit lineprinter graphical code NOSD omit SD4020 code
Details of this macro are given in the Appendices. The macro allows a user to compile and run a number of FORTRAN source files. The user may set up his own peripherals before execution and direct all output to file. If the macro is obeyed from a MOP terminal, a message will be broadcast when the job has finished.
Using the SPROGS macro, the user need only provide a program segment if he wishes to include more peripheral devices. The statements given in the standard segment should always be included in any user-provided one. The master segment should begin with:
CALL STSPR
to initialise the SPROGS common variables, and should end with:
CALL ENDSPR
if the SD4020 has been used, to release any magnetic tape or spooling file. Output streams LP1, LP5 and LP6 should be avoided by the user, as LP1 is used for lineprinter graphical output and LP5, LP6 for SD4020 operator instructions. LP5 and LP6 will not be assigned if the SD4020 is not used (but see Appendix 4 for SETIO command). Similarly, LP1 will only be assigned if lineprinter graphical output is selected.
In order to save work tapes, a disc spooling system for SD4020 output has been introduced. Output destined for this device will be sent to a central disc file which will be dumped onto magnetic tape at 2 hourly intervals throughout the day. This tape will have priority over other SD4020 output, and so the spooling system should lead to a faster turnround.
However, users who produce more than 500 blocks of output, or who require special messages to be sent to the SD4020 operators (such as requesting 35 mm output), must make use of a tape themselves by using the macro parameter #MT14.
Any user wishing to retain his SD4020 tape must initially select a tape from his own SPACEMT budget. Worktapes will not be retained once they have been printed.
It is suggested that any user producing microfilm on the SD4020 should precede and end it with at least 200 frames of blank leader, since this will make the film easier to handle.
SPROGS makes use of the COMPRESS INTEGER AND LOGICAL mode, thus reducing the amount of store required for integer and logical variables. The macro will provide a standard program segment, if required, which will also select this mode. Users who require the normal mode (for example, if they are using EQUIVALENCE, or using PLAN routines of their own) should provide their own program segment.
The SPROGS library system uses 1906A EDS files. To create an EDS file suitable for use as a library, the GEORGE command:
CE libname C*DA,KWOR1)
should be issued by the user. SPROGS will extend the file when it becomes necessary.
The film to be generated is a circle which moves from left to right across the screen at constant speed. For simplicity the complete d1splay area is def1ned as a region having units 0 to 50 in both the X and Y directions. The circle moves from X = 1 to X = 50 in 50 frames.
DO 20 I = 1, 50 XX = I CALL SETXY (XX, 25.0) CALL UPDX (1.0) DO 10 J = 1, 64 X = COS(J*PI/32.0)+XX Y = SIN(J*PI/32.0)+25.0 CALL TOXY (X,Y) 10 CONTINUE CALL ADVFLM 20 CONTINUE
The major inefficiency here is the recalculation of COS and SIN for 64 different values each time the circle is generated.
The circle is defined as a file consisting of only relative line drawing commands:
CALL STDF(ANAME('CIRCLE')) CALL UPDX (1.0) OX = 1.0 OY = 0.0 DO 10 J 1, 64 X = COS(J*PI/32.0) Y = SIN(J*PI/32.0) CALL TODXY (X-OX, Y-OY) OX = X OY = Y 10 CONTINUE CALL UPDXY (-1.0, 0.0) CALL FIDF (1.0)
The circle is generated under the assumption that the position of the centre is the display position on entry. The display position is not changed by the routine. Generating the film required would then be:
CIRCLE = ANAME('CIRCLE') DO 20 I = 1, 50 X = I CALL SETXY (X, 25.0) CALL DRAW (CIRCLE) CALL ADVFLM 20 CONTINUE
This form might well be adopted if a number of circles of the same size were used at different positions on the display area. Note the use of a FORTRAN real variable to avoid recalculating ANAME.
The following two routines will set up CIRCLE as a display routine.
SUBROUTINE CIRCLE(X,Y) DIMENSION A(2) A(1)=X A(2)=Y IF(IDSTST(82.0,A)) 2,1,2 1 CALL DSPF82(A) 2 RETURN END SUBROUTINE DSPF82(A) DIMENSION A(2) PI=3.1415926 CALL SETXY(A(1),A(2)) CALL UPDX (1.0) OX=1.0 OY=0.0 DO 10 J=I,64 X=COS(J*PI/32.0) Y=SIN(J*PI/32.0) CALL TODXY(X-OX,Y-OY) OX=X OY=Y 10 CONTINUE CALL UPDXY(-I.O,O.O) RETURN END
Then a possible use of this display routine would be inside a file:
CALL NEWDSP(ANAME('CIRCLE'),2.0,82.0) XI=ANAME ('X1') YI=ANAME ('Y1 ') CALL STDF(ANAME('CIRX')) CALL CIRCLE (PRI (X1),PR2(Y1)) CALL FIDF(I.O)
This file would be very much shorter than that used in Section 12.2, and index variables have been introduced to set the initial position.
Index variables are used to replace the multiple calls of TODXY which would be stored. Again, FORTRAN real variables are used to minimise the use of ANAME.
CALL STDF (ANAME('CIRCLE')) CALL UPDX (1.0) Z = PI/32.0 OX = ANAME ('OX') OY = ANAME ('OY') X = ANAME ('X' ) Y = ANAME ('Y' ) T = ANAME ('T ') T1 = ANAME ('T1' ) XCNT = ANAME ('XCNT') CALL LOAD (OX,1.0) CALL LOAD (OY,0.0) CALL LOAD (XCNT,1.0) CALL WHILE (PR1(XCNT),'LE',64.0) CALL BEGINS CALL LOAD (T,PR2(XCNT)) CALL MPY (T,Z) CALL COSX (X,PR2(T)) CALL SINX (Y,PR2(T)) CALL LOAD (T,PR2(X)) CALL SUB (T,PR2(OX)) CALL LOAD (T1,PR2(Y)) CALL SUB (T1,PR2(Y)) CALL TODXY (PR1(T),PR2(T1)) CALL ADD (XCNT,I.O) CALL LOAD (OX,PR2(X)) CALL LOAD (OY,PR2(Y)) CALL ENDS CALL UPDXY (-1.0,0.0) CALL FIDF (1.0)
This will cause fewer orders to be stored, although the code appears longer. The same sequence of orders in Section 12.2 will generate the required film.
Using the file CIRCLE as before, the following two routines can be used:
XX = ANAME ('XX' ) SQ1 = ANAME ('SQ1') SQ2 = ANAME ('SQ2') CALL STDF (SQ2) CALL SETXY (PR1(XX),25.0) CALL DRAW (ANAME('CIRCLE')) CALL ADVFLM CALL REPEAT CALL FIDF (1.0) CALL STDF (SQ1) CALL LOAD (XX,1.0) CALL WHILE (PR1(XX), 'LE',50.0) CALL BEGINS CALL ADVFLM CALL ADD (XX,1.0) CALL ENDS CALL STOPSQ CALL FIDF (1.0)
and executed by:
CALL ADSQLG (SQ1,0.0,0.0) CALL DRAW (SQ2)
The complete source file for immediate execution would be:
MASTER CIRCLEMOVE C--- INITIALISE SPROGS COMMON CALL STSPR C--- SET UP REGION CHAIN CALL RGLIM (1,0,0.0,0.0,100.0,100.0) CALL RGPRM (1.0,0.0,0.0,1.0,0.0,0.0) CALL RGPLIM (1.0,0.0,0.0,1023.0,1023.0,0.0) C--- SELECT OUTPUT CALL DVOUT (2.0) C--- SELECT REGION CALL REGION (1.0) C--- DRAW CIRCLE PI = 3.1415926 DO 20 I = 1,50 XX = I CALL SETXY (XX,25.0) CALL UPDX (1.0) DO 10 J = 1,64 X = COS (J*PI/32.0)+XX Y = SIN (J*PI/32.0)+25.0 CALL TOXY (X,Y) 10 CONTINUE CALL ADVFLM 20 CONTINUE C--- FINISH CALL ENDSPR STOP OK END FINISH
If this is stored in file MYSOURCE, say, the appropriate simple macro call would be:
SPROGS *CR MYSOURCE
which would compile and run the job using work files for output, BROADCAST to the MOP job issuing the macro (if one exists) and list the monitor file, except for the commands.
As another example, the following macro call will save all the lineprinter listings in a file and ignore the monitor file:
SPROGS *CR MYSOURCE,*LP MYLIST1,#LP0 MYLISTl,EJ(NONE)
Note that the use of the SPROGS macro will generate a job with a predefined title (depending on the job issuing the macro). In order to run more than one job at once, a user must use:
RUNJOB JOBNAME, :MACROS.SPROGS,parameterlist
so that unique names may be given. (In the above, parameterlist refers to the list of SPROGS parameters available, just as in the previous call.) If RUNJOB is issued from a MOP terminal, a BROADCAST can be forced by using the parameter:
MOPEJ NAMEOFMOPJOB
Full details of the macro are given in Appendix 12.
High level routines, consisting of SPROGS display routines inside FORTRAN subroutines, can be constructed. However, since WHILE can only be used inside a file definition, two versions of such routines are required if repeated saving of commands is to be avoided. The following routine will provide a wipe from one picture file to another over a given number of frames.
It is included to show how an animation effect might be produced. In FORTRAN, it looks very cumbersome, but the example is repeated in the next Chapter, which deals with the preprocessor, to show the power of that system.
SUBROUTINE WIPE (A) DIMENSION A (4) C A (1) is the first file, A (2) the second C A (3) is the number of frames C A (4) is the number of a spare region C index variable names XP = ANAME ('XP') XMINR = ANAME ('XMINR') YMINR = ANAME ('YMINR') XMAXR = ANAME ('XMAXR') YMAXR = ANAME ('YMAXR') SW = ANAME ('SW') XCNT = ANAME ('XCNT') XLIM = ANAME ('XLIM') C save current region settings CALL RDBASE (SW) CALL RDPLIM (XP,XMINR,YMINR,XMAXR,YMAXR) C - - insert a new region in the chain CALL RGPLIM (-1.0,A(4),0.0,0.0,1023.0,1023.0) CALL RGPRM (A(4),0.0,0.0,1.0,0.0,PR6(SW)) CALL RGPRM (-1.0,-1.0,-1.0,-1.0,-1.0,0.0) C - - set frame counter CALL LOAD (XCNT,0.0 ) C - - loop for each frame CALL WHILE (PR1(XCNT), 'LE' ,A(3)) CALL BEGINS C use spare region to split current picture into two parts, C part of first file and part of second. CALL LOAD (XLIM,A(3)) CALL SUB (XLIM,PR2(XCNT)) CALL DVD (XLIM,A(3)) CALL LOAD (XSTP,PR2(XMAXR)) CALL SUB (XSTP,PR2(XMINR)) CALL MPY (XSTP,PR2(XLIM)) CALL ADD (XSTP,PR2(XMINR)) CALL MPY (XLIM,1023.0) C two pictures CALL RGLIM (A(4),0.0,0.0,PR4(XLIM),1023.0) CALL RGPLIM (A(4),PR2(XP),PR3(XMINR),PR4(YMINR),PR5(XSTP),PR6(YMAXR)) CALL DRAW (A( I)) CALL RGLIM (A(4),PR2(XLIM),O.O,1023.0,1023.0) CALL RGPLIM (A(4),PR2(XP),PR3(XSTP),PR4(YMINR),PR5(XMAXR),PR6(YMAXR)) CALL DRAW (A(2)) CALL ADD (XCNT,1.0) CALL ADVFLM CALL ENDS C reset region chain CALL RGPLIM (-1.0,PR2(XP),PR3(XMINR),PR4(YMINR),PR5(XMAXR),PR6(YMAXR)) CALL RGPRM (-1.0,-1.0,-1.0,-1.0,-1.0,PR6(SW)) RETURN END
The SPROGS system has been written in FORTRAN to make it available to FORTRAN users, and to ease the job of implementing it elsewhere. However, there are a number of syntactic drawbacks to this language which tend to make a SPROGS program unreadable. The principal ones are:
The preprocessor allows simpler formats to be used. However, as it also allows ordinary FORTRAN statements to pass through unaltered, it may be used in a general program. It produces FORTRAN source output which is sent to the compiler.
Lines to be processed have * in column 1. All other lines are assumed to be correct FORTRAN and are passed over unchanged.
The general format of a command is:
* RTNAM(arg1,arg2,....)
More than one command may appear on a line, separated by ;. the asterisk is only used at the beginning of the line.
RTNAM will be preceded by CALL, and the routine arguments may also be changed. The above line then becomes:
CALL RTNAM(arg1' ,arg2',....)
The arguments correspond to the form expected in the full FORTRAN form of the call (with certain syntactic changes). However, the two routines TEXT and VTEXT have a simpler form, omitting the character count:
* TEXT ('string') * VTEXT ('string')
Also, the routines WHILE and IFS have the form:
* WHILE arg1 cond arg2 DO * IFS arg1 cond arg2 DO
where cond can be a symbolic representation of the condition. For example:
* WHILE arg1 <= arg2 DO
becomes:
CALL WHILE (arg1, 'LE', arg2)
RTNAM is assumed to be a SPROGS routine, and the argument simplification is based on this assumption. However, any routine satisfying the same conditions may be passed through the preprocessor.
With the exception of TEXT, VTEXT and ANAME, all arguments to SPROGS routines are expected to be of type REAL. However, it is possible to specify an integral constant as an integer in the command line. The preprocessor will change it into a real constant. For example:
* TOXY (3,5) or * TOXY (3.0,5.0)
becomes
CALL TOXY (3.0,5.0)
Files are specified by their text name in quotes wherever they appear. Thus, one writes:
* STSAV ('FRED' ,1) * STDF ('JIM') * DRAW ('ABC')
The preprocessor will provide a variable of the form:
ZZZn
for each file name, assign the ANAME value to this variable, and replace the quoted text name by this variable wherever it appears. ANAME should not be used explicitly. For example:
* STDF ('JIM') becomes CALL STDF (ZZZ3) with ZZZ3=ANAME ('JIM')
An index variable reference in an argument is indicated by £ followed by the index variable text name, not in quotes. For example:
* TOXY (3,£A) becomes CALL TOXY(3.0,PR2(ZZZ4)) with ZZZ4=ANAME ('A')
The function PR should not be used explicitly.
Index variable triples are expressed by enclosing the three names in square brackets, and replacing £ by % in the variable name. For example:
* VEC (1,2,3,[%F,%N,%C]) becomes CALL VEC (1.0,2.0,3.0,AR4(ZZZ5,ZZZ6,ZZZ7)) with ZZZ5 = ANAME ('F') ZZZ6 = ANAME ('N') ZZZ7 = ANAME ('C')
Alternatively, one name can be given to the triple and that name used as an argument. (There is no parallel SPROGS command for this format.)
* #XY IS [%F,%N,%C] * VEC (1,2,3,#XY)
is equivalent to the previous example.
There is currently a restriction on this shorthand form, in that the three variables may not have been used before, and may not appear in another triple. The previous form does not have this restriction.
It is possible to use arithmetic symbols in place of the routines ADD, SUB, LOAD etc. For example:
* %X=5 becomes CALL LOAD(ZZZ8,5.0) * %X=£X+10 becomes CALL ADD (ZZZ8, 10.0) * %X=£Y/5 becomes CALL LOAD(ZZZ8,PR2(ZZZ9)) CALL DVD(ZZZ8,5.0) * £X=5 becomes CALL LOAD (PR1(ZZZ8),5.0) [index X contain the name of the desired variable] * %X='JIM' becomes CALL LOAD(ZZZ8,ZZZ3)
All arithmetic symbols are treated strictly from left to right.
For example:
* %X=£Y+£F*3
becomes
CALL LOAD(ZZZ8,PR2(ZZZ9)) CALL ADD(ZZZ8,PR2(ZZZ5)) CALL MPY(ZZZ8,3.0)
From the above, it can be seen that % will refer to the variable name, while £ will refer to a PR reference. Thus:
* %X=%Y becomes CALL LOAD(ZZZ8,ZZZ9) * £X=£Y becomes CALL LOAD (PR1(ZZZ8),PR2(ZZZ9))
It is possible to combine many calls of NULL in one line, for example:
* NULLS (3,5, £CD)
becomes
CALL NULL (3.0) CALL NULL (5.0) CALL NULL (PR1(ZZZ10))
The command:
*$START
turns on the preprocessor in a given routine. >Before the end the command:
*$END
must be used to turn it off. More than one routine may be processed, but these two commands must be used in each. The whole set must end with:
****
A 1906A file containing these routines is passed to the SPROGS macro by the parameter PRE. The resulting FORTRAN is appended to the first *CR file, which either should not exist, or should have the appropriate traps set. For more details, see the SPROGS macro definition.
The following routine is a rewrite of the WIPE routine, given in Section 12.5. The FORTRAN program generated by the preprocessor is also given.
SUBROUTINE WIPE(A) DIMENSION A(4) C A(l) is the first file, C A(2) the second C A(3) is the number of frames to cover the wipe C A(4) is the number of a spare region *$START *RDBASE (%SW); RDPLIM(%XP,%XMINR,%YMINR,%XMAXR,%YMAXR) *RGPLIM (-1 ,A(4) ,0, 0, 1023, 1023) *RGPRM (A(4), 0, 0, 1, 0, £SW) *RGPRM (-1, -1 , -1 , -1 , -1 , 0) *%XCNT=0 *WHILE £XCNT <= A(3) DO *BEGINS * %XLIM = A(3)-£XCNT/A(3) * %XSTP = £XMAXR-£XMINR*£XLIM+£XMINR * %XLIM = £XLIM*1023 * RGLIM (A(4),0,0,£XLIM,1023) * RGPLIM (A(4),£XP,£XMINR,£YMINR,£XSTP,£YMAXR) * DRAW (A(l)) * RGLIM (A(4),£XLIM,0,1023,1023) * RGPLIM (A(4),£XP,£XSTP,£YMINR,£XMAXR,£YMAXR) * DRAW (A(2)) * %XCNT = £XCNT+1 ; ADVFLM *ENDS *RGPLIM (-1,£XP,£XMINR,£YMINR,£XMAXR,£YMAXR) *RGPRM (-l,-1,-l,-1,-l,£SW) *$END RETURN END
SUBROUTINE WIPE(A) DIMENSION A(4) C A(l) is the first file, C A(2) the second C A(3) is the number of frames to cover the wipes C A(4) is the number of a spare region GOTO 99088 99087 CONTINUE CALL RDBASE(ZZZ1) CALL RDPLIM(ZZZ2,ZZZ3,ZZZ4,ZZZ5,ZZZ6) CALL RGPLIM(-1.0,A(4),0.0,0.0,1023.0,1023.0) CALL RGPRM(A(4),0.0,0.0,1.0,0.0,PR6(ZZZ1)) CALL RGPRM(-1.0,-1.0,-1.0,-1.0,-1.0,0.0) CALL LOAD(ZZZ7,0.0) CALL WHILE (PR1(ZZZ7),'LE',A(3)) CALL BEGINS CALL LOAD(ZZZ8,A(3)) CALL SUB(ZZZ8,PR2(ZZZ7)) CALL DVD(ZZZ8,A(3)) CALL LOAD(ZZZ9,PR2(ZZZ5)) CALL SUB(ZZZ9,PR2(ZZZ3)) CALL MPY(ZZZ9,PR2(ZZZ8)) CALL ADD(ZZZ9,PR2(ZZZ3)) CALL MPY(ZZZ8,1023.0) CALL RGLIM(A(4),0.0,0.0,PR4(ZZZ8),1023.0) CALL RGPLIM(A(4),PR2(ZZZ2),PR3(ZZZ3),PR4(ZZZ4),PR5(ZZZ9),PR6(ZZZ6)) CALL DRAW (A(1)) CALL RGLIM(A(4),PR2(ZZZ8),0.0,1023.0,1023.0) CALL RGPLIM(A(4),PR2(ZZZ2),PR3(ZZZ9),PR4(ZZZ4),PR5(ZZZ5),PR6(ZZZ6)) CALL DRAW(A(2)) CALL ADD(ZZZ7,1.0) CALL ADVFLM CALL ENDS CALL RGPLIM(-1.0,PR2(ZZZ2),PR3(ZZZ3),PR4(ZZZ4),PR5(ZZZ5),PR6(ZZZ6)) CALL RGPRM(-1.0,-1.0,-1.0,-1.0,-1.0,PR6(ZZZI)) GOTO 99089 99088 ZZZ1 = ANAME ('SW') ZZZ2 = ANAME ('XP') ZZZ3 = ANAME ('XMINR ) ZZZ4 = ANAME ('YMINR') ZZZ5 = ANAME ('XMAXR') ZZZ6 = ANAME('YMAXR') ZZZ7 = ANAME ('XCNT' ) ZZZ8 = ANAME('XLIM') ZZZ9 = ANAME('XSTP') GOTO 99087 99089 CONTINUE RETURN END
The following extensions to SPROGS are currently under discussion.
At the moment, only global variables have been defined. It is proposed to define a set of local variables which, although similar in form to global variables, will be accessible only within the file in which they are defined. It will be possible to pass values across to local variables and receive values in return, thus making a DRAW inside a file act as a subroutine call.
ACL is obtaining one of the Teletype-compatible pen plotters from Hewlett-Packard. This device will be incorporated into the SPROGS device set.
A British Standard Interface is currently being tested to link the PDP15, with its VT04 refresh display, to the 1906A. When complete, a system will be developed in the PDP15 to connect to SPROGS. The PDP15 will look like another output device to a SPROGS program in the 1906A, and hence pictures can be sent across. Alternatively, the PDP15 can get files from the 1906A. The pictures can be displayed on the VT04, where they can be altered before being sent back to the 1906A.
Commands will be accepted from input streams as well as from file. This will enable the PDP15 to communicate with the 1906A.
The following variables are saved every time a file is entered, and a subset of them is restored on exit, depending on the settings of FIDF. The restoration of variables following ADVFLM during sequence list execution is controlled by the second argument of ADSQLG, ADSQLL.
Possible settings of FIDF are:
No | Name | Priority | Arguments | Meaning |
---|---|---|---|---|
0 | NULL | P1 | ||
1 | SETXY | 1 | X,Y | XPOS=X, YPOS=Y |
2 | TODXY | 1 | DX,DY | Line from (XPOS,YPOS) to (XPOS+DX,YPOS+DY) |
3 | UPDXY | 1 | DX,DY | XPOS=XPOS+DX,YPOS=YPOS+DY |
4 | DRCTN | 1 | DIR | DIR;XPOS=XMIN,XMA YPOS=YMIN,YMAX |
5 | DRAW | 1 | FILE | Draw File |
6 | NUMBR | 1 | XN | XN is number of next file called or defined |
7 | PLOT | 1 | X | Plots hardware character defined by SPROGS Number X |
8 | FIDF | 1 | X | Finishes a file definition, Resets globals |
9 | STRACE | 1 | XN,XM | Output trace information |
10 | RLNUMB | 1 | XN | Current file number = XN |
11 | SHIFTD | 1 | XN | Set lower shift character to XN |
12 | SHIFTU | 1 | XN | Set upper shift character to XN |
13 | TEXPAN | 1 | EXT,EYT | Set text expansion factors |
14 | TEXSW | 1 | XSW | Switch text expansion ON and OFF |
16 | EXPAN | 1 | EOX,EOY,EX,EY | Expand about EOX,EOY by factor (EX,EY) |
17 | ROTN | 1 | ROX,ROY,RXY | Rotate about (ROX,ROY) by RXY radians |
18 | ERDR | 1 | ERDRV 1,2 | Rotation before Expansion |
19 | INTNST | 1 | XNT | Change line intensity |
20 | THICK | 1 | THK | Change line thickness |
21 | DOTTED | 1 | DOT,DOTYP | Change line type |
22 | IFS | VAL1,CDTN,VAL2 | Single shot while | |
23 | ADSQLG | 1 | FILE,Y,Z | Add file to sequence list starting with GLOBAL, Y variables, Z marker |
24 | DLSQLS | 1 | FILE | Delete file from sequence list |
25 | SPSQLS | 1 | FILE | Suspend file in sequence list |
26 | RSSQLS | 1 | FILE | Restart file in sequence list |
27 | STOPSQ | 1 | Terminate sequence completely | |
28 | REPEAT | 1 | Repeat file from start | |
29 | PRINV | 1 | XINDX | Print value of Index variable |
30 | SETX | 1 | X | XPOS=X |
31 | SETY | 1 | Y | YPOS=Y |
32 | TOXY | 2 | X,Y | TODXY(X-XPOS,Y-YPOS) |
33 | VEC | 2 | X1,Y1,X2,Y2 | SETXY(X1,Y1);TODXY(X2-X1,Y2-Y1) |
34 | UPDX | 1 | DX | XPOS=XPOS+DX |
35 | UPDY | 1 | DY | YPOS=YPOS+DY |
36 | LEFT | 2 | DRCTN(1.0) | |
37 | RIGHT | 2 | DRCTN(3.0) | |
38 | DOWN | 2 | DRCTN(2.0) | |
39 | UP | 2 | DRCTN(4.0) | |
40 | LNTYP | 2 | XNT,THK,DOT,DOTYP | INTNST(XNT);THICK(THK);DOTTED(DOT,DOTYP) |
41 | REGION | REG | Select region REG | |
42 | RGLIM | R,XMIN,YMIN,XMAX,YMAX | Reset limits of R | |
43 | RGPLIM | R,P,XPMIN,YPMIN,XPMAX,YPMAX | Redefine R in terms of P | |
44 | RGPRM | R,CNV,BSC,XMI,XMO,SWOUTP | Redefine parameters | |
45 | ADVFLM | Advance Film | ||
46 | LOAD | XINDX,VAL | Variable XINDX = VAL | |
47 | ADD | XINDX,VAL | Variable XINDX = Variable XINDEX + VAL | |
48 | SUB | XINDX,VAL | Variable XINDX = Variable XINDEX - VAL | |
49 | MPY | XINDX,VAL | Variable XINDX = Variable XINDEX * VAL | |
50 | DVD | XINDX,VAL | Variable XINDX = Variable XINDEX / VAL | |
51 | POW | XINDX,VAL | Variable XINDX = Variable XINDEX ** VAL | |
52 | WHILE | VAL1,CDTN,VAL2 | Repeat next command while VAL1 CDTN VAL2 is true | |
53 | BEGINS | 1 | Command open bracket | |
54 | ENDS | 1 | Command close bracket | |
55 | SINX | XINDX,VAL | Variable XINDX = SIN(VAL) | |
56 | COSX | XINDX,VAL | Variable XINDX = COS(VAL) | |
57 | EXPX | XINDX,VAL | Variable XINDX = EXP(VAL) | |
58 | LOGX | XINDX,VAL | Variable XINDX = LOG(VAL) | |
59 | NEG | XINDX | Variable XINDX = - Variable XINDX | |
60 | ADSQLL | 1 | FILE,Y,Z | Add file to sequence list starting with CURRENT, Y variables, Z marker |
61 | TDX | 2 | X | TODXY(X=XPOS,0.0) |
62 | TDY | 2 | Y | TODXY(0.0,Y=YPOS) |
63 | TODX | 2 | DX | Line from (XPOS,YPOS) to (XPOS+DX,YPOS) |
64 | TODY | 2 | DY | Line from (XPOS,YPOS) to (XPOS,YPOS+DY) |
67 | NULSET | 1 | X | Null routines will behave as routine X |
68 | GETLIB | 1 | X,Y,Z | Get file X/Y from library |
69 | PUTLIB | 1 | X,Y,Z | Put file X/Y into library |
70 | ERSLIB | 1 | X,Y,Z | Erase file X/Y from library |
71 | LSTLIB | 1 | X | List directory on library X |
72 | RDREG | X | Read current region numbers | |
73 | RDLIM | X1,Y1,X2,Y2 | Read current limits | |
74 | RDPLIM | P,X1,Y1,X2,Y2 | Read RGPLIM setting | |
75 | RDVISO | XMI,XMO | Read visibility | |
76 | RDBASE | SW | read region device setting | |
77 | RDSHAP | CNV,BSC | Read shape | |
78 | RDXY | X,Y | Read XPOS,YPOS | |
79 | GALLIB | 1 | X | Get All Files from Library X |
80 | COLOUR | X | All subsequent lines have colour X | |
81 | COLGL | X | Only lines of colour X to be output | |
82-89 | User display routines |
The type indicates Subroutine (S) or Function (F).
Name | Type | Meaning |
---|---|---|
ANAME('ST') | F | Converts string ST into a REAL number representation, characters converted to SPROGS number, if ST is less than 5 chars, chars packed using 65 as multiplier, otherwise each must be alphanumeric, and ST must start with a letter, 37 is then used as packing multiplier |
AR1(XND1,XND2,XND3) | F | Ith argument is array reference defined by index variable |
AR2(XND1,XND2,XND3) | F | |
AR3(XND1,XND2,XND3) | F | |
AR4(XND1,XND2,XND3) | F | |
AR5(XND1,XND2,XND3) | F | |
AR6(XND1,XND2,XND3) | F | |
BASE(SWOUTP) | S | Set current region as basic for device SWOUTP |
BASER(R,SWOUTP) | S | set region R as basic for devices SWOUTP |
DLETE (FILE) | S | Delete file from store |
DSALL | S | Set visibility of current region |
DSPF82 | S | Routines to execute user defined display routines |
DSPF83 | S | |
DSPF84 | S | |
DSPF85 | S | |
DSPF86 | S | |
DSPF87 | S | |
DSPF88 | S | |
DSPF89 | S | |
DVOUT(XI) | S | Sets the value of NTRMLS to XI |
ENDSPR | S | Clears SPROGS output at end of run |
EXPRED(A) | S | Select SD4020 expand image mode and remove pagethrow in lineprinter graphical |
FILIST(X,XN) | S | List file X, number XN |
FISAV | S | Finish saving basic file |
FLASH | S | Project SD4020 form flash |
FLEMKS(ANO) | S | Write ANO file marks to SD4020 tape |
FMODE(XN) | S | Sets mode equal to XM, the mode of storage for the next file |
GARBGE | S | Collect unused space in filestore |
GETCHA(X,y) | S | Get character X from font Y into filestore |
GETFNT (X) | S | Get font X into the file store |
GVCHSZ(DX,DY) | S | Get text factor for natural character size |
IDSTST(XN,A) | S | Test for store or execute user display routine |
LCPRY(XPRYV) | S | Set local priority value |
LIBINT(X) | S | Initialise library X |
LIMIT(XM,YM,XN,YN) | S | Set limits of current region |
LPDBUG | S | Add lineprinter to current region devices and select it in addition |
LPGRAF | S | Set regions for lineprinter graphical and select |
LSTALL | S | List all files |
MF35MM | S | Select 35mm camera instead of 16mm |
NEWDSP(XN,XNI,XNO) | S | Set up new user display routine |
NOLPG | S | Do not include lineprinter graphical routines |
NOSD | S | Do not include SD4020 routines |
NLINES(XN) | S | Draws file 'NL' XN times |
NPAGE | S | ADVFLM, UP, LEFT and draw file 'NL' |
OUTR (R,XN) | S | Set region R as basic for devices XN and select devices |
PCPRY(P) | S | Sets the global priority level NPRYV equal to P for the next file definition |
PLIMIT(P,XM,YM,XN,YN) | S | Set current region in terms of region P |
PR1(XIND) | S | Defines argument in Ith position as reference to index variable |
PR2(XIND) | S | |
PR3(XIND) | S | |
PR4(XIND) | S | |
PR5(XIND) | S | |
PR6(XIND) | S | |
RUNOUT(X) | S | X frames of runout on SD4020 microfilm |
SDFILM | S | Set regions for SD4020 microfilm and select |
SDHARD | S | Set regions for SD4020 hardcopy and select |
SETIO(XL,XER,XLP,XSDO,XSDU,XSDU,XTR) | S | Reset IO streams for file lists, error messages, lineprinter output, SD4020 operator and user output and trace list |
SHAPE(CNV,BSC) | S | Set shape of current region |
SHAPER(R,CNV,BSC) | S | Set shape of region R |
SHIELD | S | Set visibility of current region to outside only |
STCHSZ(DX,DY) | S | Set text factor for character grid size |
STDF(ST) | S | Starts defining a file whose name is ST, the number of the file is the current value of NUMBER, the mode of the file is attempted as the current mode setting, the value of NPRYV defines the global priority setting |
STSAV(X,D) | S | Save orders for device D in file X |
STSPR | S | Initialise SPROGS system |
STSQLS | S | Start sequence list |
TEXT(N,'ST') | S | A shorthand for drawing a set of pictures corresponding to characters |
TOPRIN(ANO) | S | Print SD4020 tape orders |
TOTAPE(ANO( | S | Suppress writing SD4020 tape |
TYPEN(A,XI,XJ) | S | Print number A on output devices |
VISO(XMI,XMO) | S | Set visibility of current region |
VISOR(R,XMI,XMO) | S | Set visibility of region R |
VTEXT(N,'ST') | S | As for text, but character interspersed with file 'VT' |
VTYPEN(A,XI,XJ) | S | As for TYPEN, but characters interspersed with file 'VT' |
WINDOW | S | Set visibility of current region to inside only |
XMLTIM(A) | F | Mill time in secs |
DEVICE | RASTER SIZE | INITIAL REGION | RGLIM SETTINGS |
---|---|---|---|
SD4020 | 1024*1024 | 0 | 0.0,1023.0,1023.0,0.0 |
LP Graphic | 120*120 | 1 | 0.0,0.0,119.0,119.0 |
Note that these settings are initialisations only. The user can, of course, define his own basic regions for these devices.
Region 3 is initially set as an upright SD4020 region (ie, with origin in the bottom left hand corner, and region defined in terms of region 0). If only text is to be output to the SD4020, region 3 should be selected, since all software characters are defined assuming the origin at the bottom left hand corner of the frame.
SPROGS Number | Character | SD4020 Octal | 1906A Octal |
---|---|---|---|
1 | 1 | 1 | 1 |
2 | 2 | 2 | 2 |
3 | 3 | 3 | 3 |
4 | 4 | 4 | 4 |
5 | 5 | 5 | 5 |
6 | 6 | 6 | 6 |
7 | 7 | 7 | 7 |
8 | 8 | 10 | 10 |
9 | 9 | 11 | 11 |
10 | 0 | 0 | 0 |
11 | A | 21 | 41 |
12 | B | 22 | 42 |
13 | C | 23 | 43 |
14 | D | 24 | 44 |
15 | E | 25 | 45 |
16 | F | 26 | 46 |
17 | G | 27 | 47 |
18 | H | 30 | 50 |
19 | I | 31 | 51 |
20 | J | 41 | 52 |
21 | K | 42 | 53 |
22 | L | 43 | 54 |
23 | M | 44 | 55 |
24 | N | 45 | 56 |
25 | O | 46 | 57 |
26 | P | 47 | 60 |
27 | Q | 50 | 61 |
28 | R | 51 | 62 |
29 | S | 62 | 63 |
30 | T | 63 | 64 |
31 | U | 64 | 65 |
32 | V | 65 | 66 |
33 | W | 66 | 67 |
34 | X | 67 | 70 |
35 | Y | 70 | 71 |
36 | Z | 71 | 72 |
37 | + | 20 | 33 |
38 | - | 40 | 35 |
39 | * | 54 | 32 |
40 | / | 61 | 37 |
41 | Space | 60 | 20 |
42 | . | 33 | 36 |
43 | , | 73 | 34 |
44 | = | 13 | 15 |
45 | ( | 74 | 30 |
46 | ) | 34 | 31 |
47 | $ | 53 | 74 |
48 | ? | 37 | 17 |
49 | ' | 15 | 27 |
50 | " | 16 | 22 |
51 | < | 14 | |
52 | > | 16 | |
53 | [ | 73 | |
54 | ] | 75 | |
55 | ! | 21 | |
56 | # | 23 | |
57 | £ | 24 | |
58 | % | 25 | |
59 | & | 26 | |
60 | @ | 40 | |
61 | : | 12 | |
62 | ; | 13 | |
63 | ↑ (uparrow) | 76 | |
64 | ← (backarrow) | 77 | |
65 | ± (+-) | 36 | |
66 | d | 57 | |
67 | ∫ (Integral) | 75 | |
68 | Σ (Sigma) | 76 | |
69 | π (pi) | 32 | |
70 | box | 77 | |
71 | α (alpha) | 17 | |
72 | β (beta) | 35 | |
73 | γ (gamma) | 55 | |
74 | δ (delta) | 16 | |
75 | ° (degree) | 72 | |
76 | · (plotting dot) | 52 |
The following fonts are available. All of them assume that the current region is upright, ie the upper region limits (XMAX,YMAX) are greater than (XMIN,YMIN) respectively.
FONT NUMBER | CHARACTER GRID | DESCRIPTION |
---|---|---|
1 | 16 × 16 | The first 64 SPROGS characters are defined, using simple lines to construct them. |
2 | 16 × 16 | As above, but with lower case letters in place of the upper case ones. |
3 | 12 × 8 | SD4020 hardware set. Characters 65 to 76 are obtained by using the printable characters 51 to 63, which have no SD4020 equivalent. |
4 | 1 × 1 | Lineprinter hardware set. |
5 | 32 × 32 | Helvetica font. Alphanumeric characters only. This font is not equispaced, however, and will give strange effects if used vertically. |
It should be noted that, because of the coarse grid possible on the lineprinter, the software characters will appear strange if used with lineprinter graphical output selected.
Associated with each font are three files, which are used in the various high level routines. The file names are:
The following additional routine names are used by the SPROGS system. Care should be taken to avoid name clashes with user routines.
ACFLSR DVDF LOGIC RDSHPF STXFLS ACFLST DYLIST LOGXF RDVSOF STXFLT ACFLTB DYREAD LPCH RDXYF STXNMT ACLSQ DYRITE LPGEX RECOV SUBF ACNDST ENDSF LPGST REDUND TAPE14 ACNMTB ENDIST LPGOUT REGONF TAPE15 ACRGTB ERDRF LPGCH REPETF TEXPNF ADDF ERLIST LPGVEC RESET TEXSWF ADSQGF ERRMESSAGE LPPRINT RGLIMF THICKF ADSQLF ERROR LPVEC RGPLMG THKEN ANDBIT ERROR1 MAINCO RGPRMF TMPLT ANDLOG ERROR2 MDEXX RIGHTF TOBUFFER AR ERROR3 MORECORE RLNUMF TODXF ARGET ERSFIL MOVFLM ROTNF TODXYF ARK EXPANF MPYF RSSQLF TODYF ARPUT EXPXF NACDST RTRACE TOXF ASSLP FIDFTR NACMTB RTRACS TOXYF ASSTLP FILMARKS NAFLSQ SDCH TOYF BDRY FILEMARKS NAFLST SDMH TRIGS BEGNSF FISVTR NAFLTB SDVEC UNITSZ CHARSZ FINIS NEGF SDTITL UPF CHKARG FLCONT NFNDSQ SD4020 UPDXF CHKMDE FLDEL NSDCNV SEE UPDXYF CHKOUT FLINE NULLE SEEVEC UPDXYF CHNLNK FLINIT NULSTF SETUPF UPDYF CLEARLPBUFF FPLNT NUMBRF SETXF VECF CLOSEMT GALFIL OBEY SETXYF WHILF CLOSEMV GETBOD OPENMT SETYF XERROR CNVXY GETFIL OPI SHFTDF XPAND CONCUT GETSTK OUTBSC SHFTUF XPROT CONTHT GIVSTK OUTBUFFA SINXF XROT CONVINSTR IARSET OUTORDER SPOTCH XTPAN COSXF IDSRTN PACKFL SPSQLF XXJBTL CPRERR IFPOS PDPCH SQEND XXLPG DCODE IFF PDPVEC SQNTRY XXMES DELBLK IGNORE PLNTV SQSWCH XXNUMR DELSQ INISPR PLOTF STDFTR XXPACK DEXPA INPOS PLOTHT STFLSQ XXSD DLSQLF INTERP POWF STFLSR XXSDCV DMOVG INTNSF PR STFLST XXTMDT DMOVP INVIEW PRINTlNSTR STFLTB XXUNPK DOPEN ISTREX PEINVF STLSQ XXUPSN DOTTF ITOBIG PUTFIL STNMTB ZERROR DOWNF JOBNAME QRITE STORE DRAWF LEADER RCNCL STPSQR DRCTNF LEFTF RDBASF STRACF DREAD LNTYPF RDLIMF STRGTB DRITE LOADF RDREGF STSVTR DRWBDY LOGAND
SPROGS also uses the following COMMON block names
SPRG1 SPRG2 SPRG3 SPRG4 SPRG5
The SD4020 Microfilm Recorder, designed and manufactured by Stromberg DatagraphiX Corporation, is a sophisticated microfilm and hardcopy plotter which can be used as either on-line or off-line peripheral equipment for a computer. The most obvious use of the SD4020 is for the rapid production of graphical output.
The basic components of the SD4020 are shown in Fig A9.1.
These are as follows:
The operation of an SD4020 camera is basically different from that of a standard camera in that an SD4020 camera tends to have its shutter open most of the time. An SD4020 instruction requesting a line to be drawn on the Charactron tube will cause the line to appear for sufficient time to sensitize the film in the camera (with its shutter open). A complete scene on a microfilm frame is therefore built up by a large number of lines and characters appearing on the Charactron tube for short periods of time. At no time is the complete scene available on the tube face.
A diagram of the tube is shown in Fig A9.2. As far as line drawing is concerned, the Charactron tube behaves very similarly to the standard cathode ray tube. Fig A9.2 shows how a character is projected on the viewing screen. The electron gun shoots an unshaped electronic beam towards the viewing screen. The beam passes through selection plates which deflect the unshaped electronic beam through the particular matrix aperture for the desired character. As the beam leaves the matrix, it has been shaped into the form of the character aperture through which it has passed. This shaped beam is then accelerated and then deflected to the desired position on the tube face. The character matrix is a small thin alloy disc on which 64 character shaped openings are engraved in an 8 × 8 array. The whole matrix is less than 0.25in square.
As far as line drawing is concerned, the screen is divided into 1024 × 1024 positions and the beam can be deflected so that a line can be produced between any two of the raster positions. Each Charactron character occupies approximately 6 horizontal by 9 vertical raster positions on the plotting area of the tube face.
The complete Charactron tube assembly can be manually moved through 90°, 180°, 270°. Its standard setting is the CINE postion shown in Fig A9.3. The other positions of the tube are also shown in Fig A9.3. This manual movement of the tube is not a trivial operation. Consequently,plotting at the Laboratory will always be in CINE mode unless another tube position is specially requested.
35mm and 16mm film is available at the Laboratory. The 16mm film will normally be mounted. This is perforated and is ideal for producing movies direct from the SD4020. The 35mm film is also perforated. The film can be used in aperture cards or 35mm roll viewers. The image is compatible with standard 35mm movie projectors. The camera operates at speeds up to 10 frames per second and is supplied with two take-up and two supply magazines.
The hard copy camera makes it possible to record the displayed information on photo recording paper. The paper is in a continuous roll approximately 9 3/8in in width. The 4in square display on the Charactron tube is recorded as a 7.5in square on the paper. The standard pull down between frames is about 99.5in. The magazine holds about 350 feet of paper. Once a suitable amount of output has been produced on the SD4020, the hard copy magazine is removed and developed off-line from the SD4020.
This feature allows the SD4020 to superimpose fixed data on the variable data generated by the Charactron shaped beam tube. The fixed data is produced on a glass slide (for example maps and drawing formats). The glass slide is then mounted in a slide holder assembly which is inserted into the form projector. A strobe light located within the form projector is used to illuminate the glass slide. The strobe light is flashed under program control to cause the slide data to be superimposed on the information coming from the Charactron tube. Alternatively, by energising a special AUTO-FORM PROJECT switch, a form may be projected automatically for each frame advance.
Graphical output from the SPROGS package is stored on 7-track magnetic tape as SD4020 orders. This tape is then removed and remounted on the SD4020. The SD4020 tape adapter then decodes the information and produces the desired output. Output is normally produced in odd parity mode. However,the SD4020 is also capable of accepting even parity BCD records. Even parity records are assumed to be BCD information to be output as characters and such records are typed with automatic line feeds and page throws inserted between frames.
Appendix 10 defines the SD4020 order code and the format taken by the 36 bit instructions. The raster positions run from 0 to 1023 in both directions. The origin (0,0) is in the upper left hand corner with X and Y values increasing to the right and down, respectively.
The SD4020 instructions refer to these raster positions. The following section will describe each of the SD4020 operations. The opcode of each instruction is given in brackets following the instruction name. The names in the next section are those used in Appendix 10. The complete set of all SD4020 commands are described here, although a number of these cannot be used directly from SPROGS.
For all the operations given above, the SD4020 accepts 36 bit instructions one at a time, decodes them and produces the required action. This is the normal mode of working. However there is also a typewriter mode of working. Once this mode has been selected, hardware characters are generated more economically as far as both time and space are concerned. The typewriter mode is initiated by either of the two commands TYPE SPECIFIED POINT or TYPE CURRENT POINT.
The SD4020 character. numbered C, is typed at the raster position (X,Y). In addition the typing position is moved to the next character position. In the typewriter mode, the raster grid of 1024 × ]024 positions may be regarded as consisting of 64 lines of 128 typing positions. Once typing mode has been entered by the TYPE SPECIFIED POINT instruction, characters are typed across the line until the 128th space has been filled or a CARRIAGE RETURN character is typed. In either case, typing continues on the next lower line at the extreme left of the grid (X = 0, Y = Y + 16). An ADVANCE FILM instruction must be given after the 64th line has been typed. Otherwise typing will continue on the first line of the same frame at X = 0, Y = 0 and will be superimposed on any information already there.
After the SD4020 has entered typewriting mode, each subsequent instruction of 36 bits is divided up into six 6-bit fields as shown in Format 7 (Appendix 1Otyping position is then incremented. Each 36-bit instruction in typewriting mode therefore types 6 characters. The characters Ci can be any of the characters defined in Appendix 6, except that the character codes 12, 52 and 56 octal do not type characters but act as carriage and mode controlling operations.
Ci = 12 will cause the rest of the instruction to be ignored and returns the SD4020 from typewriter mode to normal mode.
Ci = 52 will cause the carriage control to move to the next line (X = 0, Y = Y + 16).
Ci = 56 is similar to the RESET instruction. Any remaining characters in the word are ignored.
As the character 12 can also appear in the first character position, this could be considered as a special SD4020 order for resetting the normal mode of operation. This is given the name STOP TYPE (see RESET).
If at any time the SD4020 encounters a record on the IBM tape which is even parity instead of the normal odd parity, then it enters a completely distinct mode of operation called PRINT MODE. In PRINT MODE, the SD4020 can be used for producing output equivalent to standard lineprinter output produced from BCD coded even parity files on a computer such as the IBM 1401. Within the PRINT MODE there are two sub-modes called PRINT NORMAL MODE and PRINT LIST MODE. The submode can be selected by the SD4020 operator. At the Laboratory, the SD4020 will normally be set to PRINT NORMAL MODE.
In this mode the first character of each record is interpreted as a control code to allow carriage control command to be fulfilled. The remaining 6-bit characters in the record are converted, the second character in the record being printed in the first character position of the line. The possible control characters in the first character position are:
When the 64th line of a page is reached, the SD4020 executes an automatic advance frame on the next carriage return. In positions other than the first, the BCD code 12 will cause the remainder of the current record to be ignored. Similarly the BCD code 56 will be equivalent to the RESET operation in typewriter mode except that the SD4020 will stay in PRINT MODE. In PRINT NORMAL MODE records of up to 132 characters can be processed.
This Appendix is a copy of the order code page.
The following routines provide histograms, shading, curve drawing, etc:
Routine | Meaning |
---|---|
Histograms | |
HSTGMA | Single shaded histogram |
CMHSTA | Composite shaded histogram |
Shading | |
TXTURA | Shading rectangular area |
Curve Drawing | |
CVFNCA | Single valued function plot |
CVFNCB | |
CVFNCR | |
CVFNCS | |
ARCB | Arc of a Circle |
ARCR | |
ARCS | |
CIRCLA | Complete Circle |
CIRCLB | |
CIRCLR | |
CIRCLS | |
ELLPSA | Complete ellipse |
ELLPSB | |
ELLPSR | |
ELLPSS | |
Contour | |
CNTOUR | square grid contours |
CNTOR1 | Contours inside specified boundary |
Graphs | |
AXESA | Plot axes |
GRATA | Graticule over plotting area |
SCALA | Label axes |
Miscellaneous | |
AROWHR | Arrow heads |
CAROWVR | |
BOXA | Rectangle |
BXR | |
READXY | Read current position |
These routines are described in more detail below:
DIMENSION DZ (YMAX,CMAX), DYAR (YMAX*CMAX) EQUIVALENCE (DZ(1,1),DYAR(1))Each histogram in this example would be contained in DZ(1,N) to DZ(YMAX,N). TYPE is a single dimension array, specifying the type for each histogram in the set. Similarly, DX,DY are single dimension arrays. Any negative Y values encountered in a histogram are taken as 0.
M(1) = count of boundary points M(2) = not used M(I) = X, Y coordinates of boundary points in order M(I+1)These two routines expect output devices and a font to be set up and selected, together with the appropriate text scaling (suggested value for scaling fonts 1 and 2 here is XN/1023). The current region limits are reset to (0.0,0.0,XN,XN).
0.0 | no pattern |
1.0 | horizontal lines, DY apart |
2.0 | vertical lines, DX apart |
3.0 | combination of 1 and 2 |
4.0 | diagonal lines, angle to horizontal THETA where TAN (THETA) = DY/DX |
5.0 | diagonal lines, angle to horizontal THETA where TAN(π - THETA) = DY/DX |
6.0 | combination of 4 and 5 |
7.0 | horizontal dashed lines, DX long, DY apart. |
8.0 | as above, but every other line displaced by DX |
9.0 | vertical dashed lines, DY long, DX apart |
10.0 | as above but every other line displaced by DY |
The SPROGS macro, which makes use of the TASK system designed at ACL, allows a user to compile and run a FORTRAN job together with the SPROGS graphics package. The macro may be OBEYed, in which case a background job is initiated, or may be called from a RUNJOB command. The following parameters are available.
#MT1 work tape, usually 9~track #MT1 MYFILE magnetic tape file #MT1 (MYTAPE) magnetic tape called MYTAPE #MT1 (7172 ,MYTAPE) magnetic tape number 7172 called MYTAPEIf the user specifies ? as the magnetic tape number, a pool tape will be obtained, a GETONLINE command instead of an ONLINE will be obeyed and the tape will be renamed. The user must have a magnetic tape budget which allows at least one more tape to be acquired, otherwise no tape will be allocated and an error will be indicated. For example:
#MT1(?,MYNEWTAPE)(WRITE)obtains a pool tape, GETONLINEs it and renames it MYNEWTAPE.
#MT14(?,FILMTAPE(PRTRACK7)) (WRITE)obtains a 7-track pool tape, GETONLINEs it, renames it FILMTAPE and WRITE qualifies it. The number of the magnetic tape used is given in the monitor file. Suppose, for example, it is 7000203. To use this tape again for SD4020 output, the user need only specify the tape name, the tape number, or both, with or without property.
#MT14 (FILMTAPE)(WRITE) #MT14 (7000203)(WRITE) . #MT14 (7000203,FILMTAPE(PRTRACK7))(WRITE)all have the same effect. The user can specify a work tape by:
#MTI4 (?,!WORKTAPE(PRTRACK7))No magnetic tape budget is required, but the tape will not be preserved after it has been printed on the SD4020. The above format is the only way to ensure that a 7-track work tape is loaded.
#?? (OL *DA1(WRITE),(999 ,HYFILE))will ONLINE the exofile MYFILE with WRITE qualifier. Any commands specified in this way will be executed before all other peripheral assignments, which will take precedence if any stream conflict occurs.
PRINT listbefore taking any remedial action.
ENDJOB ALLBUT, COMMANDSHowever, if EJ (list) is specified, the macro halts:
ENDJOB listwhere list should contain a series of legal ENDJOB parameters.
SPROGS passes the user name and the job name to the user program as parameters 1 and 2 on the ENTER command (for use as frame identification when DVOUT is called for the first time for SD4020 selection). ENP allows the user to specify a list of parameters which will be added to the end of the parameter list used by SPROGS. Hence the first parameter in the list provided by the user will be the third parameter following ENTER. These parameters can be read by PERI type 60 orders (see ICL manual). The default program parameters are:
SEMICOMPILED (A) LIBRARY (B) PROGRAM (SPRG) COMPRESS INTEGER AND LOGICAL OUTPUT 12 = LP5 OUTPUT 13 = LP6 EXTENDED ABNORMAL FUNCTIONS OUTPUT `, (MONITOR) = LP0 END
The SPROGS semicompiled is held in two files, which are always the last two files presented to the consolidator.
XFIH and XPCH are used to compile and consolidate (unless the OPT parameter is used).
MT14 is used for SD4020 output. LP0 is used for tracing and monitor (but see SETIO command. LP1 is used for lineprinter graphical. LP5, LP6 are used for SD4020 operator instructions (but see SETIO command).
(1) A simple SD4020 job is contained 1n MYFILE
SPROGS *CR MYFILE,EJ or RJ MYJOB,:MACROS.SPROGS,*CR MYFILE,EJ
(2) No output to tape.
SPROGS *CR MYFILE,EJ,NOTAPE
(3) SD4020 job with card input and extra lineprinter output. Full monitor requested.
SPROGS *CR MYFILE, #CR1 MYDATA, #LP2 MYLIST,EJ()
(4) Compiler output and job output to same file. Optimising compiler required. Save binary job.
SPROGS *CR MYFILE,*LP MYLIST, #LP2 MYLIST,OPT,SAVE MYSAVED, EJ
(5) Binary program loaded. Extra ED file.
SPROGS RUN MYSAVED, #ED2 MYDISC,EJ
Note that, if a user wishes to run more than one SPROGS job from MOP at the same time, he should use the RUNJOB form for the second and subsequent jobs to avoid a jobname clash, since SPROGS will run the job as background with a predetermined name if called from MOP.
There are two levels of errors in the SPROGS system: expected and unexpected.
An error detected by the SPROGS routines themselves will normally generate an error message on the error output stream. If it is possible to recover from the error, the message is tagged NON-FATAL, and the program continues. Fatal errors lead to:
PAUSE EX
following a call to ENDSPR to close any magnetic tape used.
There are a number of other halts in the SPROGS system. These occur in places that should not be reached by the code, and indicate either a serious error, or an attempt to access a facility that has yet to be implemented. The current halts are:
In the PLAN routines: