Changeset 6 for trunk/gui/apps


Ignore:
Timestamp:
Mar 23, 2005, 8:19:29 PM (20 years ago)
Author:
mmc
Message:

Fixed the Tcl library to mirror the API developed for XML
libraries on the Python side. The Tcl Rappture::library
now has methods like "children", "element", "put", etc.
One difference: On the Tcl side, the default -flavor for
element/children is "component", since that works better
in Tcl code. In Python, the default is flavor=object.

Also fixed the Tcl install script to install not just
the tcl/scripts library, but also the ../gui and ../lib
directories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/driver

    r1 r6  
    8282
    8383# open the XML file containing the material library
    84 set lib [Rappture::Library::open -std library.xml]
     84set lib [Rappture::library -std library.xml]
    8585                                                                               
    8686# open the XML file containing the tool parameters
     
    8989    exit 1
    9090}
    91 set tool [Rappture::Library::open $toolfile]
     91set tool [Rappture::library $toolfile]
    9292                                                                               
    9393# open the XML file containing the configuration for this application
     
    9696    exit 1
    9797}
    98 set config [Rappture::Library::open $configfile]
     98set config [Rappture::library $configfile]
    9999
    100100# ----------------------------------------------------------------------
     
    148148# ----------------------------------------------------------------------
    149149set w $win.input
    150 set ndevs [$config get -count controls.device]
    151 if {$ndevs > 0} {
    152     for {set i 0} {$i < $ndevs} {incr i} {
    153         set obj [$config get -object controls.device$i]
     150set dfirst ""
     151set dlist [$config children -type structure controls]
     152if {"" != $dlist} {
     153    foreach dname $dlist {
     154        set obj [$config element -flavor object controls.$dname]
    154155        set name [$obj get label]
    155156        set devs($name) $obj
     
    157158    set devlist [lsort [array names devs]]
    158159
    159     if {$ndevs > 1} {
     160    if {[array size devs] > 1} {
    160161        frame $w.devsel
    161162        pack $w.devsel -side top -fill x
     
    173174
    174175    set first [lindex $devlist 0]
     176    set dfirst $devs($first)
    175177    Rappture::DeviceViewer1D $w.device -device $devs($first) \
    176178        -tool $tool -library $lib
     
    185187set w $win.output
    186188Rappture::Analyzer $w.analyze -holdwindow $win.input \
    187     -tool $tool -analysis [$config get -object analysis] \
    188     -device $devs($first)
     189    -tool $tool -analysis [$config element -flavor object analysis] \
     190    -device $dfirst
    189191pack $w.analyze -expand yes -fill both
    190192
     
    192194# HOOK UP ANY CONTROLS CALLED OUT IN CONFIG.XML
    193195# ----------------------------------------------------------------------
    194 set ncntls [$config get -count controls.access]
    195 for {set i 0} {$i < $ncntls} {incr i} {
    196     set name [$config get access$i]
     196foreach access [$config children -type access controls] {
     197    set name [$config get controls.$access]
    197198    switch -glob -- $name {
    198         parameters.ambient* - device* {
     199        parameters.ambient* - structure* {
    199200            $win.input.device controls add $name
    200201        }
Note: See TracChangeset for help on using the changeset viewer.