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/outline.c

    r3693 r5846  
    145145    /* code to draw dots on Ximage */
    146146    {
    147       char *buffer, *line;
    148       int Nline, Nimage, Ximage;
     147      int Nimage, Ximage;
    149148      float xp, yp, x, y;
    150149      float dx, dy, theta, t, dt;
     150      int Noverlay, NOVERLAY;
     151      KiiOverlay *overlay;
    151152     
    152153      Nimage = -1;
    153154      if (!GetImage (&Ximage, &Nimage)) return (FALSE);
    154155     
    155       ALLOCATE (buffer, char, 65536);  /* space for 512 lines of 128 bytes */
    156       bzero (buffer, 65536);
    157       ALLOCATE (line, char, 1024);     /* space to read the file */
    158       Nline = 0;
    159      
    160       SendGraphCommand (Ximage, 4, "LOAD");
    161       SendGraphCommand (Ximage, 16, "OVER %9d ", 0);
    162      
     156      Noverlay = 0;
     157      NOVERLAY = 1000;
     158      ALLOCATE (overlay, KiiOverlay, Noverlay);
     159 
    163160      dx = par[2];
    164161      dy = par[3];
     
    173170        y = xp * sin (theta * RAD_DEG) + yp * cos (theta * RAD_DEG) + par[1];
    174171       
    175         sprintf (&buffer[Nline*128], "%15s %20.10f %20.10f %20.10f %20.10f ", "BOX", x, y, 1.0, 1.0);
    176         Nline ++;
    177        
    178         if (Nline >= 510) {
    179           SendGraphCommand (Ximage, 16, "NLINES  %7d ", Nline);
    180           write (Ximage, buffer, Nline*128);
    181           bzero (buffer, 65536);
    182           Nline = 0;
    183         }
    184       }
    185 
    186       SendGraphCommand (Ximage, 16, "NLINES  %7d ", Nline);
    187       write (Ximage, buffer, Nline*128);
    188       SendGraphCommand (Ximage, 16, "DONE");
    189 
    190       free (buffer);
    191       free (line);
    192      
     172        overlay[Noverlay].type = KII_OVERLAY_BOX;
     173        overlay[Noverlay].x = x;
     174        overlay[Noverlay].y = y;
     175        overlay[Noverlay].dx = 1.0;
     176        overlay[Noverlay].dy = 1.0;
     177
     178        Noverlay ++;
     179        CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
     180      }
     181      KiiLoadOverlay (Ximage, overlay, Noverlay, "red");
     182      free (overlay);
    193183    }
    194184
Note: See TracChangeset for help on using the changeset viewer.