IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 21, 2007, 6:29:09 PM (19 years ago)
Author:
eugene
Message:

fixed cursor functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/kapa-mods-2007-05/Ohana/src/opihi/cmd.data/cursor.c

    r13434 r13465  
    77  double X, Y, R, D, Z;
    88  void *oldsignal;
    9   Graphdata graphmode;
    10   Buffer *buf;
    119
    1210  // XXX need to be able to specify graph vs image coords
     
    2220    remove_argument (N, &argc, argv);
    2321  }
    24   if (!GetGraph (&graphmode, &kapa, name)) return (FALSE);
     22  if (!GetGraphData (NULL, &kapa, name)) return (FALSE);
    2523  FREE (name);
    2624
     
    3331  }
    3432 
    35   buf = NULL;
    36   // if (IsImage) buf = SelectBuffer (GetImageName(), OLDBUFFER, FALSE);
    37   // XXX this stuff will go away with 32bit image data
    38  
    3933  KiiCursorOn (kapa);
    4034 
    4135  oldsignal = signal (SIGINT, handle_interrupt);
    4236  interrupt = FALSE;
    43   Z = -1.0;
     37
    4438  for (i = 0; ((i < N) || (N == 0)) && !interrupt; i++) {
    4539
    46     // XXX have kapa return x,y,z,ra,dec for all options
    47     KiiCursorRead (kapa, &X, &Y, key);
     40    KiiCursorRead (kapa, &X, &Y, &Z, &R, &D, key);
    4841
    4942    sprintf (string, "X%s", key);
     
    5144    sprintf (string, "Y%s", key);
    5245    set_variable (string, Y);
     46    sprintf (string, "Z%s", key);
     47    set_variable (string, Z);
     48    sprintf (string, "R%s", key);
     49    set_variable (string, R);
     50    sprintf (string, "D%s", key);
     51    set_variable (string, D);
     52
    5353    set_str_variable ("KEY", key);
    5454   
    55     if (buf != NULL) {
    56       Z = gfits_get_matrix_value (&buf[0].matrix, (int) X, (int) Y);
    57       // gprint (GP_LOG, "%s %f %f  %f\n", key, X, Y, Z);
    58     } else {
    59       XY_to_RD (&R, &D, X, Y, &graphmode.coords);
    60       sprintf (string, "R%s", key);
    61       set_variable (string, R);
    62       sprintf (string, "D%s", key);
    63       set_variable (string, D);
    64       gprint (GP_LOG, "%s %f %f\n", key, X, Y);
    65     }
     55    gprint (GP_LOG, "%s %f %f %f %f %f\n", key, X, Y, Z, R, D);
     56
    6657    if (!strcasecmp (key, "Q")) break;
    6758  }
Note: See TracChangeset for help on using the changeset viewer.