Changeset 5981


Ignore:
Timestamp:
Feb 9, 2016, 8:20:48 AM (9 years ago)
Author:
gah
Message:

add simsets, fix puq execution to not use use

Location:
branches/1.4
Files:
2 added
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/1.4/configure

    r5862 r5981  
    1021610216
    1021710217
    10218 ac_config_files="$ac_config_files Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile src/objects/RpHash.h gui/Makefile gui/apps/Makefile gui/apps/about gui/apps/copy_rappture_examples gui/apps/encodedata gui/apps/rappture gui/apps/rappture-csh.env gui/apps/rappture.env gui/apps/rappture.use gui/apps/rerun gui/apps/simsim gui/apps/xmldiff gui/pkgIndex.tcl gui/scripts/Makefile gui/src/Makefile builder/Makefile builder/pkgIndex.tcl builder/scripts/Makefile tester/Makefile tester/pkgIndex.tcl tester/scripts/Makefile lang/Makefile lang/java/Makefile lang/java/rappture/Makefile lang/perl/Makefile lang/perl/Makefile.PL lang/python/Makefile lang/python/setup.py lang/matlab/Makefile lang/octave/Makefile lang/octave/octave2/Makefile lang/octave/octave3/Makefile lang/R/Makefile lang/ruby/Makefile lang/ruby/build.rb lang/tcl/Makefile lang/tcl/pkgIndex.tcl lang/tcl/scripts/Makefile lang/tcl/src/Makefile lang/tcl/tests/Makefile lib/Makefile examples/3D/Makefile examples/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/java/Makefile examples/app-fermi/matlab/Makefile examples/app-fermi/matlab/compiled/Makefile examples/app-fermi/matlab/uncompiled/Makefile examples/app-fermi/octave/octave2/Makefile examples/app-fermi/octave/octave3/Makefile examples/app-fermi/octave/Makefile examples/app-fermi/perl/Makefile examples/app-fermi/python/Makefile examples/app-fermi/ruby/Makefile examples/app-fermi/tcl/Makefile examples/app-fermi/wrapper/Makefile examples/app-fermi/wrapper/cee/Makefile examples/app-fermi/wrapper/perl/Makefile examples/app-fermi/wrapper/python/Makefile examples/app-fermi/wrapper/tcl/Makefile examples/app-fermi/R/Makefile examples/c-example/Makefile examples/canvas/Makefile examples/demo.bash examples/flow/Makefile examples/flow/demo1/Makefile examples/flow/demo2/Makefile examples/flow/demo3/Makefile examples/graph/Makefile examples/objects/Makefile examples/objects/axis/Makefile examples/objects/curve/Makefile examples/objects/dxWriter/Makefile examples/objects/floatBuffer/Makefile examples/objects/histogram/Makefile examples/objects/library/Makefile examples/objects/number/Makefile examples/objects/path/Makefile examples/objects/plot/Makefile examples/objects/scatter/Makefile examples/objects/string/Makefile examples/objects/tree/Makefile examples/objects/xmlparser/Makefile examples/zoo/Makefile examples/zoo/binary/Makefile examples/zoo/boolean/Makefile examples/zoo/choice/Makefile examples/zoo/curve/Makefile examples/zoo/drawing/Makefile examples/zoo/enable/Makefile examples/zoo/field/Makefile examples/zoo/group/Makefile examples/zoo/histogram/Makefile examples/zoo/image/Makefile examples/zoo/image/docs/Makefile examples/zoo/image/examples/Makefile examples/zoo/integer/Makefile examples/zoo/integer2/Makefile examples/zoo/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/log/Makefile examples/zoo/mesh/Makefile examples/zoo/note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/Makefile examples/zoo/number2/Makefile examples/zoo/parallelepiped/Makefile examples/zoo/periodicelement/Makefile examples/zoo/phase/Makefile examples/zoo/sequence/Makefile examples/zoo/sequence/examples/Makefile examples/zoo/string/Makefile examples/zoo/structure/Makefile examples/zoo/structure/examples/Makefile examples/zoo/table/Makefile video/Makefile video/pkgIndex.tcl oldtest/Makefile oldtest/src/Makefile puq/Makefile"
     10218ac_config_files="$ac_config_files Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile src/objects/RpHash.h gui/Makefile gui/apps/Makefile gui/apps/about gui/apps/copy_rappture_examples gui/apps/encodedata gui/apps/rappture gui/apps/rappture-csh.env gui/apps/rappture.env gui/apps/rappture.use gui/apps/rerun gui/apps/simsim gui/apps/xmldiff gui/pkgIndex.tcl gui/scripts/Makefile gui/src/Makefile builder/Makefile builder/pkgIndex.tcl builder/scripts/Makefile tester/Makefile tester/pkgIndex.tcl tester/scripts/Makefile lang/Makefile lang/java/Makefile lang/java/rappture/Makefile lang/perl/Makefile lang/perl/Makefile.PL lang/python/Makefile lang/python/setup.py lang/matlab/Makefile lang/octave/Makefile lang/octave/octave2/Makefile lang/octave/octave3/Makefile lang/R/Makefile lang/ruby/Makefile lang/ruby/build.rb lang/tcl/Makefile lang/tcl/pkgIndex.tcl lang/tcl/scripts/Makefile lang/tcl/src/Makefile lang/tcl/tests/Makefile lib/Makefile examples/3D/Makefile examples/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/java/Makefile examples/app-fermi/matlab/Makefile examples/app-fermi/matlab/compiled/Makefile examples/app-fermi/matlab/uncompiled/Makefile examples/app-fermi/octave/octave2/Makefile examples/app-fermi/octave/octave3/Makefile examples/app-fermi/octave/Makefile examples/app-fermi/perl/Makefile examples/app-fermi/python/Makefile examples/app-fermi/ruby/Makefile examples/app-fermi/tcl/Makefile examples/app-fermi/wrapper/Makefile examples/app-fermi/wrapper/cee/Makefile examples/app-fermi/wrapper/perl/Makefile examples/app-fermi/wrapper/python/Makefile examples/app-fermi/wrapper/tcl/Makefile examples/app-fermi/R/Makefile examples/c-example/Makefile examples/canvas/Makefile examples/demo.bash examples/flow/Makefile examples/flow/demo1/Makefile examples/flow/demo2/Makefile examples/flow/demo3/Makefile examples/graph/Makefile examples/objects/Makefile examples/objects/axis/Makefile examples/objects/curve/Makefile examples/objects/dxWriter/Makefile examples/objects/floatBuffer/Makefile examples/objects/histogram/Makefile examples/objects/library/Makefile examples/objects/number/Makefile examples/objects/path/Makefile examples/objects/plot/Makefile examples/objects/scatter/Makefile examples/objects/string/Makefile examples/objects/tree/Makefile examples/objects/xmlparser/Makefile examples/zoo/Makefile examples/zoo/binary/Makefile examples/zoo/boolean/Makefile examples/zoo/choice/Makefile examples/zoo/curve/Makefile examples/zoo/drawing/Makefile examples/zoo/enable/Makefile examples/zoo/field/Makefile examples/zoo/group/Makefile examples/zoo/histogram/Makefile examples/zoo/image/Makefile examples/zoo/image/docs/Makefile examples/zoo/image/examples/Makefile examples/zoo/integer/Makefile examples/zoo/integer2/Makefile examples/zoo/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/log/Makefile examples/zoo/mesh/Makefile examples/zoo/note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/Makefile examples/zoo/number2/Makefile examples/zoo/parallelepiped/Makefile examples/zoo/periodicelement/Makefile examples/zoo/phase/Makefile examples/zoo/sequence/Makefile examples/zoo/sequence/examples/Makefile examples/zoo/string/Makefile examples/zoo/structure/Makefile examples/zoo/structure/examples/Makefile examples/zoo/table/Makefile video/Makefile video/pkgIndex.tcl oldtest/Makefile oldtest/src/Makefile puq/Makefile puq/puq"
    1021910219
    1022010220cat >confcache <<\_ACEOF
     
    1104111041    "oldtest/src/Makefile") CONFIG_FILES="$CONFIG_FILES oldtest/src/Makefile" ;;
    1104211042    "puq/Makefile") CONFIG_FILES="$CONFIG_FILES puq/Makefile" ;;
     11043    "puq/puq") CONFIG_FILES="$CONFIG_FILES puq/puq" ;;
    1104311044
    1104411045  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
  • branches/1.4/configure.in

    r5862 r5981  
    601601    oldtest/src/Makefile
    602602    puq/Makefile
     603    puq/puq
    603604])
    604605AC_OUTPUT
  • branches/1.4/gui/apps/launcher.tcl

    r5831 r5981  
    4343set params(input) ""
    4444
     45set _rapptureCwd [pwd]
     46
    4547if {[info exists env(TOOL_PARAMETERS)]} {
    4648    # if we can't find the file, wait a little
     
    7981                            set params(opt) "-load"
    8082                        }
     83                        "(simset)" - "" {
     84                            lappend params(simset) $value
     85                            set params(opt) "-simset"
     86                        }
    8187                        "(execute)" {
    8288                            set params(execute) $value
     
    173179                    set argv [lrange $argv 1 end]
    174180                }
     181            }
     182            -simset {
     183                lappend alist $opt [lindex $argv 0]
     184                set argv [lrange $argv 1 end]
    175185            }
    176186            default {
     
    194204            set loadlist [concat $loadlist $params(load)]
    195205            set alist [concat $alist -load $loadlist]
     206
     207            package require RapptureGUI
     208            set guidir $RapptureGUI::library
     209            set mainscript [file join $guidir scripts main.tcl]
     210            set reqpkgs Tk
     211        }
     212        -simset {
     213            # add tool parameters to the end of any files given on cmd line
     214            set loadlist [concat $loadlist $params(simset)]
     215            set alist [concat $alist -simset $loadlist]
    196216
    197217            package require RapptureGUI
  • branches/1.4/gui/scripts/analyzer.tcl

    r5885 r5981  
    5050    itk_option define -notebookpage notebookPage NotebookPage ""
    5151
     52    private variable _done 0
     53    private variable _tree ""
     54    private variable _saved
     55    private variable _name ""
     56   
    5257    constructor {tool args} {
    5358        # defined below
     
    6065    public method reset {{when -eventually}}
    6166    public method load {xmlobj}
     67    public method reload { fileName }
    6268    public method clear {{xmlobj "all"}}
    6369    public method download {option args}
     
    8490
    8591    private variable _tool ""          ;# belongs to this tool
    86     private variable _appName ""       ;# Name of application
     92    private variable _appName "test"   ;# Name of application
    8793    private variable _control "manual" ;# start mode
    8894    private variable _resultset ""     ;# ResultSet object with all results
     
    97103    private variable _uq_active 0      ;# a UQ variables has been used
    98104    private variable _wait_uq 0
     105
     106    private method BuildMenu { url }
     107    private method BuildSimulationTable { w }
     108    private method Cancel {}
     109    private method CheckSimsetDetails {}
     110    private method EditSimset {}
     111    private method FindSimsetsForApp { appName }
     112    private method GetSimset { name }
     113    private method LoadSimulations { runfiles }
     114    private method Ok {}
     115    private method PostMenu {}
     116    private method ReadSimsetFile { fileName }
     117    private method SaveSimulations {}
     118    private method SelectSimsetForDeletion {}
     119    private method SelectSimsetForLoading {}
     120    private method SelectSimsetNameAndSave {}
     121    private method SelectSimsetToPublish {}
     122    private method WriteSimsetFile { appName fileName }
    99123}
    100124
     
    108132itcl::body Rappture::Analyzer::constructor {tool args} {
    109133    set _tool $tool
     134    set _tree [blt::tree create]
    110135
    111136    # use this to store all simulation results
     
    150175    # if there's a hub url, then add "About" and "Questions" links
    151176    set _appName [$_tool xml get tool.id]
     177# For testing
     178    if { $_appName == "" } {
     179        set _appName "test"
     180    }
    152181    set url [Rappture::Tool::resources -huburl]
    153     if {"" != $url && "" != $_appName} {
    154         itk_component add hubcntls {
    155             frame $itk_component(simbg).hubcntls
    156         } {
    157             usual
    158             rename -background -simcontrolcolor simControlColor Color
    159         }
    160         pack $itk_component(hubcntls) -side right -padx 4
    161 
    162         itk_component add icon {
    163             label $itk_component(hubcntls).icon -image [Rappture::icon ask] \
    164                 -highlightthickness 0
    165         } {
    166             usual
    167             ignore -highlightthickness
    168             rename -background -simcontrolcolor simControlColor Color
    169         }
    170         pack $itk_component(icon) -side left
    171 
    172         itk_component add about {
    173             button $itk_component(hubcntls).about -text "About this tool" \
    174                 -command [list Rappture::filexfer::webpage \
    175                               "$url/tools/$_appName"]
    176         } {
    177             usual
    178             ignore -font
    179             rename -background -simcontrolcolor simControlColor Color
    180             rename -highlightbackground -simcontrolcolor simControlColor Color
    181         }
    182         pack $itk_component(about) -side top -anchor w
    183 
    184         itk_component add questions {
    185             button $itk_component(hubcntls).questions -text Questions? \
    186                 -command [list Rappture::filexfer::webpage \
    187                               "$url/resources/$_appName/questions"]
    188         } {
    189             usual
    190             ignore -font
    191             rename -background -simcontrolcolor simControlColor Color
    192             rename -highlightbackground -simcontrolcolor simControlColor Color
    193         }
    194         pack $itk_component(questions) -side top -anchor w
    195     }
    196 
     182
     183    itk_component add hubcntls {
     184        frame $itk_component(simbg).hubcntls
     185    } {
     186        usual
     187        rename -background -simcontrolcolor simControlColor Color
     188    }
     189    pack $itk_component(hubcntls) -side right -padx 4
     190   
     191    itk_component add help {
     192        menubutton $itk_component(hubcntls).help \
     193            -image [Rappture::icon hamburger_menu] \
     194            -highlightthickness 0 \
     195            -menu $itk_component(hubcntls).help.menu
     196    } {
     197        usual
     198        ignore -highlightthickness
     199        rename -background -simcontrolcolor simControlColor Color
     200    }
     201    pack $itk_component(help) -side left
     202    BuildMenu $url
     203   
     204    if 0 {
     205    itk_component add about {
     206        button $itk_component(hubcntls).about \
     207            -text "About this tool" \
     208            -command [list Rappture::filexfer::webpage \
     209                          "$url/tools/$_appName"]
     210    } {
     211        usual
     212        ignore -font
     213        rename -background -simcontrolcolor simControlColor Color
     214        rename -highlightbackground -simcontrolcolor simControlColor Color
     215    }
     216    pack $itk_component(about) -side top -anchor w
     217   
     218    itk_component add questions {
     219        button $itk_component(hubcntls).questions -text Questions? \
     220            -command [list Rappture::filexfer::webpage \
     221                          "$url/resources/$_appName/questions"]
     222    } {
     223        usual
     224        ignore -font
     225        rename -background -simcontrolcolor simControlColor Color
     226        rename -highlightbackground -simcontrolcolor simControlColor Color
     227    }
     228    pack $itk_component(questions) -side top -anchor w
     229    if { $url == "" || $_appName == "" } {
     230        $itk_component(questions) configure -state disabled
     231        $itk_component(about) configure -state disabled
     232    } else {
     233        $itk_component(questions) configure -state normal
     234        $itk_component(about) configure -state normal
     235    }       
     236    }
    197237    itk_component add simstatus {
    198238        text $itk_component(simbg).simstatus -borderwidth 0 \
     
    14951535    _fixNotebook
    14961536}
     1537
     1538itcl::body Rappture::Analyzer::PostMenu {} {
     1539    set m $itk_component(help).menu
     1540    if { [FindSimsetsForApp $_appName] == 0 } {
     1541        $m entryconfigure "Load Simulations" -state disable
     1542    } else {
     1543        $m entryconfigure "Load Simulations" -state normal
     1544    }
     1545    if { [$_resultset size] == 0 } {
     1546        $m entryconfigure "Delete Simulations" -state disabled
     1547        $m entryconfigure "Save Simulations" -state disabled
     1548    } else {
     1549        $m entryconfigure "Delete Simulations" -state normal
     1550        $m entryconfigure "Save Simulations" -state normal
     1551    }
     1552}
     1553       
     1554#
     1555# Build Help menu
     1556#
     1557itcl::body Rappture::Analyzer::BuildMenu { url } {
     1558    set m $itk_component(help).menu
     1559    itk_component add helpmenu {
     1560        menu $itk_component(help).menu \
     1561            -tearoff 0 \
     1562            -postcommand [itcl::code $this PostMenu]
     1563    } {
     1564        ignore -tearoff
     1565    }
     1566    if { $_appName == "" || $url == "" } {
     1567        set state disabled
     1568    } else {
     1569        set state normal
     1570    }
     1571        set state normal
     1572    $m add command -label "About this tool" \
     1573        -command [list Rappture::filexfer::webpage "$url/tools/$_appName"] \
     1574        -state $state
     1575    $m add command -label "Questions?" \
     1576        -command [list Rappture::filexfer::webpage \
     1577                      "$url/resources/$_appName/questions"] \
     1578        -state $state
     1579    $m add command -label "Wish List" -state $state
     1580    $m add command -label "Tickets" -state $state
     1581    $m add separator
     1582    $m add command -label "Save Simulations" \
     1583        -command [itcl::code $this SelectSimsetNameAndSave] \
     1584        -state $state
     1585    $m add command -label "Load Simulations" \
     1586        -command [itcl::code $this SelectSimsetForLoading] \
     1587        -state $state
     1588    $m add command -label "Delete Simulations" \
     1589        -command [itcl::code $this SelectSimsetForDeletion] \
     1590        -state $state
     1591    $m add command -label "Publish Simulations" \
     1592        -command [itcl::code $this SelectSimsetToPublish] \
     1593        -state $state
     1594    return $m
     1595}
     1596
     1597itcl::body Rappture::Analyzer::BuildSimulationTable { top } {
     1598    # All weirdness is due to the Resultset object.
     1599
     1600    # First create nodes for each simulation.  The node label is the
     1601    # simulation number (such as #1, #2, etc). 
     1602    eval $_tree delete 0
     1603    set labels "selected simnum"
     1604    foreach {name index} [$_resultset diff values simnum] {
     1605        set node [$_tree insert 0 -label $name]
     1606        $_tree set $node "simnum" $name
     1607        set index2name($index) $name
     1608       
     1609    }
     1610    # Next fill in the xmlobj associated with each simulation.  We assume
     1611    # that the order is the the same as the simulation number.
     1612    set index 0
     1613    foreach {xmlobj dummy} [$_resultset diff values xmlobj]  {
     1614        set node [$_tree findchild 0 $index2name($index)]
     1615        set runfile [$xmlobj get output.filename]
     1616        set version [$xmlobj get output.version]
     1617        $_tree set $node \
     1618            "selected" 1 "xmlobj" $xmlobj "runfile" $runfile "version" $version
     1619        incr index
     1620    }
     1621    # Finally for each different input, for each simulation add the
     1622    # label and value for the specific input.
     1623    foreach name [$_resultset diff names] {
     1624        # Ignore non-input names.
     1625        if { $name == "xmlobj" || $name == "simnum" } {
     1626            continue
     1627        }
     1628        foreach node [$_tree children 0] {
     1629            set xmlobj [$_tree get $node xmlobj]
     1630            set label [$xmlobj get $name.about.label]
     1631            set value [$xmlobj get $name.current]
     1632            if { [$_tree exists $node $label] } {
     1633                puts stderr "This can't be: $label already exists in $node"
     1634            }
     1635            if { [lsearch $labels $label] < 0 } {
     1636                lappend labels $label
     1637            }
     1638            $_tree set $node $label $value
     1639        }
     1640    }
     1641    frame $top
     1642    set tv $top.tv
     1643    blt::treeview $top.tv -tree $_tree \
     1644        -height 1i \
     1645        -xscrollcommand [list $top.xs set] \
     1646        -yscrollcommand [list $top.ys set] \
     1647        -font "Arial 10"
     1648    scrollbar $top.xs -orient horizontal -command "$tv xview"
     1649    scrollbar $top.ys -orient vertical -command "$tv yview"
     1650       
     1651    eval $tv column insert end $labels
     1652    $tv style checkbox checkbox -showvalue no
     1653    $tv column configure simnum -title "Simulation"
     1654    $tv column configure selected -title "Save" -style checkbox \
     1655        -width .5i -edit yes
     1656    $tv column configure treeView -hide yes
     1657    blt::table $top \
     1658        0,0 $top.tv -fill both \
     1659        0,1 $top.ys -fill y \
     1660        1,0 $top.xs -fill x
     1661    blt::table configure $top r* c* -resize none
     1662    blt::table configure $top r0 c0 -resize both
     1663}
     1664#
     1665# Get the results and display them in a table.
     1666#
     1667# Use the table to omit specific results
     1668# Use file chooser to save to specific
     1669itcl::body Rappture::Analyzer::SelectSimsetNameAndSave {} {
     1670    if { [EditSimset] } {
     1671        set appDir [file normalize ~/data/saved/$_appName]
     1672        file mkdir $appDir
     1673        set fileName [tk_getSaveFile \
     1674                          -initialdir $appDir \
     1675                          -filetypes {{ "Simulations Save File" ".sav" }} \
     1676                          -title "Save Simulations To File"]
     1677        if { $fileName != "" } {
     1678            WriteSimsetFile $_appName $fileName
     1679        }
     1680    }
     1681}
     1682
     1683#
     1684# Get the results and display them in a table.
     1685#
     1686# Use the table to omit specific results
     1687# Use file chooser to save to specific
     1688itcl::body Rappture::Analyzer::SelectSimsetToPublish {} {
     1689    if { [GetSimset "publish"] } {
     1690        global env
     1691        set shareDir [file join /data/tools/shared $_appName $env(USER)]
     1692        if { [catch {
     1693            file mkdir $shareDir
     1694        } errs != 0 } {
     1695            puts stderr errs=$errs
     1696            return
     1697        }
     1698        set fileName [tk_getSaveFile \
     1699                          -initialdir $shareDir \
     1700                          -filetypes {{ "Simulations Set File" ".sav" }} \
     1701                          -title "Save Simulations To File"]
     1702        if { $fileName != "" } {
     1703            WriteSimsetFile $_appName $fileName
     1704        }
     1705    }
     1706}
     1707
     1708#
     1709# Checks editor widgets to see if the name and description have been
     1710# set.  If this is so it enables the save button in the editor.
     1711#
     1712itcl::body Rappture::Analyzer::CheckSimsetDetails {} {
     1713    set popup .savesimset
     1714    if { ![winfo exists $popup] } {
     1715        return
     1716    }
     1717    set inner [$popup component inner]
     1718    set name [string trim [$inner.name get]]
     1719    set desc [string trim [$inner.desc get 0.0 end]]
     1720    $inner.controls.save configure -state disabled
     1721    if { $name == "" || $desc == "" } {
     1722        return
     1723    }
     1724    $inner.controls.save configure -state normal
     1725}
     1726
     1727#
     1728# Gathers all the information from the simset editor into the _saved array
     1729#
     1730itcl::body Rappture::Analyzer::SaveSimulations {} {
     1731    set popup .savesimset
     1732    if { ![winfo exists $popup] } {
     1733        return
     1734    }
     1735    set inner [$popup component inner]
     1736    array unset _saved
     1737    set name [string trim [$inner.name get]]
     1738    set desc [string trim [$inner.desc get 0.0 end]]
     1739    set _saved(Application) $_appName
     1740    set _saved(Application) "test"
     1741    set _saved(Date) [clock format [clock seconds]]
     1742    set _saved(Name) $name
     1743    set _saved(Description) $desc
     1744    set files {}
     1745    foreach node [$_tree children root] {
     1746        set fileName [$_tree get $node runfile]
     1747        lappend files $fileName
     1748    }
     1749    set _saved(Files) $files
     1750    set _done 1
     1751}
     1752
     1753itcl::body Rappture::Analyzer::Cancel {} {
     1754    set _done 0
     1755}
     1756
     1757itcl::body Rappture::Analyzer::Ok {} {
     1758    set popup .selectsimset
     1759    if { ![winfo exists $popup] } {
     1760        return
     1761    }
     1762    set inner [$popup component inner]
     1763    set tv $inner.tv
     1764    if { ![$tv selection present] } {
     1765        return
     1766    }
     1767    set node [$tv curselection]
     1768    array unset _saved
     1769    array set _saved [$_tree get $node]
     1770    set _done 1
     1771}
     1772
     1773#
     1774# WriteSimsetFile --
     1775#
     1776#       Write the .sav file and the runfiles in the ~/data/saved/$_appName
     1777#       directory.  The subdirectory where the runfiles are written is
     1778#       the root of the .save file name.
     1779#
     1780itcl::body Rappture::Analyzer::WriteSimsetFile { appName fileName } {
     1781    # The runfiles directory is the root of the filename.
     1782    # For example, if the simset file is /path/to/myName.sav,
     1783    # the runfile directory is /path/to/myName
     1784    set root [file root $fileName]
     1785    if { [file exists $root] } {
     1786        file delete -force $root
     1787    }
     1788    if { [catch {
     1789        file mkdir $root
     1790        set f [open $fileName "w"]
     1791        puts $f [list "Name" $_saved(Name)]
     1792        puts $f [list "Description" $_saved(Description)]
     1793        puts $f [list "Date" $_saved(Date)]
     1794        global env
     1795        puts $f [list "Creator" $env(USER)]
     1796        puts $f [list "Application" $_saved(Application)]
     1797        set runfiles ""
     1798        set root [file root $fileName]
     1799        foreach file $_saved(Files) {
     1800            set tail [file tail $file]
     1801            set dest [file join $root $file]
     1802            file copy -force $file $dest
     1803            lappend runfiles $tail
     1804        }
     1805        puts $f [list "Files" $runfiles]
     1806        close $f
     1807    } errs] != 0 } {
     1808        puts stderr errs=$errs
     1809    }
     1810}
     1811
     1812itcl::body Rappture::Analyzer::EditSimset {} {
     1813    set popup .savesimset
     1814    if { [winfo exists $popup] } {
     1815        destroy $popup
     1816    }
     1817    # Create a popup for the print dialog
     1818    Rappture::Balloon $popup -title "Save set of simulations..."
     1819    set inner [$popup component inner]
     1820   
     1821    label $inner.name_l -text "Simulation Set Name"
     1822    entry $inner.name -background white
     1823    label $inner.desc_l -text "Simulation Set Description" -height 5
     1824    text $inner.desc  -background white
     1825    label $inner.select_l -text "Selected Simulations"
     1826    BuildSimulationTable $inner.select
     1827    frame $inner.controls
     1828    bind $inner.desc <KeyPress> [itcl::code $this CheckSimsetDetails]
     1829    bind $inner.name <KeyPress> [itcl::code $this CheckSimsetDetails]
     1830    bind $inner.desc <Motion> [itcl::code $this CheckSimsetDetails]
     1831    bind $inner.name <Motion> [itcl::code $this CheckSimsetDetails]
     1832    button $inner.controls.cancel -text "Cancel" \
     1833        -command [itcl::code $this Cancel]
     1834    button $inner.controls.save -text "Save" \
     1835        -command [itcl::code $this SaveSimulations]
     1836    blt::table $inner.controls \
     1837        0,0 $inner.controls.cancel \
     1838        0,1 $inner.controls.save
     1839   
     1840    blt::table $inner \
     1841        0,0 $inner.name_l -anchor ne \
     1842        0,1 $inner.name -fill x \
     1843        1,0 $inner.desc_l -anchor ne \
     1844        1,1 $inner.desc -fill both \
     1845        2,0 $inner.select_l -anchor ne \
     1846        2,1 $inner.select -fill both \
     1847        3,1 $inner.controls  -fill x
     1848    blt::table configure $inner r1 -height 1i
     1849    blt::table configure $inner r2 -pad 20
     1850    $popup configure \
     1851        -deactivatecommand [itcl::code $this Cancel]
     1852
     1853    set inner [$popup component inner]
     1854    if {[$_resultset size] > 1} {
     1855        blt::table $inner \
     1856            2,0 $inner.select_l -anchor ne \
     1857            2,1 $inner.select -fill both
     1858    } else {
     1859        blt::table forget $inner.select $inner.select_l
     1860    }
     1861    CheckSimsetDetails
     1862    update
     1863    # Activate the popup and call for the output.
     1864    $popup activate $itk_component(help) below
     1865    Cancel
     1866    tkwait variable [itcl::scope _done]
     1867    set doSave $_done
     1868    $popup deactivate
     1869    return $doSave
     1870}
     1871
     1872
     1873itcl::body Rappture::Analyzer::ReadSimsetFile { fileName } {
     1874    if { [catch {
     1875        set f [open $fileName "r"]
     1876        set contents [read $f]
     1877        close $f
     1878        array set _saved $contents
     1879    } errs] != 0 } {
     1880        return 0
     1881    }
     1882    if { ![info exists _saved(Files)] } {
     1883        return 0
     1884    }
     1885    set root [file root $fileName]
     1886    foreach file $_saved(Files) {
     1887        if { [file pathtype $file] == "relative" } {
     1888            set file [file join $root $file]
     1889        }
     1890        if { ![file readable $file] } {
     1891            puts stderr "runfile $file isn't readable"
     1892            return 0
     1893        }
     1894    }
     1895    set _saved(FileName) $fileName
     1896    return 1
     1897}
     1898
     1899#
     1900# Run files can be either explicitly named with their absolute or
     1901# relative path.  If the path is relative it is assumed the parent
     1902# directory is relative to the simset file.
     1903#
     1904#   /my/path/to/myfile.sav
     1905#   /my/path/to/myfile/runfiles...
     1906#
     1907itcl::body Rappture::Analyzer::LoadSimulations { files } {
     1908    set loadobjs {}
     1909    set root [file root $_saved(FileName)]
     1910    foreach runfile $files {
     1911        if { [file pathtype $runfile] == "relative" } {
     1912            set runfile [file join $root $runfile]
     1913        }
     1914        if { ![file exists $runfile] } {
     1915            puts stderr "can't find run: \"$runfile\""
     1916            continue
     1917        }
     1918        set status [catch {Rappture::library $runfile} result]
     1919        lappend loadobjs $result
     1920    }
     1921    clear
     1922    foreach runobj $loadobjs {
     1923        load $runobj
     1924    }
     1925    configure -notebookpage analyze
     1926    global win
     1927    $win.pager current analyzer
     1928   if 0 {
     1929    # Load the inputs for the very last run
     1930    global tool
     1931    $tool load $runobj
     1932}
     1933}
     1934
     1935#
     1936# Delete selected simulation set.
     1937#
     1938itcl::body Rappture::Analyzer::SelectSimsetForDeletion {} {
     1939    if { [FindSimsetsForApp $_appName] == 0 } {
     1940        return
     1941    }
     1942    if { [GetSimset "delete"] } {
     1943        set root [file root $_saved(FileName)]
     1944        file delete -force $root
     1945        file delete -force $_saved(FileName)
     1946    }
     1947}
     1948
     1949#
     1950# Find all .sav files for an application and load them into the tree.
     1951#
     1952itcl::body Rappture::Analyzer::FindSimsetsForApp { appName } {
     1953    $_tree delete 0
     1954    foreach fileName [glob -nocomplain ~/data/saved/$appName/*.sav] {
     1955        if { [ReadSimsetFile $fileName] } {
     1956            $_tree insert 0 -label $_saved(Name) -data [array get _saved]
     1957        }
     1958    }
     1959    return [$_tree degree 0]
     1960}
     1961
     1962#
     1963# Create dialog to select a simset from the currently available simsets.
     1964#
     1965itcl::body Rappture::Analyzer::GetSimset { name } {
     1966    set popup .selectsimset
     1967    if { [winfo exists $popup] } {
     1968        destroy $popup
     1969    }
     1970    # Create a popup for the print dialog
     1971    set title [string tolower $name]
     1972    Rappture::Balloon $popup -title "Select set of simulations to $title..."
     1973    set inner [$popup component inner]
     1974   
     1975    set tv $inner.tv
     1976    blt::treeview $inner.tv -tree $_tree \
     1977        -height 1i \
     1978        -width 5i \
     1979        -xscrollcommand [list $inner.xs set] \
     1980        -yscrollcommand [list $inner.ys set] \
     1981        -font "Arial 10"
     1982    scrollbar $inner.xs -orient horizontal -command "$tv xview"
     1983    scrollbar $inner.ys -orient vertical -command "$tv yview"
     1984    frame $inner.controls
     1985       
     1986    $tv column insert end "Name" "Description" "Date" "Creator"
     1987    $tv column configure treeView -hide yes
     1988    blt::table $inner \
     1989        0,0 $inner.tv -fill both \
     1990        0,1 $inner.ys -fill y \
     1991        1,0 $inner.xs -fill x
     1992    blt::table configure $inner r* c* -resize none
     1993    blt::table configure $inner r0 c0 -resize both
     1994
     1995    button $inner.controls.cancel -text "Cancel" \
     1996        -command [itcl::code $this Cancel]
     1997    set title [string totitle $name]
     1998    button $inner.controls.save -text $title \
     1999        -command [itcl::code $this Ok]
     2000    blt::table $inner.controls \
     2001        0,0 $inner.controls.cancel \
     2002        0,1 $inner.controls.save
     2003   
     2004    blt::table $inner \
     2005        0,0 $inner.tv -fill both \
     2006        0,1 $inner.ys -fill y \
     2007        1,0 $inner.xs -fill x \
     2008        3,0 $inner.controls  -fill x -cspan 2
     2009    blt::table configure $inner r* c* -resize none
     2010    blt::table configure $inner r0 c0 -resize both
     2011    blt::table configure $inner r2 -height 0.1i
     2012   
     2013    $popup configure \
     2014        -deactivatecommand [itcl::code $this Cancel]
     2015
     2016    $tv selection set [$_tree firstchild 0]
     2017    set inner [$popup component inner]
     2018    update
     2019    # Activate the popup and call for the output.
     2020    $popup activate $itk_component(help) below
     2021    Cancel
     2022    tkwait variable [itcl::scope _done]
     2023    set result $_done
     2024    $popup deactivate
     2025    return $result
     2026}
     2027
     2028itcl::body Rappture::Analyzer::SelectSimsetForLoading {} {
     2029    if { [FindSimsetsForApp $_appName] == 0 } {
     2030        return
     2031    }
     2032    if { [GetSimset "load"] } {
     2033        LoadSimulations $_saved(Files)
     2034    }
     2035}
     2036
     2037itcl::body Rappture::Analyzer::reload { fileName } {
     2038    if { [catch {
     2039        ReadSimsetFile $fileName
     2040        if { [llength $_saved(Files)] > 0 } {
     2041            #StartSplashScreen
     2042            LoadSimulations $_saved(Files)
     2043            #HideSplashScreen
     2044        }
     2045    } errs] != 0 } {
     2046        puts stderr "can't load \"$fileName\": errs=$errs"
     2047    }
     2048}
     2049
  • branches/1.4/gui/scripts/main.tcl

    r5833 r5981  
    9494    list  -load ""
    9595    value -input ""
     96    value -simset ""
    9697    value -nosim 0
    9798}
     
    264265set app [string trim [$tool xml get tool.id]]
    265266set url [Rappture::Tool::resources -huburl]
     267if 0 {
    266268if {"" != $url && "" != $app} {
    267269    set f [$win.pager component breadcrumbarea]
     
    281283    pack $f.hubcntls.questions -side top -anchor w
    282284}
     285}
     286
     287set f [$win.pager component breadcrumbarea]
     288frame $f.hubcntls
     289pack $f.hubcntls -side right -padx 4
     290label $f.hubcntls.icon -image [Rappture::icon ask] -highlightthickness 0
     291pack $f.hubcntls.icon -side left
     292button $f.hubcntls.about \
     293    -text "About this tool" \
     294    -state disabled \
     295    -command "
     296        [list Rappture::filexfer::webpage $url/tools/$app]
     297        Rappture::Logger::log help about
     298    "
     299pack $f.hubcntls.about -side top -anchor w
     300button $f.hubcntls.questions \
     301    -text Questions? \
     302    -state disabled \
     303    -command "
     304        [list Rappture::filexfer::webpage $url/resources/$app/questions]
     305        Rappture::Logger::log help questions
     306    "
     307pack $f.hubcntls.questions -side top -anchor w
     308if { $url != "" && $app != "" } {
     309    $f.hubcntls.about configure -state normal
     310    $f.hubcntls.about configure -state normal
     311}
    283312
    284313#
     
    399428    $f.analyze configure -notebookpage analyze
    400429    $win.pager current analyzer
     430} elseif {$params(-simset) ne ""} {
     431    $f.analyze reload $params(-simset)
    401432} elseif {$params(-input) ne ""} {
    402433    $tool load $inputobj
  • branches/1.4/gui/scripts/responseviewer.tcl

    r5937 r5981  
    152152
    153153    set rs $_response
    154     if {[catch {exec get_response.py $fname $rs $var1 $var2 $_label} res]} {
     154    if {[catch {exec puq get_response $fname $rs $var1 $var2 $_label} res]} {
    155155        set fp [open "response.err" r]
    156156        set rdata [read $fp]
  • branches/1.4/gui/scripts/resultset.tcl

    r5679 r5981  
    219219                    foreach {raw norm} \
    220220                        [Rappture::LibraryObj::value $xo $col] break
    221 
    222221                    if {![info exists unique($v)]} {
    223222                        # keep only unique label strings
  • branches/1.4/lang/tcl/scripts/task.tcl

    r5830 r5981  
    203203
    204204    # write out the driver.xml file for the tool
    205     set file "driver[pid].xml"
     205    global _rapptureCwd
     206    set file [file join $_rapptureCwd "driver[pid].xml"]
    206207    set status [catch {
    207208        set fid [open $file w]
     
    404405            # UQ. Collect data from all jobs and put it in one xml run file.
    405406            file delete -force -- run_uq.xml
    406             if {[catch {exec puq_analyze.py puq_[pid].hdf5} res]} {
     407            if {[catch {exec puq analyze puq_[pid].hdf5} res]} {
    407408                set fp [open "uq_debug.err" r]
    408409                set rdata [read $fp]
     
    559560                set rdir $_resources(-resultdir)
    560561            } else {
    561                 set rdir "."
     562                global _rapptureCwd
     563                set rdir $_rapptureCwd
    562564            }
    563565        } elseif {$resultdir ne ""} {
     
    578580    $xmlobj put tool.version.rappture.version $::Rappture::version
    579581    $xmlobj put tool.version.rappture.revision $::Rappture::build
    580 
     582    $xmlobj put output.filename $filename
     583    $xmlobj put output.version $Rappture::version
     584   
    581585    if {[info exists ::tcl_platform(user)]} {
    582586        $xmlobj put output.user $::tcl_platform(user)
     
    649653    set pid [pid]
    650654    # puts "get_params.py $pid $varlist $uq_type $uq_args"
    651     if {[catch {exec get_params.py $pid $varlist $uq_type $uq_args}]} {
     655    if {[catch {exec puq get_params $pid $varlist $uq_type $uq_args}]} {
    652656        set fp [open "uq_debug.err" r]
    653657        set rdata [read $fp]
  • branches/1.4/puq/Makefile.in

    r5707 r5981  
    1616pkgincludedir   = $(includedir)/$(PKG_DIR)
    1717top_builddir    = .
     18puq_libdir      = $(libdir)/puq
    1819
    1920MKDIR_P         = @MKDIR_P@
    2021INSTALL         = @INSTALL@
    2122
    22 SCRIPTS = $(srcdir)/get_params.py \
    23         $(srcdir)/puq_analyze.py \
    24         $(srcdir)/get_response.py
     23SCRIPTS =       $(srcdir)/get_params.py \
     24                $(srcdir)/analyze.py \
     25                $(srcdir)/get_response.py
    2526
    2627.PHONY: all install clean distclean
     
    2930
    3031install: all
    31         $(MKDIR_P) -m 0755 $(bindir)
     32        $(MKDIR_P) -m 0755 $(puq_libdir)
    3233        @for i in $(SCRIPTS); do \
    3334            echo "Installing $$i" ; \
    34             $(INSTALL) -m 0555 $$i $(bindir) ; \
     35            $(INSTALL) -m 0444 $$i $(puq_libdir) ; \
    3536        done
     37        $(INSTALL) -m 0555 puq $(bindir)
     38
    3639
    3740clean:
Note: See TracChangeset for help on using the changeset viewer.