Changeset 6 for trunk/gui/scripts
- Timestamp:
- Mar 23, 2005 8:19:29 PM (19 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/analyzer.tcl
r1 r6 258 258 # ---------------------------------------------------------------------- 259 259 itcl::configbody Rappture::Analyzer::tool { 260 if {![Rappture:: Library::valid $itk_option(-tool)]} {260 if {![Rappture::library isvalid $itk_option(-tool)]} { 261 261 error "bad value \"$itk_option(-tool)\": should be Rappture::Library" 262 262 } … … 276 276 itcl::configbody Rappture::Analyzer::device { 277 277 if {$itk_option(-device) != "" 278 && ![Rappture:: Library::valid $itk_option(-device)]} {278 && ![Rappture::library isvalid $itk_option(-device)]} { 279 279 error "bad value \"$itk_option(-device)\": should be Rappture::Library" 280 280 } … … 289 289 # ---------------------------------------------------------------------- 290 290 itcl::configbody Rappture::Analyzer::analysis { 291 if {![Rappture:: Library::valid $itk_option(-analysis)]} {291 if {![Rappture::library isvalid $itk_option(-analysis)]} { 292 292 error "bad value \"$itk_option(-analysis)\": should be Rappture::Library" 293 293 } … … 299 299 300 300 set counter 0 301 foreach item [$itk_option(-analysis) get -children] {301 foreach item [$itk_option(-analysis) children] { 302 302 switch -glob -- $item { 303 303 xyplot* { … … 311 311 312 312 set _widgets($item) [Rappture::Xyplot $page.#auto \ 313 -layout [$itk_option(-analysis) get -object $item]]313 -layout [$itk_option(-analysis) element -flavor object $item]] 314 314 pack $_widgets($item) -expand yes -fill both 315 315 } -
trunk/gui/scripts/curve.tcl
r1 r6 38 38 # ---------------------------------------------------------------------- 39 39 itcl::body Rappture::Curve::constructor {libobj path} { 40 if {![Rappture:: Library::valid $libobj]} {40 if {![Rappture::library isvalid $libobj]} { 41 41 error "bad value \"$libobj\": should be LibraryObj" 42 42 } 43 43 set _libobj $libobj 44 set _curve [$libobj get -object $path]44 set _curve [$libobj element -flavor object $path] 45 45 46 46 # build up vectors for various components of the curve … … 144 144 # vectors for each part. 145 145 # 146 set max [$_curve get -count component] 147 for {set i 0} {$i < $max} {incr i} { 146 foreach cname [$_curve children -type component] { 148 147 set xv "" 149 148 set yv "" 150 149 151 set xydata [$_curve get component$i.xy]150 set xydata [$_curve get $cname.xy] 152 151 if {"" != $xydata} { 153 152 set xv [blt::vector create x$_counter] … … 163 162 164 163 if {$xv != "" && $yv != ""} { 165 set _comp2vecs( component$i) [list $xv $yv]164 set _comp2vecs($cname) [list $xv $yv] 166 165 incr _counter 167 166 } -
trunk/gui/scripts/deviceLayout1D.tcl
r1 r6 182 182 # see if any of the slabs has a label 183 183 if {$_device != ""} { 184 foreach nn [$_device get -children recipe] {184 foreach nn [$_device children recipe] { 185 185 if {"" != [$_device get recipe.$nn.label]} { 186 186 set extra [expr {1.2*[font metrics $fnt -linespace]}] … … 192 192 193 193 # a little extra height for the molecule image 194 if { [$_device get -existsrecipe.molecule]} {194 if {"" != [$_device element recipe.molecule]} { 195 195 set h [expr {$h+15}] 196 196 } … … 210 210 set z 0 211 211 if {$_device != ""} { 212 foreach nn [$_device get -children recipe] {212 foreach nn [$_device children recipe] { 213 213 switch -glob -- $nn { 214 214 slab* - molecule* { … … 310 310 set h [expr {[winfo height $c]-1}] 311 311 # a little extra height for the molecule image 312 if { [$_device get -existsrecipe.molecule]} {312 if {"" != [$_device element recipe.molecule]} { 313 313 set h [expr {$h-15}] 314 314 } … … 361 361 set h [expr {[winfo height $c]-1}] 362 362 # a little extra height for the molecule image 363 if { [$_device get -existsrecipe.molecule]} {363 if {"" != [$_device element recipe.molecule]} { 364 364 set h [expr {$h-15}] 365 365 } … … 395 395 set h [expr {[winfo height $c]-1}] 396 396 # a little extra height for the molecule image 397 if { [$_device get -existsrecipe.molecule]} {397 if {"" != [$_device element recipe.molecule]} { 398 398 set h [expr {$h-15}] 399 399 } … … 448 448 # 449 449 if {"" != $_device} { 450 set label [$_device get "$elem.label"]450 set label [$_device get $elem.label] 451 451 if {"" != $label} { 452 452 set y [expr {$y-0.5*$lh}] … … 491 491 itcl::configbody Rappture::DeviceLayout1D::library { 492 492 if {$itk_option(-library) != ""} { 493 if {![Rappture:: Library::valid $itk_option(-library)]} {493 if {![Rappture::library isvalid $itk_option(-library)]} { 494 494 error "bad value \"$itk_option(-library)\": should be Rappture::Library" 495 495 } … … 508 508 itcl::configbody Rappture::DeviceLayout1D::device { 509 509 if {$itk_option(-device) != ""} { 510 if {![Rappture:: Library::valid $itk_option(-device)]} {510 if {![Rappture::library isvalid $itk_option(-device)]} { 511 511 error "bad value \"$itk_option(-device)\": should be Rappture::Library" 512 512 } -
trunk/gui/scripts/deviceViewer1D.tcl
r1 r6 186 186 # 187 187 if {$_device != ""} { 188 foreach nn [$_device get -children] {188 foreach nn [$_device children] { 189 189 if {[string match field* $nn]} { 190 190 set name [$_device get $nn.label] … … 516 516 itcl::body Rappture::DeviceViewer1D::_controlCreate {container libObj path} { 517 517 set presets "" 518 set npre [$libObj get -count $path.preset] 519 for {set i 0} {$i < $npre} {incr i} { 518 foreach pre [$libObj children -type preset $path] { 520 519 lappend presets \ 521 [$libObj get $path. preset$i.value] \522 [$libObj get $path. preset$i.label]520 [$libObj get $path.$pre.value] \ 521 [$libObj get $path.$pre.label] 523 522 } 524 523 … … 606 605 itcl::configbody Rappture::DeviceViewer1D::device { 607 606 if {$itk_option(-device) != ""} { 608 if {![Rappture:: Library::valid $itk_option(-device)]} {607 if {![Rappture::library isvalid $itk_option(-device)]} { 609 608 error "bad value \"$itk_option(-device)\": should be Rappture::Library" 610 609 } … … 623 622 itcl::configbody Rappture::DeviceViewer1D::tool { 624 623 if {$itk_option(-tool) != ""} { 625 if {![Rappture:: Library::valid $itk_option(-tool)]} {624 if {![Rappture::library isvalid $itk_option(-tool)]} { 626 625 error "bad value \"$itk_option(-tool)\": should be Rappture::Library" 627 626 } -
trunk/gui/scripts/field.tcl
r1 r6 43 43 # ---------------------------------------------------------------------- 44 44 itcl::body Rappture::Field::constructor {devobj libobj path} { 45 if {![Rappture:: Library::valid $devobj]} {45 if {![Rappture::library isvalid $devobj]} { 46 46 error "bad value \"$devobj\": should be LibraryObj" 47 47 } 48 if {![Rappture:: Library::valid $libobj]} {48 if {![Rappture::library isvalid $libobj]} { 49 49 error "bad value \"$libobj\": should be LibraryObj" 50 50 } 51 51 set _device $devobj 52 52 set _libobj $libobj 53 set _field [$libobj get -object $path]53 set _field [$libobj element -flavor object $path] 54 54 set _units [$_field get units] 55 55 56 56 # determine the overall size of the device 57 57 set z0 [set z1 0] 58 foreach elem [$_device get -children recipe] {58 foreach elem [$_device children recipe] { 59 59 switch -glob -- $elem { 60 60 slab* - molecule* { … … 192 192 # vectors for each part. 193 193 # 194 set max [$_field get -count component] 195 for {set i 0} {$i < $max} {incr i} { 194 foreach cname [$_field children -type component] { 196 195 set xv "" 197 196 set yv "" 198 197 199 set val [$_field get component$i.constant]198 set val [$_field get $cname.constant] 200 199 if {$val != ""} { 201 set domain [$_field get component$i.domain]200 set domain [$_field get $cname.domain] 202 201 if {$domain == "" || ![info exists _limits($domain)]} { 203 202 set z0 0 … … 217 216 218 217 set zm [expr {0.5*($z0+$z1)}] 219 set _comp2cntls( component$i) \220 [list component$i.constant $zm $val "$val$_units"]218 set _comp2cntls($cname) \ 219 [list $cname.constant $zm $val "$val$_units"] 221 220 } else { 222 set xydata [$_field get component$i.xy]221 set xydata [$_field get $cname.xy] 223 222 if {"" != $xydata} { 224 223 set xv [blt::vector create x$_counter] … … 235 234 236 235 if {$xv != "" && $yv != ""} { 237 set _comp2vecs( component$i) [list $xv $yv]236 set _comp2vecs($cname) [list $xv $yv] 238 237 incr _counter 239 238 } -
trunk/gui/scripts/xyplot.tcl
r1 r6 96 96 if {$layout != "" && $run != ""} { 97 97 set count 0 98 foreach item [$layout get -children] {98 foreach item [$layout children] { 99 99 switch -glob -- $item { 100 100 title { … … 118 118 field* { 119 119 set name [$layout get $item] 120 if { [$run get -existsoutput.$name]} {120 if {"" != [$run element output.$name]} { 121 121 set fobj [Rappture::Field ::#auto $_device $run output.$name] 122 122 set _path2obj($name) $fobj … … 144 144 curve* { 145 145 set name [$layout get $item] 146 if { [$run get -existsoutput.$name]} {146 if {"" != [$run get element output.$name]} { 147 147 set cobj [Rappture::Curve ::#auto $run output.$name] 148 148 set _path2obj($name) $cobj … … 211 211 itcl::configbody Rappture::Xyplot::layout { 212 212 if {$itk_option(-layout) != ""} { 213 if {![Rappture:: Library::valid $itk_option(-layout)]} {213 if {![Rappture::library isvalid $itk_option(-layout)]} { 214 214 error "bad value \"$itk_option(-layout)\": should be Rappture::Library" 215 215 } … … 231 231 } 232 232 if {$itk_option(-run) != ""} { 233 if {![Rappture:: Library::valid $itk_option(-run)]} {233 if {![Rappture::library isvalid $itk_option(-run)]} { 234 234 error "bad value \"$itk_option(-run)\": should be Rappture::Library" 235 235 } 236 set _device [$itk_option(-run) get -object device]236 set _device [$itk_option(-run) element -flavor object device] 237 237 } 238 238 after cancel [itcl::code $this _rebuild]
Note: See TracChangeset
for help on using the changeset viewer.