IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10802


Ignore:
Timestamp:
Dec 17, 2006, 10:09:31 AM (20 years ago)
Author:
eugene
Message:

adding -newpage to kapa capabilities

Location:
trunk/Ohana/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa/event/CheckPipe.c

    r5852 r10802  
    4646  if (!strcmp (buffer, "PSNS")) {
    4747    status = PSit (NOSCALE);
     48    write (sock, "DONE", 4);
     49    return (status);
     50  }
     51 
     52  if (!strcmp (buffer, "PSNP")) {
     53    status = PSit (NEWPAGE);
    4854    write (sock, "DONE", 4);
    4955    return (status);
  • trunk/Ohana/src/kapa/graph/PSObjects.c

    r9845 r10802  
    2020  filename[status] = 0; /* make the string easy to parse */
    2121
    22   f = fopen (filename, "w");
     22  if (mode == NEWPAGE) {
     23    f = fopen (filename, "a");
     24  } else {
     25    f = fopen (filename, "w");
     26  }
     27
    2328  if (f == (FILE *) NULL) {
    2429    fprintf (stderr, "can't open output file %s\n", filename);
     
    3439  }
    3540
    36   if (mode != RAW) {
    37     fprintf (f, "%%!PS-Adobe-2.0 EPSF-2.0\n");
    38     fprintf (f, "%%%%Title: Kapa Plot\n");
    39     fprintf (f, "%%%%Creator: Kapa (0.95)\n");
    40     fprintf (f, "%%%%BoundingBox: %d %d %.0f %.0f\n",
    41              XOFFSET, YOFFSET, XOFFSET + scale*graphic.dx, YOFFSET + scale*graphic.dy);
    42     fprintf (f, "%%%%Pages: 1\n");
    43     fprintf (f, "%%%%DocumentFonts:\n");
    44     fprintf (f, "%%%%EndComments\n");
    45     fprintf (f, "%%%%EndProlog\n");
    46     fprintf (f, "%%%%Page: 1 1\n\n");
     41  switch (mode) {
     42    case NEWPAGE:
     43      fprintf (f, "%%%%Page: foobar\n\n");
     44      break;
     45
     46    case SCALE:
     47    case NOSCALE:
     48      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");
     51      fprintf (f, "%%%%BoundingBox: %d %d %.0f %.0f\n",
     52               XOFFSET, YOFFSET, XOFFSET + scale*graphic.dx, YOFFSET + scale*graphic.dy);
     53      fprintf (f, "%%%%Pages: 1\n");
     54      fprintf (f, "%%%%DocumentFonts:\n");
     55      fprintf (f, "%%%%EndComments\n");
     56      fprintf (f, "%%%%EndProlog\n");
     57      fprintf (f, "%%%%Page: foobar\n\n");
     58      break;
     59
     60    case RAW:
     61      break;
    4762  }
    4863  fprintf (f, "gsave %% encloses picture\n");
  • trunk/Ohana/src/kapa/include/constants.h

    r6684 r10802  
    2626# define LABELLR 7
    2727
    28 enum {SCALE, NOSCALE, RAW};
     28enum {SCALE, NOSCALE, RAW, NEWPAGE};
    2929
    3030/* EVENT_MASK consists of:
  • trunk/Ohana/src/libkapa/include/kapa.h

    r10337 r10802  
    110110
    111111/* KiiConvert.c */
    112 int KiiPS (int fd, int scale, int raw, char *filename);
     112int KiiPS (int fd, int scale, int raw, int newpage, char *filename);
    113113int KiiJPEG (int fd, char *filename);
    114114int KapaPNG (int fd, char *filename);
  • trunk/Ohana/src/libkapa/src/KiiConvert.c

    r5852 r10802  
    3737}
    3838
    39 int KiiPS (int fd, int scale, int raw, char *filename) {
     39int KiiPS (int fd, int scale, int raw, int newpage, char *filename) {
    4040
    4141  char buffer[20];
     
    4949    goto name;
    5050  }
    51   if (!raw && !scale) {
    52     KiiSendCommand (fd, 4, "PSIT");
     51  if (newpage) {
     52    KiiSendCommand (fd, 4, "PSNP");
    5353    goto name;
    5454  }
     55  /* the default operation */
     56  KiiSendCommand (fd, 4, "PSIT");
    5557
    5658name:
  • trunk/Ohana/src/opihi/cmd.data/ps.c

    r7917 r10802  
    44
    55  char filename[1024];
    6   int N, Source, Nsource, RawImage, NoScale, IsImage;
     6  int N, Source, Nsource, RawImage, NoScale, NewPage, IsImage;
    77 
    88  if ((N = get_argument (argc, argv, "--help"))) goto help;
    99  if ((N = get_argument (argc, argv, "-h"))) goto help;
    1010
     11  /* raw image? */
     12  NewPage = FALSE;
     13  if ((N = get_argument (argc, argv, "-newpage"))) {
     14    remove_argument (N, &argc, argv);
     15    NewPage = TRUE;
     16  }
    1117  /* raw image? */
    1218  RawImage = FALSE;
     
    5460 
    5561  /* tell Ximage/Xgraph to ps the image */
    56   KiiPS (Source, NoScale, RawImage, filename);
     62  KiiPS (Source, NoScale, RawImage, NewPage, filename);
    5763  return (TRUE);
    5864
  • trunk/Ohana/src/relastro/src/plotstuff.c

    r6808 r10802  
    4949  if (Xgraph[N] == 0) return;
    5050
    51   KiiPS (Xgraph[N], FALSE, FALSE, filename);
     51  KiiPS (Xgraph[N], FALSE, FALSE, FALSE, filename);
    5252  return;
    5353}
  • trunk/Ohana/src/relphot/src/plotstuff.c

    r8646 r10802  
    4949  if (Xgraph[N] == 0) return;
    5050
    51   KiiPS (Xgraph[N], FALSE, FALSE, filename);
     51  KiiPS (Xgraph[N], FALSE, FALSE, FALSE, filename);
    5252  return;
    5353}
Note: See TracChangeset for help on using the changeset viewer.