home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume10 / tek / hp7470-tek4.h next >
Encoding:
C/C++ Source or Header  |  1990-02-20  |  1.4 KB  |  72 lines

  1. /*
  2.  *    tek4.h - hp7470a version
  3.  *    copyright 1987 Ronald Florence
  4.  */
  5.  
  6. #define WEATHER        1
  7. #define Maxpts        1000
  8.  
  9. #define Points        0
  10. #define Solid        1
  11. #define Longdash    2
  12. #define Dotted        3
  13. #define Dotdash        4
  14. #define Shortdash    5
  15. #define Altcolor    2
  16.  
  17. extern    FILE    *plw;        /* plotter write file */
  18. extern    int    quit();        /* baleout function */
  19. extern    double    xm,        /* scalars */
  20.         ym,
  21.         xscale,
  22.         yscale;
  23.  
  24.  
  25. char    *linetype[] = {
  26.         "LT0",        /* Points */
  27.         "LT",        /* Solid */
  28.         "LT3",        /* Longdash */
  29.         "LT1,1",    /* Dotted */
  30.         "LT4",        /* Dotdash */
  31.         "LT2"        /* Shortdash */
  32.     };
  33.  
  34.  
  35. #define Clear_scr()
  36. #define Align(H, V)
  37. #define Set_line(L)    fprintf(plw, "%s", linetype[L])
  38. #define Increment(X,Y)    fprintf(plw, "PU%d,%d", X, Y)
  39. #define Wr_str(X, Y, p)    fprintf(plw, "LB%s\03", p)
  40. #define Switch_pen()    fprintf(plw, "SP%d", Altcolor)
  41.  
  42. #define Set_charsize(s)    cellw = charwd[s] * xm * (3 / 2);        \
  43.             fprintf(plw, "SI%.3f,%.3f",             \
  44.                 charwd[s] * xm /400, charht[s] * ym /400)
  45.  
  46. #define    Vector(N, PTS)    plot(N, PTS)
  47.  
  48. #define Marker(N, PTS)    {            \
  49.             Set_line (Points);    \
  50.             plot (N, PTS);        \
  51.             Set_line (Solid);    \
  52.             }
  53.  
  54. #define err(a)        if (!strcmp(a, "data"))                      \
  55.             fprintf(stderr, "hp: too many data points\n"), quit()
  56.         
  57.  
  58. plot (num, points)
  59.      int  num, points[];
  60. {
  61.   register    i;
  62.     
  63.   fprintf(plw, "PU%d,%d", points[0], points[1]);
  64.   if (num > 2) 
  65.     {    
  66.       fprintf(plw, "PD");
  67.       for (i = 2; i < num - 1; i++) 
  68.     fprintf(plw, "%d,", points[i]);
  69.       fprintf(plw, "%d", points[i]);
  70.     }
  71. }
  72.