IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21060


Ignore:
Timestamp:
Dec 30, 2008, 10:15:32 AM (18 years ago)
Author:
eugene
Message:

functions to set the display parity

Location:
trunk/Ohana/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa2/include/prototypes.h

    r17466 r21060  
    144144
    145145int           Center              PROTO(());
     146int           Parity              PROTO(());
    146147void          SetColorScale       PROTO((Graphic *graphic, KapaImageWidget *image));
    147148void          SetColorScale1D     PROTO((Graphic *graphic, KapaImageWidget *image));
  • trunk/Ohana/src/kapa2/src/Center.c

    r16256 r21060  
    3131}
    3232
     33int Parity (int sock) {
     34
     35  int X, Y;
     36  Graphic *graphic;
     37  Section *section;
     38  KapaImageWidget *image;
     39
     40  KiiScanMessage (sock, "%d %d", &X,  &Y);
     41
     42  graphic = GetGraphic();
     43  section = GetActiveSection();
     44  image = section->image;
     45  if (image == NULL) return (TRUE);
     46
     47  image[0].picture.flipx = X;
     48  image[0].picture.flipy = Y;
     49
     50  image[0].zoom.flipx    = X;
     51  image[0].zoom.flipy    = Y;
     52
     53  image[0].wide.flipx    = X;
     54  image[0].wide.flipy    = Y;
     55
     56  if (USE_XWINDOW) {
     57    Remap (graphic, image);
     58    Refresh ();
     59    XFlush (graphic[0].display);
     60  }
     61
     62  return (TRUE);
     63}
     64
  • trunk/Ohana/src/kapa2/src/CheckPipe.c

    r16011 r21060  
    304304  }
    305305
     306  if (!strcmp (word, "PARI")) {
     307    status = Parity (sock);
     308    KiiSendCommand (sock, 4, "DONE");
     309    FINISHED (status);
     310  }
     311
    306312  if (!strcmp (word, "NPIX")) {
    307313    GetPixelCount (sock);
  • trunk/Ohana/src/kapa2/src/LoadPicture.c

    r21058 r21060  
    9191  SetColorScale (graphic, image);
    9292
     93  SetColorScale (graphic, image);
     94
    9395  if (!USE_XWINDOW) return (TRUE);
    9496
  • trunk/Ohana/src/libkapa/include/kapa.h

    r16010 r21060  
    155155int KiiResize (int fd, int Nx, int Ny);
    156156int KiiCenter (int fd, double x, double y, int zoom);
     157int KiiParity (int fd, int xflip, int yflip);
    157158int KapaBox (int fd, Graphdata *graphdata);
    158159int KapaClearCurrentPlot (int fd);
  • trunk/Ohana/src/libkapa/src/KapaWindow.c

    r17530 r21060  
    55  KiiSendCommand (fd, 4, "CENT");
    66  KiiSendMessage (fd, "%8.3f %8.3f %8d ", x, y, zoom);
     7  KiiWaitAnswer (fd, "DONE");
     8 
     9  return (TRUE);
     10}
     11
     12int KiiParity (int fd, int xflip, int yflip) {
     13
     14  KiiSendCommand (fd, 4, "PARI");
     15  KiiSendMessage (fd, "%2d %2d ", xflip, yflip);
    716  KiiWaitAnswer (fd, "DONE");
    817 
  • trunk/Ohana/src/opihi/cmd.data/center.c

    r13479 r21060  
    3030  return (TRUE);
    3131}
     32
     33int parity (int argc, char **argv) {
     34 
     35  int x, y;
     36  int kapa, N;
     37  char *name;
     38 
     39  name = NULL;
     40  if ((N = get_argument (argc, argv, "-n"))) {
     41    remove_argument (N, &argc, argv);
     42    name = strcreate (argv[N]);
     43    remove_argument (N, &argc, argv);
     44  }
     45  if (!GetImage (NULL, &kapa, name)) return (FALSE);
     46  FREE (name);
     47
     48  if (argc != 3) {
     49    gprint (GP_ERR, "USAGE: parity x y\n");
     50    return (FALSE);
     51  }
     52
     53  x = atof (argv[1]);
     54  y = atof (argv[2]);
     55
     56  KiiParity (kapa, x, y);
     57  return (TRUE);
     58}
Note: See TracChangeset for help on using the changeset viewer.