Changeset 14500
- Timestamp:
- Aug 15, 2007, 9:10:13 AM (19 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 6 edited
-
kapa2/include/prototypes.h (modified) (1 diff)
-
kapa2/src/CheckPipe.c (modified) (1 diff)
-
kapa2/src/SetImageData.c (modified) (1 diff)
-
kapa2/src/SetImageSize.c (modified) (4 diffs)
-
libkapa/include/kapa.h (modified) (1 diff)
-
libkapa/src/KiiPicture.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa2/include/prototypes.h
r13479 r14500 67 67 int SetImageData PROTO((int sock)); 68 68 int GetImageData PROTO((int sock)); 69 int SetImageCoords PROTO((int sock)); 70 int GetImageCoords PROTO((int sock)); 71 int GetImageRange PROTO((int sock)); 69 72 70 73 int LoadVectorData PROTO((int sock, KapaGraphWidget *graph, int N, char *type)); -
trunk/Ohana/src/kapa2/src/CheckPipe.c
r13899 r14500 155 155 } 156 156 157 if (!strcmp (word, "SIMC")) { 158 SetImageCoords (sock); 159 KiiSendCommand (sock, 4, "DONE"); 160 FINISHED (TRUE); 161 } 162 163 if (!strcmp (word, "GIMC")) { 164 GetImageCoords (sock); 165 KiiSendCommand (sock, 4, "DONE"); 166 FINISHED (TRUE); 167 } 168 169 if (!strcmp (word, "GIMR")) { 170 GetImageRange (sock); 171 KiiSendCommand (sock, 4, "DONE"); 172 FINISHED (TRUE); 173 } 174 157 175 if (!strcmp (word, "GIMD")) { 158 176 GetImageData (sock); -
trunk/Ohana/src/kapa2/src/SetImageData.c
r13479 r14500 52 52 return (TRUE); 53 53 } 54 55 int SetImageCoords (int sock) { 56 57 int i; 58 double xmin, xmax, ymin, ymax; 59 Graphic *graphic; 60 Section *section; 61 KapaImageWidget *image; 62 63 graphic = GetGraphic(); 64 65 section = GetActiveSection(); 66 if (section->image == NULL) { 67 section->image = InitImage (); 68 SetSectionSizes (section); 69 } 70 image = section->image; 71 72 KiiScanMessage (sock, "%f %f %f %f", 73 &image[0].coords.pc1_1, &image[0].coords.pc2_2, 74 &image[0].coords.pc1_2, &image[0].coords.pc2_1); 75 76 KiiScanMessage (sock, "%s", image[0].coords.ctype); 77 78 KiiScanMessage (sock, "%lf %lf %f %f %f %f", 79 &image[0].coords.crval1, 80 &image[0].coords.crval2, 81 &image[0].coords.crpix1, 82 &image[0].coords.crpix2, 83 &image[0].coords.cdelt1, 84 &image[0].coords.cdelt2); 85 86 return (TRUE); 87 } 88 89 int GetImageCoords (int sock) { 90 91 Section *section; 92 KapaImageWidget *image; 93 94 section = GetActiveSection(); 95 if (section->image == NULL) { 96 section->image = InitImage (); 97 SetSectionSizes (section); 98 } 99 image = section->image; 100 101 KiiSendMessage (sock, "%g %g %g %g", 102 image[0].coords.pc1_1, image[0].coords.pc2_2, 103 image[0].coords.pc1_2, image[0].coords.pc2_1); 104 105 KiiSendMessage (sock, "%s", image[0].coords.ctype); 106 107 KiiSendMessage (sock, "%g %g %g %g %g %g", 108 image[0].coords.crval1, 109 image[0].coords.crval2, 110 image[0].coords.crpix1, 111 image[0].coords.crpix2, 112 image[0].coords.cdelt1, 113 image[0].coords.cdelt2); 114 115 return (TRUE); 116 } 117 118 int GetImageRange (int sock) { 119 120 Section *section; 121 KapaImageWidget *image; 122 double Xmin, Xmax, Ymin, Ymax; 123 124 section = GetActiveSection(); 125 if (section->image == NULL) { 126 section->image = InitImage (); 127 SetSectionSizes (section); 128 } 129 image = section->image; 130 131 Screen_to_Image (&Xmin, &Ymin, 0.0, 0.0, image); 132 Screen_to_Image (&Xmax, &Ymax, image[0].picture.dx, image[0].picture.dy, image); 133 134 KiiSendMessage (sock, "%g %g %g %g", Xmin, Xmax, Ymin, Ymax); 135 136 return (TRUE); 137 } 138 -
trunk/Ohana/src/kapa2/src/SetImageSize.c
r13479 r14500 77 77 image[0].text_dx = ZOOM_X; 78 78 image[0].text_dy = 6*textpad + 7*PAD1; 79 image[0].text_dyo = 3*textpad + 4*PAD1; 79 80 80 81 image[0].overlay_button[0].x = image[0].text_x; … … 144 145 image[0].text_dx = ZOOM_X; 145 146 image[0].text_dy = 6*textpad + 7*PAD1; 147 image[0].text_dyo = 3*textpad + 4*PAD1; 146 148 147 149 image[0].overlay_button[0].x = image[0].text_x; … … 209 211 image[0].text_dx = ZOOM_X; 210 212 image[0].text_dy = 6*textpad + 7*PAD1; 213 image[0].text_dyo = 3*textpad + 4*PAD1; 211 214 212 215 image[0].overlay_button[0].x = image[0].text_x; … … 274 277 image[0].text_dx = ZOOM_X; 275 278 image[0].text_dy = 6*textpad + 7*PAD1; 279 image[0].text_dyo = 3*textpad + 4*PAD1; 276 280 277 281 image[0].overlay_button[0].x = image[0].text_x; -
trunk/Ohana/src/libkapa/include/kapa.h
r13899 r14500 124 124 int KiiNewPicture1D (int fd, KiiImage *image, KapaImageData *data, Coords *coords); 125 125 int KiiNewPicture2D (int fd, KiiImage *image, KapaImageData *data, Coords *coords); 126 127 int KapaSetImageCoords (int fd, Coords *coords); 128 int KapaGetImageCoords (int fd, Coords *coords); 129 int KapaGetImageRange (int fd, double *Xmin, double *Xmax, double *Ymin, double *Ymax); 126 130 127 131 /* KiiOverlay.c */ -
trunk/Ohana/src/libkapa/src/KiiPicture.c
r13479 r14500 155 155 } 156 156 157 int KapaSetImageCoords (int fd, Coords *coords) { 158 159 /* tell kapa to look for the incoming image */ 160 KiiSendCommand (fd, 4, "SIMC"); 161 162 KiiSendMessage (fd, "%g %g %g %g", 163 coords[0].pc1_1, coords[0].pc2_2, 164 coords[0].pc1_2, coords[0].pc2_1); 165 166 KiiSendMessage (fd, "%s", coords[0].ctype); 167 168 KiiSendMessage (fd, "%g %g %g %g %g %g", 169 coords[0].crval1, 170 coords[0].crval2, 171 coords[0].crpix1, 172 coords[0].crpix2, 173 coords[0].cdelt1, 174 coords[0].cdelt2); 175 176 KiiWaitAnswer (fd, "DONE"); 177 return (TRUE); 178 } 179 180 int KapaGetImageCoords (int fd, Coords *coords) { 181 182 /* tell kapa to look for the incoming image */ 183 KiiSendCommand (fd, 4, "GIMC"); 184 185 KiiScanMessage (fd, "%f %f %f %f", 186 &coords[0].pc1_1, &coords[0].pc2_2, 187 &coords[0].pc1_2, &coords[0].pc2_1); 188 189 KiiScanMessage (fd, "%s", coords[0].ctype); 190 191 KiiScanMessage (fd, "%lf %lf %f %f %f %f", 192 &coords[0].crval1, 193 &coords[0].crval2, 194 &coords[0].crpix1, 195 &coords[0].crpix2, 196 &coords[0].cdelt1, 197 &coords[0].cdelt2); 198 199 // XXX at some point, we need to add polynomials and 2-level mosaic 200 // astrometry here. 201 202 coords[0].Npolyterms = 0; 203 204 KiiWaitAnswer (fd, "DONE"); 205 return (TRUE); 206 } 207 208 int KapaGetImageRange (int fd, double *Xmin, double *Xmax, double *Ymin, double *Ymax) { 209 210 /* tell kapa to look for the incoming image */ 211 KiiSendCommand (fd, 4, "GIMR"); 212 213 KiiScanMessage (fd, "%lf %lf %lf %lf", Xmin, Xmax, Ymin, Ymax); 214 215 KiiWaitAnswer (fd, "DONE"); 216 return (TRUE); 217 } 218 219 157 220 /* this function should be broken into pieces: 158 221 KiiSendImage
Note:
See TracChangeset
for help on using the changeset viewer.
