Changeset 26891
- Timestamp:
- Feb 10, 2010, 7:24:46 PM (16 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 26 edited
- 10 copied
-
addstar/src/psps_ids.c (modified) (1 prop)
-
kapa2/doc/communication.txt (copied) (copied from branches/eam_branches/20091201/Ohana/src/kapa2/doc/communication.txt )
-
kapa2/include/constants.h (modified) (1 diff)
-
kapa2/src/ColorHistogram.c (modified) (1 diff)
-
kapa2/src/EraseOverlay.c (modified) (1 diff)
-
kapa2/src/LoadPicture.c (modified) (2 diffs)
-
kapa2/src/PNGit.c (modified) (1 diff)
-
kapa2/src/PPMit.c (modified) (1 diff)
-
kapa2/src/Resize.c (modified) (1 diff)
-
kapa2/src/SaveOverlay.c (modified) (1 diff)
-
kapa2/src/SetColorScale.c (modified) (4 diffs)
-
kapa2/src/SetColormap.c (modified) (7 diffs)
-
libkapa/src/KiiOverlay.c (modified) (1 diff)
-
opihi/cmd.astro/mkgauss.c (modified) (2 diffs)
-
opihi/cmd.astro/profile.c (modified) (1 diff)
-
opihi/cmd.astro/star.c (modified) (1 diff)
-
opihi/cmd.basic/Makefile (modified) (1 diff)
-
opihi/cmd.basic/init.c (modified) (3 diffs)
-
opihi/cmd.basic/nop.c (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.basic/nop.c )
-
opihi/cmd.data/Makefile (modified) (2 diffs)
-
opihi/cmd.data/hermitian1d.c (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/hermitian1d.c )
-
opihi/cmd.data/hermitian2d.c (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/hermitian2d.c )
-
opihi/cmd.data/init.c (modified) (4 diffs)
-
opihi/cmd.data/matrix.c (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/matrix.c )
-
opihi/cmd.data/svd.c (modified) (1 diff)
-
opihi/cmd.data/test/matrix.sh (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/test/matrix.sh )
-
opihi/cmd.data/test/svd.sh (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/cmd.data/test/svd.sh )
-
opihi/doc/svdcmp_eispack.f (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/doc/svdcmp_eispack.f )
-
opihi/include/data.h (modified) (2 diffs)
-
opihi/include/pclient.h (modified) (1 diff)
-
opihi/lib.data/Makefile (modified) (2 diffs)
-
opihi/lib.data/hermitian.c (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/lib.data/hermitian.c )
-
opihi/lib.data/svdcmp_bond_raw.c (copied) (copied from branches/eam_branches/20091201/Ohana/src/opihi/lib.data/svdcmp_bond_raw.c )
-
opihi/lib.shell/stack_math.c (modified) (4 diffs)
-
opihi/pclient/ChildOps.c (modified) (3 diffs)
-
opihi/pclient/pclient.c.in (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/psps_ids.c
- Property svn:mergeinfo changed
/branches/eam_branches/20091201/Ohana/src/addstar/src/psps_ids.c (added) merged: 26711,26885
- Property svn:mergeinfo changed
-
trunk/Ohana/src/kapa2/include/constants.h
r25757 r26891 11 11 12 12 # define NCHANNELS 3 13 # define NPIXELS_DYNAMIC 460013 # define NPIXELS_DYNAMIC 128 14 14 15 15 // XXX for the moment, this is set to match the values in SetColorScale3D_CC 16 # define NPIXELS_STATIC 460016 # define NPIXELS_STATIC 128 17 17 18 18 # define PAD1 3 -
trunk/Ohana/src/kapa2/src/ColorHistogram.c
r16061 r26891 174 174 node->pixel = current[0]; 175 175 current[0] ++; 176 assert (current[0] < =Npixels);176 assert (current[0] < Npixels); 177 177 return TRUE; 178 178 } -
trunk/Ohana/src/kapa2/src/EraseOverlay.c
r14590 r26891 8 8 KapaImageWidget *image; 9 9 10 // We have to accept the incoming message even if we cannot perform the action 11 KiiScanCommand (sock, 16, "%*s %d", &N); 12 10 13 graphic = GetGraphic(); 11 14 section = GetActiveSection(); 12 15 image = section->image; 13 16 if (image == NULL) return (TRUE); 14 15 KiiScanCommand (sock, 16, "%*s %d", &N);16 17 17 18 if (N > NOVERLAYS) { -
trunk/Ohana/src/kapa2/src/LoadPicture.c
r25757 r26891 73 73 if (status == 0) { /* No more pipe */ 74 74 fprintf (stderr, "error: pipe closed\n"); 75 fcntl (sock, F_SETFL, !O_NONBLOCK); 75 76 return (FALSE); 76 77 } … … 92 93 SetColorScale (graphic, image); 93 94 94 SetColorScale (graphic, image);95 96 95 if (!USE_XWINDOW) return (TRUE); 97 96 -
trunk/Ohana/src/kapa2/src/PNGit.c
r13479 r26891 16 16 17 17 /* expect a line telling the number of bytes and a filename */ 18 status = read (sock, filename, 16); 19 filename[16] = 0; 20 sscanf (filename, "%*s %d", &Nbytes); 21 status = read (sock, filename, Nbytes); 22 filename[status] = 0; /* make the string easy to parse */ 18 KiiScanMessage (sock, "%s", filename); 23 19 24 20 f = fopen (filename, "w"); -
trunk/Ohana/src/kapa2/src/PPMit.c
r13479 r26891 13 13 14 14 /* expect a line telling the number of bytes and a filename */ 15 status = read (sock, filename, 16); 16 filename[16] = 0; 17 sscanf (filename, "%*s %d", &Nbytes); 18 status = read (sock, filename, Nbytes); 19 filename[status] = 0; /* make the string easy to parse */ 15 KiiScanMessage (sock, "%s", filename); 20 16 21 17 f = fopen (filename, "w"); -
trunk/Ohana/src/kapa2/src/Resize.c
r21153 r26891 11 11 graphic = GetGraphic(); 12 12 13 // must scan the message before possible return 13 14 KiiScanMessage (sock, "%d %d", &NX, &NY); 14 15 -
trunk/Ohana/src/kapa2/src/SaveOverlay.c
r13479 r26891 9 9 KapaImageWidget *image; 10 10 11 KiiScanMessage (sock, "%*s %d %s", &N, filename); 12 11 13 section = GetActiveSection(); 12 14 image = section->image; 13 15 if (image == NULL) return (TRUE); 14 16 15 KiiScanMessage (sock, "%*s %d %s", &N, filename);16 17 17 f = fopen (filename, "w"); 18 18 if (f == NULL) { -
trunk/Ohana/src/kapa2/src/SetColorScale.c
r25757 r26891 34 34 float slope; 35 35 float start; 36 unsigned short MaxValue ;36 unsigned short MaxValue, NANValue; 37 37 Matrix *matrix; 38 38 39 39 // define the color transform parameters 40 MaxValue = graphic[0].Npixels - 1; 40 NANValue = graphic[0].Npixels - 1; 41 MaxValue = graphic[0].Npixels - 2; 41 42 if (image[0].image[0].range != 0.0) { 42 slope = graphic[0].Npixels/ image[0].image[0].range;43 start = graphic[0].Npixels * image[0].image[0].zero / image[0].image[0].range;43 slope = (graphic[0].Npixels - 1) / image[0].image[0].range; 44 start = slope * image[0].image[0].zero; 44 45 } else { 45 46 slope = 1.0; … … 63 64 // convert pixel data values to pixel index values (0 - Npixel) 64 65 for (i = 0; i < nPixels; i++, iData++, oData++) { 66 if (isnan(*iData) || isinf(*iData)) { 67 *oData = NANValue; 68 continue; 69 } 65 70 value = *iData * slope - start; 66 if (value < 0) value = 0; 67 if (value > MaxValue) value = MaxValue; 71 if (value < 0) { 72 *oData = 0; 73 continue; 74 } 75 if (value > MaxValue) { 76 *oData = MaxValue; 77 continue; 78 } 68 79 *oData = value; 69 80 } … … 169 180 if (DX != image[0].channel[KAPA_CHANNEL_BLUE].matrix.Naxis[0]) return FALSE; 170 181 if (DY != image[0].channel[KAPA_CHANNEL_BLUE].matrix.Naxis[1]) return FALSE; 182 183 // XXX a bit bogus: we are going to store a special color at Npixels-1 for 184 // marking the NAN pixels. 185 { 186 // XXX set pure green for now 187 graphic[0].cmap[graphic[0].Npixels-1].red = 0; 188 graphic[0].cmap[graphic[0].Npixels-1].green = 0xffff; 189 graphic[0].cmap[graphic[0].Npixels-1].blue = 0; 190 } 171 191 172 192 // create the top-level cube … … 214 234 // convert histogram 3D values to cmap colors 215 235 Npixels = 0; 216 CCNodeSetColorMap (cube, graphic[0].cmap, graphic[0].Npixels , &Npixels);236 CCNodeSetColorMap (cube, graphic[0].cmap, graphic[0].Npixels - 1, &Npixels); 217 237 218 238 // store the colors -
trunk/Ohana/src/kapa2/src/SetColormap.c
r25757 r26891 10 10 VAR = tmp; \ 11 11 } } 12 13 // the image arrives from the client program as an array of floats, stored in image->matrix. 14 // whenever we load a new image or change tv channels, we need to map the currently active 15 // image from float to pixel index (image->pixmap). When we actually display (or change the 16 // display of) an image, we simply remap the lit pixels (in Remap32.c, etc). 12 17 13 18 int SetColormap (char *name) { … … 26 31 } 27 32 33 // XXX a bit bogus: we are going to store a special color at Npixels-1 for 34 // marking the NAN pixels. 35 { 36 // XXX set pure green for now 37 graphic[0].cmap[graphic[0].Npixels-1].red = 0; 38 graphic[0].cmap[graphic[0].Npixels-1].green = 0xffff; 39 graphic[0].cmap[graphic[0].Npixels-1].blue = 0; 40 } 41 28 42 // very simple color model: evenly spaced cube 29 43 if (!strcasecmp (name, "ruffcolor")) { 30 44 graphic[0].nRed = pow (graphic[0].Npixels, 0.333); 31 45 graphic[0].nBlue = pow (graphic[0].Npixels, 0.333); 32 graphic[0].nGreen = graphic[0].Npixels/ (graphic[0].nRed * graphic[0].nBlue);46 graphic[0].nGreen = (graphic[0].Npixels - 1) / (graphic[0].nRed * graphic[0].nBlue); 33 47 34 48 // red,green,blue are values in range 0x0000 to 0xffff … … 48 62 } 49 63 } 64 fprintf (stderr, "ruff Npix: %d vs %d\n", i, graphic[0].Npixels); 50 65 51 66 // all other modes are 1D: set the flag: … … 58 73 59 74 // red,green,blue are values in range 0x0000 to 0xffff 60 scale = 0xffff / (graphic[0].Npixels - 1);75 scale = 0xffff / (graphic[0].Npixels - 2); 61 76 62 77 /* greyscale */ 63 78 if ((!strcasecmp (name, "grayscale")) || (!strcasecmp (name, "greyscale"))) { 64 for (i = 0; i < graphic[0].Npixels ; i++) {79 for (i = 0; i < graphic[0].Npixels - 1; i++) { 65 80 SETVALUE (graphic[0].cmap[i].red, 0xffff - i*scale, 0, 0xffff); 66 81 SETVALUE (graphic[0].cmap[i].green, 0xffff - i*scale, 0, 0xffff); … … 72 87 /* -grayscale */ 73 88 if ((!strcasecmp (name, "-grayscale")) || (!strcasecmp (name, "-greyscale"))) { 74 for (i = 0; i < graphic[0].Npixels ; i++) {89 for (i = 0; i < graphic[0].Npixels - 1; i++) { 75 90 SETVALUE (graphic[0].cmap[i].red, i*scale, 0, 0xffff); 76 91 SETVALUE (graphic[0].cmap[i].green, i*scale, 0, 0xffff); … … 102 117 graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue; 103 118 } 104 for (i = (int)(0.75*graphic[0].Npixels); i < graphic[0].Npixels ; i++) {119 for (i = (int)(0.75*graphic[0].Npixels); i < graphic[0].Npixels - 1; i++) { 105 120 graphic[0].cmap[i].red = 0xffff; 106 121 graphic[0].cmap[i].green = 0xffff; … … 134 149 } 135 150 blueRef = 0.75*graphic[0].Npixels*scale*4.0; 136 for (i = (int)(0.75*graphic[0].Npixels); i < graphic[0].Npixels ; i++) {151 for (i = (int)(0.75*graphic[0].Npixels); i < graphic[0].Npixels - 1; i++) { 137 152 graphic[0].cmap[i].red = 0xffff; 138 153 graphic[0].cmap[i].green = 0xffff; -
trunk/Ohana/src/libkapa/src/KiiOverlay.c
r15620 r26891 92 92 93 93 write (fd, textdata, Ntextdata); 94 KiiWaitAnswer (fd, "DONE"); 94 KiiWaitAnswer (fd, "DONE"); // this 'DONE' notes the end of the textdata buffer 95 95 96 96 free (buffer); 97 97 free (textdata); 98 98 99 KiiWaitAnswer (fd, "DONE"); 99 KiiWaitAnswer (fd, "DONE"); // this 'DONE' notes the end of the command 100 100 return (TRUE); 101 101 } -
trunk/Ohana/src/opihi/cmd.astro/mkgauss.c
r7917 r26891 11 11 Buffer *buf; 12 12 13 Xo = Yo = 0; 13 // this should be Nx/2, Ny/2 if not set 14 Xo = Yo = NAN; 14 15 if ((N = get_argument (argc, argv, "-c"))) { 15 16 remove_argument (N, &argc, argv); … … 30 31 Ny = buf[0].header.Naxis[1]; 31 32 33 if (isnan(Xo)) Xo = Nx / 2; 34 if (isnan(Yo)) Yo = Ny / 2; 35 32 36 /* gaussian parameters */ 33 37 Sig_x = atof (argv[2]); -
trunk/Ohana/src/opihi/cmd.astro/profile.c
r20936 r26891 31 31 ResetVector (yvec, OPIHI_FLT, (int)SQ(2*N+1)); 32 32 33 bzero (yvec[0].elements.Flt, (int)SQ(2*N+1)*sizeof(opihi_flt) +1);33 bzero (yvec[0].elements.Flt, (int)SQ(2*N+1)*sizeof(opihi_flt)); 34 34 V = (float *)(buf[0].matrix.buffer); 35 35 Npt = 0; 36 36 Nx = buf[0].matrix.Naxis[0]; 37 for (i = sx - N; i < sx + N; i++) {38 for (j = sy - N; j < sy + N; j++, Npt++) {37 for (i = sx - N; i <= sx + N; i++) { 38 for (j = sy - N; j <= sy + N; j++, Npt++) { 39 39 yvec[0].elements.Flt[Npt] = V[i + j*Nx]; 40 xvec[0].elements.Flt[Npt] = hypot (i - sx, j- sy);40 xvec[0].elements.Flt[Npt] = hypot (i + 0.5 - sx, j + 0.5 - sy); 41 41 } 42 42 } -
trunk/Ohana/src/opihi/cmd.astro/star.c
r7917 r26891 24 24 if ((argc != 4) && (argc != 5)) { 25 25 gprint (GP_ERR, "USAGE: star (buffer) x y [dx] [-border N] [-sat cnts]\n"); 26 gprint (GP_ERR, " dx is the aperture diameter, but is adjusted up to the next odd number\n"); 26 27 return (FALSE); 27 28 } -
trunk/Ohana/src/opihi/cmd.basic/Makefile
r25965 r26891 39 39 $(SRC)/mkdir.$(ARCH).o \ 40 40 $(SRC)/module.$(ARCH).o \ 41 $(SRC)/nop.$(ARCH).o \ 41 42 $(SRC)/output.$(ARCH).o \ 42 43 $(SRC)/quit.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.basic/init.c
r25965 r26891 25 25 int mkdir_opihi PROTO((int, char **)); 26 26 int module PROTO((int, char **)); 27 int nop PROTO((int, char **)); 27 28 int output PROTO((int, char **)); 28 29 int pwd PROTO((int, char **)); … … 66 67 {1, "?", list_help, "list commands *"}, 67 68 {1, "??", list_vars, "list variables *"}, 69 {1, "#", nop, "a NOP function"}, 68 70 {1, "local", local, "define local variables"}, 69 71 {1, "macro", macro, "deal with the macros *"}, … … 71 73 {1, "mkdir", mkdir_opihi, "built-in mkdir command"}, 72 74 {1, "module", module, "load script file from the modules directories"}, 75 {1, "nop", nop, "a NOP function"}, 73 76 {1, "output", output, "redirect output to file"}, 74 77 {1, "pwd", pwd, "print current working directory"}, -
trunk/Ohana/src/opihi/cmd.data/Makefile
r25757 r26891 53 53 $(SRC)/ungridify.$(ARCH).o \ 54 54 $(SRC)/histogram.$(ARCH).o \ 55 $(SRC)/hermitian1d.$(ARCH).o \ 56 $(SRC)/hermitian2d.$(ARCH).o \ 55 57 $(SRC)/imcut.$(ARCH).o \ 56 58 $(SRC)/imhist.$(ARCH).o \ … … 69 71 $(SRC)/load.$(ARCH).o \ 70 72 $(SRC)/lookup.$(ARCH).o \ 73 $(SRC)/matrix.$(ARCH).o \ 71 74 $(SRC)/mkrgb.$(ARCH).o \ 72 75 $(SRC)/mcreate.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/init.c
r25757 r26891 42 42 int ungridify PROTO((int, char **)); 43 43 int histogram PROTO((int, char **)); 44 int hermitian1d PROTO((int, char **)); 45 int hermitian2d PROTO((int, char **)); 44 46 int imcut PROTO((int, char **)); 45 47 int imhist PROTO((int, char **)); … … 58 60 int load PROTO((int, char **)); 59 61 int lookup PROTO((int, char **)); 62 int matrix PROTO((int, char **)); 60 63 int mkrgb PROTO((int, char **)); 61 64 int mcreate PROTO((int, char **)); … … 172 175 {1, "header", header, "print image header"}, 173 176 {1, "histogram", histogram, "generate histogram from vector"}, 177 {1, "hermitian1d", hermitian1d, "generate 1-D Hermitian Polynomial"}, 178 {1, "hermitian2d", hermitian2d, "generate 2-D Hermitian Polynomial"}, 174 179 {1, "imbin", rebin, "rebin image data by factor of N"}, 175 180 {1, "imclip", imclip, "clip values in an image to be within a range"}, … … 195 200 {1, "minterp", minterp, "interpolate image pixels"}, 196 201 {1, "iminterp", minterp, "interpolate image pixels"}, 202 {1, "matrix", matrix, "matrix math operations"}, 197 203 {1, "mkrgb", mkrgb, "convert 3 images to rgb jpeg (use Kapa for better control)"}, 198 204 {1, "mset", mset, "insert a vector in an image"}, -
trunk/Ohana/src/opihi/cmd.data/svd.c
r20936 r26891 57 57 /* use a bcopy instead? */ 58 58 59 // try C.R. Bond's version -- requires matrices in the form A[row][col] not A[row*Ncol + col] 60 if (1) { 61 int j; 62 double **a, **u, **v, *q; 63 ALLOCATE (a, double *, Ny); 64 ALLOCATE (u, double *, Ny); 65 ALLOCATE (v, double *, Ny); 66 for (i = 0; i < Ny; i++) { 67 ALLOCATE (a[i], double, Nx); 68 ALLOCATE (u[i], double, Nx); 69 ALLOCATE (v[i], double, Nx); 70 } 71 ALLOCATE (q, double, Nx); 72 73 for (j = 0; j < Ny; j++) { 74 for (i = 0; i < Nx; i++) { 75 a[j][i] = A[j*Nx + i]; 76 u[j][i] = 0; 77 v[j][i] = 0; 78 } 79 } 80 for (i = 0; i < Nx; i++) { 81 q[i] = 0; 82 } 83 84 status = svdcmp_bond_raw (Ny, Nx, 1, 1, FLT_EPSILON, 1e-6, a, q, u, v); 85 fprintf (stderr, "status: %d\n", status); 86 87 // copy u q v back to U W V: 88 for (j = 0; j < Ny; j++) { 89 for (i = 0; i < Nx; i++) { 90 U[j*Nx + i] = u[j][i]; 91 V[j*Nx + i] = v[j][i]; 92 } 93 } 94 for (i = 0; i < Nx; i++) { 95 W[i] = q[i]; 96 } 97 98 for (j = 0; j < Ny; j++) { 99 free(a[j]); 100 free(u[j]); 101 free(v[j]); 102 } 103 free (a); 104 free (u); 105 free (v); 106 free (q); 107 108 return TRUE; 109 } 110 59 111 status = svdcmp (U, W, V, Nx, Ny); 60 112 if (!status) { -
trunk/Ohana/src/opihi/include/data.h
r26258 r26891 89 89 int svdcmp (float *a, opihi_flt *w, float *v, int Nx, int Ny); 90 90 91 /* in svdcmp_bond_raw.c */ 92 int svdcmp_bond_raw(int m, int n, int withu, int withv, double eps, double tol, double **a, double *q, double **u, double **v); 93 91 94 /* mrqmin.c */ 92 95 opihi_flt mrqcof (opihi_flt *x, opihi_flt *y, opihi_flt *dy, int Npts, … … 162 165 void FreeBooks (void); 163 166 167 /* hermitian functions */ 168 double hermitian_polynomial (double x, int order); 169 double hermitian_00(double x); 170 double hermitian_01(double x); 171 double hermitian_02(double x); 172 double hermitian_03(double x); 173 double hermitian_04(double x); 174 double hermitian_05(double x); 175 double hermitian_06(double x); 176 double hermitian_07(double x); 177 double hermitian_08(double x); 178 double hermitian_09(double x); 179 double hermitian_10(double x); 180 164 181 # endif -
trunk/Ohana/src/opihi/include/pclient.h
r21153 r26891 52 52 void FreePclient (void); 53 53 void gotsignal (int signum); 54 void pipe_signal (int signum); 55 void pipe_signal_clear(void); 54 56 55 57 # define DTIME(A,B) ((A.tv_sec - B.tv_sec) + 1e-6*(A.tv_usec - B.tv_usec)) -
trunk/Ohana/src/opihi/lib.data/Makefile
r16117 r26891 20 20 $(SDIR)/fft.$(ARCH).o \ 21 21 $(SDIR)/svdcmp.$(ARCH).o \ 22 $(SDIR)/svdcmp_bond_raw.$(ARCH).o \ 22 23 $(SDIR)/convert.$(ARCH).o \ 23 24 $(SDIR)/bracket.$(ARCH).o \ … … 27 28 $(SDIR)/precess.$(ARCH).o \ 28 29 $(SDIR)/starfuncs.$(ARCH).o \ 30 $(SDIR)/hermitian.$(ARCH).o \ 29 31 $(SDIR)/gaussian.$(ARCH).o \ 30 32 $(SDIR)/graphtools.$(ARCH).o \ -
trunk/Ohana/src/opihi/lib.shell/stack_math.c
r20936 r26891 628 628 629 629 # define MS_FUNC(OP) { \ 630 if (V2->type == ' s') { \630 if (V2->type == 'S') { \ 631 631 opihi_flt M2 = V2[0].FltValue; \ 632 632 for (i = 0; i < Nx*Ny; i++, out++, M1++) { \ … … 635 635 break; \ 636 636 } \ 637 if (V2->type == ' S') { \637 if (V2->type == 's') { \ 638 638 opihi_int M2 = V2[0].IntValue; \ 639 639 for (i = 0; i < Nx*Ny; i++, out++, M1++) { \ … … 704 704 705 705 # define SM_FUNC(OP) { \ 706 if (V1->type == ' s') { \706 if (V1->type == 'S') { \ 707 707 opihi_flt M1 = V1[0].FltValue; \ 708 708 for (i = 0; i < Nx*Ny; i++, out++, M2++) { \ … … 711 711 break; \ 712 712 } \ 713 if (V1->type == ' S') { \713 if (V1->type == 's') { \ 714 714 opihi_int M1 = V1[0].IntValue; \ 715 715 for (i = 0; i < Nx*Ny; i++, out++, M2++) { \ -
trunk/Ohana/src/opihi/pclient/ChildOps.c
r26257 r26891 1 1 # include "pclient.h" 2 # include <sys/ioctl.h>3 # include <sys/types.h>4 # include <unistd.h>2 # include <sys/ioctl.h> 3 # include <sys/types.h> 4 # include <unistd.h> 5 5 // #include <stropts.h> 6 6 … … 67 67 case 0: /* pipe is closed */ 68 68 /** change child state? **/ 69 pipe_signal_clear(); 69 70 break; 70 71 default: /* data in pipe */ … … 81 82 case 0: /* pipe is closed */ 82 83 /** change child state? **/ 84 pipe_signal_clear(); 83 85 break; 84 86 default: /* data in pipe */ -
trunk/Ohana/src/opihi/pclient/pclient.c.in
r18123 r26891 46 46 47 47 /* ignore the history file. to change this, see, eg, mana.c */ 48 signal (SIGPIPE, gotsignal); 48 49 /* We do not want pclient to exit just because the connection to the 50 child process is broken. However, if the connection to the parent 51 process is broken, we should exit. To handle this, we define 52 pipe_signal() which tracks the number of times it has been called. 53 Every time an I/O operation on the child file descriptor raises this signal, 54 we need to manage the crashed child and then clear the count. Signals raised by 55 I/O to the parent do not result in clearing the count. If the count passes a maximum, 56 we exit pclient */ 57 58 signal (SIGPIPE, pipe_signal); 49 59 signal (SIGTSTP, gotsignal); 50 60 signal (SIGTTIN, gotsignal); … … 67 77 } 68 78 79 static int Npipe = 0; 80 81 void pipe_signal (int signum) { 82 Npipe ++; 83 if (Npipe > 100) { 84 exit (5); 85 } 86 gprint (GP_ERR, "closed pipe : did child process exit unexpectedly?\n"); 87 return; 88 } 89 90 void pipe_signal_clear(void) { 91 Npipe = 0; 92 } 93 69 94 void gotsignal (int signum) { 70 95 gprint (GP_ERR, "got signal : %d\n", signum);
Note:
See TracChangeset
for help on using the changeset viewer.
