source: trunk/builder/scripts/tool.rp @ 4503

Last change on this file since 4503 was 2158, checked in by mmc, 13 years ago

Integrated the new -tooltip support into the builder and added tooltips
for the Tool section. Also, fixed a problem whereby you would load an
XML file and then switch to another, and the program would prompt you
to save changes, even though nothing was changed. Empty strings were
being inserted into the XML causing it to appear different than the
original. That's fixed now.

File size: 2.2 KB
Line 
1object tool {
2    help http://rappture.org/wiki/rappture_xml_elements
3
4    attr title -type string -path title -tooltip "Sets the title of your tool, which usually appears on the right-hand side of your tool when it first starts up."
5
6    attr description -type string:lines=6 -expand yes -path about -tooltip "A few paragraphs describing your tool, which usually appear just below the title on the right-hand side of your tool when it first starts up."
7
8    attr command -title "Program" -type language -path command -tooltip "Sets the programming language used to implement your underlying simulation tool.  This determines the command line that Rappture will use to invoke your tool."
9
10
11    check title {
12        if {[string length [string trim $attr(title)]] == 0} {
13            return [list warning "You should include a title that describes your tool.  This usually appears on the opening screen when the tool starts up."]
14        }
15    }
16
17    check description {
18        if {[string length [string trim $attr(description)]] == 0} {
19            return [list warning "You should include a brief description of your tool.  This usually appears on the opening screen when the tool starts up."]
20        }
21    }
22
23    check command {
24        set cmd [string trim $attr(command)]
25        if {[string length $cmd] == 0} {
26            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."]
27        }
28        if {[string index $cmd 0] ne "!"} {
29            if {![regexp @tool $cmd]} {
30                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."]
31            }
32            if {![regexp @driver $cmd]} {
33                return [list warning "The command should contain the argument @driver, which represents the driver input file generated by Rappture."]
34            }
35        }
36    }
37}
Note: See TracBrowser for help on using the repository browser.