- Timestamp:
- Jul 16, 2012, 6:03:04 PM (12 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/numberresult.tcl
r3074 r3099 1489 1489 itcl::body Rappture::NumberResult::GetValue {dataobj {which both}} { 1490 1490 if {[info exists _dataobj2param($dataobj)]} { 1491 set x [lindex $_dataobj2param($dataobj) 0]1491 set x [lindex $_dataobj2param($dataobj) 1] 1492 1492 } else { 1493 1493 set x 0 -
trunk/gui/scripts/resultset.tcl
r3074 r3099 203 203 } 204 204 205 if {$which eq "all"} { 206 set rlist "" 207 # build an array of normalized values and their labels 208 if {$col == "simnum"} { 209 set nruns [$_results size] 210 for {set n 0} {$n < $nruns} {incr n} { 211 set simnum [$_results get -format simnum $n] 212 lappend rlist $simnum $n 205 set rlist "" 206 # build an array of normalized values and their labels 207 if {$col == "simnum"} { 208 set nruns [$_results size] 209 for {set n 0} {$n < $nruns} {incr n} { 210 set simnum [$_results get -format simnum $n] 211 lappend rlist $simnum $n 212 } 213 } else { 214 set havenums 1 215 foreach rec [$_results get -format [list xmlobj $col]] { 216 set xo [lindex $rec 0] 217 set v [lindex $rec 1] 218 foreach {raw norm} \ 219 [Rappture::LibraryObj::value $xo $col] break 220 221 if {![info exists unique($v)]} { 222 # keep only unique label strings 223 set unique($v) $norm 224 } 225 if {$havenums && ![string is double $norm]} { 226 set havenums 0 227 } 228 } 229 230 if {!$havenums} { 231 # don't have normalized nums? then sort and create nums 232 set rlist "" 233 set n 0 234 foreach val [lsort -dictionary [array names unique]] { 235 lappend rlist $val [incr n] 213 236 } 214 237 } else { 215 set havenums 1 216 foreach rec [$_results get -format [list xmlobj $col]] { 217 set xo [lindex $rec 0] 218 set v [lindex $rec 1] 219 foreach {raw norm} \ 220 [Rappture::LibraryObj::value $xo $col] break 221 222 if {![info exists unique($v)]} { 223 # keep only unique label strings 224 set unique($v) $norm 225 } 226 if {$havenums && ![string is double $norm]} { 227 set havenums 0 228 } 229 } 230 231 if {!$havenums} { 232 # don't have normalized nums? then sort and create nums 233 set rlist "" 234 set n 0 235 foreach val [lsort -dictionary [array names unique]] { 236 lappend rlist $val [incr n] 237 } 238 } else { 239 set rlist [array get unique] 240 } 241 } 238 set rlist [array get unique] 239 } 240 } 241 242 if {$which eq "all"} { 242 243 return $rlist 243 244 } … … 246 247 set irun [lindex [$_results find -format xmlobj $which] 0] 247 248 if {$irun ne ""} { 248 if {$col == "simnum"} { 249 set val [$_results get -format simnum $irun] 250 return [list $irun $val] 251 } else { 252 # Be careful giving singleton elements as the 253 # "columns" argument to "Tuples::get". It is 254 # expecting a list. 255 foreach {raw norm} \ 256 [Rappture::LibraryObj::value $which $col] break 257 return [list $norm $raw] 249 set val [$_results get -format $col $irun] 250 array set val2norm $rlist 251 if {[info exists val2norm($val)]} { 252 return [list $val $val2norm($val)] 258 253 } 259 254 } … … 279 274 280 275 set rlist "" 281 foreach irun [$_results find -format $collist $vallist] {276 foreach irun [$_results find -format $collist -- $vallist] { 282 277 lappend rlist [$_results get -format xmlobj $irun] 283 278 }
Note: See TracChangeset
for help on using the changeset viewer.