Ignore:
Timestamp:
Dec 8, 2010, 2:47:15 PM (14 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/gui/scripts/heightmapviewer.tcl

    r1923 r1985  
    103103    private variable _resizePending 0
    104104    private variable _resizeLegendPending 0
     105    private variable _frame 0;          # Current frame number.
    105106}
    106107
     
    508509# ----------------------------------------------------------------------
    509510itcl::body Rappture::HeightmapViewer::Connect {} {
     511    global readyForNextFrame
     512    set readyForNextFrame 1
    510513    Disconnect
    511514    set _hosts [GetServerList "nanovis"]
     
    529532    set _outbuf ""
    530533    # disconnected -- no more data sitting on server
     534    global readyForNextFrame
     535    set readyForNextFrame 1
    531536}
    532537
     
    557562# ----------------------------------------------------------------------
    558563itcl::body Rappture::HeightmapViewer::ReceiveImage { args } {
     564    global readyForNextFrame
     565    set readyForNextFrame 1
    559566    if {![IsConnected]} {
    560567        return
     
    565572    array set info $args
    566573    set bytes [ReceiveBytes $info(-bytes)]
    567     ReceiveEcho <<line "<read $info(-bytes) bytes"
     574    ReceiveEcho <<line "<read $info(-bytes) bytes args=$args"
     575 puts stderr "<read $info(-bytes) bytes"
    568576    if { $info(-type) == "image" } {
    569577        $_image(plot) configure -data $bytes
    570578        ReceiveEcho <<line "<read for [image width $_image(plot)]x[image height $_image(plot)] image>"
     579 puts stderr "<read for [image width $_image(plot)]x[image height $_image(plot)] image>"
    571580    } elseif { $info(type) == "print" } {
    572581        set tag $this-print-$info(-token)
     
    727736    SendBytes $_outbuf;                 
    728737    blt::busy release $itk_component(hull)
     738
     739    # The "readyForNextFrame" variable throttles the sequence play rate.
     740    global readyForNextFrame
     741    set readyForNextFrame 0;            # Don't advance to the next frame
     742                                        # until we get an image.
    729743    set _buffering 0;                   # Turn off buffering.
    730744    set _outbuf "";                     # Clear the buffer.             
Note: See TracChangeset for help on using the changeset viewer.