Ignore:
Timestamp:
Nov 16, 2009, 3:03:37 PM (15 years ago)
Author:
dkearney
Message:

clean up on example programs for new bindings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/objects/app-fermi/fermi4.tcl

    r1581 r1615  
    1414
    1515# open the XML file containing the run parameters
    16 set lib [Rappture::Library [lindex $argv 0]]
     16set lib [Rappture::Library]
     17
     18$lib loadFile [lindex $argv 0]
    1719
    1820if {[$lib error] != 0} {
    1921    # cannot open file or out of memory
    20     puts stderr [$lib traceback]
     22    set o [$lib outcome]
     23    puts stderr [$o context]
     24    puts stderr [$o remark]
    2125    exit [$lib error]
    2226}
    2327
    24 set T [Rappture::connect $lib "temperature"]
    25 set Ef [$lib value "Ef" "units=eV"]
     28set T [Rappture::Connect $lib "temperature"]
     29set Ef [$lib value "Ef" "units eV"]
    2630
    2731if {[$lib error != 0]} {
    2832    # there were errors while retrieving input data values
    2933    # dump the tracepack
    30     puts stderr [$lib traceback]
     34    set o [$lib outcome]
     35    puts stderr [$o context]
     36    puts stderr [$o remark]
    3137    exit [$lib error]
    3238}
     
    3844set Emax [expr {$Ef + 10*$kT}]
    3945
    40 set dE [expr {0.005*($Emax-$Emin)}]
     46set dE [expr {(1.0/$nPts)*($Emax-$Emin)}]
    4147
    4248set E $Emin
     
    5056}
    5157
    52 set curveLabel "Fermi-Dirac Curve"
    53 set curveDesc "Plot of Fermi-Dirac Calculation"
    54 
    5558# do it the easy way,
    5659# create a plot to add to the library
     
    5962
    6063set p1 [Rappture::Plot $lib]
    61 $p1 add $nPts $fArr $EArr "" $curveLabel $curveDesc
     64$p1 add $fArr $EArr -name "fdfactor"
     65$p1 propstr "label" "Fermi-Dirac Curve"
     66$p1 propstr "desc" "Plot of Fermi-Dirac Calculation"
    6267$p1 propstr "xlabel" "Fermi-Dirac Factor"
    6368$p1 propstr "ylabel" "Energy"
Note: See TracChangeset for help on using the changeset viewer.