Changeset 5199


Ignore:
Timestamp:
Apr 10, 2015, 5:11:59 PM (5 years ago)
Author:
mmh
Message:

fix issue with double-counting variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/uq/lang/tcl/scripts/library.tcl

    r5192 r5199  
    10551055# ----------------------------------------------------------------------
    10561056itcl::body Rappture::LibraryObj::uq_get_vars {{tfile ""}} {
    1057     set varlist \[
     1057    set varout \[
     1058    set varlist []
    10581059
    10591060    if {$tfile == ""} {
     
    10741075            [string equal -length 9 $val "gaussian "]} {
    10751076
     1077            set vname [$_n getAttribute id]
     1078            if {[lsearch $varlist $vname] >= 0} {
     1079                continue
     1080            } else {
     1081                lappend varlist $vname
     1082            }
     1083
    10761084            if {$count > 0} {
    1077                 append varlist ,
     1085                append varout ,
    10781086            }
    10791087            incr count
     
    10871095            }
    10881096
    1089             set v \[\"[$_n getAttribute id]\",\"$units\",
    1090             #set val \"[lindex $val 0]\",[lindex $val 1],[lindex $val 2]
     1097            set v \[\"$vname\",\"$units\",
    10911098            set fmt "\[\"%s\",%.16g,%.16g"
    10921099            set val [format $fmt [lindex $val 0] [lindex $val 1] [lindex $val 2]]
     
    11281135                $x nodeValue @@[$_n getAttribute id]
    11291136            }
    1130             append varlist $v\]\]
    1131         }
    1132     }
    1133     append varlist \]
     1137            append varout $v\]\]
     1138        }
     1139    }
     1140    append varout \]
    11341141
    11351142    if {$tfile != ""} {
     
    11401147        $doc delete
    11411148    }
    1142     if {$varlist == "\[\]"} {set varlist ""}
    1143     puts "uq_get_vars returning $varlist"
    1144     return [list $varlist $count]
    1145 }
     1149    if {$varout == "\[\]"} {set varout ""}
     1150    puts "uq_get_vars returning $varout"
     1151    return [list $varout $count]
     1152}
Note: See TracChangeset for help on using the changeset viewer.