Changeset 40501
- Timestamp:
- Jul 6, 2018, 1:42:20 PM (8 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 6 edited
-
imregister/detrend/altpath.c (modified) (5 diffs)
-
imregister/detrend/db_names.c (modified) (1 diff)
-
imregister/detrend/output.c (modified) (2 diffs)
-
kapa2/include/constants.h (modified) (1 diff)
-
kapa2/include/structures.h (modified) (2 diffs)
-
kapa2/src/UpdateStatusBox.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/imregister/detrend/altpath.c
r34088 r40501 7 7 off_t i, j, n, Nlist; 8 8 off_t *list; 9 char *dBPath, infile[ 256], outfile[256], line[1024];9 char *dBPath, infile[512], outfile[512], line[1100]; 10 10 struct stat statbuf; 11 11 … … 28 28 i = list[j]; 29 29 for (n = 0; n < NDetrendAltDB; n++) { 30 s printf (infile, "%s/%s", dBPath, image[i].filename);31 s printf (outfile, "%s/%s", DetrendAltDB[n], image[i].filename);30 snprintf (infile, 512, "%s/%s", dBPath, image[i].filename); 31 snprintf (outfile, 512, "%s/%s", DetrendAltDB[n], image[i].filename); 32 32 status = ckpathname (outfile); 33 33 if (!status) { … … 35 35 continue; 36 36 } 37 s printf (line, "cp %s %s", infile, outfile);37 snprintf (line, 1100, "cp %s %s", infile, outfile); 38 38 fprintf (stderr, "%s\n", line); 39 39 status = system (line); … … 73 73 image[i].altpath = FALSE; 74 74 for (n = 0; n < NDetrendAltDB; n++) { 75 s printf (outfile, "%s/%s", DetrendAltDB[n], image[i].filename);76 s printf (line, "rm %s", outfile);75 snprintf (outfile, 512, "%s/%s", DetrendAltDB[n], image[i].filename); 76 snprintf (line, 1100, "rm %s", outfile); 77 77 fprintf (stderr, "%s\n", line); 78 78 status = system (line); … … 104 104 found = TRUE; 105 105 for (n = 0; found && (n < NDetrendAltDB); n++) { 106 s printf (outfile, "%s/%s", DetrendAltDB[n], image[i].filename);106 snprintf (outfile, 512, "%s/%s", DetrendAltDB[n], image[i].filename); 107 107 status = stat (outfile, &statbuf); 108 108 fprintf (stderr, "checking for %s, status is %d\n", outfile, status); -
trunk/Ohana/src/imregister/detrend/db_names.c
r6674 r40501 52 52 53 53 int status; 54 char line[ 256];54 char line[512]; 55 55 56 56 if (output.verbose) fprintf (stderr, "deleting %s\n", item[0].filename); 57 s printf (line, "mv -f %s/%s %s", dBPath, item[0].filename, dBTrash);57 snprintf (line, 512, "mv -f %s/%s %s", dBPath, item[0].filename, dBTrash); 58 58 status = system (line); 59 59 if (status) fprintf (stderr, "trouble moving %s to trash (%s)\n", item[0].filename, dBTrash); -
trunk/Ohana/src/imregister/detrend/output.c
r38441 r40501 193 193 int PrintSubset (DetReg *detdata, Match *match, off_t Nmatch) { 194 194 195 char *dBPath, *Path, *typestr, *filtstr, filename[ 128];195 char *dBPath, *Path, *typestr, *filtstr, filename[512]; 196 196 char *timestr, *modestr, *ccdstr, ccdinfo[16], ccdformat[16]; 197 197 off_t i, j; … … 239 239 /* output mode (Select vs List) */ 240 240 if (output.Chipname && criteria[0].CCDSelect && detdata[i].mode == M_MEF) { 241 snprintf (filename, 128, "%s[%s]", detdata[i].filename, ccds[criteria[0].CCD]);241 snprintf (filename, 512, "%s[%s]", detdata[i].filename, ccds[criteria[0].CCD]); 242 242 } else { 243 243 strcpy (filename, detdata[i].filename); -
trunk/Ohana/src/kapa2/include/constants.h
r40419 r40501 11 11 12 12 # define NCHANNELS 10 13 # define LONG_LINE_LENGTH 1024 13 14 14 15 # define PAD1 3 -
trunk/Ohana/src/kapa2/include/structures.h
r40419 r40501 64 64 int x, y, dx, dy; /* position and size */ 65 65 char *label; /* label on TextLine */ 66 char text[ 1024]; /* words of TextLine */67 char old_text[ 1024]; /* words of TextLine */66 char text[LONG_LINE_LENGTH]; /* words of TextLine */ 67 char old_text[LONG_LINE_LENGTH]; /* words of TextLine */ 68 68 int outline; /* draw an outline? */ 69 69 int cursor; /* location of cursor (if selected) */ … … 179 179 double start, slope; /* zero, range for cmap to pixels */ 180 180 Coords coords; 181 char file[ 1024]; /* name of file */182 char name[ 1024]; /* name of buffer */181 char file[LONG_LINE_LENGTH]; /* name of file */ 182 char name[LONG_LINE_LENGTH]; /* name of buffer */ 183 183 } KapaImageChannel; 184 184 -
trunk/Ohana/src/kapa2/src/UpdateStatusBox.c
r37807 r40501 1 1 # include "Ximage.h" 2 2 3 # define MY_LONG_LINE (LONG_LINE_LENGTH + 128) 3 4 void UpdateStatusBox (Graphic *graphic, KapaImageWidget *image, double x, double y, double z, int mode) { 4 5 5 6 int textpad; 6 7 double ra, dec; 7 char line[ 100];8 char line[MY_LONG_LINE]; 8 9 9 10 XY_to_RD (&ra, &dec, x, y, &image[0].image[0].coords); … … 19 20 image[0].text_x, image[0].text_y, image[0].text_dx, image[0].text_dy); 20 21 21 bzero (line, 100);22 snprintf (line, 100, "(%d x %d) @ %d ch: %d ",22 bzero (line, MY_LONG_LINE); 23 snprintf (line, MY_LONG_LINE, "(%d x %d) @ %d ch: %d ", 23 24 image[0].picture.dx, image[0].picture.dy, image[0].picture.expand, image[0].currentChannel+1); 24 25 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 25 26 image[0].text_x + PAD1, image[0].text_y + 4*textpad + 4*PAD1, line, 25); 26 27 27 bzero (line, 100);28 snprintf (line, 100, "%-25s", image[0].image[0].file);28 bzero (line, MY_LONG_LINE); 29 snprintf (line, MY_LONG_LINE, "%-25s", image[0].image[0].file); 29 30 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 30 31 image[0].text_x + PAD1, image[0].text_y + 5*textpad + 5*PAD1, line, strlen(line)); 31 32 32 bzero (line, 100);33 snprintf (line, 100, "(%s) ", image[0].image[0].name);33 bzero (line, MY_LONG_LINE); 34 snprintf (line, MY_LONG_LINE, "(%s) ", image[0].image[0].name); 34 35 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 35 36 image[0].text_x + PAD1, image[0].text_y + 6*textpad + 6*PAD1, line, 25); … … 42 43 XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore); 43 44 } 44 bzero (line, 100);45 bzero (line, MY_LONG_LINE); 45 46 46 47 if (image[0].HexValue) { 47 snprintf (line, 100, "%04x", (int) z);48 snprintf (line, MY_LONG_LINE, "%04x", (int) z); 48 49 } else { 49 snprintf (line, 100, "%22.3f", z);50 snprintf (line, MY_LONG_LINE, "%22.3f", z); 50 51 } 51 52 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 52 53 image[0].text_x + PAD1, image[0].text_y + textpad + PAD1, line, strlen(line)); 53 54 54 bzero (line, 100);55 snprintf (line, 100, "%10.2f %10.2f", x, y);55 bzero (line, MY_LONG_LINE); 56 snprintf (line, MY_LONG_LINE, "%10.2f %10.2f", x, y); 56 57 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 57 58 image[0].text_x + PAD1, image[0].text_y + 2*textpad + 2*PAD1, line, strlen(line)); 58 59 59 bzero (line, 100);60 bzero (line, MY_LONG_LINE); 60 61 if (image[0].DecimalDegrees) { 61 snprintf (line, 100, "%10.6f %10.6f", ra, dec);62 snprintf (line, MY_LONG_LINE, "%10.6f %10.6f", ra, dec); 62 63 } else { 63 hh_hms (line, ra, dec, ':', 100);64 hh_hms (line, ra, dec, ':', MY_LONG_LINE); 64 65 } 65 66
Note:
See TracChangeset
for help on using the changeset viewer.
