Changeset 1894 for branches


Ignore:
Timestamp:
Aug 31, 2010 7:01:06 PM (14 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/examples/objects/app-fermi/tcl/fermi_io.tcl

    r1623 r1894  
    1212    # declare a number named "temperature",
    1313    # with units of Kelvin, default value 300,
    14     # and specify that it is only an input
     14    #
    1515    # the next number is named "Ef", has units of
    16     # electron Volts, default value of -5.5 and
    17     # is also only an input value
    18     Rappture::Number "temperature" "K" 300 RP_VAR_INPUT
    19     Rappture::Number "Ef" "eV" -5.5 RP_VAR_INPUT
     16    # electron Volts, default value of -5.5
     17    #
     18    # Rappture::Number are assumed to be an input
     19    Rappture::Number "temperature" "K" 300
     20    Rappture::Number "Ef" "eV" -5.5
    2021
    2122    # describe the outputs
    2223    # declare a table to store the outputs
    23     # table is named "factorsTable" and is declared as
    24     # an output only object. two new columns are added to the
     24    # table is named "factorsTable".
     25    # two new columns are added to the
    2526    # table "factorsTable". the first column is named
    2627    # "Fermi-Dirac Factor", a description is provided,
     
    2829    # "Energy", a description is provided, and has units
    2930    # of electron Volts
    30     set results [Rappture::Table "factorsTable" RP_VAR_OUTPUT]
    31     $results new column "Fermi-Dirac Factor" \
    32                       "Plot of Fermi-Dirac Calculation"
    33     $results new column "Energy" \
    34                       "Energy cooresponding to each fdf" \
    35                       -hints {"units=eV"}
     31    # Rappture::Table is assumed to be an output
     32    set results [Rappture::Table "factorsTable"]
     33    $results column "Fermi-Dirac Factor" \
     34                    "Plot of Fermi-Dirac Calculation"
     35    $results column "Energy" \
     36                    "Energy cooresponding to each fdf" \
     37                    -hints {"units=eV"}
    3638
    3739    # describe how the outputs shoud be displayed
    38     # initialize a view named "fdfView", specifying it
    39     # as an output only object with a 1x1 view layout.
    40     # next, add a plot named "fdfPlot" to the view fdfView".
     40    # initialize a view named "fdfView", with a 1x1 layout.
     41    # next, add a plot named "fdfPlot" to the view "fdfView".
    4142    # populate the plot with data from the table
    42     # "fermifactors". Plot the column named
     43    # "factorsTable". Plot the column named
    4344    # "Fermi-Dirac Factor" vs the column named "Energy".
    44     # place the plot, named fdfPlot, at position 1x1 within
     45    # place the plot, named fdfPlot, at position 1,1 within
    4546    # the view's layout.
    46     set v [Rappture::View "fdfView" -flags RP_VAR_OUTPUT|RP_VIEW_1X1]
    47     $v plot table "fdfPlot" "factorsTable" \
    48                   "Fermi-Dirac Factor" "Energy" \
    49                    -hints {"position=1x1"}
    50 
    51     # add another curve to the "fdfPlot" plot.
    52     # plot the column named "Fermi-Dirac Factor2" vs
    53     # the column named "Energy"
    54     # $v plot table "fdfPlot" "factorsTable" \
    55     #               "Fermi-Dirac Factor2" "Energy" \
    56     #               -hints {"position=1x1"}
     47    # Rappture::View is assumed to be an output
     48    set v [Rappture::View "fdfView" -rows 1 -cols 1]
     49    $v plot "fdfPlot" -at "1,1" -table "factorsTable" \
     50        {"Fermi-Dirac Factor" "Energy" "g:o"}
    5751}
Note: See TracChangeset for help on using the changeset viewer.