The program in Figure 115 uses the plotter as the primary device. It
plots a picture created by another program and stored on a segment
library. The picture, called ADMTEST, is retrieved with a GSLOAD call.
The program could, instead, have drawn a picture using the ordinary
primitive and attribute calls such as GSLINE, GSMOVE, GSAREA, GSCOL, and
so on.
No processing options have been specified, so they all take their default
values. The operator must ensure that the pen holders are loaded with
pens of 0.3 millimeter width (for instance, the standard fiber-tipped
pens), with the correct color in each holder. On all plotters, the
plotting area is the whole paper. The pen velocity and pen pressure are
as set by the operator (or the fixed hardware values on plotters that do
not allow the operator to vary them).
The GDDM page size and graphics field are allowed to default. This means
that they fill the plot area. When a plotter is used as the primary
device, a page size or graphics field (or both) can be specified in terms
of the notional cells described in "Cells, pixels, and plotter units" in
topic 21.1.4.
The program displays setup instructions for the IBM 7375 plotter, which
can detect the size of paper loaded, and has adjustable pen velocity and
pressure.
PLOT1: PROC OPTIONS(MAIN);
DECLARE (ATYPE,AVAL,ACOUNT) FIXED BINARY(31);
DECLARE PROCOPT_LIST(1) FIXED BIN(31);
DECLARE NAME_LIST(2) CHAR(8);
DECLARE CNTRL(2) FIXED BIN(31);
DECLARE COUNT FIXED BIN(31);
DECLARE DESC CHAR(50);
CALL FSINIT;
/*******************************************************************/
/* DISPLAY PLOTTER SETUP INSTRUCTIONS */
/*******************************************************************/
CALL GSSEG(0);
CALL GSCM(3);
CALL GSCOL(6);
CALL GSCHAR(25.0,95.0,40,' HOW TO SET UP THE IBM 7375 PLOTTER ');
CALL GSCOL(1);
CALL GSCHAR(25.0,90.0,40,'CHECK THERE IS A FIBER-TIPPED PEN IN ');
CALL GSCHAR(25.0,85.0,40,'EACH HOLDER WITH THE FOLLOWING COLOR: ');
CALL GSCOL(6);
CALL GSCHAR(25.0,80.0,40,' PEN HOLDER COLOR ');
CALL GSCOL(1);
CALL GSCHAR(25.0,75.0,40,' 1 BLUE ');
CALL GSCHAR(25.0,70.0,40,' 2 RED ');
CALL GSCHAR(25.0,65.0,40,' 3 PINK ');
CALL GSCHAR(25.0,60.0,40,' 4 GREEN ');
CALL GSCHAR(25.0,55.0,40,' 5 TURQUOISE ');
CALL GSCHAR(25.0,50.0,40,' 6 YELLOW ');
CALL GSCHAR(25.0,45.0,40,' 7 BLACK ');
CALL GSCHAR(25.0,40.0,40,' 8 GREEN ');
CALL GSCHAR(25.0,35.0,40,'SET THE PEN SPEED AND FORCE TO SUITABLE ');
CALL GSCHAR(25.0,30.0,40,'VALUES (SEE PLOTTER OPERATING MANUAL). ');
CALL GSCHAR(25.0,20.0,40,'LOAD THE PLOTTER WITH PAPER OF THE SIZE ');
CALL GSCHAR(25.0,15.0,40,'YOU REQUIRE. ');
CALL GSCOL(7);
CALL GSCHAR(25.0, 3.0,40,' PRESS ENTER WHEN READY TO PLOT ');
CALL GSSCLS;
CALL ASREAD(ATYPE,AVAL,ACOUNT); /* Send instructions to screen */
IF ATYPE=0 THEN GO TO FIN; /* Plot only if ENTER pressed */
CALL DSDROP(1,0); /* Drop screen as primary device */
/*******************************************************************/
/* OPEN THE PLOTTER */
/*******************************************************************/
NAME_LIST(1)='*'; /* Is attached to invoking terminal*/
NAME_LIST(2)='ADMPLOT'; /* Special GDDM-defined name */
/* DEV ID FAMILY DEV TOKEN PROCESSING OPTIONS DEV NAME */
CALL DSOPEN( 101, 1, '*', 0,PROCOPT_LIST, 2,NAME_LIST );
CALL DSUSE(1,101); /* Use as primary device */
/*******************************************************************/
/* LOAD A PICTURE */
/*******************************************************************/
CNTRL(1) = 0; /* Keep original segment ids */
CNTRL(2) = 2; /* Make as big as possible */
/* OBJECT-NAME ARRAY-CNT ARRAY SEG-CNT DESCRIP-LEN DESCRIP */
CALL GSLOAD( 'ADMTEST', 2, CNTRL, COUNT, 50, DESC);
/*******************************************************************/
/* SEND PICTURE TO PLOTTER */
/*******************************************************************/
CALL FSFRCE;
FIN:
CALL FSTERM;
%INCLUDE ADMUPINA;
%INCLUDE ADMUPIND;
%INCLUDE ADMUPINF;
%INCLUDE ADMUPING;
END PLOT1;
Figure 115. Program using plotter as primary device
Subtopics:
|