Changeset 2673 for trunk/gui/scripts


Ignore:
Timestamp:
Nov 14, 2011, 11:58:46 AM (13 years ago)
Author:
gah
Message:
 
Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r2672 r2673  
    7272    protected method Color2RGB { color }
    7373    protected method Euler2XYZ { theta phi psi }
     74    protected method StartWaiting {}
     75    protected method StopWaiting {}
    7476
    7577    private method Waiting { option widget }
     
    415417        flush $_sid
    416418    }
     419    return $_done($this)
     420}
     421
     422#
     423# ReceiveBytes --
     424#
     425#    Read some number of bytes from the visualization server.
     426#
     427itcl::body Rappture::VisViewer::StartWaiting {} {
    417428    after cancel $_afterId
    418429    set _afterId [after 500 [itcl::code $this SplashScreen on]]
    419     return $_done($this)
     430}
     431
     432itcl::body Rappture::VisViewer::StopWaiting {} {
     433    SplashScreen off
    420434}
    421435
     
    426440#
    427441itcl::body Rappture::VisViewer::ReceiveBytes { size } {
    428     SplashScreen off
    429442    if { ![CheckConnection] } {
    430443        return 0
     
    561574        set inner [frame $itk_component(plotarea).view.splash]
    562575        $inner configure -relief raised -bd 2
    563         label $inner.text1 -text "Rendering. Please Wait." \
     576        label $inner.text1 -text "Rendering, please wait." \
    564577            -font "Arial 10"
    565578        label $inner.icon
  • trunk/gui/scripts/vtkstreamlinesviewer.tcl

    r2671 r2673  
    8181    protected method Rotate {option x y}
    8282    protected method SendCmd {string}
     83    protected method SendCmdNoWait {string}
    8384    protected method Zoom {option}
    8485
     
    9899    private method EventuallyReseed { numPoints }
    99100    private method EventuallyRotate { q }
    100     private method EventuallyRequestLegend {}
    101101    private method EventuallySetCutplane { axis args }
    102102    private method GetImage { args }
     
    495495    set _start [clock clicks -milliseconds]
    496496    SendCmd "screen size $_width $_height"
    497     EventuallyRequestLegend
     497    set _legendPending 1
    498498
    499499    #SendCmd "imgflush"
     
    553553        set _cutplanePending 1
    554554        $_dispatcher event -after 100 !${axis}cutplane
    555     }
    556 }
    557 
    558 itcl::body Rappture::VtkStreamlinesViewer::EventuallyRequestLegend {} {
    559     if { !$_legendPending } {
    560         set _legendPending 1
    561555    }
    562556}
     
    875869itcl::body Rappture::VtkStreamlinesViewer::sendto { bytes } {
    876870    SendBytes "$bytes\n"
     871    StartWaiting
    877872}
    878873
     
    889884    } else {
    890885        SendBytes "$string\n"
     886        StartWaiting
     887    }
     888}
     889
     890#
     891# SendCmdNoWait
     892#
     893#       Send commands off to the rendering server.  If we're currently
     894#       sending data objects to the server, buffer the commands to be
     895#       sent later.
     896#
     897itcl::body Rappture::VtkStreamlinesViewer::SendCmdNoWait {string} {
     898    if { $_buffering } {
     899        append _outbuf $string "\n"
     900    } else {
     901        SendBytes "$string\n"
    891902    }
    892903}
     
    907918    array set info $args
    908919    set bytes [ReceiveBytes $info(-bytes)]
     920    StopWaiting
    909921    if { $info(-type) == "image" } {
    910922        if 0 {
     
    9891001    }
    9901002
     1003    set _buffering 1
     1004    set _legendPending 1
    9911005    # Turn on buffering of commands to the server.  We don't want to
    9921006    # be preempted by a server disconnect/reconnect (which automatically
    9931007    # generates a new call to Rebuild).   
    994     set _buffering 1
    9951008    set _width $w
    9961009    set _height $h
     
    11181131    # care.  We're finished here.
    11191132    blt::busy hold $itk_component(hull)
    1120     SendBytes $_outbuf;                       
     1133    sendto $_outbuf;                       
    11211134    blt::busy release $itk_component(hull)
    11221135    set _outbuf "";                        # Clear the buffer.               
     
    15091522                ChangeColormap $dataobj $comp $palette
    15101523            }
    1511             EventuallyRequestLegend
     1524            set _legendPending 1
    15121525        }
    15131526        "streamlines-opacity" {
     
    15531566                SendCmd "cutplane colormode $_colorMode ${name} $dataset"
    15541567            }
    1555             EventuallyRequestLegend
     1568            set _legendPending 1
    15561569        }
    15571570        default {
     
    15691582#
    15701583itcl::body Rappture::VtkStreamlinesViewer::RequestLegend {} {
    1571     puts stderr "RequestLegend"
    1572     set _legendPending 0
    15731584    set font "Arial 8"
    15741585    set lineht [font metrics $font -linespace]
     
    15901601        foreach {dataobj comp} [split $dataset -] break
    15911602        if { [info exists _dataset2style($dataset)] } {
    1592             SendCmd "legend $_dataset2style($dataset) $_colorMode $name {} $w $h 0"
     1603            SendCmdNoWait \
     1604                "legend $_dataset2style($dataset) $_colorMode $name {} $w $h 0"
    15931605            break;
    15941606        }
     
    25682580# ----------------------------------------------------------------------
    25692581itcl::body Rappture::VtkStreamlinesViewer::ReceiveLegend { colormap title vmin vmax size } {
     2582    set _legendPending 0
    25702583    puts stderr "ReceiveLegend colormap=$colormap title=$title range=$vmin,$vmax size=$size"
    25712584    set _limits(vmin) $vmin
Note: See TracChangeset for help on using the changeset viewer.