Changeset 1249 for trunk


Ignore:
Timestamp:
Dec 1, 2008 12:50:26 PM (15 years ago)
Author:
gah
Message:

Fix for interrupted nanovis session

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/nanovisviewer.tcl

    r1248 r1249  
    862862    set outbuf_ ""
    863863
    864     $_dispatcher event -idle !legend
     864    #_fixLegend
     865    #$_dispatcher event -idle !legend
    865866}
    866867
     
    926927#       "_rebuild", "add", etc.
    927928#
    928 itcl::body Rappture::NanovisViewer::_ReceiveLegend { ivol vmin vmax size } {
     929itcl::body Rappture::NanovisViewer::_ReceiveLegend { tf vmin vmax size } {
    929930    if { ![isconnected] } {
    930931        return
     
    937938    set w [winfo width $c]
    938939    set h [winfo height $c]
    939     foreach { dataobj comp } $_id2obj($ivol) break
     940    #foreach { dataobj comp } $_id2obj($ivol) break
    940941    set lx 10
    941942    set ly [expr {$h - 1}]
     
    952953    }
    953954    # Display the markers used by the active transfer function.
    954     set tf $activeTf_
     955    #set tf $activeTf_
    955956
    956957    array set limits [GetLimits $tf]
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r1248 r1249  
    21672167
    21682168    int status = TCL_OK;
    2169     int npass = 0;
    21702169
    21712170    //
    21722171    //  Read and execute as many commands as we can from stdin...
    21732172    //
     2173    bool isComplete = false;
    21742174    while (status == TCL_OK) {
    21752175        //
     
    21902190            char ch;
    21912191            if (c <= 0) {
    2192                 if (npass == 0) {
    2193                     DoExit(0);
    2194                 } else {
     2192                if (errno == EWOULDBLOCK) {
    21952193                    break;
    2196                 }
     2194                }
     2195                DoExit(0);
    21972196            }
    21982197            ch = (char)c;
    21992198            Tcl_DStringAppend(&cmdbuffer, &ch, 1);
    2200             if (ch=='\n' && Tcl_CommandComplete(Tcl_DStringValue(&cmdbuffer))) {
    2201                 break;
     2199            if (ch == '\n') {
     2200                isComplete = Tcl_CommandComplete(Tcl_DStringValue(&cmdbuffer));
     2201                if (isComplete) {
     2202                    break;
     2203                }
    22022204            }
    22032205        }
     
    22072209        }
    22082210
    2209         // back to original flags during command evaluation...
    2210         fcntl(0, F_SETFL, flags & ~O_NONBLOCK);
    2211         status = ExecuteCommand(interp, &cmdbuffer);
    2212         // non-blocking for next read -- we might not get anything
    2213         fcntl(0, F_SETFL, flags | O_NONBLOCK);
    2214         npass++;
     2211        if (isComplete) {
     2212            // back to original flags during command evaluation...
     2213            fcntl(0, F_SETFL, flags & ~O_NONBLOCK);
     2214            status = ExecuteCommand(interp, &cmdbuffer);
     2215            // non-blocking for next read -- we might not get anything
     2216            fcntl(0, F_SETFL, flags | O_NONBLOCK);
     2217            isComplete = false;
     2218        }
    22152219    }
    22162220    fcntl(0, F_SETFL, flags);
Note: See TracChangeset for help on using the changeset viewer.