IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27714


Ignore:
Timestamp:
Apr 20, 2010, 10:41:44 AM (16 years ago)
Author:
eugene
Message:

some API changes

Location:
branches/eam_branches/Ohana.20100407/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/LoadFrame.c

    r27693 r27714  
    1616  graph = section->graph;
    1717
    18   KiiScanMessage (sock, "%lf %lf %lf %lf",
    19                   &graph[0].axis[0].min, &graph[0].axis[0].max,
    20                   &graph[0].axis[1].min, &graph[0].axis[1].max);
     18  KapaScanGraphData (sock, &graph[0].data);
    2119
    2220  graph[0].axis[3].min = graph[0].axis[1].min;
     
    2523  graph[0].axis[2].max = graph[0].axis[0].max;
    2624 
    27   KiiScanMessage (sock, "%lf %d", &lweight, &color);
    28   color = MAX (0, MIN (15, color));
     25  // XXX this is fragile
     26  graph[0].data.color = MAX (0, MIN (15, graph[0].data.color));
    2927
    30   KiiScanMessage (sock, "%lf %lf %lf %lf %lf %lf", &ticktextPad, &labelPad, &padXm, &padXp, &padYm, &padYp);
    31   graph[0].axis[0].pad = padXm;
    32   graph[0].axis[1].pad = padYm;
    33   graph[0].axis[2].pad = padXp;
    34   graph[0].axis[3].pad = padYp;
    35 
    36   KiiScanMessage (sock, "%s %s %s", Axis, Labels, Ticks);
     28  graph[0].axis[0].pad = graph[0].data.padXm;
     29  graph[0].axis[1].pad = graph[0].data.padYm;
     30  graph[0].axis[2].pad = graph[0].data.padXp;
     31  graph[0].axis[3].pad = graph[0].data.padYp;
    3732
    3833  for (i = 0; i < 4; i++) {
    39     graph[0].axis[i].lweight = lweight;
    40     graph[0].axis[i].color = color;
     34    graph[0].axis[i].lweight = graph[0].data.lweight;
     35    graph[0].axis[i].color = graph[0].data.color;
    4136
    4237    graph[0].axis[i].ticktextPad = ticktextPad;
    4338    graph[0].axis[i].labelPad = labelPad;
    4439
    45     switch (Axis[i]) {
     40    switch (graph[0].data.axis[i]) {
    4641    case '0':
    4742      graph[0].axis[i].isaxis = FALSE;
     
    5449      break;
    5550    }
    56     switch (Ticks[i]) {
     51    switch (graph[0].data.ticks[i]) {
    5752    case '0':
    5853      graph[0].axis[i].areticks = FALSE;
     
    6560      break;
    6661    }
    67     switch (Labels[i]) {
     62    switch (graph[0].data.labels[i]) {
    6863    case '0':
    6964      graph[0].axis[i].islabel = FALSE;
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/SetGraphData.c

    r27713 r27714  
    2121  fprintf (stderr, "pad: %f %f %f\n", section->graph->axis[0].pad, section->graph->axis[0].labelPad, section->graph->axis[0].ticktextPad);
    2222 
    23   // get graph data from client
    24   KiiScanMessage (sock, "%d %d %d %d %d %d %lf %lf",
    25                   &graph[0].data.style,
    26                   &graph[0].data.ptype,
    27                   &graph[0].data.ltype,
    28                   &graph[0].data.etype,
    29                   &graph[0].data.ebar,
    30                   &graph[0].data.color,
    31                   &graph[0].data.lweight,
    32                   &graph[0].data.size);
    33 
    34   KiiScanMessage (sock, "%lf %lf %lf %lf %lf %lf",
    35                   &graph[0].data.ticktextPad,
    36                   &graph[0].data.labelPad,
    37                   &graph[0].data.padXm,
    38                   &graph[0].data.padXp,
    39                   &graph[0].data.padYm,
    40                   &graph[0].data.padYp);
     23  KapaScanGraphData (sock, &graph[0].data);
    4124
    4225  for (i = 0; i < 4; i++) {
     
    4831  graph[0].axis[2].pad = graph[0].data.padXp;
    4932  graph[0].axis[3].pad = graph[0].data.padYp;
    50 
    51   KiiScanMessage (sock, "%lf %lf %lf %lf",
    52                   &graph[0].data.xmin,
    53                   &graph[0].data.xmax,
    54                   &graph[0].data.ymin,
    55                   &graph[0].data.ymax);
    56 
    57   KiiScanMessage (sock, "%f %f %f %f",
    58                   &graph[0].data.coords.pc1_1, &graph[0].data.coords.pc2_2,
    59                   &graph[0].data.coords.pc1_2, &graph[0].data.coords.pc2_1);
    60 
    61   KiiScanMessage (sock, "%d %d %s",
    62                   &graph[0].data.flipeast, &graph[0].data.flipnorth,
    63                   graph[0].data.coords.ctype);
    64 
    65   KiiScanMessage (sock, "%lf %lf %f %f %f %f",
    66                   &graph[0].data.coords.crval1,
    67                   &graph[0].data.coords.crval2,
    68                   &graph[0].data.coords.crpix1,
    69                   &graph[0].data.coords.crpix2,
    70                   &graph[0].data.coords.cdelt1,
    71                   &graph[0].data.coords.cdelt2);
    72 
    73 
    7433
    7534  xmin = graph[0].data.xmin;
     
    11069  graph = section->graph;
    11170
    112   KiiSendMessage (sock, "%8d %d %d %d %d %d %f %f",
    113                   graph[0].data.style,
    114                   graph[0].data.ptype, graph[0].data.ltype,
    115                   graph[0].data.etype, graph[0].data.ebar, graph[0].data.color,
    116                   graph[0].data.lweight, graph[0].data.size);
    117 
    118   KiiSendMessage (sock, "%g %g %g %g %g %g",
    119                   graph[0].data.ticktextPad,
    120                   graph[0].data.labelPad,
    121                   graph[0].data.padXm,
    122                   graph[0].data.padXp,
    123                   graph[0].data.padYm,
    124                   graph[0].data.padYp);
    125 
    126   KiiSendMessage (sock, "%g %g %g %g",
    127                   graph[0].data.xmin, graph[0].data.xmax,
    128                   graph[0].data.ymin, graph[0].data.ymax);
    129 
    130   KiiSendMessage (sock, "%g %g %g %g",
    131                   graph[0].data.coords.pc1_1, graph[0].data.coords.pc2_2,
    132                   graph[0].data.coords.pc1_2, graph[0].data.coords.pc2_1);
    133 
    134   KiiSendMessage (sock, "%d %d %s",
    135                   graph[0].data.flipeast, graph[0].data.flipnorth,
    136                   graph[0].data.coords.ctype);
    137 
    138   KiiSendMessage (sock, "%g %g %g %g %g %g",
    139                   graph[0].data.coords.crval1,
    140                   graph[0].data.coords.crval2,
    141                   graph[0].data.coords.crpix1,
    142                   graph[0].data.coords.crpix2,
    143                   graph[0].data.coords.cdelt1,
    144                   graph[0].data.coords.cdelt2);
     71  KapaSendGraphData (sock, &graph[0].data);
    14572
    14673  return (TRUE);
  • branches/eam_branches/Ohana.20100407/src/libkapa/include/kapa.h

    r27693 r27714  
    180180int KapaSetGraphData (int fd, Graphdata *graphmode);
    181181int KapaGetGraphData (int fd, Graphdata *graphmode);
     182int KapaScanGraphData (int fd, Graphdata *graphmode);
     183int KapaSendGraphData (int fd, Graphdata *graphmode);
    182184int KapaSetImageData (int fd, KapaImageData *graphmode);
    183185int KapaGetImageData (int fd, KapaImageData *graphmode);
  • branches/eam_branches/Ohana.20100407/src/libkapa/src/KapaWindow.c

    r27693 r27714  
    3838
    3939  KiiSendCommand (fd, 4, "DBOX");
    40   KiiSendMessage (fd, "%12.6g %12.6g %12.6g %12.6g",
    41                     graphdata[0].xmin, graphdata[0].xmax, graphdata[0].ymin, graphdata[0].ymax);
    42 
    43   KiiSendMessage (fd, "%lf %d", graphdata[0].lweight, graphdata[0].color);
    44 
    45   KiiSendMessage (fd, "%lf %lf %lf %lf %lf %lf", graphdata[0].ticktextPad, graphdata[0].labelPad, graphdata[0].padXm, graphdata[0].padXp, graphdata[0].padYm, graphdata[0].padYp);
    46 
    47   KiiSendMessage (fd, "%s %s %s", graphdata[0].axis, graphdata[0].labels, graphdata[0].ticks);
     40
     41  KapaSendGraphData (fd, graphdata);
     42
    4843  KiiWaitAnswer (fd, "DONE");
    4944  return (TRUE);
     
    8681}
    8782
     83// XXX drop this function? : kapa is responsible for the graph initialization
    8884int KapaInitGraph (Graphdata *graphdata) {
    8985
     
    130126}
    131127
    132 int KapaSetGraphData (int fd, Graphdata *data) {
    133 
    134   /* tell kapa to look for the incoming image */
    135   KiiSendCommand (fd, 4, "SSTY");
    136  
     128int KapaSendGraphData (int fd, Graphdata *data) {
     129
    137130  /* send kapa the plot details */
     131  KiiSendMessage (fd, "%g %g %g %g",
     132                  data[0].xmin, data[0].xmax,
     133                  data[0].ymin, data[0].ymax);
     134
    138135  KiiSendMessage (fd, "%8d %d %d %d %d %d %f %f",
    139136                  data[0].style,
     
    146143                  data[0].padXm, data[0].padXp,
    147144                  data[0].padYm, data[0].padYp);
    148 
    149 
    150   KiiSendMessage (fd, "%g %g %g %g",
    151                   data[0].xmin, data[0].xmax,
    152                   data[0].ymin, data[0].ymax);
    153145
    154146  KiiSendMessage (fd, "%g %g %g %g",
     
    168160                  data[0].coords.cdelt2);
    169161
    170   KiiWaitAnswer (fd, "DONE");
    171   return (TRUE);
    172 }
    173 
    174 int KapaGetGraphData (int fd, Graphdata *data) {
    175 
    176   /* tell kapa to look for the incoming image */
    177   KiiSendCommand (fd, 4, "GSTY");
    178  
     162  KiiSendMessage (fd, "%s %s %s", data[0].axis, data[0].ticks, data[0].labels);
     163
     164  return (TRUE);
     165}
     166
     167int KapaScanGraphData (int fd, Graphdata *data) {
     168
    179169  /* send kapa the plot details */
     170  KiiScanMessage (fd, "%lf %lf %lf %lf",
     171                  &data[0].xmin, &data[0].xmax,
     172                  &data[0].ymin, &data[0].ymax);
     173
    180174  KiiScanMessage (fd, "%d %d %d %d %d %d %lf %lf",
    181175                  &data[0].style,
     
    188182                  &data[0].padXm, &data[0].padXp,
    189183                  &data[0].padYm, &data[0].padYp);
    190 
    191   KiiScanMessage (fd, "%lf %lf %lf %lf",
    192                   &data[0].xmin, &data[0].xmax,
    193                   &data[0].ymin, &data[0].ymax);
    194184
    195185  KiiScanMessage (fd, "%f %f %f %f",
     
    209199                  &data[0].coords.cdelt2);
    210200
     201  KiiScanMessage (fd, "%s %s %s", data[0].axis, data[0].ticks, data[0].labels);
     202
    211203  // XXX at some point, we need to add polynomials and 2-level mosaic
    212204  // astrometry here.
    213205
    214206  data[0].coords.Npolyterms = 0;
     207
     208  return (TRUE);
     209}
     210
     211int KapaSetGraphData (int fd, Graphdata *data) {
     212
     213  /* tell kapa to look for the incoming image */
     214  KiiSendCommand (fd, 4, "SSTY");
     215 
     216  KapaSendGraphData (fd, data);
     217
     218  KiiWaitAnswer (fd, "DONE");
     219  return (TRUE);
     220}
     221
     222int KapaGetGraphData (int fd, Graphdata *data) {
     223
     224  /* tell kapa to look for the incoming image */
     225  KiiSendCommand (fd, 4, "GSTY");
     226 
     227  KapaScanGraphData (fd, data);
    215228
    216229  KiiWaitAnswer (fd, "DONE");
Note: See TracChangeset for help on using the changeset viewer.