Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ Forword and contents1. Introduction2. Plotting a graph3. Device and coordinate selection4. The Graphics Library (New routines)5. Miscellaneous notesAppendices and references
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureICL 1906A manualsSMOG
ACLLiteratureICL 1906A manualsSMOG
ACL ACD C&A INF CCD CISD Archives
Further reading

Forword and contents
1. Introduction
2. Plotting a graph
3. Device and coordinate selection
4. The Graphics Library (New routines)
5. Miscellaneous notes
Appendices and references

3. DEVICE AND COORDINATE SELECTION

SPROGS and SMOG can produce output for any of four graphics devices. SPROGS can use more than one of these in any run but SMOG has to select only one. The four devices are: the FR80 microfilm recorder, the Tektronix 4010 storage display, the Hewlett-Packard pen-plotter and the lineprinter. If one keeps in mind that the above mentioned are the output devices then the rest of this chapter will not be too confusing. The confusion is caused by the complexity of the FR80. Firstly it has four distinct cameras and secondly, some of these cameras use several types of film. The FR80 has one cathode ray tube, referred to by the manufacturers as the Precision Light Source (PLS), and unlike the SD4020 only one camera can be mounted at one time. To further complicate the issue, each of these cameras photographs a different area of the tube face. The rest of this chapter is an attempt to clarify this situation.

3.1 Selecting A Device

The system, be it SPROGS or SMOG, needs to know which device the output is destined for before it can output to it. It follows that the device must be selected before any output is produced. As one would expect, with a system that is complex, the choice of how to select a device is manifold. The following are three distinct methods of selecting devices.

3.1.1 A definite decision

If it is known that for the life of a, program only one type of output is required then this can be chosen explicitly. A set of routines exist which not only select a device but, where appropriate, select the output medium on that device as well. For example, to select the 16/35mm camera on the FR80 with black and white 35mm film one calls the routine FRBW35. The complete list of these routines is given below in Table 3.1.1. Most of the examples in this guide use this method of selection, in fact all the examples in chapter two select the hardcopy camera in "many-up" mode by calling the routine FRHCM.

Number Routine Output Device
1 FRCL16 16mm Colour film FR80 + Combined
35/16mm
camera
2 FRBW16 16mm Black and White film
3 FRCL35 35mm Colour film
4 FRBW35 35mm Black and White film *
5 FRPR16 16mm Black and White film * FR80 + Precision 16mm camera
6 FRMFCH 105mm Microfiche film * FR80 +
Microfiche camera (see 6.3.3)
7 FRHCS Hardcopy single FR80 +
Hardcopy camera (see 6.3.1)
8 FRHCM "Many-up" Hardcopy *
9 TKTRON Storage cathod-ray tube Tektronix 4010
10 HPACK Paper chart Hewlett-Packard pen-plotter
11 LPGRAF Lineprinter paper Standard lineprinter
Table 3.1.1 Unique Output Selection

The * indicates the preferred output for each of the FR80's cameras. For 16mm black and white film type 5 is preferred to type 2.

3.1.2 Not sure yet

To avoid having to recompile the program each time a different device/camera/film is required, another routine is provided. The routine, DVALL(I), loads the code for all of the devices and thus allows one to vary the type of output by changing the value of I, but only in subsequent runs. For example, it is possible to read in the value of "I" that is desired for a particular run. The possible values "I" can take are given in the first column of Table 3.1.1, thus a call to DVALL (6) will select the microfiche camera.

As mentioned above the routine DVALL(I) loads the code for all of the devices. If one knows that one or more of the devices (there are four remember) will not be required at all then it is possible to exclude these pieces of code. For example, the routine NOFR excludes the code for the FR80 and as a result "I" can only take one of the values 9, 10 or 11. (For the complete list of exclusion routines see [6] 3.5.)

3.1.3 More than one

As SMOG cannot output to more than one device per run, this section is only of relevance to SPROGS users. The SPROGS user has the ability to direct output to any or all of the devices at any point in the program. This is of particular use when producing a film, if, say, every 100th frame is output to the Tektronix as a check before the complete sequence is plotted on film.

There are two important points to remember when using the method of device selection described in this section: firstly, the routine DVOUT, used for device selection, does not initialise the system and so one has to call the routine STSPR as the first graphics routine; secondly, if one is using the FR80 as an output device, for example, calling DVOUT(1.0), one must select the film type and camera beforehand. The routine to do this is called CAMERA(X) where X can take any of the first eight values in the first column of table 3.1.1. The argument X, used when calling CAMERA(X) has to be a REAL integer, that is, an integral REAL. The reason for stating this now is that it is good practice to start one's SPROGS program with the above mentioned two routines; for example:

C---INITIALISE THE SPROGS SYSTEM AND
C---SELECT THE HARDCOPY CAMERA IN "MANY-UP"
C---MODE FOR LATER USE.
      CALL STSPR
      CALL CAMERA(8.0)

The call to CAMERA(8.0) has not selected the FR80 - it is simply stating that if the FR80 is selected as an output device later on, then this is the film type to be used. It is important that this distinction is understood so as to avoid confusion later on in the chapter. This small example will be part of a complete program which outputs to several devices.

Throughout a SPROGS program it is possible to keep turning output devices on and off as often as is desired. The routine to do this is DVOUT(DEVICS) where, DEVICS is a bit-switching variable. Each of the binary bits used to represent the integral value of DEVICS represents a device, for example, bit 6 represents the Tektronix. To switch on the Tektronix this bit must be a one which means that DEVICS must equal 2 to the power 6, that is 64.0, plus the bit settings for any other devices that are required. Another example is shown towards the end of section 3.2.4. The following table shows which bits are used for each device.

Bit Value   Device
0     1.0   FR80 (recommended)
1     2.0   FR80 (temporarily)
2     4.0   Reserved
3     8.0   Lineprinter Graphical
A    16.0   Lineprinter
5    32.0   Pseudo Device
6    64.0   Tektronix 4010
7   128.0   User-defined device
8   256.0   User-defined device
9   512.0   Hewlett-Packard pen-plotter
Table 3.1.2 SPROGS Device Numbers

3.2 What Coordinate To Use

The aim of a user's program is to produce graphical output, be it on film, Tektronix or whatever. SMOG and SPROGS allow the user to work in the device coordinates, default coordinates or the user's own coordinates. The system has to be informed as to which type of coordinates are being used and, if user coordinates are chosen then what these are.

3.2.1 Device coordinates

Device coordinates are a direct reference by the user to the actual points/rasters on the selected physical device. There are many ways of selecting device coordinates but the simplest is described here. To use device coordinates after the system has been initialised, as described in section 3.1.1 and 3.1.2, requires a call to REGION(0.0). Care has to be taken if the program is rerun with a different device, for example, the point (150,140) is in the bottom left corner of the FR80 but none of the cameras can photograph it, yet on lineprinter graphical it will be out of the top right of the frame (all device coordinates and areas are given in [6] Appendix 5).

3.2.2 User coordinates - full area

If one initialises the system as described in section 3.1.1 and 3.1.2, then user coordinates are referred to as "Region One", this has already been selected by the initialising routine and all that remains is to specify what the scaling of the region should be. The routine LIMIT(XMIN,YMIN,XMAX,YMAX) defines the bottom left corner and the top right corner of the device as (XMIN,YMIN) and (XMAX, YMAX) respectively. An example follows where the Tektronix is selected and the user has data in the range 0 to 10 in the X direction and -5 to 5 in the Y direction:

      CALL DVALL(9)
      CALL LIMIT(0.0,-5.0,10.0,5.0)

If the user now refers to the point (10.0,5.0) he is in fact referencing the top right corner of the Tektronix screen. See the next section for problems in using LIMIT.

3.2.3 User coordinates - restricted area

It may have occurred to readers that one does not always want to specify one's own coordinates for the whole device area, especially since none of the FR80's cameras can photograph the complete area. To save the user having to remember how much is missed by each camera a set of routines has been provided to select certain standard areas and let the system sort out which is the real area required. The area most frequently used is the cine area because this allows for a gap between successive frames. To select this area requires a call to the routine CINE (for the complete list see [6] section 3.4).

There are two routines for specifying user coordinates for whichever area has been selected. The first specifies that this area has these coordinates and the second specifies that this shape is to be fitted into the selected area and given these coordinates. The first routine, LIMITV(XMIN,YMIX,XMAX,YMAX), works in a similar way to LIMIT but the coordinates refer to the "visible area" on the device. The second routine, LIMITS(XMIN,YMIN,XMAX,YMAX,WIDTH,HEIGHT), fits a rectangle into the selected area and gives it the coordinates (XMIN,YMIN) to (XMAX,YMAX). The confusion is caused by the definition of WIDTH and HEIGHT; these arguments define the aspect ratio of the largest rectangle that will fit into the selected area (for example, letting WIDTH equal 3.0 and HEIGHT equal 1.5 will produce a rectangle twice as wide as it is high. The largest rectangle of this shape will be fitted centrally into the currently selected area.

If LIMITS has been used effectively to reduce the size of the area then any subsequent use of LIMITV or LIMITS will refer to this area, unless of course a new area has been selected. Two new routines have been added to make SMOG/SPROGS even more flexible. The first is similar to LIMITS and is called LIMITR. LIMITR has the following format:

      LIMITR(XMIN,YMIN,XMAX,YMAX,XASP,YASP)

where (XMIN,YMIN) and (XMAX,YMAX) define the coordinates for the selected area and XASP,YASP defines the shape in the following manner. XASP units in the X direction equals YASP units in the Y direction. For example

      CALL LIMITR(0.0,-5.0,15.0,5.0,1,0,2.0)

will select an area which is 15 units wide by 10/2 units high or three times as wide as it is high. The largest area of this shape that will fit into the currently selected area, for example, the CINE area, is set up and given the desired user coordinates.

The other new routine is one to save users from having to do too much mental arithmetic. It selects a fraction of the current area as the new current area in the following manner. The routine is SUBDIV(XFMN,YFMN,XFMX,YFMX) where each value is in the range zero to one. For example:

      CALL SUBDIV(0.25,0.25,0.75,0.75)

will reduce the current area to half its length and half its height without altering the user's coordinates for that area. In this example the new area will be centred on the old area.

3.2.4 User and device coordinates - region chain

This facility is only available to users of SPROGS. The general idea is that a user works in the currently selected region's coordinates. The output to be plotted is passed down a "Region Chain" and all the coordinate conversion is done en route. If any region has an associated output device then the output is plotted on that device, and the output continues down the chain to the end. A method of initialising the system is described in section 3.1.3.

The simplest forms of region chain are the two used by SMOG. A single region is used when working in device coordinates, referred to as region "0". A two region chain is set up when working in user coordinates, referred to as region "1". In the second case no device is associated with the user region but all the output is passed down the chain, with suitable coordinate conversion taking place, to the device region where the output occurs.

There are basically two routines needed to set up a region chain. The first defines the coordinates for a region, the second selects the next region in the chain and upon what area of the next region to map this region. The two routines are:

      RGLIM(REG,XMIN,YMIN,XMAX,YMAX) 
      RGPLIM(REG,PREG,XPMIN,YPMIN,XPMAX,YPMAX)

respectively, where REG and PREG are region numbers from 0.0 to 29.0; that is, there are only thirty regions available for use in SPROGS. XMIN,YMIN,XMAX and YMAX define the coordinates of region REG. The points (XPMIN,YPMIN) and (XPMAX,YPMAX) are where in region PREG the points (XMIN,YMIN) and (XMAX,YMAX) of region REG are located.

The example will hopefully make the above a bit clearer. The problem is to split the frame into two small rectangles and output to both the FR80 and the Tektronix. To do this the four regions 8,9,10 and 21 will be used. It does not matter in which order the chain is set up so regions 8 and 10 will be used for the rectangular areas, region 21 for the FR80 and region 9 for the Tektronix. The two rectangular areas are set up as follows:

C---SPECIFY THE LIMITS FOR THE TWO 
C---USER AREAS.
      CALL RGLIM(8.0,0.0,0.0,100.0,10.0)
      CALL RGLIM(10.0,0.0,0.0,100.0,1.0)

It is at this stage that complications occur; one has to use a manual to find out what the coordinates are for the FR80 and the Tektronix (try [6] appendix 5). One can now specify the areas of the two devices that are required as follows:

C---SET UP LIMITS FOR THE FR80 (21) 
C--AND THE TEKTRONIX (9) REGIONS.
      CALL RGLIM(21.0,0.0,2059.0,16383.0,14325.0)
      CALL RGLIM(9.0,224.0,97.0,1023.0,682.0) .

Next we link the regions together. The cine area on the FR80 will map exactly onto the cine area on the Tektronix and regions 8 and 10 map onto different parts of region 21 as follows:

C---LINK- THE REGIONS TOGETHER.
      CALL RGPLIM(21.0,9.0,224.0,97.0,1023.0,682.0)
      CALL RGPLIM(8.0,21.0,1000.0,10000.0,11000.0,12000.0)
      CALL RGPLIM(10.0,21.0,1000.0,4000.0,11000.0,6000.0)

The following diagram showing just the mapping of the Y coordinates may help to explain what is going on:

Mapping of the Y Coordinates

Mapping of the Y Coordinates
Full image ⇗
© UKRI Science and Technology Facilities Council

As yet, regions 21 and 9 are not associated with any output devices, they just have suitable coordinates. The simplest way to accomplish this is by using BASER(REG,DEVICS) as follows:

C---HOOK UP THE DESIRED DEVICES. 
      CALL BASER(21.0,1.0) 
      CALL BASER(9.0,64.0)

At last we are ready to produce some output - or are we? Two things still remain to be selected; which of our regions do we wish to work in and which device do we want to output to? To start with, select region 8 and produce output on both the FR80 and Tektronix:

C---OUTPUT TO FR80 AND TEKTRONIX.
      CALL DVOUT(65.0) 
C---SELECT REGION 8 TO WORK IN.
      CALL REGION (8.0) 
C---DRAW THE DIAGONALS FOR THIS AREA.
      CALL VEC(0.0,0.0,100.0,10.0)
      CALL VEC(0.0,10.0,100.0,0.0)

Now use region 10 and only output to the FR80.

C---JUST THE FR80.
      CALL DVOUT(1.0) 
C---SELECT REGION 10.
      CALL REGION(10.0) 
C---DRAW A 'BOX' AROUND THIS REGION.
      CALL VEC(0.0,0.0,100.0,0.0)
      CALL TOXY(100.0, 1.0)
      CALL TOXY(0.0,1.0)
      CALL TOXY(0.0,0.0) 
C---ADVANCE THE FILM - SELECT NEW FRAME.
      CALL ADVFLM

The new frame will only be selected on the FR80, thus we still have a half-filled Tektronix frame, but first select region 8 and output a circle.

C---DRAW A CIRCLE IN REGION 8. 
      CALL REGION(8.0) 
      CALL CIRCLE(50.0,5.0,5.0,24.0,0.0)

Now output a triangle to both devices using region 10.

C---BOTH DEVICES AGAIN.
      CALL DVOUT(65.0) 
C---DRAW A TRIANGLE IN REGION 10.
      CALL REGION (10.0)
      CALL VEC(0.0,0.0,100.0,1.0)
      CALL TOXY(100.0,0.0)
      CALL TOXY(0.0,0.0)

3.3 An Example Of Output To Two Devices

This section brings together the examples from sections 3.1.3 and 3.2.4 into a complete program. The problem is to output four different pictures not necessarily to both devices. Picture one, a cross, is output to the top of frame one on both the FR80 and the Tektronix. Picture two, a rectangle, is output to the bottom of frame one on the FR80. Picture three, a circle, is output to the top of frame two on the FR80, Finally, picture four, a triangle, is out to the bottom of both frame two on the FR80 and frame one on the Tektronix. All of this is accomplished by use of the region facility of SPROGS and switching the various devices on and off as desired. The example program and the FR80 output are shown below.

3.3.1 Listing of source, file is GRAFEX.PROGRAM9

      LIST
      MASTER REGIONS
C---INITIALISE THE SPROGS SYSTEM AND 
C---SELECT THE HARDCOPY CAMERA IN "MANY-UP" 
C---MODE FOR LATER USE.
      CALL STSPR
      CALL CAMERA(8.0)
C---SPECIFY THE LIMITS FOR THE TWO 
C---USER AREAS.
      CALL RGLIM (8.0,0.0,0,0,100.0,10.0)
      CALL RGLIM (10.0,0.0,0.0,100.0,1.0) 
C---SET UP THE LIMITS FOR THE FR80 (21) 
C---AND THE TEKTRONIX (9) REGIONS.
      CALL RGLIM (21.0,0.0,2059.0,16383.0,14325.0)
      CALL RGLIM (9.0,224.0,97.0,1023.0,682.0) 
C---LINK THE REGIONS TOGETHER.
      CALL RGPLIM (21.0,9.0,224,0,97.0,1023.0,682.0)
      CALL RGPLIM (8.0,21.0,1000.0,10000.0,11000.0,12000.0)
      CALL RGPLIM (10.0,21.0,1000.0,4000.0,11000.0,6000.0)
C---HOOK UP THE DESIRED DEVICES.
      CALL BASER (21.0,1.0)
      CALL BASER (9.0,64.0) 
C---OUTPUT TO FR80 AND TEKTRONIX.
      CALL DVOUT (65.0) 
C---SELECT REGION 8 TO WORK IN.
      CALL REGION (8.0) 
C---DRAW THE DIAGONALS FOR THIS AREA.
      CALL VEC (0.0,0.0,100.0,10.0)
      CALL VEC (0.0,10.0,100.0,0.0) 
C---JUST THE FR80,
      CALL DVOUT (1.0) 
C---SELECT REGION 10
      CALL REGION (10.0) 
C---DRAW A BOX AROUND THIS REGION.
      CALL VEC (0.0,0.0,100.0,0.0)
      CALL TOXY (100.0,1.0)
      CALL TOXY (0.0,1.0)
      CALL TOXY (0.0,0.0) 
C---ADVANCE THE FILM - SELECT NEW FRAME.
      CALL ADVFLM 
C---DRAW A CIRCLE IN REGION 8.
      CALL REGION (8.0)
      CALL CIRCLB (50.0,5.0,5.0,24.0,0.0) 
C---BOTH DEVICES AGAIN.
      CALL DVOUT (65.0) 
C---DRAW A TRIANGLE IN REGION 10.
      CALL REGION (10.0)
      CALL VEC (0.0,0.0,100.0,1.0)
      CALL TOXY (100.0,0.0)
      CALL TOXY (0.0,0.0) 
C---TERMINATE PLOTTING.
      CALL ENDSPR
      STOP
      END

3.3.2 Command obeyed to run job

The example program will only work with SPROGS owing to the use of more than one device in the run. To output to the Tektronix requires an additional parameter of #TPO filename (ALLCHAR) and causes the output to be stored in filename so that it can be viewed at a later date. The *LP and #LP6 are a convenience as they force all of the lineprinter output for the job to be on one sheet of paper instead of the usual three that would occur otherwise. The command obeyed is:

SPROGS *CR :GRAFEX.PROGRAM9,#TP0 TEKOUT9(ALLCHAR)-
,*LP,#LP6,JT30

The hyphen at the end of the first line is the standard continuation character.

3.3.3 FR80 output produced

Output to two devices

Output to two devices
Full image ⇗
© UKRI Science and Technology Facilities Council

The "circle" is not circular because when region eight was set up the area of 100 units by 10 units was mapped onto an area 10000 units by 2000 units on the FR80. This gives a real ratio of two X units equals one Y unit, that is, the Y units are twice as big as the X units hence the thin "circle".

3.3.4 Listing the Tektronix output

A copy of the output is kept in file :GRAFEX.TEKOUT9 and can be viewed when logged in on a Tektronix by typing the following command:

LF :GRAFEX.TEKOUT9,ALL

The ALL ensures that the "clear screen" command at the end of the first frame is not obeyed until desired. A fuller description of this facility is given in section 5.2. The frame of output consists of a cross at the top and a triangle at the bottom.

3.4 Five Different Ways To Select The Same Area

The main object of this program was to test the different methods available to SMOG users for setting up their own coordinates. The problem was to select a quarter of the tube face (PLS) area and give this the coordinates for a unit square. The area chosen was in the middle so that it would be completely visible to the hardcopy camera. The five methods are described below, but one must remember that the desired area is a nice fraction of the tube face not the hardcopy frame size, hence the contort

(1) Set the user coordinates for the whole of the FR80 tube face to be large enough so that the central quarter ranges from zero to one. In other words, let X range from -0.5 to 1.5 and Y range from -0.5 to 1.5 then any user coordinates in the range 0.0 to 1.0 will be mapped onto the central quarter. The routine LIMIT was used as follows

      CALL LIMIT(-0.5,-0.5,1.5,1.5)

(2) Select the cine area and then, in the same way as above select suitable coordinates for the cine area so that the central quarter of the tube face is a unit square. The author had to use log tables to calculate the Values. The routine LIMITV which sets up the limits for the currently selected area was used, see below:

      CALL CINE
      CALL LIMITV(-0.5,-0.2485,1.5,1.2512)

Note how only the Y values differ from method (1), this is because the cine area uses the full width but reduces the Y range.

(3) Select the cine area and then use the LIMITS routine to set up a rectangle which is twice as wide as it is high. The Y coordinates are for the unit square but the X coordinates are greater for the same reasons as above. This gives a central unit square as follows:

      CALL CINE
      CALL LIMITS(-0.5,0.0,1.5,1.0,2.0,1.0)

(4) As for (3) but using the LIMITR routine. The rectangle is set so that one unit in the X direction is equal to one unit in the Y direction. The last two arguments specify what the ratio of a unit in X is to a unit in Y as follows:

      CALL CINE
      CALL LIMITR(-0.5,0.0,1.5,1.0,1.0,1.0)

(5) Set the whole tube face to be a unit square and then reduce the area on the tube face to the central quarter using the routine SUBDIV as follows:

      CALL LIMIT(0.0,0.0,1.0,1.0)
      CALL SUBDIV(0.25,0.25,0.75,0.75)

Methods (3) and (4) cheat a little in that the cine area is not quite central in the Y direction but as can be seen from the FR80 output, see section 3.4.2, the discrepancy is negligible. In each of the five areas a cross was plotted and appears as a rather black cross on the centre of the frame. The complete program is shown below.

3.4.1 Listing of source, file is GRAFEX.AREATEST

LIST
MASTER COORD
C THIS PROGRAM TESTS 5 WAYS OF SELECTING THE SAME
C AREA AND PLOTS A CROSS TO CHECK THIS.
C
C INITIALISE -  USE MANY-UP HARDCOPY.
      CALL FRHCM 
C METHOD ONE
      CALL LIMIT (-0.5,-0.5,1.5,1.5)
      CALL CROSS
C METHOD TWO
      CALL CINE
      CALL LIMITV (-0.5.-0.2485,1.5,1.2512)
      CALL CROSS 
C METHOD THREE
      CALL CINE
      CALL LIMITS (-0.5,0.0,1.5,1.0,2.0,1.0)
      CALL CROSS 
C METHOD FOUR
      CALL CINE
      CALL LIMITR (-0.5,0.0,1.5,1.0,1.0,1.0)
      CALL CROSS 
C METHOD FIVE
      CALL LIMIT (0.0,0.0,1.0,1.0)
      CALL SUBDIV (0.25,0.25,0.75,0.75)
      CALL CROSS 
C END PLOTTING
      CALL ENDSPR
      STOP
      END
      SUBROUTINE CROSS
      CALL VEC (0.0,0.0,1.0,1.0)
      CALL VEC (0.0,1.0,1.0,0.0)
      RETURN
      END 
****

3.4.2 Command to run program

The program is stored in the file :GRAFEX.AREATEST and the command used to run it was:

TASK SMOG,*CR:GRAFEX.AREATEST,JT20,*LP,#LP6

The *LP and #LP6 ensure that the three separate listings all occur on the same piece of paper rather than separately.

3.4.3 Hardcopy output

Full image ⇗
© UKRI Science and Technology Facilities Council
⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site