Changeset 5846 for trunk/Ohana/src/opihi/cmd.astro/outline2.c
- Timestamp:
- Dec 27, 2005, 5:06:32 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.astro/outline2.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/outline2.c
r3693 r5846 303 303 int plot_outline () { 304 304 305 char *buffer, *line; 306 int Nline, Nimage, Ximage; 305 int Nimage, Ximage; 307 306 float xp, yp, x, y; 308 307 float dx, dy, theta, t, dt; 308 int Noverlay, NOVERLAY; 309 KiiOverlay *overlay; 309 310 310 311 Nimage = -1; 311 312 if (!GetImage (&Ximage, &Nimage)) return (FALSE); 312 313 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); 320 317 321 318 dx = par[2]; … … 331 328 y = xp * sin (theta * RAD_DEG) + yp * cos (theta * RAD_DEG) + par[1]; 332 329 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); 350 341 return (TRUE); 351 342 }
Note:
See TracChangeset
for help on using the changeset viewer.
