Ignore:
Timestamp:
Dec 8, 2010, 3:47:59 PM (14 years ago)
Author:
dkearney
Message:

adding -runfile flag to simsim
updating tool.tcl to cover the condition where resource file has results_dir directive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/simsim.in

    r1971 r1986  
    88# ======================================================================
    99#\
    10 . rappture.env \
    11 exec wish "$0" $*
     10dir=`dirname $0` ; \
     11. $dir/rappture.env ; \
     12exec $dir/wish "$0" $*
    1213
    1314package require Rappture
     
    414415 -compare <path>     - compare the results with the run.xml
    415416                       file at <path>.
     417 -runfile <path>     - move the run file to <path>
    416418 -nosim              - no simulation.
    417419 -help               - print this help menu.
     
    632634                set params(--driver) [lindex $argv $i]
    633635                # need to check to see if file exists, if not raise error
     636            } else {
     637                printHelp
     638            }
     639        } elseif {  ("-r" == $opt)      ||
     640                    ("-runfile" == $opt) ||
     641                    ("--runfile" == $opt)    } {
     642            if {[expr {$i + 1}] < $argc} {
     643                incr i
     644                set params(--runfile) [lindex $argv $i]
    634645            } else {
    635646                printHelp
     
    686697        --nosim false
    687698        --driver ""
     699        --runfile ""
    688700        --tool "./tool.xml"
    689701        oParams {}
     
    691703
    692704    parseOptions argv params
     705
     706    # ----------------------------------------------------------------------
     707    # LOAD RESOURCE SETTINGS
     708    #
     709    # Try to load the $SESSIONDIR/resources file, which contains
     710    # middleware settings, such as the application name and the
     711    # filexfer settings.
     712    # ----------------------------------------------------------------------
     713    Rappture::resources::load
     714
    693715
    694716    # keep the wish window from popping up
     
    739761    }
    740762
     763
     764
     765
    741766    set tool [Rappture::Tool ::#auto $xmlobj $installdir]
    742767
     
    748773    foreach {status result} [eval $tool run] break
    749774
    750     # read back the result from run.xml
     775    if {[string compare "" $params(--runfile)] != 0} {
     776        set runfilename [$tool getRunFile]
     777        set err [catch {file rename $runfilename $params(--runfile)} out]
     778        if {$err} {
     779            puts stderr $out
     780        }
     781    }
     782
     783    # if run was successful, check to see if we should compare
    751784    if {$status == 0 && $result != "ABORT"} {
    752785        if {[Rappture::library isvalid $result]} {
Note: See TracChangeset for help on using the changeset viewer.