source: trunk/examples/objects/app-fermi/tcl/ex2/fermi_io.tcl @ 1655

Last change on this file since 1655 was 1655, checked in by dkearney, 11 years ago

examples of using a view in tcl and c, update tcl and c view apis

File size: 1.5 KB
Line 
1proc fermi_io {
2
3    # assume global interface variable.
4    # newly created objects are stored in the
5    # global interface variable. if there is more
6    # than one global interface variable, the
7    # interface that should be used is specified
8    # using an alternative version of the object constructor
9    # that supports an interface argument.
10
11    # describe the inputs
12    # declare a number named "temperature",
13    # with units of Kelvin, default value 300,
14    #
15    # the next number is named "Ef", has units of
16    # electron Volts, default value of -5.5
17    #
18    # Rappture::Number is assumed to be an input
19    Rappture::Number "temperature" "K" 300
20    Rappture::Number "Ef" "eV" -5.5
21
22    # Most simple xy plots for output
23    # Because it is a single plot, it gets it's own view.
24    # The plot is placed in the position 1,1 of the view.
25    set plot [Rappture::Plot "fdfPlot"]
26    $plot xaxis "Fermi-Dirac Factor" \
27        "Plot of Fermi-Dirac Calculation"
28    $plot yaxis "Energy"
29        "Energy cooresponding to each fdf" \
30        -hints {"units=eV"}
31
32    # Declaring a second plot creates a new view.
33    # The new plot will be placed in the position 1,1 of its view.
34    # User can do simple plot grouping using the add function
35    # in the science code.
36    Rappture::Plot "fdfPlot2" \
37        -xlabel "Fermi-Dirac Factor"\
38        -xdesc "Plot of Fermi-Dirac Calculation" \
39        -yaxis "Energy" \
40        -ydesc "Energy cooresponding to each fdf" \
41        -yhints {"units=eV"}
42}
Note: See TracBrowser for help on using the repository browser.