Changeset 3302


Ignore:
Timestamp:
Feb 17, 2013, 8:27:24 AM (12 years ago)
Author:
gah
Message:

fixes for clientdata output, fix streamlines to use vtkdata

Location:
branches/Rappture 1.2/gui/scripts
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/Rappture 1.2/gui/scripts/analyzer.tcl

    r3187 r3302  
    11851185# ----------------------------------------------------------------------
    11861186itcl::body Rappture::Analyzer::_isPdbTrajectory {data} {
    1187     if { [llength $data]  == 0 } {
     1187    if { [llength $data] == 0 } {
    11881188        return 0
    11891189    }
     
    12091209# ----------------------------------------------------------------------
    12101210itcl::body Rappture::Analyzer::_isLammpsTrajectory { data } {
    1211     if { [llength $data]  == 0 } {
     1211    if { [llength $data] == 0 } {
    12121212        return 0
    12131213    }
  • branches/Rappture 1.2/gui/scripts/field.tcl

    r3296 r3302  
    5353itcl::class Rappture::Field {
    5454    private variable _dim       0;      # Dimension of mesh
    55     private variable _xmlobj ""  ;      # ref to XML obj with device data
     55    private variable _xmlobj ""  ;      # ref to XML obj with field data
    5656    private variable _limits     ;      # maps box name => {z0 z1} limits
    5757    private variable _field ""
     
    5959    private variable _fieldUnits ""   ; # list of units of each field name.
    6060    private variable _fieldLabels ""  ; # list of labels of each field name.
    61     private variable _viewer            "auto"
     61    private variable _viewer            ""
     62    private variable _hints
    6263
    6364    constructor {xmlobj path} {
     
    568569# ----------------------------------------------------------------------
    569570itcl::body Rappture::Field::hints {{keyword ""}} {
    570     set hints(fieldnames)  $_fieldNames
    571     set hints(fieldunits)  $_fieldUnits
    572     set hints(fieldlabels) $_fieldLabels
    573     foreach {key path} {
    574         camera          camera.position
    575         color           about.color
    576         default         about.default
    577         group           about.group
    578         label           about.label
    579         fieldnames      about.fieldnames
    580         fieldunits      about.fieldunits
    581         fieldlabels     about.fieldlabels
    582         scale           about.scale
    583         seeds           about.seeds
    584         style           about.style
    585         toolId          tool.id
    586         toolName        tool.name
    587         toolTitle       tool.title
    588         toolRevision    tool.version.application.revision
    589         type            about.type
    590         xlabel          about.xaxis.label
    591         ylabel          about.yaxis.label
    592         zlabel          about.zaxis.label
    593         xunits          about.xaxis.units
    594         yunits          about.yaxis.units
    595         zunits          about.zaxis.units
    596         units           units
    597         updir           updir
    598         vectors         about.vectors
    599     } {
    600         set str [$_field get $path]
    601         if {"" != $str} {
    602             set hints($key) $str
    603         }
    604     }
    605     # Set tool and path hints
    606     set hints(tool) [$_xmlobj get tool.name]
    607     set hints(path) $_path
    608     if 0 {
    609         # to be compatible with curve objects
    610         set hints(xlabel) "Position"
    611     }
    612     if {[info exists hints(group)] && [info exists hints(label)]} {
    613         # pop-up help for each curve
    614         set hints(tooltip) $hints(label)
    615     }
    616 
    617     if {$keyword != ""} {
    618         if {[info exists hints($keyword)]} {
     571    if { ![info exists _hints] } {
     572        set _hints(fieldnames)  $_fieldNames
     573        set _hints(fieldunits)  $_fieldUnits
     574        set _hints(fieldlabels) $_fieldLabels
     575        foreach {key path} {
     576            camera          camera.position
     577            color           about.color
     578            default         about.default
     579            group           about.group
     580            label           about.label
     581            fieldnames      about.fieldnames
     582            fieldunits      about.fieldunits
     583            fieldlabels     about.fieldlabels
     584            scale           about.scale
     585            seeds           about.seeds
     586            style           about.style
     587            type            about.type
     588            xlabel          about.xaxis.label
     589            ylabel          about.yaxis.label
     590            zlabel          about.zaxis.label
     591            xunits          about.xaxis.units
     592            yunits          about.yaxis.units
     593            zunits          about.zaxis.units
     594            units           units
     595            updir           updir
     596            vectors         about.vectors
     597        } {
     598            set str [$_field get $path]
     599            if { "" != $str } {
     600                set _hints($key) $str
     601            }
     602        }
     603        foreach {key path} {
     604            toolid          tool.id
     605            toolname        tool.name
     606            toolcommand     tool.execute
     607            tooltitle       tool.title
     608            toolrevision    tool.version.application.revision
     609        } {
     610            set str [$_xmlobj get $path]
     611            if { "" != $str } {
     612                set _hints($key) $str
     613            }
     614        }
     615        # Set toolip and path hints
     616        set _hints(path) $_path
     617        if { [info exists _hints(group)] && [info exists _hints(label)] } {
     618            # pop-up help for each curve
     619            set _hints(tooltip) $_hints(label)
     620        }
     621    }
     622    if { $keyword != "" } {
     623        if {[info exists _hints($keyword)]} {
    619624            return $hints($keyword)
    620625        }
    621626        return ""
    622627    }
    623     return [array get hints]
     628    return [array get _hints]
    624629}
    625630
     
    10541059        incr _dim
    10551060    }
    1056     if { $_dim == 2 } {
    1057         set _viewer heightmap
    1058     } else {
    1059         set _viewer isosurface
     1061    if { $_viewer == "" } {
     1062        if { $_dim == 2 } {
     1063            set _viewer heightmap
     1064        } else {
     1065            set _viewer isosurface
     1066        }
    10601067    }
    10611068    set _comp2dims($cname) ${_dim}D
  • branches/Rappture 1.2/gui/scripts/molvisviewer.tcl

    r3296 r3302  
    8585    private variable _cell 0;           # Restore camera settings
    8686
    87     constructor { hostlist args } {
    88         Rappture::VisViewer::constructor $hostlist
     87    constructor { servers args } {
     88        Rappture::VisViewer::constructor $servers
    8989    } {
    9090        # defined below
     
    158158# CONSTRUCTOR
    159159# ----------------------------------------------------------------------
    160 itcl::body Rappture::MolvisViewer::constructor {hostlist args} {
     160itcl::body Rappture::MolvisViewer::constructor {servers args} {
    161161    set _serverType "pymol"
    162162
     
    203203    set _state(server) 1
    204204    set _state(client) 1
    205     set _hostlist $hostlist
    206205    set _reset 1
    207206
     
    11061105            # what data objects are using the renderer until be get here.
    11071106            global env
    1108             lappend data "hub" [exec hostname]
    1109             lappend data "viewer" "molvisviewer"
     1107            lappend out "hub" [exec hostname]
     1108            lappend out "viewer" "molvisviewer"
    11101109            if { [info exists env(USER)] } {
    1111                 lappend data "user" $env(USER)
     1110                lappend out "user" $env(USER)
    11121111            }
    11131112            if { [info exists env(SESSION)] } {
    1114                 lappend data "session" $env(SESSION)
     1113                lappend out "session" $env(SESSION)
    11151114            }
    1116             lappend data "tool_id" [$_first get tool.id]
    1117             lappend data "tool_name" [$_first get tool.name]
    1118             lappend data "tool_version" [$_first get tool.version]
    1119             lappend data "tool_title" [$_first get tool.title]
    1120             SendCmd "clientinfo $data"
     1115            set parent [$_first parent -as object]
     1116            while { $parent != "" } {
     1117                set xmlobj $parent
     1118                set parent [$parent parent -as object]
     1119            }
     1120            lappend out "tool_id" [$xmlobj get tool.id]
     1121            lappend out "tool_name" [$xmlobj get tool.name]
     1122            lappend out "tool_title" [$xmlobj get tool.title]
     1123            lappend out "tool_command" [$xmlobj get tool.execute]
     1124            lappend out "tool_revision" \
     1125                [$xmlobj get tool.version.application.revision]
     1126            SendCmd "clientinfo $out"
    11211127        }
    11221128
  • branches/Rappture 1.2/gui/scripts/nanovisviewer.tcl

    r3297 r3302  
    940940                    lappend out "session" $env(SESSION)
    941941                }
    942                 lappend out "tool_id" [$_first hints toolId]
     942                lappend out "tool_id"      [$_first hints toolId]
     943                lappend out "tool_name"    [$_first hints toolName]
    943944                lappend out "tool_version" [$_first hints toolRevision]
    944                 lappend out "tool_title" [$_first hints toolTitle]
     945                lappend out "tool_title"   [$_first hints toolTitle]
    945946                lappend out "tool_dataset" [$_first hints label]
    946947                SendCmd "clientinfo [list $out]"
  • branches/Rappture 1.2/gui/scripts/resultviewer.tcl

    r3298 r3302  
    2424    itk_option define -simulatecommand simulateCommand SimulateCommand ""
    2525
    26     constructor {args} { # defined below }
    27     destructor { # defined below }
    28 
     26    constructor {args} {
     27        # defined below
     28    }
     29    destructor {
     30        # defined below
     31    }
    2932    public method add {index xmlobj path}
    3033    public method clear {{index ""}}
  • branches/Rappture 1.2/gui/scripts/tool.tcl

    r3284 r3302  
    192192            set cmd [linsert $cmd 0 submit --local]
    193193        }
     194        $_xmlobj put tool.execute $cmd
    194195
    195196        # starting job...
  • branches/Rappture 1.2/gui/scripts/visviewer.tcl

    r3299 r3302  
    4848    protected variable _debugConsole 0
    4949
    50     constructor { hostlist args } {
     50    constructor { servers args } {
    5151        # defined below
    5252    }
     
    5555    }
    5656    # Used internally only.
    57     private method Shuffle { hostlist }
     57    private method Shuffle { servers }
    5858    private method ReceiveHelper {}
    5959    private method ServerDown {}
     
    7272    protected method SendEcho { channel {data ""} }
    7373    protected method ReceiveEcho { channel {data ""} }
    74     protected method Connect { hostlist }
     74    protected method Connect { servers }
    7575    protected method Disconnect {}
    7676    protected method IsConnected {}
     
    131131# CONSTRUCTOR
    132132# ----------------------------------------------------------------------
    133 itcl::body Rappture::VisViewer::constructor { hostlist args } {
     133itcl::body Rappture::VisViewer::constructor { servers args } {
    134134
    135135    Rappture::dispatcher _dispatcher
     
    141141    $_dispatcher register !waiting
    142142
    143     CheckNameList $hostlist
    144     set _hostlist $hostlist
     143    CheckNameList $servers
    145144    set _buffer(in) ""
    146145    set _buffer(out) ""
     
    235234#    (no I/O with the server) for some specified time.
    236235#
    237 itcl::body Rappture::VisViewer::Connect { hostlist } {
     236itcl::body Rappture::VisViewer::Connect { servers } {
    238237    blt::busy hold $itk_component(hull) -cursor watch
    239238
    240239    puts stderr "server type is $_serverType"
    241     foreach server [Shuffle $hostlist] {
     240    foreach server [Shuffle $servers] {
    242241        puts stderr "connecting to $server..."
    243242        foreach {hostname port} [split $server ":"] break
  • branches/Rappture 1.2/gui/scripts/vtkheightmapviewer.tcl

    r3301 r3302  
    984984            global env
    985985
    986 puts stderr "sending clientinfo"
    987             lappend data "hub" [exec hostname]
    988             lappend data "viewer" "vtkheightmapviewer"
     986            lappend out "hub" [exec hostname]
     987            lappend out "viewer" "vtkheightmapviewer"
    989988            if { [info exists env(USER)] } {
    990                 lappend data "user" $env(USER)
     989                lappend out "user" $env(USER)
    991990            }
    992991            if { [info exists env(SESSION)] } {
    993                 lappend data "session" $env(SESSION)
     992                lappend out "session" $env(SESSION)
    994993            }
    995             lappend data "tool_id" [$_first hints toolId]
    996             lappend data "tool_version" [$_first hints toolRevision]
    997             lappend data "tool_title" [$_first hints toolTitle]
    998             lappend data "tool_dataset" [$_first hints label]
    999             SendCmd "clientinfo [list $data]"
     994            lappend out "tool_id"      [$_first hints toolId]
     995            lappend out "tool_name"    [$_first hints toolName]
     996            lappend out "tool_version" [$_first hints toolRevision]
     997            lappend out "tool_title"   [$_first hints toolTitle]
     998            lappend out "tool_dataset" [$_first hints label]
     999            SendCmd "clientinfo [list $out]"
    10001000        }
    10011001        set _fieldNames [$_first hints fieldnames]
  • branches/Rappture 1.2/gui/scripts/vtkisosurfaceviewer.tcl

    r3301 r3302  
    10191019                lappend data "session" $env(SESSION)
    10201020            }
    1021             lappend data "tool_id" [$_first hints toolId]
     1021            lappend data "tool_id"      [$_first hints toolId]
     1022            lappend data "tool_name"    [$_first hints toolName]
    10221023            lappend data "tool_version" [$_first hints toolRevision]
    1023             lappend data "tool_title" [$_first hints toolTitle]
     1024            lappend data "tool_title"   [$_first hints toolTitle]
    10241025            lappend data "tool_dataset" [$_first hints label]
    10251026            SendCmd "clientinfo [list $data]"
  • branches/Rappture 1.2/gui/scripts/vtkstreamlinesviewer.tcl

    r3297 r3302  
    10411041            set tag $dataobj-$comp
    10421042            if { ![info exists _datasets($tag)] } {
    1043                 set bytes [$dataobj blob $comp]
     1043                set bytes [$dataobj vtkdata $comp]
    10441044                set length [string length $bytes]
    10451045                append _outbuf "dataset add $tag data follows $length\n"
     
    10601060        if { $location != "" } {
    10611061            array set view $location
    1062         }
    1063         if 1 {
    1064             # Tell the server the name of the tool, the version, and dataset
    1065             # that we are rendering.  Have to do it here because we don't know
    1066             # what data objects are using the renderer until be get here.
    1067             global env
    1068 
    1069             lappend data "hub" [exec hostname]
    1070             lappend data "viewer" "vtkstreamlinesviewer"
    1071             if { [info exists env(USER)] } {
    1072                 lappend data "user" $env(USER)
    1073             }
    1074             if { [info exists env(SESSION)] } {
    1075                 lappend data "session" $env(SESSION)
    1076             }
    1077             lappend data "tool_id"      [$_first hints toolId]
    1078             lappend data "tool_version" [$_first hints toolRevision]
    1079             lappend data "tool_title"   [$_first hints toolTitle]
    1080             lappend data "tool_dataset" [$_first hints label]
    1081             SendCmd "clientinfo $data"
    10821062        }
    10831063        foreach axis { x y z } {
     
    11411121                lappend data "session" $env(SESSION)
    11421122            }
    1143             lappend data tool [$_first hints toolId]
    1144             lappend data version [$_first hints toolRevision]
    1145             lappend data dataset [$_first hints label]
    1146             SendCmd "clientinfo $data"
     1123            lappend data "tool_id"      [$_first hints toolId]
     1124            lappend data "tool_name"    [$_first hints toolName]
     1125            lappend data "tool_version" [$_first hints toolRevision]
     1126            lappend data "tool_title"   [$_first hints toolTitle]
     1127            lappend data "tool_dataset" [$_first hints label]
     1128            SendCmd "clientinfo [list $data]"
    11471129        }
    11481130        InitSettings streamlines-seeds streamlines-opacity \
Note: See TracChangeset for help on using the changeset viewer.