IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10834


Ignore:
Timestamp:
Dec 27, 2006, 9:10:53 AM (20 years ago)
Author:
eugene
Message:

support for multipage plots; additional PS info now sent after PSIT command

Location:
trunk/Ohana/src/kapa
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa/Makefile

    r10342 r10834  
    1515
    1616LDFLAGS :=      -lkapa -ldvo -lFITS -lohana $(LDFLAGS)
     17LDDEPS  = $(DESTLIB)/libkapa.a $(DESTLIB)/libdvo.a $(DESTLIB)/libFITS.a $(DESTLIB)/libohana.a
     18INDEPS  = $(DESTINC)/kapa.h $(DESTINC)/dvo.h $(DESTINC)/gfitsio.h $(DESTINC)/ohana.h
    1719
    1820kapa: $(BIN)/kapa.$(ARCH)
     
    6668        $(INC)/prototypes.h
    6769
     70$(OBJ): $(INDEPS) $(LDDEPS)
     71
    6872$(BIN)/kapa.$(ARCH): $(OBJ)
  • trunk/Ohana/src/kapa/event/CheckPipe.c

    r10802 r10834  
    3333 
    3434  if (!strcmp (buffer, "PSIT")) {
    35     status = PSit (SCALE);
    36     write (sock, "DONE", 4);
    37     return (status);
    38   }
    39  
    40   if (!strcmp (buffer, "PSRW")) {
    41     status = PSit (RAW);
    42     write (sock, "DONE", 4);
    43     return (status);
    44   }
    45  
    46   if (!strcmp (buffer, "PSNS")) {
    47     status = PSit (NOSCALE);
    48     write (sock, "DONE", 4);
    49     return (status);
    50   }
    51  
    52   if (!strcmp (buffer, "PSNP")) {
    53     status = PSit (NEWPAGE);
     35    status = PSit ();
    5436    write (sock, "DONE", 4);
    5537    return (status);
  • trunk/Ohana/src/kapa/event/Resize.c

    r5852 r10834  
    1414  graphic.dy = MAX(NY, 50);
    1515
    16   XResizeWindow (graphic.display, graphic.window, NX, NY);
     16  if (USE_XWINDOW) XResizeWindow (graphic.display, graphic.window, NX, NY);
    1717
    1818  for (i = 0; i < Nsection; i++) {
     
    2020  }
    2121
    22   XClearWindow (graphic.display, graphic.window);
     22  if (USE_XWINDOW) XClearWindow (graphic.display, graphic.window);
    2323  Refresh (1);
    2424
  • trunk/Ohana/src/kapa/graph/PSObjects.c

    r10802 r10834  
    55void ClipLinePS (double, double, double, double, double, double, double, double, FILE *);
    66
    7 int PSit (int mode) {
    8 
    9   int i;
     7static char *name = "$Name: not supported by cvs2svn $";
     8
     9int PSit () {
     10
     11  int i, pageMode, scaleMode;
    1012  double scale;
    1113  FILE *f;
    12   char filename[1024];
     14  char filename[1024], pagename[1024], *version;
    1315  int Nbytes, status;
    1416
    1517  /* expect a line telling the number of bytes and a filename */
    16   status = read (sock, filename, 16);
    17   filename[16] = 0;
    18   sscanf (filename, "%*s %d", &Nbytes);
    19   status = read (sock, filename, Nbytes);
    20   filename[status] = 0; /* make the string easy to parse */
    21 
    22   if (mode == NEWPAGE) {
    23     f = fopen (filename, "a");
     18  KiiScanMessage (sock, "%s %s %d %d", filename, pagename, &scaleMode, &pageMode);
     19
     20  if (pageMode == KAPA_PS_NEWPAGE) {
     21    f = fopen (filename, "a+");
    2422  } else {
    2523    f = fopen (filename, "w");
    2624  }
    27 
    28   if (f == (FILE *) NULL) {
     25  if (f == NULL) {
    2926    fprintf (stderr, "can't open output file %s\n", filename);
    3027    return (TRUE);  /* true because otherwise it quits kapa! */
     
    3229
    3330  /* two scaling options: expand to fit page / keep absolute size */
    34   scale = 1;
    35   if (mode == SCALE) {
     31  if (scaleMode) {
    3632    scale = MIN (fabs(500.0 / graphic.dx), fabs (700.0 / graphic.dy));
    3733  } else {
     
    3935  }
    4036
    41   switch (mode) {
    42     case NEWPAGE:
    43       fprintf (f, "%%%%Page: foobar\n\n");
    44       break;
    45 
    46     case SCALE:
    47     case NOSCALE:
     37  switch (pageMode) {
     38    case KAPA_PS_NEWPLOT:
    4839      fprintf (f, "%%!PS-Adobe-2.0 EPSF-2.0\n");
    49       fprintf (f, "%%%%Title: Kapa Plot\n");
    50       fprintf (f, "%%%%Creator: Kapa (0.95)\n");
     40      fprintf (f, "%%%%Title: %s\n", filename);
     41      version = strip_version (name);
     42      fprintf (f, "%%%%Creator: Kapa (%s)\n", version);
     43      free (version);
    5144      fprintf (f, "%%%%BoundingBox: %d %d %.0f %.0f\n",
    5245               XOFFSET, YOFFSET, XOFFSET + scale*graphic.dx, YOFFSET + scale*graphic.dy);
     
    5548      fprintf (f, "%%%%EndComments\n");
    5649      fprintf (f, "%%%%EndProlog\n");
    57       fprintf (f, "%%%%Page: foobar\n\n");
    58       break;
    59 
    60     case RAW:
     50      fprintf (f, "%%%%Page: %s\n\n", pagename);
     51      break;
     52
     53    case KAPA_PS_NEWPAGE:
     54      fprintf (f, "%%%%Page: %s\n\n", pagename);
     55      break;
     56
     57    case KAPA_PS_RAWPAGE:
    6158      break;
    6259  }
     
    7370  fprintf (f, "/TF {newpath moveto lineto lineto fill stroke} def\n\n");
    7471
    75   if (mode != RAW) {
     72  if (pageMode != KAPA_PS_RAWPAGE) {
    7673    fprintf (f, " %d %d translate\n", XOFFSET, YOFFSET);
    7774    fprintf (f, "  %f  %f scale\n", scale, scale);
     
    8784  fprintf (f, "grestore %% end of picture\n");
    8885
    89   if (mode != RAW) fprintf (f, "showpage\n");
     86  if (pageMode != KAPA_PS_RAWPAGE) fprintf (f, "showpage\n");
    9087
    9188  fclose (f);
  • trunk/Ohana/src/kapa/include/constants.h

    r10802 r10834  
    2626# define LABELLR 7
    2727
    28 enum {SCALE, NOSCALE, RAW, NEWPAGE};
    29 
    3028/* EVENT_MASK consists of:
    3129
  • trunk/Ohana/src/kapa/include/prototypes.h

    r5852 r10834  
    4444void          PSXErrors           PROTO((Layout *, Gobjects *, FILE *));
    4545void          PSYErrors           PROTO((Layout *, Gobjects *, FILE *));
    46 int           PSit                PROTO((int));
     46int           PSit                PROTO(());
    4747void          PositionPicture     PROTO((Layout *));
    4848void          QuitX               PROTO((Display *, char *, char *));
Note: See TracChangeset for help on using the changeset viewer.