Changeset 3302
- Timestamp:
- Feb 17, 2013, 8:27:24 AM (12 years ago)
- Location:
- branches/Rappture 1.2/gui/scripts
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Rappture 1.2/gui/scripts/analyzer.tcl
r3187 r3302 1185 1185 # ---------------------------------------------------------------------- 1186 1186 itcl::body Rappture::Analyzer::_isPdbTrajectory {data} { 1187 if { [llength $data] 1187 if { [llength $data] == 0 } { 1188 1188 return 0 1189 1189 } … … 1209 1209 # ---------------------------------------------------------------------- 1210 1210 itcl::body Rappture::Analyzer::_isLammpsTrajectory { data } { 1211 if { [llength $data] 1211 if { [llength $data] == 0 } { 1212 1212 return 0 1213 1213 } -
branches/Rappture 1.2/gui/scripts/field.tcl
r3296 r3302 53 53 itcl::class Rappture::Field { 54 54 private variable _dim 0; # Dimension of mesh 55 private variable _xmlobj "" ; # ref to XML obj with devicedata55 private variable _xmlobj "" ; # ref to XML obj with field data 56 56 private variable _limits ; # maps box name => {z0 z1} limits 57 57 private variable _field "" … … 59 59 private variable _fieldUnits "" ; # list of units of each field name. 60 60 private variable _fieldLabels "" ; # list of labels of each field name. 61 private variable _viewer "auto" 61 private variable _viewer "" 62 private variable _hints 62 63 63 64 constructor {xmlobj path} { … … 568 569 # ---------------------------------------------------------------------- 569 570 itcl::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)]} { 619 624 return $hints($keyword) 620 625 } 621 626 return "" 622 627 } 623 return [array get hints]628 return [array get _hints] 624 629 } 625 630 … … 1054 1059 incr _dim 1055 1060 } 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 } 1060 1067 } 1061 1068 set _comp2dims($cname) ${_dim}D -
branches/Rappture 1.2/gui/scripts/molvisviewer.tcl
r3296 r3302 85 85 private variable _cell 0; # Restore camera settings 86 86 87 constructor { hostlistargs } {88 Rappture::VisViewer::constructor $ hostlist87 constructor { servers args } { 88 Rappture::VisViewer::constructor $servers 89 89 } { 90 90 # defined below … … 158 158 # CONSTRUCTOR 159 159 # ---------------------------------------------------------------------- 160 itcl::body Rappture::MolvisViewer::constructor { hostlistargs} {160 itcl::body Rappture::MolvisViewer::constructor {servers args} { 161 161 set _serverType "pymol" 162 162 … … 203 203 set _state(server) 1 204 204 set _state(client) 1 205 set _hostlist $hostlist206 205 set _reset 1 207 206 … … 1106 1105 # what data objects are using the renderer until be get here. 1107 1106 global env 1108 lappend data"hub" [exec hostname]1109 lappend data"viewer" "molvisviewer"1107 lappend out "hub" [exec hostname] 1108 lappend out "viewer" "molvisviewer" 1110 1109 if { [info exists env(USER)] } { 1111 lappend data"user" $env(USER)1110 lappend out "user" $env(USER) 1112 1111 } 1113 1112 if { [info exists env(SESSION)] } { 1114 lappend data"session" $env(SESSION)1113 lappend out "session" $env(SESSION) 1115 1114 } 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" 1121 1127 } 1122 1128 -
branches/Rappture 1.2/gui/scripts/nanovisviewer.tcl
r3297 r3302 940 940 lappend out "session" $env(SESSION) 941 941 } 942 lappend out "tool_id" [$_first hints toolId] 942 lappend out "tool_id" [$_first hints toolId] 943 lappend out "tool_name" [$_first hints toolName] 943 944 lappend out "tool_version" [$_first hints toolRevision] 944 lappend out "tool_title" [$_first hints toolTitle]945 lappend out "tool_title" [$_first hints toolTitle] 945 946 lappend out "tool_dataset" [$_first hints label] 946 947 SendCmd "clientinfo [list $out]" -
branches/Rappture 1.2/gui/scripts/resultviewer.tcl
r3298 r3302 24 24 itk_option define -simulatecommand simulateCommand SimulateCommand "" 25 25 26 constructor {args} { # defined below } 27 destructor { # defined below } 28 26 constructor {args} { 27 # defined below 28 } 29 destructor { 30 # defined below 31 } 29 32 public method add {index xmlobj path} 30 33 public method clear {{index ""}} -
branches/Rappture 1.2/gui/scripts/tool.tcl
r3284 r3302 192 192 set cmd [linsert $cmd 0 submit --local] 193 193 } 194 $_xmlobj put tool.execute $cmd 194 195 195 196 # starting job... -
branches/Rappture 1.2/gui/scripts/visviewer.tcl
r3299 r3302 48 48 protected variable _debugConsole 0 49 49 50 constructor { hostlistargs } {50 constructor { servers args } { 51 51 # defined below 52 52 } … … 55 55 } 56 56 # Used internally only. 57 private method Shuffle { hostlist}57 private method Shuffle { servers } 58 58 private method ReceiveHelper {} 59 59 private method ServerDown {} … … 72 72 protected method SendEcho { channel {data ""} } 73 73 protected method ReceiveEcho { channel {data ""} } 74 protected method Connect { hostlist}74 protected method Connect { servers } 75 75 protected method Disconnect {} 76 76 protected method IsConnected {} … … 131 131 # CONSTRUCTOR 132 132 # ---------------------------------------------------------------------- 133 itcl::body Rappture::VisViewer::constructor { hostlistargs } {133 itcl::body Rappture::VisViewer::constructor { servers args } { 134 134 135 135 Rappture::dispatcher _dispatcher … … 141 141 $_dispatcher register !waiting 142 142 143 CheckNameList $hostlist 144 set _hostlist $hostlist 143 CheckNameList $servers 145 144 set _buffer(in) "" 146 145 set _buffer(out) "" … … 235 234 # (no I/O with the server) for some specified time. 236 235 # 237 itcl::body Rappture::VisViewer::Connect { hostlist} {236 itcl::body Rappture::VisViewer::Connect { servers } { 238 237 blt::busy hold $itk_component(hull) -cursor watch 239 238 240 239 puts stderr "server type is $_serverType" 241 foreach server [Shuffle $ hostlist] {240 foreach server [Shuffle $servers] { 242 241 puts stderr "connecting to $server..." 243 242 foreach {hostname port} [split $server ":"] break -
branches/Rappture 1.2/gui/scripts/vtkheightmapviewer.tcl
r3301 r3302 984 984 global env 985 985 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" 989 988 if { [info exists env(USER)] } { 990 lappend data"user" $env(USER)989 lappend out "user" $env(USER) 991 990 } 992 991 if { [info exists env(SESSION)] } { 993 lappend data"session" $env(SESSION)992 lappend out "session" $env(SESSION) 994 993 } 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]" 1000 1000 } 1001 1001 set _fieldNames [$_first hints fieldnames] -
branches/Rappture 1.2/gui/scripts/vtkisosurfaceviewer.tcl
r3301 r3302 1019 1019 lappend data "session" $env(SESSION) 1020 1020 } 1021 lappend data "tool_id" [$_first hints toolId] 1021 lappend data "tool_id" [$_first hints toolId] 1022 lappend data "tool_name" [$_first hints toolName] 1022 1023 lappend data "tool_version" [$_first hints toolRevision] 1023 lappend data "tool_title" [$_first hints toolTitle]1024 lappend data "tool_title" [$_first hints toolTitle] 1024 1025 lappend data "tool_dataset" [$_first hints label] 1025 1026 SendCmd "clientinfo [list $data]" -
branches/Rappture 1.2/gui/scripts/vtkstreamlinesviewer.tcl
r3297 r3302 1041 1041 set tag $dataobj-$comp 1042 1042 if { ![info exists _datasets($tag)] } { 1043 set bytes [$dataobj blob$comp]1043 set bytes [$dataobj vtkdata $comp] 1044 1044 set length [string length $bytes] 1045 1045 append _outbuf "dataset add $tag data follows $length\n" … … 1060 1060 if { $location != "" } { 1061 1061 array set view $location 1062 }1063 if 1 {1064 # Tell the server the name of the tool, the version, and dataset1065 # that we are rendering. Have to do it here because we don't know1066 # what data objects are using the renderer until be get here.1067 global env1068 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"1082 1062 } 1083 1063 foreach axis { x y z } { … … 1141 1121 lappend data "session" $env(SESSION) 1142 1122 } 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]" 1147 1129 } 1148 1130 InitSettings streamlines-seeds streamlines-opacity \
Note: See TracChangeset
for help on using the changeset viewer.