Changeset 1195 for trunk/packages/vizservers/nanovis/nanovis.cpp
- Timestamp:
- Oct 28, 2008 2:18:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/nanovis.cpp
r1194 r1195 356 356 DoExit(int code) 357 357 { 358 if (NanoVis::debug_flag) { 359 fprintf(stderr, "in DoExit\n"); 360 } 358 361 removeAllData(); 359 362 NvExit(); … … 409 412 start = CVT2SECS(tv); 410 413 414 #ifdef notdef 411 415 if (NanoVis::debug_flag) { 412 fprintf(NanoVis::logfile, "(%s)\n", Tcl_DStringValue(dsPtr)); 413 } 416 fprintf(NanoVis::logfile, "%s\n", Tcl_DStringValue(dsPtr)); 417 fflush(NanoVis::logfile); 418 } 419 #endif 414 420 if (NanoVis::recfile != NULL) { 415 421 fprintf(NanoVis::recfile, "%s", Tcl_DStringValue(dsPtr)); … … 568 574 //glReadPixels(0, 0, width, height, GL_BGR, GL_UNSIGNED_BYTE, screen_buffer); // INSOO's 569 575 570 char prefix[200]; 571 sprintf(prefix, "nv>legend %s %g %g", volArg, min, max); 572 ppm_write(prefix); 573 write(0, "\n", 1); 574 576 if (!debug_flag) { 577 char prefix[200]; 578 sprintf(prefix, "nv>legend %s %g %g", volArg, min, max); 579 ppm_write(prefix); 580 write(0, "\n", 1); 581 } 575 582 plane_render->remove_plane(index); 576 583 resize_offscreen_buffer(old_width, old_height); … … 2101 2108 NanoVis::xinetd_listen(void) 2102 2109 { 2110 if (debug_flag) { 2111 fprintf(stderr, "in xinetd_listen\n"); 2112 } 2103 2113 int flags = fcntl(0, F_GETFL, 0); 2104 2114 fcntl(0, F_SETFL, flags & ~O_NONBLOCK); … … 2120 2130 // here. 2121 2131 // 2122 while (1) { 2132 if (debug_flag) { 2133 fprintf(stderr, "in xinetd_listen: check eof %d\n", feof(NanoVis::stdin)); 2134 } 2135 while (!feof(NanoVis::stdin)) { 2136 if (debug_flag) { 2137 fprintf(stderr, "in xinetd_listen: reading 1 char\n"); 2138 fflush(stderr); 2139 } 2123 2140 int c = fgetc(NanoVis::stdin); 2141 if (debug_flag) { 2142 fprintf(stderr, "in xinetd_listen: read %c,%x\n", c, c); 2143 fflush(stderr); 2144 } 2124 2145 char ch; 2125 2146 if (c <= 0) { … … 2132 2153 ch = (char)c; 2133 2154 Tcl_DStringAppend(&cmdbuffer, &ch, 1); 2134 2155 if (debug_flag) { 2156 fprintf(stderr, "in xinetd_listen: appending 1 char\n"); 2157 } 2135 2158 if (ch=='\n' && Tcl_CommandComplete(Tcl_DStringValue(&cmdbuffer))) { 2136 2159 break; … … 2148 2171 fcntl(0, F_SETFL, flags | O_NONBLOCK); 2149 2172 npass++; 2150 if (NanoVis::debug_flag) {2151 break;2152 }2153 2173 } 2154 2174 fcntl(0, F_SETFL, flags); … … 2167 2187 iov[2].iov_len = 1; 2168 2188 writev(0, iov, 3); 2189 if (debug_flag) { 2190 fprintf(stderr, "leaving xinetd_listen\n"); 2191 } 2169 2192 return; 2170 2193 } … … 2210 2233 write(0, rle, rle_size); //unsigned byte 2211 2234 #else 2212 NanoVis::ppm_write("nv>image -bytes"); 2213 #endif 2235 if (!debug_flag) { 2236 NanoVis::ppm_write("nv>image -bytes"); 2237 } 2238 #endif 2239 if (feof(NanoVis::stdin)) { 2240 exit(2); 2241 } 2242 if (debug_flag) { 2243 fprintf(stderr, "leaving xinetd_listen\n"); 2244 } 2214 2245 } 2215 2246
Note: See TracChangeset
for help on using the changeset viewer.