home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1991 / 02 / tricks / plotter.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1990-11-28  |  1.6 KB  |  62 lines

  1. (* ------------------------------------------------------ *)
  2. (*                   PLOTTER.PAS                          *)
  3. (*          Ausgaberoutinen für HPGL-Plotter              *)
  4. (*  können zusätzlich oder ersatzweise für die Grafik-    *)
  5. (*  befehle eingesetzt werden.                            *)
  6. (*               aus: TOOLBOX 5'89, S.42                  *)
  7. (* ------------------------------------------------------ *)
  8.  
  9. TYPE
  10.   Str80 = STRING [80];
  11.  
  12. VAR
  13.   Plot      : TEXT;
  14.   PFaktor   : INTEGER;     (* Plotterschritte     *)
  15.   MaxColors : INTEGER;
  16.   UaxMax,
  17.   VaxMax    : INTEGER;     (* maximale Blattgröße *)
  18.  
  19.   PROCEDURE P_Open;
  20.   BEGIN
  21.     Assign(Plot, 'PRN');
  22.     Rewrite(Plot);
  23.     Write(Plot, 'IN;');
  24.                           (* Bitte anpassen : *)
  25.     UaxMax := 403;  VaxMax := 276;
  26.     PFAktor := 40;
  27.     MaxColors := 8;
  28.   END;
  29.  
  30.   PROCEDURE P_SetColor(Farbe : BYTE);
  31.   BEGIN
  32.     Farbe := (Farbe MOD Succ(MaxColors));
  33.   END;
  34.  
  35.   PROCEDURE P_LineTo(x, y : REAL);
  36.   BEGIN
  37.     x := PFaktor * x;  y := PFaktor * y;
  38.     Write(Plot, 'PD', ';');
  39.     WriteLn(Plot, 'PA', Round(x), ',', Round(y), ';');
  40.   END;
  41.  
  42.   PROCEDURE P_MoveTo(x, y : REAL);
  43.   BEGIN
  44.     x := PFaktor * x;  y := PFaktor * y;
  45.     WriteLn(Plot, 'PU', Round(x), ',', Round(y); ';');
  46.   END;
  47.  
  48.   PROCEDURE P_OutTextXY(x, y : INTEGER; s : Str80);
  49.   BEGIN
  50.     P_MoveTo(x, y);
  51.     WriteLn(Plot, 'LB', s, Chr(3), ';');
  52.   END;
  53.  
  54.   PROCEDURE P_Close;
  55.   BEGIN
  56.     P_SetColor(1);
  57.     WriteLn(Plot, 'PU0,0;');
  58.     Close(Plot);
  59.   END;
  60.  
  61. (* ------------------------------------------------------ *)
  62. (*               Ende von PLOTTER.PAS                     *)