Changeset 27714
- Timestamp:
- Apr 20, 2010, 10:41:44 AM (16 years ago)
- Location:
- branches/eam_branches/Ohana.20100407/src
- Files:
-
- 4 edited
-
kapa2/src/LoadFrame.c (modified) (4 diffs)
-
kapa2/src/SetGraphData.c (modified) (3 diffs)
-
libkapa/include/kapa.h (modified) (1 diff)
-
libkapa/src/KapaWindow.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/Ohana.20100407/src/kapa2/src/LoadFrame.c
r27693 r27714 16 16 graph = section->graph; 17 17 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); 21 19 22 20 graph[0].axis[3].min = graph[0].axis[1].min; … … 25 23 graph[0].axis[2].max = graph[0].axis[0].max; 26 24 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)); 29 27 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; 37 32 38 33 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; 41 36 42 37 graph[0].axis[i].ticktextPad = ticktextPad; 43 38 graph[0].axis[i].labelPad = labelPad; 44 39 45 switch ( Axis[i]) {40 switch (graph[0].data.axis[i]) { 46 41 case '0': 47 42 graph[0].axis[i].isaxis = FALSE; … … 54 49 break; 55 50 } 56 switch ( Ticks[i]) {51 switch (graph[0].data.ticks[i]) { 57 52 case '0': 58 53 graph[0].axis[i].areticks = FALSE; … … 65 60 break; 66 61 } 67 switch ( Labels[i]) {62 switch (graph[0].data.labels[i]) { 68 63 case '0': 69 64 graph[0].axis[i].islabel = FALSE; -
branches/eam_branches/Ohana.20100407/src/kapa2/src/SetGraphData.c
r27713 r27714 21 21 fprintf (stderr, "pad: %f %f %f\n", section->graph->axis[0].pad, section->graph->axis[0].labelPad, section->graph->axis[0].ticktextPad); 22 22 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); 41 24 42 25 for (i = 0; i < 4; i++) { … … 48 31 graph[0].axis[2].pad = graph[0].data.padXp; 49 32 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 74 33 75 34 xmin = graph[0].data.xmin; … … 110 69 graph = section->graph; 111 70 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); 145 72 146 73 return (TRUE); -
branches/eam_branches/Ohana.20100407/src/libkapa/include/kapa.h
r27693 r27714 180 180 int KapaSetGraphData (int fd, Graphdata *graphmode); 181 181 int KapaGetGraphData (int fd, Graphdata *graphmode); 182 int KapaScanGraphData (int fd, Graphdata *graphmode); 183 int KapaSendGraphData (int fd, Graphdata *graphmode); 182 184 int KapaSetImageData (int fd, KapaImageData *graphmode); 183 185 int KapaGetImageData (int fd, KapaImageData *graphmode); -
branches/eam_branches/Ohana.20100407/src/libkapa/src/KapaWindow.c
r27693 r27714 38 38 39 39 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 48 43 KiiWaitAnswer (fd, "DONE"); 49 44 return (TRUE); … … 86 81 } 87 82 83 // XXX drop this function? : kapa is responsible for the graph initialization 88 84 int KapaInitGraph (Graphdata *graphdata) { 89 85 … … 130 126 } 131 127 132 int KapaSetGraphData (int fd, Graphdata *data) { 133 134 /* tell kapa to look for the incoming image */ 135 KiiSendCommand (fd, 4, "SSTY"); 136 128 int KapaSendGraphData (int fd, Graphdata *data) { 129 137 130 /* 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 138 135 KiiSendMessage (fd, "%8d %d %d %d %d %d %f %f", 139 136 data[0].style, … … 146 143 data[0].padXm, data[0].padXp, 147 144 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);153 145 154 146 KiiSendMessage (fd, "%g %g %g %g", … … 168 160 data[0].coords.cdelt2); 169 161 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 167 int KapaScanGraphData (int fd, Graphdata *data) { 168 179 169 /* 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 180 174 KiiScanMessage (fd, "%d %d %d %d %d %d %lf %lf", 181 175 &data[0].style, … … 188 182 &data[0].padXm, &data[0].padXp, 189 183 &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);194 184 195 185 KiiScanMessage (fd, "%f %f %f %f", … … 209 199 &data[0].coords.cdelt2); 210 200 201 KiiScanMessage (fd, "%s %s %s", data[0].axis, data[0].ticks, data[0].labels); 202 211 203 // XXX at some point, we need to add polynomials and 2-level mosaic 212 204 // astrometry here. 213 205 214 206 data[0].coords.Npolyterms = 0; 207 208 return (TRUE); 209 } 210 211 int 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 222 int 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); 215 228 216 229 KiiWaitAnswer (fd, "DONE");
Note:
See TracChangeset
for help on using the changeset viewer.
