IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 22, 2007, 12:23:09 PM (19 years ago)
Author:
eugene
Message:

upgrading to kapa 2.0 API, upgrades to dvo user interface

File:
1 edited

Legend:

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

    r7917 r13479  
    33int cursor (int argc, char **argv) {
    44
    5   char string[20], key[20];
    6   int i, N, Nsource, Source, IsImage;
     5  char string[20], key[20], *name;
     6  int i, N, kapa;
    77  double X, Y, R, D, Z;
    88  void *oldsignal;
    9   Graphdata graphmode;
    10   Buffer *buf;
    119
    12   Nsource = -1;
     10  // XXX need to be able to specify graph vs image coords
     11  // currently, if only one exists, that frame will be used
     12  // if both exist, defaults to ??
     13  // if ((N = get_argument (argc, argv, "-g"))) {
     14  // if ((N = get_argument (argc, argv, "-i"))) {
     15
     16  name = NULL;
    1317  if ((N = get_argument (argc, argv, "-n"))) {
    1418    remove_argument (N, &argc, argv);
    15     Nsource = atof (argv[N]);
     19    name = strcreate (argv[N]);
    1620    remove_argument (N, &argc, argv);
    1721  }
    18   if ((N = get_argument (argc, argv, "-g"))) {
    19     remove_argument (N, &argc, argv);
    20     SetImageDevice (FALSE);
    21   } 
    22   if ((N = get_argument (argc, argv, "-i"))) {
    23     remove_argument (N, &argc, argv);
    24     SetImageDevice (TRUE);
    25   } 
    26   IsImage = GetCurrentDevice ();
    27   if (IsImage) {
    28     if (!GetImage (&Source, &Nsource)) return (FALSE);
    29   } else {
    30     if (!GetGraph (&graphmode, &Source, &Nsource)) return (FALSE);
    31   }
     22  if (!GetGraphData (NULL, &kapa, name)) return (FALSE);
     23  FREE (name);
    3224
    3325  N = 0;
     
    3931  }
    4032 
    41   buf = NULL;
    42   if (IsImage) buf = SelectBuffer (GetImageName(), OLDBUFFER, FALSE);
    43  
    44   KiiCursorOn (Source);
     33  KiiCursorOn (kapa);
    4534 
    4635  oldsignal = signal (SIGINT, handle_interrupt);
    4736  interrupt = FALSE;
    48   Z = -1.0;
     37
    4938  for (i = 0; ((i < N) || (N == 0)) && !interrupt; i++) {
    50     KiiCursorRead (Source, &X, &Y, key);
     39
     40    KiiCursorRead (kapa, &X, &Y, &Z, &R, &D, key);
    5141
    5242    sprintf (string, "X%s", key);
     
    5444    sprintf (string, "Y%s", key);
    5545    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
    5653    set_str_variable ("KEY", key);
    5754   
    58     if (IsImage) {
    59       if (buf != NULL) {
    60         Z = gfits_get_matrix_value (&buf[0].matrix, (int) X, (int) Y);
    61       }
    62       gprint (GP_LOG, "%s %f %f  %f\n", key, X, Y, Z);
    63     } else {
    64       XY_to_RD (&R, &D, X, Y, &graphmode.coords);
    65       sprintf (string, "R%s", key);
    66       set_variable (string, R);
    67       sprintf (string, "D%s", key);
    68       set_variable (string, D);
    69       gprint (GP_LOG, "%s %f %f\n", key, X, Y);
    70     }
     55    gprint (GP_LOG, "%s %f %f %f %f %f\n", key, X, Y, Z, R, D);
     56
    7157    if (!strcasecmp (key, "Q")) break;
    7258  }
    7359
    7460  signal (SIGINT, oldsignal);
    75   KiiCursorOff (Source);
     61  KiiCursorOff (kapa);
    7662  return (TRUE);
    7763}
Note: See TracChangeset for help on using the changeset viewer.