home *** CD-ROM | disk | FTP | other *** search
- (* ------------------------------------------------------ *)
- (* PLOTTER.PAS *)
- (* Ausgaberoutinen für HPGL-Plotter *)
- (* können zusätzlich oder ersatzweise für die Grafik- *)
- (* befehle eingesetzt werden. *)
- (* aus: TOOLBOX 5'89, S.42 *)
- (* ------------------------------------------------------ *)
-
- TYPE
- Str80 = STRING [80];
-
- VAR
- Plot : TEXT;
- PFaktor : INTEGER; (* Plotterschritte *)
- MaxColors : INTEGER;
- UaxMax,
- VaxMax : INTEGER; (* maximale Blattgröße *)
-
- PROCEDURE P_Open;
- BEGIN
- Assign(Plot, 'PRN');
- Rewrite(Plot);
- Write(Plot, 'IN;');
- (* Bitte anpassen : *)
- UaxMax := 403; VaxMax := 276;
- PFAktor := 40;
- MaxColors := 8;
- END;
-
- PROCEDURE P_SetColor(Farbe : BYTE);
- BEGIN
- Farbe := (Farbe MOD Succ(MaxColors));
- END;
-
- PROCEDURE P_LineTo(x, y : REAL);
- BEGIN
- x := PFaktor * x; y := PFaktor * y;
- Write(Plot, 'PD', ';');
- WriteLn(Plot, 'PA', Round(x), ',', Round(y), ';');
- END;
-
- PROCEDURE P_MoveTo(x, y : REAL);
- BEGIN
- x := PFaktor * x; y := PFaktor * y;
- WriteLn(Plot, 'PU', Round(x), ',', Round(y); ';');
- END;
-
- PROCEDURE P_OutTextXY(x, y : INTEGER; s : Str80);
- BEGIN
- P_MoveTo(x, y);
- WriteLn(Plot, 'LB', s, Chr(3), ';');
- END;
-
- PROCEDURE P_Close;
- BEGIN
- P_SetColor(1);
- WriteLn(Plot, 'PU0,0;');
- Close(Plot);
- END;
-
- (* ------------------------------------------------------ *)
- (* Ende von PLOTTER.PAS *)