Changeset 1159 for trunk/gui/apps/driver


Ignore:
Timestamp:
Sep 22, 2008, 5:41:59 PM (16 years ago)
Author:
dkearney
Message:

updated driver to allow the user to revisualize old run files just as rerun did. if driver can find the tool.xml file and where the application is installed, it can also allow the user to run new simulations after preloading old simulations.

Finally figured out where the current tags in group objects were coming from. controlOwner was adjusted to stop putting current tags in things. this only seemed to happen when the application also contained a loader, because we were doing an xml copy of nodes.

rewrote rerun to be a small wrapper around the "driver -load" command. rerun is now a script like rappture, it is populated with rappture's install directory from configure, so configure.in was updated. added some stuff for finding mcc in the configure.in script for a future commit

changed Rappture::Analyzer to accept -notebookpage configure flag so we can specify which page of the analyzer notebook should be currently showing. also inside of the analyzer, changed behavior of simstatus to allow us to still show a message even if the simulation button is disabled. this is helpful because we can tell the user why the simulation button is grayed out. one example of this is the case when we load old run.xml files, but cannot find a tool.xml file. the user cannot run a simulation, even if they change an input, because we can't figure out where the app is installed. now we can tell the user, why they cannot run the simulation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/driver

    r1143 r1159  
    8585Rappture::getopts argv params {
    8686    value -tool tool.xml
     87    value -load ""
     88    value -nosim 0
     89}
     90
     91# rewrite out params(-load) variable with a properly split list of files
     92array set params [list -load [split $params(-load) ","]]
     93
     94set loadobjs {}
     95foreach runfile $params(-load) {
     96    if {![file exists $runfile]} {
     97        puts stderr "can't find run: \"$runfile\""
     98        exit 1
     99    }
     100    set status [catch {Rappture::library $runfile} result]
     101    lappend loadobjs $result
    87102}
    88103
    89104# open the XML file containing the tool parameters
    90105if {![file exists $params(-tool)]} {
    91     puts stderr "can't find tool \"$params(-tool)\""
    92     exit 1
    93 }
     106    # check to see if the user specified any run.xml files to load.
     107    # if so, we can use that as the tool.xml. if we can find where
     108    # the original application was installed using the xml tag
     109    # tool.version.application.directory(top), the user can
     110    # run new simulations, otherwise they can only revisualize the
     111    # run.xml files they are loading.
     112    set pseudotool ""
     113    set lflen [llength $loadobjs)]
     114    if {0 == $lflen} {
     115        puts stderr "can't find tool \"$params(-tool)\""
     116        exit 1
     117    }
     118    if {!$params(-nosim)} {
     119        foreach runobj $loadobjs {
     120            set tdir [$runobj get tool.version.application.directory(tool)]
     121            if {[file isdirectory $tdir] && \
     122                [file exists $tdir/tool.xml]} {
     123                set pseudotool $tdir/tool.xml
     124                break
     125            }
     126        }
     127    }
     128    if {![file exists $pseudotool]} {
     129        # we didn't find a tool.xml file,
     130        # use info from a runfile to build gui
     131        # disable simulation, because no tool.xml
     132        set pseudotool [lindex $params(-load) 0]
     133        array set params [list -nosim true]
     134    }
     135    if {![file exists $pseudotool]} {
     136        puts stderr "can't find tool \"$params(-tool)\""
     137        exit 1
     138    }
     139    array set params [list -tool $pseudotool]
     140}
     141
    94142set xmlobj [Rappture::library $params(-tool)]
    95143
     
    201249}]
    202250
    203 Rappture::Analyzer $f.analyze $tool -simcontrol auto
     251# can we call analyzer without specifying -notebookpage?
     252Rappture::Analyzer $f.analyze $tool -simcontrol auto -notebookpage about
    204253pack $f.analyze -expand yes -fill both
    205254
     
    236285    }
    237286}
     287
     288# load previous xml runfiles
     289if {0 != [llength $params(-load)]} {
     290    foreach runobj $loadobjs {
     291        $f.analyze load $runobj
     292    }
     293    $f.analyze configure -notebookpage analyze
     294    if {$params(-nosim)} {
     295        $f.analyze configure -simcontrol off
     296    }
     297}
     298
    238299wm deiconify .main
Note: See TracChangeset for help on using the changeset viewer.