IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 27, 2005, 5:06:32 AM (21 years ago)
Author:
eugene
Message:

converting to use libkapa commands instead of raw graph commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/outline2.c

    r3693 r5846  
    303303int plot_outline () {
    304304 
    305   char *buffer, *line;
    306   int Nline, Nimage, Ximage;
     305  int Nimage, Ximage;
    307306  float xp, yp, x, y;
    308307  float dx, dy, theta, t, dt;
     308  int Noverlay, NOVERLAY;
     309  KiiOverlay *overlay;
    309310 
    310311  Nimage = -1;
    311312  if (!GetImage (&Ximage, &Nimage)) return (FALSE);
    312313 
    313   ALLOCATE (buffer, char, 65536);  /* space for 512 lines of 128 bytes */
    314   bzero (buffer, 65536);
    315   ALLOCATE (line, char, 1024);     /* space to read the file */
    316   Nline = 0;
    317  
    318   SendGraphCommand (Ximage, 4, "LOAD");
    319   SendGraphCommand (Ximage, 16, "OVER %9d ", 0);
     314  Noverlay = 0;
     315  NOVERLAY = 1000;
     316  ALLOCATE (overlay, KiiOverlay, Noverlay);
    320317 
    321318  dx = par[2];
     
    331328    y = xp * sin (theta * RAD_DEG) + yp * cos (theta * RAD_DEG) + par[1];
    332329   
    333     sprintf (&buffer[Nline*128], "%15s %20.10f %20.10f %20.10f %20.10f ", "BOX", x, y, 1.0, 1.0);
    334     Nline ++;
    335    
    336     if (Nline >= 510) {
    337       SendGraphCommand (Ximage, 16, "NLINES  %7d ", Nline);
    338       write (Ximage, buffer, Nline*128);
    339       bzero (buffer, 65536);
    340       Nline = 0;
    341     }
    342   }
    343  
    344   SendGraphCommand (Ximage, 16, "NLINES  %7d ", Nline);
    345   write (Ximage, buffer, Nline*128);
    346   SendGraphCommand (Ximage, 16, "DONE");
    347 
    348   free (buffer);
    349   free (line);
     330    overlay[Noverlay].type = KII_OVERLAY_BOX;
     331    overlay[Noverlay].x = x;
     332    overlay[Noverlay].y = y;
     333    overlay[Noverlay].dx = 1.0;
     334    overlay[Noverlay].dy = 1.0;
     335
     336    Noverlay ++;
     337    CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
     338  }
     339  KiiLoadOverlay (Ximage, overlay, Noverlay, "red");
     340  free (overlay);
    350341  return (TRUE);
    351342}
Note: See TracChangeset for help on using the changeset viewer.