Ignore:
Timestamp:
Oct 28, 2008 2:18:37 PM (16 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r1194 r1195  
    356356DoExit(int code)
    357357{
     358    if (NanoVis::debug_flag) {
     359        fprintf(stderr, "in DoExit\n");
     360    }
    358361    removeAllData();
    359362    NvExit();
     
    409412    start = CVT2SECS(tv);
    410413
     414#ifdef notdef
    411415    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
    414420    if (NanoVis::recfile != NULL) {
    415421        fprintf(NanoVis::recfile, "%s", Tcl_DStringValue(dsPtr));
     
    568574    //glReadPixels(0, 0, width, height, GL_BGR, GL_UNSIGNED_BYTE, screen_buffer); // INSOO's
    569575
    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    }
    575582    plane_render->remove_plane(index);
    576583    resize_offscreen_buffer(old_width, old_height);
     
    21012108NanoVis::xinetd_listen(void)
    21022109{
     2110    if (debug_flag) {
     2111        fprintf(stderr, "in xinetd_listen\n");
     2112    }
    21032113    int flags = fcntl(0, F_GETFL, 0);
    21042114    fcntl(0, F_SETFL, flags & ~O_NONBLOCK);
     
    21202130        //  here.
    21212131        //
    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            }
    21232140            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            }
    21242145            char ch;
    21252146            if (c <= 0) {
     
    21322153            ch = (char)c;
    21332154            Tcl_DStringAppend(&cmdbuffer, &ch, 1);
    2134 
     2155            if (debug_flag) {
     2156                fprintf(stderr, "in xinetd_listen: appending 1 char\n");
     2157            }
    21352158            if (ch=='\n' && Tcl_CommandComplete(Tcl_DStringValue(&cmdbuffer))) {
    21362159                break;
     
    21482171        fcntl(0, F_SETFL, flags | O_NONBLOCK);
    21492172        npass++;
    2150         if (NanoVis::debug_flag) {
    2151            break;
    2152         }
    21532173    }
    21542174    fcntl(0, F_SETFL, flags);
     
    21672187        iov[2].iov_len = 1;
    21682188        writev(0, iov, 3);
     2189        if (debug_flag) {
     2190            fprintf(stderr, "leaving xinetd_listen\n");
     2191        }
    21692192        return;
    21702193    }
     
    22102233    write(0, rle, rle_size);    //unsigned byte
    22112234#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    }
    22142245}
    22152246
Note: See TracChangeset for help on using the changeset viewer.