- Timestamp:
- Mar 27, 2011, 11:34:36 AM (14 years ago)
- Location:
- trunk/builder/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/builder/scripts/main.tcl
r2153 r2155 40 40 option add *BugReport*banner*font -*-helvetica-bold-r-normal-*-18-* 41 41 option add *Filmstrip.background #aaaaaa 42 option add *Hierlist.selectBackground #9999ff 43 option add *errorHighlightColor #9999ff 42 44 option add *previewButtonBackground #4a758c 43 45 option add *previewButtonActiveBackground #a3c3cc … … 52 54 option add *build*cntls*Button.padX 2 53 55 option add *build*cntls*Editor.background white 56 option add *build*editelem*background #cccccc 57 option add *build*editelem*font {helvetica -12} 58 option add *build*editelem*title.font {helvetica -12 italic} 59 option add *build*editelem*vopt.font {helvetica -12 italic} 54 60 option add *options*Entry.background white 61 option add *options*Listbox.background white 55 62 option add *options*Text.background white 56 63 option add *options*Text.font {Helvetica -12} … … 153 160 set vname "value[incr ValueId]" 154 161 set type [string totitle $type] 155 return [list node: id $vname type $type terminal $term attributes ""] 162 return [list node: id $vname type $type terminal $term \ 163 attributes [list label $type]] 156 164 } 157 165 … … 175 183 176 184 if {[string length $LastToolXmlLoaded] > 0 && [$ToolXml xml] ne $LastToolXmlLoaded} { 177 puts ">>>>"178 puts $LastToolXmlLoaded179 puts "----"180 puts [$ToolXml xml]181 puts "<<<<"182 185 set choice [tk_messageBox -icon warning -type yesno -title "Rappture: Save Changes?" -message "Changes to the current tool haven't been saved.\n\nSave changes?"] 183 186 if {$choice == "yes" && ![main_saveas]} { … … 289 292 set alist "" 290 293 set type [$xmlobj element -as type $path] 294 set side [lindex [split $path .] 0] 291 295 292 296 if {[catch {Rappture::objects::get $type -attributes} attr] == 0} { … … 296 300 catch {unset info} 297 301 array set info [lrange $rec 1 end] 302 303 # see if this attribute is excluded based on the -only option 304 if {$info(-only) ne "" && [lsearch $info(-only) $side] < 0} { 305 continue ;# skip it! 306 } 298 307 299 308 set atype [lindex [split $info(-type) :] 0] … … 342 351 set type [string tolower [$hlist tree get $node type]] 343 352 353 # make sure this object has a viewer 354 if {[catch {Rappture::objects::get $type -palettes} pals]} { 355 # must not have an object definition 356 continue 357 } 358 set debug [list -node $node -counter [incr counter]] 359 360 set path [$hlist tree path $node "%lc:type(%id)"] 361 regsub -all {\(%id\)} $path "" path 362 # convert input.foo to palette name "Inputs" 363 set side [lindex [split $path .] 0] 364 set pname "[string totitle $side]s" 365 366 if {$side ne "tool" && [lsearch $pals $pname] < 0} { 367 lappend ErrList [list error "This object doesn't yet have a visualizer that lets it be used as an $side to the program. Support for this probably will be added in a future version of Rappture, but for now, it must be removed from the $side section." $debug] 368 continue 369 } 370 371 # query attributes for this type and check their values 344 372 if {[catch {Rappture::objects::get $type -attributes} attrdef] 345 373 || [catch {$hlist tree get $node attributes} attrlist]} { … … 355 383 } 356 384 } 357 set debug [list -node $node -counter [incr counter]]358 385 359 386 # perform all checks for this attribute type and append to ErrList 360 387 eval lappend ErrList [Rappture::objects::check $type \ 361 [array get ainfo] $debug]388 $side [array get ainfo] $debug] 362 389 } 363 390 … … 406 433 set thereis "There is" 407 434 set problem "this problem" 435 set errors "this error" 408 436 } else { 409 437 set thereis "There are" 410 438 set problem "these problems" 411 } 412 439 if {$nwarn+$nother == 0} { 440 set errors "these errors" 441 } else { 442 set errors "at least the $nerrs errors" 443 } 444 } 445 446 # if there are errors, we can't continue on 447 if {$nerrs > 0} { 448 tk_messageBox -icon error -type ok -title "Rappture: Problems with your tool definition" -message "$thereis $phrases for your current tool definition. You must resolve $errors before you continue with the preview." 449 return 1 450 } 451 452 # let the user decide whether to proceed 413 453 set choice [tk_messageBox -icon error -type yesno -title "Rappture: Problems with your tool definition" -message "$thereis $phrases for your current tool definition. Examine and resolve $problem?"] 414 454 if {$choice == "yes"} { … … 464 504 465 505 set win [.func.build.options.panes pane 0] 466 set ErrFocusAttr $debug(-attribute) 506 if {[info exists debug(-attribute)]} { 507 set ErrFocusAttr $debug(-attribute) 508 } else { 509 set ErrFocusAttr "" 510 } 467 511 $win.scrl.skel select none -silent ;# force a reload of options 468 512 $win.scrl.skel select $debug(-node) ;# so we can highlight ErrFocusAttr 469 513 514 # fix the navigation buttons for next/prev error 470 515 .func.build.options.errs.nav.prev configure \ 471 516 -state [expr {($ErrListPos == 0) ? "disabled" : "normal"}] … … 551 596 regsub -all {\(%id\)} $path "" path 552 597 set type [string tolower [$hlist tree get $node type]] 598 set side [lindex [split $path .] 0] 553 599 554 600 if {[catch {Rappture::objects::get $type -attributes} attrdef] … … 565 611 } 566 612 array set info [lrange $rec 1 end] 613 614 # see if this attribute is excluded based on the -only option 615 if {$info(-only) ne "" && [lsearch $info(-only) $side] < 0} { 616 continue ;# skip it! 617 } 618 567 619 set atype [lindex [split $info(-type) :] 0] 568 620 set proc "Attr[string totitle $atype]::export" … … 1136 1188 set path [$hlist curselection -path "%lc:type(%id)"] 1137 1189 regsub -all {\(%id\)} $path "" path 1190 set side [lindex [split $path .] 0] 1138 1191 1139 1192 # set the value column to expand … … 1176 1229 array set info [lrange $rec 1 end] 1177 1230 1231 # see if this attribute is excluded based on the -only option 1232 if {$info(-only) ne "" && [lsearch $info(-only) $side] < 0} { 1233 continue ;# skip it! 1234 } 1235 1236 # create the widget to edit this attribute 1178 1237 set atype [split $info(-type) :] 1179 1238 set atname [lindex $atype 0] … … 1212 1271 if {$name eq $ErrFocusAttr} { 1213 1272 $obj edit 1273 set errbg [option get $frame errorHighlightColor Background] 1274 $frame.l$wnum configure -background $errbg 1214 1275 set ErrFocusAttr "" 1215 1276 } -
trunk/builder/scripts/tool.rp
r2153 r2155 21 21 set cmd [string trim $attr(command)] 22 22 if {[string length $cmd] == 0} { 23 return [list error "Must set the command associated with the underlying tool that will be invoked to handle the simulation."]23 return [list warning "You should set the program type or enter a custom command that will be used to invoke the simulation program. This is necessary in order for the tool to compute any results. If you select a programming language, the builder will let you save a skeleton program that you can use as a starting point."] 24 24 } 25 if {![regexp @tool $cmd]} { 26 return [list warning "The command string usually contains @tool, which represents the directory containing the tool.xml file. The program is usually located relative to this directory. Avoid hard-coded directory paths."] 27 } 28 if {![regexp @driver $cmd]} { 29 return [list warning "The command should contain the argument @driver, which represents the driver input file generated by Rappture."] 25 if {[string index $cmd 0] ne "!"} { 26 if {![regexp @tool $cmd]} { 27 return [list warning "The command string usually contains @tool, which represents the directory containing the tool.xml file. The program is usually located relative to this directory. Avoid hard-coded directory paths."] 28 } 29 if {![regexp @driver $cmd]} { 30 return [list warning "The command should contain the argument @driver, which represents the driver input file generated by Rappture."] 31 } 30 32 } 31 33 }
Note: See TracChangeset
for help on using the changeset viewer.