Changeset 1985 for branches/blt4


Ignore:
Timestamp:
Dec 8, 2010 2:47:15 PM (14 years ago)
Author:
gah
Message:
 
Location:
branches/blt4/gui/scripts
Files:
2 edited

Legend:

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

    r1941 r1985  
    244244                        set dlist [linsert $dlist 0 $dataobj]
    245245                    }
    246 
    247246                    # generate the comma-separated value data for these objects
     247
     248                    # This is at least better than what was there.
     249                    # For each datatable object convert the values
     250                    # in the tree by loading it into a blt::datatable
     251                    # and then exporting the comma separated values
    248252                    set csvdata ""
    249253                    foreach dataobj $dlist {
     254                        set tree [$dataobj values]
     255                        set d0 [blt::datatable create]
     256                        package require blt_datatable_tree
     257                        $d0 import tree $tree 0
    250258                        append csvdata "[string repeat - 60]\n"
    251259                        append csvdata " [$dataobj hints label]\n"
     
    259267                        }
    260268                        append csvdata "[string repeat - 60]\n"
    261 
    262                         append csvdata "[$dataobj hints xlabel], [$dataobj hints ylabel]\n"
    263                         set first 1
    264                         foreach comp [$dataobj components] {
    265                             if {!$first} {
    266                                 # blank line between components
    267                                 append csvdata "\n"
    268                             }
    269                             set xv [$dataobj mesh $comp]
    270                             set yv [$dataobj values $comp]
    271                             foreach x [$xv values] y [$yv values] {
    272                                 append csvdata [format "%20.15g, %20.15g\n" $x $y]
    273                             }
    274                             set first 0
    275                         }
     269                        append csvdata [$d0 export csv -columnlabels]
    276270                        append csvdata "\n"
     271                        blt::datatable destroy $d0
    277272                    }
    278273                    return [list .txt $csvdata]
  • 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.