IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 8, 2005, 5:38:38 PM (21 years ago)
Author:
eugene
Message:

converted Xgraph messages to SendGraphCommand

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/tv.c

    r2843 r3692  
    77  double a1, a2, max, min, zero, range;
    88  float *in;
    9   char *out, *outbuffer, *p, *tmpstring;
     9  char *out, *outbuffer, *root;
    1010  int Ximage, Nimage;
    1111  Coords coords;
     
    5656  out = outbuffer;
    5757
    58   status = write (Ximage, "READ", 4); /* tell Ximage to look for the incoming image */
     58  SendGraphCommand (Ximage, 4, "READ"); /* tell Ximage to look for the incoming image */
    5959
    6060  /* convert from (float) internal rep to 1 byte chars -- depends on how many colors Kii owns*/
     
    8181 
    8282  /* done with the conversion, now send Ximage the converted picture */
    83   sprintf (buffer, "%8d %8d 8 1 %f %f ", buf[0].matrix.Naxis[0], buf[0].matrix.Naxis[1], 0.0, 1.0);
    84   sprintf (buffer2, "NBYTES: %6d ", strlen (buffer));
    85   write (Ximage, buffer2, 16);
    86   write (Ximage, buffer, strlen (buffer));
    87  
    88   sprintf (buffer, "%f %f %f %f %d ", zero, range, min, max, size);
    89   sprintf (buffer2, "NBYTES: %6d ", strlen (buffer));
    90   write (Ximage, buffer2, 16);
    91   write (Ximage, buffer, strlen (buffer));
     83  SendGraphMessage (Ximage, "%8d %8d 8 1 %f %f", buf[0].matrix.Naxis[0], buf[0].matrix.Naxis[1], 0.0, 1.0);
     84  SendGraphMessage (Ximage, "%f %f %f %f %d ", zero, range, min, max, size);
     85  SendGraphMessage (Ximage, "%f %f %g %g %g ", coords.crval1, coords.crpix1, coords.cdelt1, coords.pc1_1, coords.pc1_2);
     86  SendGraphMessage (Ximage, "%f %f %g %g %g ", coords.crval2, coords.crpix2, coords.cdelt2, coords.pc2_1, coords.pc2_2);
    9287
    93   sprintf (buffer, "%f %f %g %g %g ", coords.crval1, coords.crpix1, coords.cdelt1, coords.pc1_1, coords.pc1_2);
    94   sprintf (buffer2, "NBYTES: %6d ", strlen (buffer));
    95   write (Ximage, buffer2, 16);
    96   write (Ximage, buffer, strlen (buffer));
    97 
    98   sprintf (buffer, "%f %f %g %g %g ", coords.crval2, coords.crpix2, coords.cdelt2, coords.pc2_1, coords.pc2_2);
    99   sprintf (buffer2, "NBYTES: %6d ", strlen (buffer));
    100   write (Ximage, buffer2, 16);
    101   write (Ximage, buffer, strlen (buffer));
    102 
    103   p = strrchr (buf[0].file, '/');
    104   if (p == (char *) NULL) p = buf[0].file;
    105   else p++;
    106   tmpstring = strcreate (p);
    107   sprintf (buffer, "%s %s %s ", coords.ctype, tmpstring, buf[0].name);
    108   free (tmpstring);
    109   sprintf (buffer2, "NBYTES: %6d ", strlen (buffer));
    110   write (Ximage, buffer2, 16);
    111   write (Ximage, buffer, strlen (buffer));
     88  root = filerootname (buf[0].file);
     89  SendGraphMessage (Ximage, "%s %s %s ", coords.ctype, root, buf[0].name);
    11290
    11391  write (Ximage, outbuffer, size);
    114 
    11592  free (outbuffer);
    11693
     
    11895  set_str_variable ("TV", argv[1]);
    11996  return (TRUE);
    120 
    12197}
    12298
Note: See TracChangeset for help on using the changeset viewer.