Changeset 766
- Timestamp:
- Jun 10, 2007 4:06:35 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/zoo/number/number.tcl
r115 r766 13 13 set driver [Rappture::library [lindex $argv 0]] 14 14 15 set T [$driver get input.(temperature).current] 16 set v [$driver get input.(vsweep).current] 17 18 $driver put output.number(outt).current $T 19 $driver put output.number(outv).current $v 15 $driver copy output.number(outt) from input.(temperature) 16 $driver copy output.number(outv) from input.(vsweep) 20 17 21 18 # save the updated XML describing the run... -
trunk/gui/scripts/contourresult.tcl
r739 r766 42 42 public method delete {args} 43 43 public method scale {args} 44 public method parameters {title args} { # do nothing } 44 45 public method download {option args} 45 46 -
trunk/gui/scripts/deviceEditor.tcl
r689 r766 30 30 public method add {dataobj {settings ""}} 31 31 public method delete {args} 32 public method parameters {title args} { # do nothing } 32 33 33 34 protected method _redraw {} -
trunk/gui/scripts/deviceViewer1D.tcl
r742 r766 35 35 public method get {} 36 36 public method delete {args} 37 public method parameters {title args} { # do nothing } 37 38 38 39 public method controls {option args} -
trunk/gui/scripts/deviceresult.tcl
r689 r766 28 28 public method delete {args} 29 29 public method scale {args} 30 public method parameters {title args} { # do nothing } 30 31 public method download {option args} 31 32 -
trunk/gui/scripts/energyLevels.tcl
r761 r766 47 47 public method scale {args} 48 48 public method download {args} {} 49 public method parameters {title args} { # do nothing } 49 50 50 51 protected method _redraw {{what all}} … … 270 271 -linestyle solid 271 272 -description "" 273 -param "" 272 274 } 273 275 foreach {opt val} $settings { -
trunk/gui/scripts/field3dresult.tcl
r676 r766 37 37 public method delete {args} 38 38 public method scale {args} 39 public method parameters {title args} { # do nothing } 39 40 public method download {option args} 40 41 -
trunk/gui/scripts/imageresult.tcl
r676 r766 32 32 public method delete {args} 33 33 public method scale {args} 34 public method parameters {title args} { # do nothing } 34 35 public method download {option args} 35 36 -
trunk/gui/scripts/meshresult.tcl
r676 r766 36 36 public method delete {args} 37 37 public method scale {args} 38 public method parameters {title args} { # do nothing } 38 39 public method download {option args} 39 40 -
trunk/gui/scripts/moleculeViewer.tcl
r730 r766 34 34 public method get {} 35 35 public method delete {args} 36 public method parameters {title args} { # do nothing } 36 37 37 38 public method emblems {option} -
trunk/gui/scripts/molvisviewer.tcl
r706 r766 33 33 public method get {} 34 34 public method delete {args} 35 public method parameters {title args} { # do nothing } 35 36 36 37 public method emblems {option} -
trunk/gui/scripts/nanovisviewer.tcl
r713 r766 44 44 public method scale {args} 45 45 public method download {option args} 46 public method parameters {title args} { # do nothing } 46 47 47 48 public method connect {{hostlist ""}} -
trunk/gui/scripts/resultset.tcl
r764 r766 65 65 protected method _drawValue {column widget wmax} 66 66 protected method _toggleAll {{column "current"}} 67 protected method _getValues {column {which ""}} 67 68 protected method _getTooltip {role column} 68 protected method _getParamDesc { {index "current"}}69 protected method _getParamDesc {which {index "current"}} 69 70 70 71 private variable _dispatcher "" ;# dispatchers for !events … … 650 651 set col [lindex $args 1] 651 652 652 if {$col == "xmlobj"} {653 # load the Simulation # control654 set nruns [$_results size]655 656 # load the results into the control657 $dial clear658 for {set n 0} {$n < $nruns} {incr n} {659 $dial add "#[expr {$n+1}]" $n660 }661 return662 }663 664 set havenums 1665 set vlist ""666 foreach rec [$_results get -format [list xmlobj $col]] {667 set xo [lindex $rec 0]668 set v [lindex $rec 1]669 670 if {![info exists values($v)]} {671 lappend vlist $v672 foreach {raw norm} [Rappture::LibraryObj::value $xo $col] break673 set values($v) $norm674 675 if {$havenums && ![string is double $norm]} {676 set havenums 0677 }678 }679 }680 681 if {!$havenums} {682 # don't have normalized nums? then sort and create nums683 catch {unset values}684 685 set n 0686 foreach v [lsort $vlist] {687 set values($v) [incr n]688 }689 }690 691 # load the results into the control692 653 $dial clear 693 foreach v [array names values] {694 $dial add $ v $values($v)654 foreach {label val} [_getValues $col all] { 655 $dial add $label $val 695 656 } 696 657 } … … 1114 1075 _doPrompt off 1115 1076 1077 if {[info exists _cntlInfo($this-$_active-label)]} { 1078 lappend params $_cntlInfo($this-$_active-label) 1079 } else { 1080 lappend params "???" 1081 } 1082 eval lappend params [_getValues $_active all] 1083 1116 1084 switch -- [$_results size] { 1117 1085 0 { … … 1121 1089 1 { 1122 1090 # only one data set? then plot it 1123 _doSettings [list 0 [list -width 2 -description [_getParamDesc]]] 1091 _doSettings [list \ 1092 0 [list -width 2 \ 1093 -param [_getValues $_active current] \ 1094 -description [_getParamDesc all] \ 1095 ] \ 1096 params $params \ 1097 ] 1124 1098 return 1125 1099 } … … 1246 1220 # single result -- always use active color 1247 1221 set i [lindex $ilist 0] 1248 set plist [list $i [list -width 2 -description [_getParamDesc $i]]] 1222 set plist [list \ 1223 $i [list -width 2 \ 1224 -param [_getValues $_active $i] \ 1225 -description [_getParamDesc all $i] \ 1226 ] \ 1227 params $params \ 1228 ] 1249 1229 } else { 1250 1230 # … … 1252 1232 # the color spectrum. 1253 1233 # 1254 set plist ""1234 set plist [list params $params] 1255 1235 foreach i $ilist { 1256 1236 if {$i == $icurr} { 1257 1237 lappend plist $i [list -width 3 -raise 1 \ 1258 -description [_getParamDesc $i]] 1238 -param [_getValues $_active $i] \ 1239 -description [_getParamDesc all $i]] 1259 1240 } else { 1260 1241 lappend plist $i [list -brightness 0.7 -width 1 \ 1261 -description [_getParamDesc $i]] 1242 -param [_getValues $_active $i] \ 1243 -description [_getParamDesc all $i]] 1262 1244 } 1263 1245 } … … 1470 1452 1471 1453 # ---------------------------------------------------------------------- 1454 # USAGE: _getValues <column> ?<which>? 1455 # 1456 # Called automatically whenever the user hovers a control within 1457 # this widget. Returns the tooltip associated with the control. 1458 # ---------------------------------------------------------------------- 1459 itcl::body Rappture::ResultSet::_getValues {col {which ""}} { 1460 if {$col == "xmlobj"} { 1461 # load the Simulation # control 1462 set nruns [$_results size] 1463 for {set n 0} {$n < $nruns} {incr n} { 1464 set v "#[expr {$n+1}]" 1465 set label2val($v) $n 1466 } 1467 } else { 1468 set havenums 1 1469 set vlist "" 1470 foreach rec [$_results get -format [list xmlobj $col]] { 1471 set xo [lindex $rec 0] 1472 set v [lindex $rec 1] 1473 1474 if {![info exists label2val($v)]} { 1475 lappend vlist $v 1476 foreach {raw norm} [Rappture::LibraryObj::value $xo $col] break 1477 set label2val($v) $norm 1478 1479 if {$havenums && ![string is double $norm]} { 1480 set havenums 0 1481 } 1482 } 1483 } 1484 1485 if {!$havenums} { 1486 # don't have normalized nums? then sort and create nums 1487 catch {unset label2val} 1488 1489 set n 0 1490 foreach v [lsort $vlist] { 1491 incr n 1492 set label2val($v) $n 1493 } 1494 } 1495 } 1496 1497 switch -- $which { 1498 current { 1499 set curr $_cntlInfo($this-$col-value) 1500 if {[info exists label2val($curr)]} { 1501 return [list $curr $label2val($curr)] 1502 } 1503 return "" 1504 } 1505 all { 1506 return [array get label2val] 1507 } 1508 default { 1509 if {[string is integer $which]} { 1510 if {$col == "xmlobj"} { 1511 set val "#[expr {$which+1}]" 1512 } else { 1513 set val [lindex [$_results get -format $col $which] 0] 1514 } 1515 if {[info exists label2val($val)]} { 1516 return [list $val $label2val($val)] 1517 } 1518 return "" 1519 } 1520 error "bad option \"$which\": should be all, current, or an integer index" 1521 } 1522 } 1523 } 1524 1525 # ---------------------------------------------------------------------- 1472 1526 # USAGE: _getTooltip <role> <column> 1473 1527 # … … 1518 1572 1519 1573 # ---------------------------------------------------------------------- 1520 # USAGE: _getParamDesc ?<index>?1574 # USAGE: _getParamDesc <which> ?<index>? 1521 1575 # 1522 1576 # Used internally to build a descripton of parameters for the data … … 1524 1578 # results viewer, so it will know what data is being viewed. 1525 1579 # ---------------------------------------------------------------------- 1526 itcl::body Rappture::ResultSet::_getParamDesc { {index "current"}} {1580 itcl::body Rappture::ResultSet::_getParamDesc {which {index "current"}} { 1527 1581 if {$index == "current"} { 1528 1582 # search for the result for these settings … … 1539 1593 } 1540 1594 1541 set desc "" 1542 foreach col $_cntlInfo($this-all) { 1543 set quantity $_cntlInfo($this-$col-label) 1544 set val [lindex [$_results get -format $col $index] 0] 1545 if {$col == "xmlobj"} { 1546 set num [lindex [$_results find -format xmlobj $val] 0] 1547 set val "#[expr {$num+1}]" 1548 } 1549 append desc "$quantity = $val\n" 1550 } 1551 return [string trim $desc] 1595 switch -- $which { 1596 active { 1597 if {"" == $_active} { 1598 return "" 1599 } 1600 } 1601 all { 1602 set desc "" 1603 foreach col $_cntlInfo($this-all) { 1604 set quantity $_cntlInfo($this-$col-label) 1605 set val [lindex [$_results get -format $col $index] 0] 1606 if {$col == "xmlobj"} { 1607 set num [lindex [$_results find -format xmlobj $val] 0] 1608 set val "#[expr {$num+1}]" 1609 } 1610 append desc "$quantity = $val\n" 1611 } 1612 return [string trim $desc] 1613 } 1614 default { 1615 error "bad value \"$which\": should be active or all" 1616 } 1617 } 1552 1618 } 1553 1619 -
trunk/gui/scripts/resultviewer.tcl
r736 r766 43 43 private variable _mode2widget ;# maps plotting mode => widget 44 44 private variable _dataslots "" ;# list of all data objects in this widget 45 private variable _plotlist "" ;# list of indices plotted in _dataslots46 45 } 47 46 … … 154 153 switch -- $option { 155 154 add { 155 set params "" 156 156 foreach {index opts} $args { 157 if {$index == "params"} { 158 set params $opts 159 continue 160 } 157 161 set reset "-color autoreset" 158 162 set slot [lindex $_dataslots $index] … … 179 183 } 180 184 } 185 if {"" != $params && "" != $_mode} { 186 eval $_mode2widget($_mode) parameters $params 187 } 181 188 } 182 189 clear { … … 185 192 $_mode2widget($_mode) delete 186 193 } 187 set _plotlist ""188 194 } 189 195 default { … … 289 295 } 290 296 } 291 number - integer - boolean - choice { 297 number - integer { 298 set mode "number" 299 if {![info exists _mode2widget($mode)]} { 300 set w $itk_interior.number 301 Rappture::NumberResult $w 302 set _mode2widget($mode) $w 303 } 304 } 305 boolean - choice { 292 306 set mode "value" 293 307 if {![info exists _mode2widget($mode)]} { -
trunk/gui/scripts/sequenceresult.tcl
r676 r766 34 34 public method delete {args} 35 35 public method scale {args} 36 public method parameters {title args} { # do nothing } 36 37 public method download {option args} 37 38 -
trunk/gui/scripts/textresult.tcl
r702 r766 31 31 public method delete {args} 32 32 public method scale {args} 33 public method parameters {title args} { # do nothing } 33 34 public method download {option args} 34 35 -
trunk/gui/scripts/valueresult.tcl
r761 r766 26 26 public method delete {args} 27 27 public method scale {args} 28 public method parameters {title args} { # do nothing } 28 29 public method download {option args} 29 30 -
trunk/gui/scripts/xyresult.tcl
r738 r766 48 48 public method delete {args} 49 49 public method scale {args} 50 public method parameters {title args} { # do nothing } 50 51 public method download {option args} 51 52 -
trunk/tcl/scripts/result.tcl
r171 r766 31 31 # ---------------------------------------------------------------------- 32 32 proc Rappture::result {libobj {status 0}} { 33 global tcl_platform 34 33 35 $libobj put output.time [clock format [clock seconds]] 34 36 if {$status != 0} { … … 36 38 } else { 37 39 $libobj put output.status "ok" 40 } 41 42 if {[info exists tcl_platform(user)]} { 43 $libobj put output.user $tcl_platform(user) 38 44 } 39 45
Note: See TracChangeset
for help on using the changeset viewer.