Changeset 1159 for trunk/gui/apps/driver
- Timestamp:
- Sep 22, 2008, 5:41:59 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/apps/driver
r1143 r1159 85 85 Rappture::getopts argv params { 86 86 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 92 array set params [list -load [split $params(-load) ","]] 93 94 set loadobjs {} 95 foreach 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 87 102 } 88 103 89 104 # open the XML file containing the tool parameters 90 105 if {![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 94 142 set xmlobj [Rappture::library $params(-tool)] 95 143 … … 201 249 }] 202 250 203 Rappture::Analyzer $f.analyze $tool -simcontrol auto 251 # can we call analyzer without specifying -notebookpage? 252 Rappture::Analyzer $f.analyze $tool -simcontrol auto -notebookpage about 204 253 pack $f.analyze -expand yes -fill both 205 254 … … 236 285 } 237 286 } 287 288 # load previous xml runfiles 289 if {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 238 299 wm deiconify .main
Note: See TracChangeset
for help on using the changeset viewer.