Ignore:
Timestamp:
Apr 2, 2005 9:33:16 AM (19 years ago)
Author:
mmc
Message:

Updated the code to the latest Rappture XML conventions, and fixed
up the moleculeViewer and energyLevels viewer. Everything works
properly now with the new app-huckel project. You can load up
the molecule viewer, rotate molecules, and view their energy levels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/analyzer.tcl

    r6 r8  
    125125#
    126126# If the simulation page is showing, this kicks off the simulator
    127 # by executing the executable.command associated with the -tool.  While
     127# by executing the tool.command associated with the -tool.  While
    128128# the simulation is running, it shows status.  When the simulation is
    129129# finished, it switches automatically to "analyze" mode and shows
     
    137137
    138138        set job(control) ""
     139        set job(error) ""
    139140
    140141        # if the hold window is set, then put up a busy cursor
     
    152153            set xml2 [$itk_option(-device) xml]
    153154            regsub -all {&} $xml2 {\\\&} xml2
    154             regsub {</tool>} $xml "$xml2</tool>" xml
     155            regsub {</run>} $xml "$xml2</run>" xml
    155156            puts $fid $xml
    156157            close $fid
     
    159160        # execute the tool using the path from the tool description
    160161        if {$status == 0} {
    161             set cmd [$itk_option(-tool) get executable.command]
     162            set cmd [$itk_option(-tool) get tool.command]
    162163
    163164            set status [catch {eval blt::bgexec \
     
    211212
    212213    # if control mode is "auto", then simulate right away
    213     if {$_control == "auto"} {
     214    if {[string match auto* $_control]} {
    214215        simulate
    215216    }
     
    231232
    232233    # try to load new results from the given file
    233     set _run [Rappture::Library::open $file]
     234    set _run [Rappture::library $file]
    234235
    235236    # go through the analysis and create widgets to display results
    236237    foreach item [array names _widgets] {
    237         $_widgets($item) configure -run $_run
     238        $_widgets($item) configure -output $_run
    238239    }
    239240}
     
    254255# CONFIGURATION OPTION: -tool
    255256#
    256 # Set to the Rappture::Library object representing the tool being
     257# Set to the Rappture::library object representing the tool being
    257258# run in this analyzer.
    258259# ----------------------------------------------------------------------
    259260itcl::configbody Rappture::Analyzer::tool {
    260261    if {![Rappture::library isvalid $itk_option(-tool)]} {
    261         error "bad value \"$itk_option(-tool)\": should be Rappture::Library"
     262        error "bad value \"$itk_option(-tool)\": should be Rappture::library"
    262263    }
    263264
     
    271272# CONFIGURATION OPTION: -device
    272273#
    273 # Set to the Rappture::Library object representing the device being
     274# Set to the Rappture::library object representing the device being
    274275# run in this analyzer.
    275276# ----------------------------------------------------------------------
     
    277278    if {$itk_option(-device) != ""
    278279          && ![Rappture::library isvalid $itk_option(-device)]} {
    279         error "bad value \"$itk_option(-device)\": should be Rappture::Library"
     280        error "bad value \"$itk_option(-device)\": should be Rappture::library"
    280281    }
    281282    reset
     
    285286# CONFIGURATION OPTION: -analysis
    286287#
    287 # Set to the Rappture::Library object representing the analysis that
     288# Set to the Rappture::library object representing the analysis that
    288289# should be shown in this analyzer.
    289290# ----------------------------------------------------------------------
    290291itcl::configbody Rappture::Analyzer::analysis {
    291292    if {![Rappture::library isvalid $itk_option(-analysis)]} {
    292         error "bad value \"$itk_option(-analysis)\": should be Rappture::Library"
     293        error "bad value \"$itk_option(-analysis)\": should be Rappture::library"
    293294    }
    294295    set _control [$itk_option(-analysis) get control]
     
    314315                pack $_widgets($item) -expand yes -fill both
    315316            }
     317            elevels* {
     318                set name "page[incr counter]"
     319
     320                set page [$itk_component(results) insert end $name]
     321                $itk_component(resultselector) choices insert end \
     322                    $name "Energy Levels"
     323
     324                set _widgets($item) [Rappture::EnergyLevels $page.#auto \
     325                    -layout [$itk_option(-analysis) element -flavor object $item]]
     326                pack $_widgets($item) -expand yes -fill both
     327            }
    316328        }
    317329    }
Note: See TracChangeset for help on using the changeset viewer.