.ps 60 80 .rm 78 .p 0 1 4 .noj .ap .ch USING#DIGS#ON#THE#VAX#CLUSTER .hl 1 INTRODUCTION VAX DIGS is an implementation of the Fermilab Device Independent Graphics System (DIGS) for the VAX-11 series computer under VMS. Post Processors are available which can produce output from this DIGF on 4010 type terminals or PRINTRONIX printers. .hl 2 Setup .s 1 The following logical names are defined by the LIB:[LIB.DIGS]SETUP procedure, in addition to the PRINTPP, PREVU, and PLOT symbols. .s 1 .nofill DIGS__EXE - Directory containing PRINTPP, PREVU procedures DIGS__LIBRARY - Directory containing GRALIB library DIGS__PRINT - Default Printronix plotting device .f .hl 1 LINKING#AND#EXECUTION To include GRALIB in a LINK, follow this example: .s 1 $ LINK file1,file2,...,filen,DIGS__LIBRARY:GRALIB.OLB/LIBRARY The COLOR subroutine is supported by VAX DIGS, either to DIGF's or to the Envision terminal. If no special assignment is made, any DIGF produced will be named DIGF.DAT on the current default area. (The current default area may be determined with the command: $ SHOW DEFAULT ) The name of the DIGF may be changed by defining a file name as in the following example: .s 1 $ DEFINE DIGF filename .hl 1 DISPLAYING AND PLOTTING A DIGF The mechanism for viewing the graphics described in DIGF files is the Post Processor (PP). A PP reads the data in the DIGF, and a command stream either from an interactive terminal or from a Device Independent Graphics Indirect Commands file (DIGIC). It responds to the command stream either by plotting the data directly on the target device, or by producing a device-specific file which is routed to the device for output at the end of PP execution. Invoking PP's - PRINTPP may be invoked by typing PRINTPP after having defined that symbol with LIB:[LIB.DIGS]SETUP.COM. The specification of DIGF files for VAX PP's is as described above for programs linked using GRALIB. In addition, the first parameter on the command line that executes the PP can be the name of the desired DIGF. This parameter overrides the default of DIGF.DAT. If no special assignment is made, a PP will open a file named DIGIC.CMD on the current default area. The name of the DIGIC may be specified by defining a file name as in the following example: .s 1 $ DEFINE DIGIC filename In addition, the second parameter on the command line that executes the PP can be the name of the desired DIGIC. This parameter overrides the default of DIGIC.CMD and any previous assignment of the DIGIC logical name for the duration of that execution of the PP. If it is desired to execute the DIGIC file immediately, PRINTPP allows the user to specify GO as the third parameter. If this is not done, the PP expects that commands will be entered from the keyboard interactively. This is the recommended manner of entering commands to PP's that will be executed in a command procedure either interactively or via BATCH. It is recommended that the last instruction in the DIGIC be QUIT. Command parameters may be delimited by a comma or a single space. Two spaces or two commas in a row are equivalent to a zero parameter. .s 1 Printronix PP .s 1 The PRINTPP procedure produces graphis output for the Printronix lineprinter. PRINTPP expects that the symbol PLOT be defined, typically by placement of @LIB:[LIB.DIGS]SETUP in the user's LOGIN.COM file. The recommended definition of PLOT is: .s 1 $ PLOT :== PRINT/QUEUE=DIGS__PRINT:/NOFEED/NOFLAG/DELETE The /DELETE parameter is optional. The queue name for any standard Printronix graphics printer could be substituted if desired. PRINTPP produces a file named SYS$LOGIN:PXOUT.GRA. This file contains the characters needed to produce the requested plots on a Printronix printer. These files can be quite large. Careful attention to their management is suggested. PRINTPP rasterizes an area 13.0 inches by 17.0 inches. It does not issue a formfeed between plots. PRINTPP can be instructed to rasterize any area up to 13.0 inches by 17.0 inches. It may optionally skip to top of form between plots. It may optionally queue the output to the printer specified in the PLOT symbol on exit. If no additional parameters are included when the PRINTPP command is entered, PRINTPP will prompt the user for the desired data. As with all VAX PP's, all input must be in UPPERCASE. Parameters for PRINTPP may be entered via logical names as in example below: .s 1 .nofill $ DEFINE DIGS__XMAX number $ DEFINE DIGS__YMAX number $ DEFINE DIGS__FEED (Y / N) $ DEFINE DIGS__QUEUE (Y / N) .f The command line for PRINTPP looks like: .s 1 $ PRINTPP P1 P2 P3 P4 P5 P6 P7 .s 1 P1 - DIGF specification. P2 - DIGIC specification. P3 - GO if DIGIC is to be executed immediately, else blank or "". P4 - XMAX, real number between 0.0 and 13.0, number of inches to be rasterized in the X direction. P5 - YMAX, Real number between 0.0 and 17.0, number of inches to be rasterized in the Y direction. P6 - FEED, either Y or N, If Y, then PRINTPP will insert a formfeed in the plot after each DEINIT call (usually after each PLOT). P7 - QUEUE, either Y or N, If Y, then PRINTPP will automatically execute the symbol PLOT at end of execution to queue the output file to the printer. If N, PRINTPP will type out the name and version number of the created file prior to end of execution. In addition to the above, PRINTPP can also be instructed not to produce a DIGS-style banner page by this definition: .s 1 $ DEFINE DIGS__BANNER N If this logical is not defined, PRINTPP will produce a banner by default. .s 1 TEK 4010 PP .s 1 Except as noted above, PREVU conforms to both SP-12 and J-01. The command line for PREVU looks like: .s 1 $ PREVU P1 P2 P3 .s 1 P1 - DIGF specification. P2 - DIGIC specification. .s 1 PREVU produces color output for Envison terminals. The use of 4010 hardware characters requires that the terminal be in GRAPH MODE. For further information on setting up this device , see the "Models 220 and 230 Color Graphics Terminals Reference Manual", HN-0053. .s 1 .hl 1 DIGS EXAMPLE The following example program illustrate the basic use of DIGS: .nofill PROGRAM SPHERE !DRAW PICTURE OF SPHERE C** C** AUTHOR: A. KRZYWDZINSKI C** C** LIBRARY OF VARIABLES: C** C** A COEFFICIENT( (X-XOR)**2/A/A+(Y-YOR)**2/B/B=1) C** ALFA ANGLE IN RADIANS C** B COEFFICIENT(SEE VARIABLE A) C** DA CONSTANT (INCREMENT OF A) C** DALFA CONSTANT (INCREMENT OF ALFA) C** DOD WHAT SHOULD BE ADDED TO Y C** DX INCREMENT OF X VALUE C** DY -----""----- Y --"-- C** I,J ARGUMENTS OF DOLOOPS C** PI VALUE OF PI C** R VALUE OF THE RADIUS C** X,Y X AND Y AXIS C** XOR,YOR STARTING POINTS FOR PLOT C** C C CALL PLTSIZ TO SET SIZE OF PLOT PRIOR TO INITDV C CALL PLTSIZ(11.,8.5) C C CALL INITDV TO INITIALIZE THE DIGF C (SINCE THE NDEV PARAMETER = 0) C CALL INITDV(0,0) R=3. PI=ACOS(-1.) DALFA=PI/26. ALFA=DALFA XOR=5.5 YOR=4.25 C C USE PLOTTO TO PLOT A BORDER AROUND THE PLOT C CALL PLOTTO(0.,0.,3) CALL PLOTTO(11.,0.,2) CALL PLOTTO(11.,8.5,2) CALL PLOTTO(0.,8.5,2) CALL PLOTTO(0.,0.,2) C C NOW BEGIN PLOTTING THE SPHERE - SPHERE MADE UP OF ELIPSES C C PLOTIF IS USED TO PLACE THE LINE SEGMENTS WHICH MAKE UP C THE DESCRIBED ELIPSES INTO THE DIGF C DO 1 I=1,26 X=XOR-R*SIN(ALFA) DOD=R*COS(ALFA) Y=YOR+DOD CALL PLOTIF(X,Y,3) A=XOR-X B=A*.25 DX=A/38. DO 2 J=1,152 IF(J-76)3,3,4 3 X=X+DX Y=F(XOR,YOR,X,A,B,1.)+DOD CALL PLOTIF(X,Y,2) GO TO 2 4 X=X-DX Y=F(XOR,YOR,X,A,B,-1.)+DOD CALL PLOTIF(X,Y,2) 2 CONTINUE 1 ALFA=ALFA+DALFA B=3. DY=3./38. A=0. DA=3./7. DO 5 I=1,8 X=XOR Y=YOR+3. CALL PLOTIF(X,Y,3) DO 6 J=1,152 IF(J-76)7,7,8 7 Y=Y-DY X=F(YOR,XOR,Y,B,A,1.) CALL PLOTIF(X,Y,2) GO TO 6 8 Y=Y+DY X=F(YOR,XOR,Y,B,A,-1.) CALL PLOTIF(X,Y,2) 6 CONTINUE 5 A=A+DA C C NOW WE ARE ALL DONE WITH THE PLOT AND USE DEINIT TO CLOSE C THE DIGF GRACEFULLY... C CALL DEINIT CALL EXIT END C FUNCTION F(XOR,YOR,X,A,B,W) IF(A.EQ.0.)GO TO 1 F=W*B*SQRT(ABS(1.-(X-XOR)**2./A/A))+YOR RETURN 1 F=0. RETURN END .f The above program is compiled and linked as follows: .s 1 .nofill _$! Compile the program $ FORTRAN SPHERE _$! Link the object file with GRALIB $ LINK SPHERE,DIGS__LIBRARY:GRALIB/LIBRARY _$! Specify the output graphics file, and run SPHERE $ DEFINE/USER DIGF SPHERE.DGF $ RUN SPHERE _$! See that the digf has been created $ DIRECTORY/SIZE SPHERE.DGF Directory USR$ROOT4:[BURCH.DIGS] SPHERE.DGF;1 63 Total of 1 file, 63 blocks. _$! Fine, now run the post processor to rasterize and _$! output the picture $ DEFINE/USER DIGF SPHERE.DGF $ PRINTPP PRINTPP - PRINTRONIX POST PROCESSOR FOR DIGS COMMAND PLOT FILE HEADER VERSION 1 BURCH BURCH 2-FEB-84 10:04:47 COMMAND QUIT Job 379 entered on queue TTC6 FORTRAN STOP _$! GREAT!, now go to the printronix and pick it up... $ LOGOUT .f