Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-12 - 43,50547/pltlib/v12/pltunv.mac
There are 2 other files named pltunv.mac in the archive. Click here to see a list.
SUBTTL	Initialization  /RWS/JMS

	ftdbug==-1	;temporary - while debugging

IFNDEF	TOPS,TOPS==10		;CSM runs version 7.01 of TOPS-10
DEFINE	TOPS10,<IFE TOPS-10,>
DEFINE	TOPS20,<IFE TOPS-20,>
	SALL


TOPS10<	SEARCH	MACTEN,UUOSYM >	;Standard TOPS-10 definitions
TOPS20<	SEARCH	MACSYM,MONSYM	;Standard TOPS-20 definitions
IF2,<	PRINTX	[Creating TOPS-20 PLTUNV]>
	DEFINE	ND(SYM,VAL),<	;Macro not in MACSYM
IF2,<IFDEF SYM,<SYM==SYM>> IFNDEF SYM,<SYM==<VAL>> >
>  ;End TOPS20

;Define the version number
	PLTWHO==0	;Who last edited 'PLOT'
	PLTVER==12	;The version number of 'PLOT'
	PLTMIN=="@"-"@"	;The minor version number of 'PLOT'
	PLTEDT==514	;The edit number of 'PLOT'
			;Last edited 29-Oct-82 by Joe Smith

	VERSON==<BYTE (3)PLTWHO(9)PLTVER(6)PLTMIN(18)PLTEDT>


SUBTTL	Feature-Test definitions

TOPS10< ND FT701,-1 >	;Use FILOP. with extended channels
TOPS20< FT701==0 >	;Use OPEN/LOOKUP/IN/RELEAS uuos
TOPS20< FTSHR==0 >	;No HISEG for orange toads
ND FTJSYS,0	;No native mode TOPS20 stuff yet
ND FTDBUG,0	;Do not include features for debugging PLOT.REL with DDT
ND FTKA,0	;Use FIXR instruction instead of IFX.1 subroutine
ND FTMKTB,0	;Do not include MKTBL and SETABL in SYMBOL (DEC compatibility)
ND FTSHR,-1	;Put code in HISEG, data in LOSEG
ND FTAPLT,0	;Do not allow for alias plotters (subroutine PLOTER)
SUBTTL	Table of Contents

;        Table of Contents for PLOT universal definitions
;
;
;			   Section			      Page
;
;    1. Feature-Test definitions . . . . . . . . . . . . . . .   1
;    2. Table of Contents  . . . . . . . . . . . . . . . . . .   2
;    3. Edit history . . . . . . . . . . . . . . . . . . . . .   3
;    4. Macro definitions  . . . . . . . . . . . . . . . . . .   4
;    5. AC definitions . . . . . . . . . . . . . . . . . . . .   6
;    6. Subroutine Descriptions
;         6.1   IPLOT  - Fake a call to PLOTS  . . . . . . . .   7
;         6.2   PLOTS  - Initialize the plotter  . . . . . . .   8
;         6.3   CRSHRS - Alias for XHAIRS  . . . . . . . . . .   9
;         6.4   ERASE  - Erase screen or go to new page  . . .  10
;         6.5   FACTOR - Change size of plotter movements  . .  11
;         6.6   GETWIN - Get size of universal window  . . . .  12
;         6.7   NEWPEN - Change to different pen color . . . .  13
;         6.8   OPRTXT - Send a message to the OPR . . . . . .  14
;         6.9   PAUSEP - Cause the plotter to pause  . . . . .  15
;         6.10  PLOT   - Move the pen to X,Y coordinates . . .  16
;         6.11  PLOTER - Define plotter aliases  . . . . . . .  17
;         6.12  PLOTOF - Temporarily disable output  . . . . .  18
;         6.13  PLOTOK - Get status of the plotter . . . . . .  19
;         6.14  PLOTON - Resume plotting . . . . . . . . . . .  20
;         6.15  ROTATE - Set up for a rotation of axis . . . .  21
;         6.16  SETWIN - Set the size of the universal windo .  22
;         6.17  SUBWIN - Set/reset/status of sub-window  . . .  23
;         6.18  TITLE  - Plot symbols (letters, digits, etc) .  24
;         6.19  WHERE  - Get current pen position  . . . . . .  25
;         6.20  XHAIRS - Trigger crosshairs on TEK 4012  . . .  26
SUBTTL	Edit history

;Version number 11
;Edit	Date
; ***	**-***-**  RWS	No previous history.
;			PLOT.MAC was written by Rex Shadrick around 1976.
;
; 443	12-Aug-81  JMS	Last edit to version 11.
;			Joe Smith at CSM.
;
;************  START OF VERSION 12 ****************************************
;
; 500	16-Dec-81  JMS	Major changes.  Reset version number.
;			(PLOT.MAC)
;
; 501	26-Jul-82  JMS	Add ReGIS output for VT125 and GIGI terminals.
;			(PLTRGS portion of PLOT.MAC)
;
; 502	18-Aug-82  JMS	Split into separate source files, compile
;			PLOT.MAC+PLTDSK.MAC+PLTRGS.MAC+PLTTEK.MAC+PLTIOD.MAC
;
; 503	22-Sep-82  JMS	More on edit 502.
;			(all)
;
; 504	15-Oct-82  JMS	Remove all UUOs from PLOT.MAC, put them in PLTIOD.
;			(PLOT,PLTIOD)
;
; 505	20-Oct-82  JMS	Remove debugging HALT from SYMBOL.
;			(SYMBOL)
;
; 506	20-Oct-82  JMS	Implement CR, LF, TAB, BS, SI, and SO in SYMBOL.
;			(SYMBOL)
;
; 507	22-Oct-82  JMS	Clear the screen when XHAIRS reads a formfeed.
;			(PLTTEK,PLTRGS)
;
; 510	22-Oct-82  JMS	Initialize Tektronix 4025 properly.
;			(PLTTEK)
;
; 511	27-Oct-82  JMS	Do orthoganal or diagonal moves up to 8 pixels by
;			sending only digits to the GIGI.
;			(PLTRGS)
;
; 512	29-Oct-82  JMS	Implement SETSYM routine to replace ISETAB/MSETAB.
;			(SYMBOL)
;
; 513	 2-Nov-82  JMS	Allow [1,2] to write in other directories,
;			fix the return of IERR in SETSYM after edit 512.
;			(PLTIOD,SYMBOL)
;
; 514	 9-Nov-82  JMS	Do not special case CR, LF, etc for centered symbols.
;			(SYMBOL)
;
;End of Revision History

		PAGE

;	Suggestions to be implemented
;
; What happens for centered symbols on tables without them?
;
; Make callable from ALGOL, COBOL, PASCAL, XPL0, etc
;
; Return plotter type in ASCII as well as integer
;
; Try to intercept calls to EXIT on fatal FORTRAN errors
SUBTTL	Macro definitions

; $TITLE - This is a macro to the define the version number
;
; Calling sequence:
;	$TITLE \VERSION.NUMBER,\EDIT.LEVEL

DEFINE	$TITLE ($VER,$EDT),<
  DEFINE  UNV ($TXT),<UNIVERSAL $TXT  %'$VER($EDT) >
  DEFINE  TTL ($TXT,$TYPE),<	SALL
    TITLE $TXT  %'$VER($EDT)
    IFNB <$TYPE>,<NOSYM	;Dummy module
		  IF2,<PRINTX $TXT>>
    IFB <$TYPE>,<TOPS10< SEARCH	MACTEN,UUOSYM >
		 TOPS20< SEARCH	MACSYM,MONSYM >
		 IF2,<PRINTX $TXT  %'$VER($EDT)>
		 $RELOC	400000 >> ;End of DEFINE TTL
>  ;End of DEFINE $TITLE

$TITLE	\PLTVER,\PLTEDT

UNV	<PLTUNV - UNV file for plotting package>
	PURGE	$TITLE



; $RELOC, $HISEG, $LOSEG - Relocation macros for 1 or 2 segments

IFE FTSHR,<	;Put everything in LOSEG, with data and code intermixed
  DEFINE $RELOC (ADDR),<..==.>
  DEFINE $HISEG,<..==.>
  DEFINE $LOSEG,<..==.>
>  ;End of IFE FTSHR

IFN FTSHR,<	;Put code in HISEG and data in LOSEG
  DEFINE $RELOC (ADDR),<	TWOSEG
			RELOC	ADDR>
  DEFINE $HISEG,<IFL  .-400000,<RELOC>>	;HISEG origin must be 400000 or above
  DEFINE $LOSEG,<IFGE .-400000,<RELOC>>
>  ;End of IFN FTSHR


; PFALL - Used to verify the flow by falling into subroutines

  DEFINE PFALL(LABEL),<IF2,<IFN .-LABEL,<
	PRINTX	?PFALL - LABEL: is not next statement
	STOPI;;Cause an "A" error>>  ;End IFN and IF2
	..==LABEL	>  ;End DEFINE PFALL
; ERRSTR - Output an error message to the terminal
; Produces 1 word of in-line code, can be skiped over

  DEFINE ERRSTR(MESSAGE),<
IFDEF RESTTY,<
	PUSHJ	P,[HRROI T1,[ASCIZ ~
MESSAGE
~]
	PJRST	RESTTY]>;;Restore TTY to normal before outputing string
IFNDEF RESTTY,<
TOPS10<	OUTSTR	[ASCIZ	~
MESSAGE
~]>
TOPS20<	PUSHJ	P,[HRROI T1,[ASCIZ ~
MESSAGE
~]
		PSOUT
		POPJ	P,]>
>> ;End IFNDEF, end DEFINE



; Definitions from MACTEN and UUOSYM that are not in MACSYM

TOPS20<	DEFINE	MONRT.,<HALTF>		;Quiet exit to the EXEC
	OPDEF	PJRST	[JUMPA	17,]	;Not in MACSYM
	SYN	FLD,INSVL.		;Insert value
	.IOASC==0			;Normal ASCII mode
	.IOPIM==3			;Packed Image Mode for TTY
	.IOIMG==10			;Image mode
	.IOIBN==13			;Image BINARY mode
>  ;End TOPS20
;DMOVE and DMOVEM for handling (X,Y) as a pair

IFN FTKA,<	;Define DMOVE and DMOVEM to load/store X and Y
  DEFINE DMOVE (AC,MEM),<IFN MEM&@,<PRINTX ?Improper use of DMOVE>
	MOVE	AC,MEM
	MOVE	AC+1,MEM+1>
  DEFINE DMOVEM (AC,MEM),<IFN MEM&@,<PRINTX ?Improper use of DMOVEM>
	MOVEM	AC,MEM
	MOVEM	AC+1,MEM+1>
>  ;End of IFN FTKA


;FLOAT macro - converts a signed integer with 27 or fewer bits to floating point

IFN FTKA,<
  DEFINE FLOAT (AC,MEM),<;;Convert small integers to floating point
    IFB <MEM>,<
	FSC	AC,233>
    IFNB <MEM>,<
	MOVE	AC,MEM
	FSC	AC,233>
>>  ;End of KA FLOAT

IFE FTKA,<
  DEFINE FLOAT (AC,MEM),<;;Convert small integers to floating point
    IFB <MEM>,<	FLTR	AC,AC>
    IFNB <MEM>,<FLTR	AC,MEM>
>>  ;End of non-KA FLOAT
SUBTTL	AC definitions

	T0= 0		;Temporary
	T1= 1		; ACs usually
	T2= 2		; NOT saved
	T3= 3		; across
	T4= 4		; routines
	P1= 5		;Permanent ACs
	P2= 6		; usually saved
	P3= 7		; across
	P4=10		; routines
	X= 11		;Holds the location
	Y= 12		; being moved to
	G3==13		;General ACs,
	G4==14		; redefined in
	G5==15		; modules that need them
	L= 16		;Pointer to the argument list
	P= 17		;Push down pointer

;Other definitions

	PEN.DN==2	;Lower the pen before moving
	PEN.UP==3	;Raise the pen before moving
	PEN.OR==-3	;Change the origin

	OPDEF	INTEGER	[Z 02,0] ;Fixed point argument
	OPDEF	REAL	[Z 04,0] ;Floating point argument
	OPDEF	STRING	[Z 17,0] ;ASCIZ string


;NOTE:	In the remaining modules in this file, IPLOT must come before PLOTS.
;	PLOTS must come before .PLOT. to properly set up forward references
;	Everything else is in alphabetical order.

	PRGEND		;End of PLTUNV universal
SUBTTL	Subroutine Descriptions -- IPLOT  - Fake a call to PLOTS
	SEARCH	PLTUNV	;Search the universal file
TTL	(<IPLOT  - Initalizes the plot to spooled *.PLT file>)

;	FUNCTION IPLOT(IWARN)		! You should use PLOTS instead of IPLOT
;	IERR = IWARN			! Number of warnings to type
;	CALL PLOTS (IERR,0)		! Initialize the plot the right way
;	IPLOT = IERR			! Return 0 if OK, -1 if failed
;	END

	ENTRY	IPLOT
	SIXBIT	/IPLOT/
IPLOT:	MOVEI	0,SAVE00	;Save all ACs
	BLT	0,SAVE00+L	;1 through 16
;*;	ERRSTR	(<[Function IPLOT has called subroutine PLOTS to set up the plotter]>)
				;Call PLOTS directly to avoid the message
	MOVE	T1,@0(L)	;Get argument to IPLOT(IWARN)
	MOVEM	T1,IERR		;Store as 2nd arg to PLOTS
	MOVEI	L,[-2,,0	  ;2 args
		INTEGER IERR	  ;IERR - Nonzero if error occured
		INTEGER IPLT	  ;IPLT - Type of plotter
		  ]+1		;Point to args
	PUSHJ	P,PLOTS##	;Call routine in PLOT module
	SKIPE	IERR		;Was IERR non-zero?
	 SETOM	IERR		;Yes, return -1 even for positive IERR
	MOVSI	L,SAVE00	;Restore ACs
	BLT	L,L		;0 through 16
	MOVE	T0,IERR		;Return function value in AC 0
	POPJ	P,

	$LOSEG		;Variables

SAVE00:	BLOCK	16+1		;Functions must preserve ACs 2-16
IERR:	BLOCK	1
IPLT:	BLOCK	1		;Zero means use default plotter

	$HISEG
LITS:	PRGEND
SUBTTL	Subroutine Descriptions -- PLOTS  - Initialize the plotter
	SEARCH	PLTUNV	;Search the universal file
TTL	(<PLOTS  - Initializes the plot)>,DUMMY)

;Calling sequence:
;	CALL PLOTS (IERR)
;	CALL PLOTS (IERR, IPLT)
;	CALL PLOTS (IERR, IPLT, DFILE)
;
;  IERR   - (input) The number of "window exceeded" errors to display.
;	    If negative, the subroutine calls will be traced.
;	    (output) The error flag.  Zero means no errors.
;	    -1 if no such plotter, positive numbers for output file failure.
;
;  IPLT   - The type of plotter to set up.  This variable is either an integer
;	    or name stored in an A5 format.
;     '     ' or   0	Default plotter ('SPOOL' unless set otherwise)
;     'PLOT'  or 'PLT'	Same as 0, use the default plotter
;     'TTY'		'TEK' or 'GIGI' depending on terminal type
;     'SPOOL' or   1	Spooled disk file, use ".PLOT *.PLT" to send to plotter
;     100, 200, or 400	Spooled disk file, using that many increments per inch
;     'ARDS'  or   2	Advanced Remote Display Station
;     'TEK'   or   3	Generic Tektronix terminal (same as 4010)
;     'REGIS' or   4	Generic ReGIS terminal (GIGI, VT125, HI-DMP4R
;     'XY10'  or  10	Unspooled output directly to plotter (DEC format)
;     'GIGI', 'VK100', 'VT125', or 'DMP4R' = Specific ReGIS terminals
;     '4006' or 4006	Tektronix 4006 terminal
;     '4010' or 4010	Tektronix 4010 or 4012 terminal
;     '4014' or 4014	Tektronix 4014 terminal using full resolution
;     '4025' or 4025	Tektronix 4025 raster scan terminal
;
;  DFILE  - (optional) A literal or double-precision variable specifying
;	    the device and file name for output, in an (A10) format.

;Examples:
;	IERR = 0			!Do not trace window exeeded errors
;	CALL PLOTS (IERR,'TEK')		!Set TEKTRONIX into graphics mode
;	IF (IERR.NE.0) STOP 'Cannot open PLOT file'
;
;		or
;
;	IERR = -9			!Trace first 9 errors
;	CALL PLOTS (IERR,'SPOOL','LIB:ABCDEF') !Send data to LIB:ABCDEF.PLT
;	IF (IERR.NE.0) STOP 'Cannot open PLOT file'
;
;Note: On the last example, logical device LIB: can be defined by
;	.PATH LIB:/SEARCH=[13,10,PLOT,TEST]

PAGE
	EXTERN	SYMBOL,ISETAB	;Use subroutine SYMBOL for headers and TITLE
	EXTERN	.PLOT.		;Default plotter (ASCII/SPOOL/)

	ENTRY	PLOTS
	PLOTS=%PLOTS##		;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- CRSHRS - Alias for XHAIRS
	SEARCH	PLTUNV	;Search the universal file
TTL	(<CRSHRS - Alias for XHAIRS>,DUMMY)

;Calling sequence:  See subroutine XHAIRS


	ENTRY	CRSHRS
	CRSHRS=%XHAIRS##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- ERASE  - Erase screen or go to new page
	SEARCH	PLTUNV	;Search the universal file
TTL	(<ERASE  - Erases the screen on graphics terminals>,DUMMY)

;Calling sequence:
;	CALL ERASE
;
;  The current X and Y positions are set to zero, the origin is set to the
;lower left corner of the screen, and rotation is turned off.
;
;  The GENCOM, DIABLO, or PTC5 will move to the top of a new page.


	ENTRY	ERASE
	ERASE=%ERASE##		;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- FACTOR - Change size of plotter movements
	SEARCH	PLTUNV	;Search the universal file
TTL	(<FACTOR - Sets the scaling factor>,DUMMY)

;Calling sequence:
;	CALL FACTOR (FACT)
;	CALL FACTOR (FACT, FACTY)
;
;   FACT - The multiplicative factor value to be used
;  FACTY - (optional) Factor to be used in the Y directon.  If not given,
;	   FACT will be used for both directions.
;
;  If FACT or FACTY is zero, the corresponding factor is left unchanged.


	ENTRY	FACTOR
	FACTOR=%FACTOR##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- GETWIN - Get size of universal window
	SEARCH	PLTUNV	;Search the universal file
TTL	(<GETWIN - Gets the universal the window size>,DUMMY)

;Calling sequence:
;	CALL GETWIN (XMIN, YMIN, XMAX, YMAX)
;
;  XMIN - Coordinate of left edge of window
;  YMIN - Coordinate of bottom edge of window
;  XMAX - Coordinate of right edge of window
;  YMAX - Coordinate of upper edge of window

;Example:
;	CALL GETWIN (XMIN, YMIN, XMAX, YMAX)	!Get the current borders
;	CALL PLOT (XMIN, YMIN, -3)	!Restore true origin
;	CALL FACTOR (1.0)		!Restore true factor


	ENTRY	GETWIN
	GETWIN=%GETWIN##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- NEWPEN - Change to different pen color
	SEARCH	PLTUNV	;Search the universal file
TTL	(<NEWPEN - Allows the user to switch pens>,DUMMY)

;Calling sequence:
;	CALL NEWPEN(IPEN,IERR)
;
;  IPEN - The new pen to be used, return current pen if IPEN=0.
;  IERR - The error flag.  Returned as 0 if no errors in setting up the
;	  new pen, -1 if IPEN is illegal, and returns the current pen
;	  number if IPEN=0.
;  Pen 1 is blue, 2 is black, and 3 is red.


	ENTRY     NEWPEN
	NEWPEN=%NEWPEN##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- OPRTXT - Send a message to the OPR
	SEARCH	PLTUNV	;Search the universal file
TTL	(<OPRTXT - Sends a message to the OPR>,DUMMY)

;Calling sequence:
;	CALL OPRTXT (IARRAY, N)
;
;  IARRAY - The array of characters (the message) to be output
;    N    - The number of characters in the message

;Example:
;	CALL OPRTXT ('Need black felt-tip in pen 1', 28)
;	CALL PLOT (X, Y, 0)	!Wait for operator to change pens


	ENTRY	 OPRTXT
	OPRTXT=%OPRTXT##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- PAUSEP - Cause the plotter to pause
	SEARCH	PLTUNV	;Search the universal file
TTL	(<PAUSEP - Pauses the plotter>,DUMMY)

;Calling sequence:
;	CALL PAUSEP (NSEC)
;
;    NSEC - The number of seconds to pause
;
;Note:  PAUSEP can be used on graphics terminals to allow the user to
;	view the plot.  PAUSEP does not affect the spooled plotter (DP-8),
;	but the command is stored in the disk file in case the 'TEK'
;	program is used to view the plot.


	ENTRY	 PAUSEP
	PAUSEP=%PAUSEP##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- PLOT   - Move the pen to X,Y coordinates
	SEARCH	PLTUNV	;Search the universal file
TTL	(<PLOT.  - Moves the pen>,DUMMY)

;Calling sequence:
;	CALL PLOT (X, Y, IFUNC)
;
;(X,Y)	Floating point values of X and Y to be used in this call to PLOT.
;
;IFUNC	= 999  To finish off the PLOT in proper form.
;---------  999 must be executed before the end of your program  -------------
;	=  13  X and Y are polar coordinates (X = radus and Y = angle in
;	         radians), the movement is with pen up.
;	=  12  X and Y are polar coordinates, the movement is with the
;	         pen down.
;	=  11  X and Y are polar coordinates, the movement is with the last
;	         pen value (2 or 3).
;	=  10  X and Y are polar coordinates (X = radus and Y = angle in
;	         degrees), the movement is with pen up.
;	=   9  X and Y are polar coordinates, the movement is with the
;	         pen down.
;	=   8  X and Y are polar coordinates, the movement is with the last
;	         pen value (2 or 3).
;--------------							---------------------
;	=   7  X and Y are delta values, the movement is with the pen up.
;	=   6  X and Y are delta values, the movement is with the pen down.
;	=   5  X and Y are delta values, the movement is with the old pen (up or down)
;--------------							---------------------
;	=   4  Make the current pen position (X,Y) by shifting the origin.
;--------------   These next two functions are used the most	---------------------
;	=   3  X and Y are coordinates, the movement is with the pen up.
;	=   2  X and Y are coordinates, the movement is with the pen down.
;--------------							---------------------
;	=   1  X and Y are coodinates, leaving the pen as is (up or down).
;	=   0  Make the output to the plotter pause, CRT's will wait for LF.
;	=  -1  Same as '1', except after the movement this point is the origin.
;--------------							---------------------
;   -2 to -13  Set origin to (X,Y) after moving to new position.
;   -999 to abort the plot and delete the disk file (if any).
;
;##NOTE:  For absolute value of "IFUNC" greater than 13 ends the plot.
;The proper way to finish the plot is by:
;	CALL PLOT (X, Y, 999)


	ENTRY	  PLOT
	PLOT=%PLOT##		;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- PLOTER - Define plotter aliases
	SEARCH	PLTUNV	;Search the universal file
IFN FTAPLT,<	;Only if alias plotters

TTL	(<PLOTER - Define new plotter name>,DUMMY)

;Calling sequence:
;	CALL PLOTER (IPLT,IALIAS,IERR)
;
;  IPLT - An existing plotter type.  See PLOTS for list of valid types.
;
;  IALIAS - The new name to define.  Up to 5 letters and/or digits.
;
;  IERR - Returned as 0 if OK, -1 if IPLT is unknown or table full.


	ENTRY	  PLOTER
	PLOTER=%PLTER##		;Defined in PLOT module
	PRGEND	>  ;End of IFN FTAPLT
SUBTTL	Subroutine Descriptions -- PLOTOF - Temporarily disable output
	SEARCH	PLTUNV	;Search the universal file
TTL	(<PLOTOF - Turn off the one of the plotters>,DUMMY)

;Calling sequence:
;	CALL PLOTOF (IPLT)
;
;  IPLT - The plotter to turn off.  Zero means current plotter.
;	See PLOTS for list of valid types.
;
;NOTE:  If your program intends to do READ/ACCEPT from the terminal or
;	WRITE/TYPE to the terminal, you must call PLOTOF to reset the graphics
;	terminal to text mode.  Subroutine PLOTON will resume plotting without
;	erasing the screen, subroutine PLOTS will erase and start over.


	ENTRY	  PLOTOF
	PLOTOF=%PLTOFF##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- PLOTOK - Get status of the plotter
	SEARCH	PLTUNV	;Search the universal file
TTL	(<PLOTOK - Check on plotter status>,DUMMY)

;Calling sequence:
;	CALL PLOTOK (IPLT,IOK,DNAME,X,Y,IPEN,FACTX,FACTY,ORIGX,ORIGY,ANGLE)
;
;  IPLT  - The type of plotter to check.  See PLOTS for list.
;  IOK   - Plotter status, -1 if no such plotter, 0 if OFF, 1 if ON
;  DNAME - Output device and file name, double precision in (A10) format
;  X     - Current pen position
;  Y     -   "           "
;  IPEN  - Current pen number, negative if pen is up (Set by PLOT and NEWPEN)
;  FACTX - Scaling factor in X direction        (Set by call to FACTOR)
;  FACTY - Scaling factor in Y direction
;  ORIGX - Coordinate of absolute origin        (Set by CALL PLOT (X,Y,-3)
;  ORIGY -  "           "            "
;  ANGLE - Rotation angle in degrees            (Set by call to ROTATE)


	ENTRY	PLOTOK
	PLOTOK==%PLTOK##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- PLOTON - Resume plotting
	SEARCH	PLTUNV	;Search the universal file
TTL	(<PLOTON - Turn off the one of the plotters>,DUMMY)

;Calling sequence:
;	CALL PLOTON (IPLT)
;
;  IPLT - The type of plotter to turn on.  Zero means the current plotter.
;	See PLOTS for list of plotter types.
;
;NOTE:  PLOTS can be called more than once, to send output to the spooled
;	plotter and to the Tektronix simultaneously.  You can call PLOTOF
;	and PLOTON to turn on and off each plotter individually.

;Example:
;
;	CALL PLOTS (IERR,'SPOOL')	!Open spooled plotter disk file
;	IF (IERR.NE.0) STOP 'PLOTS failed'
;	CALL PLOTS (IERR,'TEK')		!Enable the Tektronix also
;	  ---   (a bunch of calls to PLOT)
;	CALL PLOTOF('TEK')		!Set Tektronix back to text mode
;	TYPE 10
;10	FORMAT (' Proceed? ',$)
;	ACCEPT 20, ANS
;20	FORMAT (A1)
;	IF (ANS.NE.'Y') GOTO 2000	!Abort if not "YES"
;	CALL PLOTON('TEK')		!Back to graphics mode
;	  ---   (more calls to PLOT)
;1000	CALL PLOT(X,Y,999)		!Finish off the plot properly
;	STOP 'Plot is done'
;2000	CALL PLOT(X,Y,998)		!Cancel the plot file
;	STOP '%Plot aborted'
;	END


	ENTRY	  PLOTON
	PLOTON=%PLTON##		;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- ROTATE - Set up for a rotation of axis
	SEARCH	PLTUNV	;Search the universal file
TTL	(<ROTATE - Sets up for a rotation of axis>,DUMMY)

;Calling sequence:
;	CALL ROTATE (IFUNC, X, Y, ANGLE)
;
; (X,Y) - The coordinate the plot is to be rotated about, new origin
; ANGLE - The angle the plot is to be rotated about, in degrees
; IFUNC = 0  To clear all rotation, set origin to lower left corner
;		Current origin and angle are returned in X, Y, and ANGLE
;	< 0  To set rotation to ANGLE, regardless of previous rotation.
;	> 0  To sum the new angle with old rotation.
;
;NOTE:	The origin set by CALL PLOT(X,Y,-3) affects all plotters equally.
;	The origin set by ROTATE affects only the plotters currently active.
;	The origin of the Tektronix can be set to be different from that of
;	the spooled plotter by calling PLOTOF to disable all other plotters
;	before calling ROTATE, and calling PLOTON after.


	ENTRY	  ROTATE
	ROTATE=%ROTATE##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- SETWIN - Set the size of the universal window
	SEARCH	PLTUNV	;Search the universal file
TTL	(<SETWIN - Sets up the window size>,DUMMY)

;Calling sequence:
;	CALL SETWIN (WX, WY, PRVX, PRVY)
;
;  WX  - The requested width of the window in inches (X direction)
;  WY  - The requested height of the window in inches (Y direction)
; PRVX - The maximum width you are allowed to use.
; PRVY - The maximum height you are allowed to use.
;	 Users are limited to 11 inches unless special privleges are granted.
;
;  This subroutine defines the universal window.  It must be called before
;PLOT and SUBWIN, but after PLOTS.


	ENTRY	 SETWIN
	SETWIN=%SETWIN##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- SUBWIN - Set/reset/status of sub-window
	SEARCH	PLTUNV	;Search the universal file
TTL	(<SUBWIN - Allows the user to set up subwindows>,DUMMY)

;  This routine allows the user to set up a subwindow.  The user can
;also turn the subwindow feature off and on at will.  No lines will
;be plotted outside the current subindow.
;
;Calling sequence:
;
;	CALL SUBWIN (IFUNC, IVALUE, X0, Y0, WIDTH, HEIGHT)
;
;  IFUNC  - (Input) allows for 4 modes of operation
;	     0 or 'SET'  - Set up the window.
;	     1 or 'READ' - Read the window size and ON/OFF flag.
;	     2 or 'OFF'  - Disable the subwindow for now.
;	     3 or 'ON'   - Reenable the window with the last subwindow defined.
;
;  IVALUE - (Output) A mode (IFUNC) dependent value (if IFUNC < 0 or IFUNC > 4
;	    then IVALUE will be set equal to -1)
;	     IFUNC = 0 or 'READ'
;	      -1 - Error - The width or height was less than zero.
;	       0 - The window was set up.
;	     IFUNC = 1 or 'SET'
;	      -1 - Error - No subwindow has been set up yet.
;	       0 - The subwindow is defined, but disabled.
;	       1 - The subwindow is defined and active.
;	     IFUNC = 2 or 'OFF' or 3 or 'ON'
;	      -1 - Error - No subwindow was set up.
;	       0 - The subwindow checking was set or cleared.
;
;  X0,Y0  - (I/O) The coordinate of the lower hand corner of the subwindow
;	    (not used if IFUNC = 2 or 3)
;
;  WIDTH  - (I/O) The width of the window (not used if IFUNC = 2 or 3)
;
;  HEIGHT - (I/O) The height of the window (not used if IFUNC = 2 or 3)


	ENTRY	SUBWIN
	SUBWIN=%SUBWIN##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- TITLE  - Plot symbols (letters, digits, etc)
	SEARCH	PLTUNV	;Search the universal file
TTL	(<TITLE  - Activates hardware character generator>,DUMMY)

;Calling sequence:
;	CALL TITLE (X, Y, HEIGHT, ICHAR, ANGLE, NUMCHR)
;
;  (X,Y)  - The coordinate of the first character to be drawn.
;  HEIGHT - The height of the characters in inches.
;  ICHAR  - An array of characters to be plotted, or an integer number.
;  ANGLE  - The angle of rotation, must be a multiple of 45 degrees.
;  NUMCHR - the number of characters to be plotted.
;	If NUMCHR is zero, plot the single char whose ASCII code is in ICHAR.
;
;This routine uses the hardware character set if possible.  Otherwise it
;uses subroutine SYMBOL and ISETAB table #1.

	ENTRY	TITLE
	TITLE==%TITLE##	;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- WHERE  - Get current pen position
	SEARCH	PLTUNV	;Search the universal file
TTL	(<WHERE  - Returns the current loctation of the pen>,DUMMY)

;Calling sequence:
;	CALL WHERE (X, Y, FACT)
;	CALL WHERE (X, Y, FACT, IPLT, FACTY)
;
;    X   - The current X value of the point
;    Y   - The current Y value of the point
;   FACT - The current factor value
;   IPLT - (optional) The current type of plotter in use:
;		 1 - Spooled version, compressed output for PLTSPL
;		 2 - ARDS terminal
;		 3 - TEKTRONIX terminal
;		 4 - ReGIS terminal (GIGI,VT125)
;		10 - Original DEC spooler version, expanded output
;  FACTY - (optional) The current factor used in the Y direction


	ENTRY	WHERE
	WHERE=%WHERE##		;Defined in PLOT module
	PRGEND
SUBTTL	Subroutine Descriptions -- XHAIRS - Trigger crosshairs on TEK 4012
	SEARCH	PLTUNV	;Search the universal file
TTL	(<XHAIRS - Triggers crosshairs on TEK 4012 and GIGI>,DUMMY)

;Calling sequence:
;	CALL XHAIRS (XPOS, YPOS, LETTER)
;	CALL XHAIRS (XPOS, YPOS, LETTER, DSTRNG)
;	CALL CRSHRS (XPOS, YPOS, LETTER)	! Old name for XHAIRS
;
;  XPOS  - The X coordinate of the crosshairs
;  YPOS  - The Y coordinate of the crosshairs
; LETTER - The character that was typed.  Normal characters are
;	   returned in an 'A1' format, control characters are returned
;	   as a number between 1 and 31 in an 'R1' format.
; DSTRNG - (optional) The string of characters as sent by terminal
;	   left justified in a DOUBLE PRECISION variable.  (10 characters
;	   for GIGI, only 5 for TEKTRONIX.)
;
;  If the character typed is a Control-L (formfeed), the screen is erased,
;the beam position set to (0,0) at the lower left corner of the screen,
;and all arguments are returned as zero.


	ENTRY	XHAIRS
	XHAIRS=%XHAIRS##	;Defined in PLOT module
	END