Ignore:
Timestamp:
Feb 17, 2015 5:49:36 PM (9 years ago)
Author:
mmh
Message:

puq integration snap

File:
1 edited

Legend:

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

    r4180 r5029  
    215215    public method remove {{path ""}}
    216216    public method xml {{path ""}}
     217    public method uq_make_template {}
    217218
    218219    public method diff {libobj}
     
    228229    private variable _root 0       ;# non-zero => this obj owns document
    229230    private variable _document ""  ;# XML DOM tree
    230     private variable _node ""      ;# node within 
     231    private variable _node ""      ;# node within
    231232}
    232233
     
    10381039    return $rlist
    10391040}
     1041
     1042
     1043# FIXME: get units convert. change varlist to have no units
     1044itcl::body Rappture::LibraryObj::uq_make_template {} {
     1045    set varlist ""
     1046    set n [$_node selectNodes /run/input//number]
     1047    foreach _n $n {
     1048        set x [$_n selectNodes current/text()]
     1049        set val [$x nodeValue]
     1050        if {[string equal -length 8 $val "uniform "] ||
     1051            [string equal -length 9 $val "gaussian "]} {
     1052            set unode [$_n selectNodes units/text()]
     1053            if {"" != $unode} {
     1054                set units [$unode nodeValue]
     1055                set val [Rappture::Units::mconvert $val \
     1056                -context $units -to $units -units off]
     1057            }
     1058            $x nodeValue @@[$_n getAttribute id]
     1059            lappend varlist [list [$_n getAttribute id] $val]
     1060        }
     1061    }
     1062    return $varlist
     1063}
Note: See TracChangeset for help on using the changeset viewer.