- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/Ohana
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/Ohana merged eligible /branches/eam_branches/Ohana.20100407 27635-27772 /branches/pap_delete/Ohana 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/simtest_nebulous_branches/Ohana/src/libkapa/src/KapaWindow.c
r21060 r27840 27 27 } 28 28 29 int KiiRelocate (int fd, int x, int y) { 30 31 KiiSendCommand (fd, 4, "MOVE"); 32 KiiSendMessage (fd, "%d %d", x, y); 33 KiiWaitAnswer (fd, "DONE"); 34 return (TRUE); 35 } 36 29 37 int KapaBox (int fd, Graphdata *graphdata) { 30 38 31 39 KiiSendCommand (fd, 4, "DBOX"); 32 KiiSendMessage (fd, "%12.6g %12.6g %12.6g %12.6g", 33 graphdata[0].xmin, graphdata[0].xmax, graphdata[0].ymin, graphdata[0].ymax); 34 35 KiiSendMessage (fd, "%lf %d", graphdata[0].lweight, graphdata[0].color); 36 37 KiiSendMessage (fd, "%s %s %s", graphdata[0].axis, graphdata[0].labels, graphdata[0].ticks); 40 41 KapaSendGraphData (fd, graphdata); 42 38 43 KiiWaitAnswer (fd, "DONE"); 39 44 return (TRUE); … … 76 81 } 77 82 83 // XXX drop this function? : kapa is responsible for the graph initialization 78 84 int KapaInitGraph (Graphdata *graphdata) { 79 85 … … 95 101 graphdata[0].flipeast = TRUE; 96 102 graphdata[0].flipnorth = FALSE; 103 97 104 strcpy (graphdata[0].axis, "2222"); 98 105 strcpy (graphdata[0].ticks, "2222"); 99 106 strcpy (graphdata[0].labels, "2222"); 107 108 graphdata[0].ticktextPad = NAN; 109 110 graphdata[0].labelPadXm = NAN; 111 graphdata[0].labelPadXp = NAN; 112 graphdata[0].labelPadYm = NAN; 113 graphdata[0].labelPadYp = NAN; 114 115 graphdata[0].padXm = NAN; 116 graphdata[0].padXp = NAN; 117 graphdata[0].padYm = NAN; 118 graphdata[0].padYp = NAN; 100 119 101 120 return (TRUE); … … 120 139 } 121 140 122 int KapaSetGraphData (int fd, Graphdata *data) { 123 124 /* tell kapa to look for the incoming image */ 125 KiiSendCommand (fd, 4, "SSTY"); 126 141 int KapaSendGraphData (int fd, Graphdata *data) { 142 127 143 /* send kapa the plot details */ 144 KiiSendMessage (fd, "%g %g %g %g", 145 data[0].xmin, data[0].xmax, 146 data[0].ymin, data[0].ymax); 147 128 148 KiiSendMessage (fd, "%8d %d %d %d %d %d %f %f", 129 149 data[0].style, … … 132 152 data[0].lweight, data[0].size); 133 153 154 KiiSendMessage (fd, "%g %g %g %g %g", 155 data[0].ticktextPad, 156 data[0].padXm, data[0].padXp, 157 data[0].padYm, data[0].padYp); 158 134 159 KiiSendMessage (fd, "%g %g %g %g", 135 data[0]. xmin, data[0].xmax,136 data[0]. ymin, data[0].ymax);160 data[0].labelPadXm, data[0].labelPadXp, 161 data[0].labelPadYm, data[0].labelPadYp); 137 162 138 163 KiiSendMessage (fd, "%g %g %g %g", … … 152 177 data[0].coords.cdelt2); 153 178 154 KiiWaitAnswer (fd, "DONE"); 155 return (TRUE); 156 } 157 158 int KapaGetGraphData (int fd, Graphdata *data) { 159 160 /* tell kapa to look for the incoming image */ 161 KiiSendCommand (fd, 4, "GSTY"); 162 179 KiiSendMessage (fd, "%s %s %s", data[0].axis, data[0].ticks, data[0].labels); 180 181 return (TRUE); 182 } 183 184 int KapaScanGraphData (int fd, Graphdata *data) { 185 163 186 /* send kapa the plot details */ 187 KiiScanMessage (fd, "%lf %lf %lf %lf", 188 &data[0].xmin, &data[0].xmax, 189 &data[0].ymin, &data[0].ymax); 190 164 191 KiiScanMessage (fd, "%d %d %d %d %d %d %lf %lf", 165 192 &data[0].style, … … 168 195 &data[0].lweight, &data[0].size); 169 196 197 KiiScanMessage (fd, "%lf %lf %lf %lf %lf", 198 &data[0].ticktextPad, 199 &data[0].padXm, &data[0].padXp, 200 &data[0].padYm, &data[0].padYp); 201 170 202 KiiScanMessage (fd, "%lf %lf %lf %lf", 171 &data[0]. xmin, &data[0].xmax,172 &data[0]. ymin, &data[0].ymax);203 &data[0].labelPadXm, &data[0].labelPadXp, 204 &data[0].labelPadYm, &data[0].labelPadYp); 173 205 174 206 KiiScanMessage (fd, "%f %f %f %f", … … 188 220 &data[0].coords.cdelt2); 189 221 222 KiiScanMessage (fd, "%s %s %s", data[0].axis, data[0].ticks, data[0].labels); 223 190 224 // XXX at some point, we need to add polynomials and 2-level mosaic 191 225 // astrometry here. 192 226 193 227 data[0].coords.Npolyterms = 0; 228 229 return (TRUE); 230 } 231 232 int KapaSetGraphData (int fd, Graphdata *data) { 233 234 /* tell kapa to look for the incoming image */ 235 KiiSendCommand (fd, 4, "SSTY"); 236 237 KapaSendGraphData (fd, data); 238 239 KiiWaitAnswer (fd, "DONE"); 240 return (TRUE); 241 } 242 243 int KapaGetGraphData (int fd, Graphdata *data) { 244 245 /* tell kapa to look for the incoming image */ 246 KiiSendCommand (fd, 4, "GSTY"); 247 248 KapaScanGraphData (fd, data); 194 249 195 250 KiiWaitAnswer (fd, "DONE"); … … 224 279 int KapaPlotVector (int fd, int Npts, float *values, char *type) { 225 280 226 int Nbytes ;281 int Nbytes, Nwrite; 227 282 int swap; 228 283 … … 248 303 KiiSendMessage (fd, "%s %d %d %d", type, Npts, Nbytes, swap); 249 304 250 write (fd, values, Nbytes); 305 Nwrite = write (fd, values, Nbytes); 306 if (Nwrite != Nbytes) { 307 fprintf (stderr, "error sending data\n"); 308 return FALSE; 309 } 251 310 KiiWaitAnswer (fd, "DONE"); 252 311 return (TRUE); … … 300 359 301 360 KiiSendCommand (fd, 4, "DSEC"); 302 KiiSendMessage (fd, "%s %6.3f %6.3f %6.3f %6.3f ",361 KiiSendMessage (fd, "%s %6.3f %6.3f %6.3f %6.3f %3d", 303 362 section[0].name, 304 363 section[0].x, 305 364 section[0].y, 306 365 section[0].dx, 307 section[0].dy); 366 section[0].dy, 367 section[0].bg); 368 KiiWaitAnswer (fd, "DONE"); 369 return (TRUE); 370 } 371 372 int KapaSectionBG (int fd, char *name, int bg) { 373 374 KiiSendCommand (fd, 4, "BSEC"); 375 KiiSendMessage (fd, "%s %3d", name, bg); 308 376 KiiWaitAnswer (fd, "DONE"); 309 377 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
