Changeset 1930


Ignore:
Timestamp:
Oct 25, 2010 8:50:55 AM (14 years ago)
Author:
gah
Message:
 
Location:
trunk
Files:
8 edited

Legend:

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

    r1587 r1930  
    209209itcl::body Rappture::ResultViewer::_plotAdd {dataobj {settings ""}} {
    210210    switch -- [$dataobj info class] {
     211        ::Rappture::DataTable {
     212            set mode "datatable"
     213            if {![info exists _mode2widget($mode)]} {
     214                set w $itk_interior.datatable
     215                Rappture::DataTableResult $w
     216                set _mode2widget($mode) $w
     217            }
     218        }
     219        ::Rappture::Drawing3d {
     220            set mode "vtkviewer"
     221            if {![info exists _mode2widget($mode)]} {
     222                set w $itk_interior.xy
     223                Rappture::VtkViewer $w
     224                set _mode2widget($mode) $w
     225            }
     226        }
    211227        ::Rappture::Histogram {
    212228            set mode "histogram"
     
    436452            return [Rappture::Curve ::#auto $xmlobj $path]
    437453        }
     454        datatable {
     455            return [Rappture::DataTable ::#auto $xmlobj $path]
     456        }
    438457        histogram {
    439458            return [Rappture::Histogram ::#auto $xmlobj $path]
     
    462481        number - integer - boolean - choice {
    463482            return [$xmlobj element -as object $path]
     483        }
     484        drawing3d {
     485            return [Rappture::Drawing3d ::#auto $xmlobj $path]
    464486        }
    465487        time - status {
  • trunk/gui/scripts/sequence.tcl

    r1929 r1930  
    7272                curve {
    7373                    set obj [Rappture::Curve ::#auto $xmlobj $path.$name.$cname]
     74                }
     75                datatable {
     76                    set obj [Rappture::DataTable ::#auto $xmlobj $path.$name.$cname]
    7477                }
    7578                histogram {
  • trunk/gui/scripts/sequenceresult.tcl

    r1929 r1930  
    436436            ::Rappture::Curve {
    437437                Rappture::XyResult $viewer
     438                pack $viewer -expand yes -fill both
     439            }
     440            ::Rappture::DataTable {
     441                Rappture::DataTable $viewer
    438442                pack $viewer -expand yes -fill both
    439443            }
  • trunk/gui/scripts/textresult.tcl

    r1929 r1930  
    2525    inherit itk::Widget
    2626
    27     constructor {args} { # defined below }
    28 
     27    constructor {args} {
     28        # defined below
     29    }
    2930    public method add {dataobj {settings ""}}
    3031    public method get {}
    3132    public method delete {args}
    3233    public method scale {args}
    33     public method parameters {title args} { # do nothing }
     34    public method parameters {title args} {
     35        # do nothing
     36    }
    3437    public method download {option args}
    3538
    3639    public method select {option args}
    3740    public method find {option}
     41    public method popup {option args}
    3842
    3943    private variable _dataobj ""  ;# data object currently being displayed
     
    134138
    135139    $itk_component(text) tag configure ERROR -foreground red
     140
     141    itk_component add emenu {
     142        menu $itk_component(text).menu -tearoff 0
     143    } {
     144        ignore -tearoff
     145    }
     146    $itk_component(emenu) add command \
     147        -label "Select All" -accelerator "Ctrl+A" \
     148        -command [itcl::code $this select all]
     149    $itk_component(emenu) add command \
     150        -label "Select None" -accelerator "Esc" \
     151        -command [itcl::code $this select none]
     152    bind $itk_component(text) <<PopupMenu>> \
     153        [itcl::code $this popup menu emenu %X %Y]
     154    $itk_component(emenu) add command \
     155        -label "Copy" -accelerator "Ctrl+C" \
     156        -command [list event generate $itk_component(text) <<Copy>>]
     157
     158    bind $itk_component(text) <Control-KeyPress-a> \
     159        [list $itk_component(emenu) invoke "Select All"]
     160    bind $itk_component(text) <Control-KeyPress-c> \
     161        [list $itk_component(emenu) invoke "Copy"]
     162    bind $itk_component(text) <Escape> \
     163        [list $itk_component(emenu) invoke "Select None" ]
     164    bind $itk_component(text) <Enter> [list ::focus $itk_component(text)]
    136165
    137166    eval itk_initialize $args
     
    333362            $itk_component(text) tag add sel 1.0 end
    334363        }
     364        none {
     365            if { [$itk_component(text) tag ranges "sel"] != "" } {
     366                selection clear
     367            }
     368        }
    335369        default {
    336             error "bad option \"$option\": should be all"
     370            error "bad option \"$option\": should be all or none"
    337371        }
    338372    }
     
    406440    $itk_component(findstatus) configure -text $status
    407441}
     442
     443# ----------------------------------------------------------------------
     444# USAGE: _popup menu <which> <X> <Y>
     445#
     446# Used internally to manage edit operations.
     447# ----------------------------------------------------------------------
     448itcl::body Rappture::TextResult::popup {option args} {
     449    switch -- $option {
     450        menu {
     451            if {[llength $args] != 3} {
     452                error "wrong # args: should be \"_popup $option which x y\""
     453            }
     454            set mname [lindex $args 0]
     455            set x [lindex $args 1]
     456            set y [lindex $args 2]
     457            tk_popup $itk_component($mname) $x $y
     458        }
     459        default {
     460            error "bad option \"$option\": should be menu"
     461        }
     462    }
     463}
  • trunk/gui/scripts/xyprint.tcl

    r1929 r1930  
    316316    # Element component
    317317    foreach elem [$orig element names] {
    318         $_clone element create $elem
    319         CopyOptions [list element configure $elem] $orig $_clone -data
    320         if { [$_clone element cget $elem -hide] } {
    321             $_clone element configure $elem -label ""
     318        set oper [$orig element type $elem]
     319        $_clone $oper create $elem
     320        CopyOptions [list $oper configure $elem] $orig $_clone -data
     321        if { [$_clone $oper cget $elem -hide] } {
     322            $_clone $oper configure $elem -label ""
     323            puts stderr [$_clone $oper configure]
    322324        }
    323325    }
     
    354356        -plotborderwidth 1 -plotrelief solid  \
    355357        -plotbackground white -plotpadx 0 -plotpady 0
    356     #
     358
    357359    set _settings($this-layout-width) [Pixels2Inches [$_clone cget -width]]
    358360    set _settings($this-layout-height) [Pixels2Inches [$_clone cget -height]]
    359 
    360361    set _fonts(legend) [font create legend \
    361362                            -family helvetica -size 10 -weight normal]
     
    385386    }
    386387    foreach elem [$_clone element names] {
     388        if { [$_clone element type $elem] == "bar" } {
     389            continue
     390        }
    387391        if { [$_clone element cget $elem -linewidth] > 1 } {
    388392            $_clone element configure $elem -linewidth 1 -pixels 3
     
    517521    set index [$itk_component(element_slider) get]
    518522    set elem $_settings($this-element-$index)
    519     set _settings($this-element-symbol) [$_clone element cget $elem -symbol]
     523    set _settings($this-element-label) [$_clone element cget $elem -label]
    520524    set _settings($this-element-color) [$_clone element cget $elem -color]
    521     set _settings($this-element-dashes) [$_clone element cget $elem -dashes]
    522     set _settings($this-element-label) [$_clone element cget $elem -label]
     525    if { [$_clone element type $elem] != "bar" } {
     526        set _settings($this-element-symbol) [$_clone element cget $elem -symbol]
     527        set _settings($this-element-dashes) [$_clone element cget $elem -dashes]
     528    }
    523529    set page $itk_component(legend_page)
    524530    set color [$page.color label $_settings($this-element-color)]
     
    530536        $page.color value [$page.color label $_settings($this-element-color)]
    531537    }
    532     $page.symbol value [$page.symbol label $_settings($this-element-symbol)]
    533     $page.dashes value [$page.dashes label $_settings($this-element-dashes)]
     538    if { [$_clone element type $elem] != "bar" } {
     539        $page.symbol value [$page.symbol label $_settings($this-element-symbol)]
     540        $page.dashes value [$page.dashes label $_settings($this-element-dashes)]
     541    }
    534542    #FixElement
    535543}
     
    665673itcl::body Rappture::XyPrint::ApplyLegendSettings {} {
    666674    set page $itk_component(legend_page)
    667     set _settings($this-legend-position)  [$page.position current]
    668675    set _settings($this-legend-anchor)    [$page.anchor current]
    669     foreach option { -hide -position -anchor -borderwidth } {
    670         SetComponentOption legend $option
    671     }
    672     $_clone legend configure -font legend
     676    if { $_clone != "" } {
     677        font configure $_fonts(legend) \
     678            -family $_settings($this-legend-font-family) \
     679            -size $_settings($this-legend-font-size) \
     680            -weight $_settings($this-legend-font-weight) \
     681            -slant $_settings($this-legend-font-slant)
     682        foreach option { -hide -position -anchor -borderwidth } {
     683            SetComponentOption legend $option
     684        }
     685        $_clone legend configure -font fixed -font $_fonts(legend)
     686    }
    673687    ApplyElementSettings
    674688}
     
    11241138itcl::body Rappture::XyPrint::ApplyElementSettings {} {
    11251139    set index [$itk_component(element_slider) get]
    1126     set elem $_settings($this-element-$index)
    11271140    set page $itk_component(legend_page)
    11281141    set _settings($this-element-color)  [$page.color current]
    1129     set _settings($this-element-symbol) [$page.symbol current]
    1130     set _settings($this-element-dashes) [$page.dashes current]
    1131     foreach option { -symbol -color -dashes -label } {
    1132         SetNamedComponentOption element $elem $option
    1133     }
    1134     RegeneratePreview
     1142    if { $_clone != "" } {
     1143        set elem $_settings($this-element-$index)
     1144        if { [$_clone element type $elem] != "bar" } {
     1145            set _settings($this-element-symbol) [$page.symbol current]
     1146            set _settings($this-element-dashes) [$page.dashes current]
     1147            foreach option { -symbol -dashes } {
     1148                SetNamedComponentOption element $elem $option
     1149            }
     1150        }
     1151        foreach option { -color -label } {
     1152            SetNamedComponentOption element $elem $option
     1153        }
     1154        RegeneratePreview
     1155    }
    11351156}
    11361157
     
    11651186    set _settings($this-general-remember) 0
    11661187    set page $itk_component(graph_page)
    1167     $page.format value [$page.format label $_settings($this-general-format)]
    1168     $page.style value [$page.style label $_settings($this-general-style)]
    11691188
    11701189    # Layout settings
     
    13551374        append out "    if \{ \[preview element exists \"$label\"\] \} \{\n"
    13561375        append out "        preview element configure \"$label\""
    1357         foreach opt { -symbol -color -dashes -label } {
     1376        if { [$_clone element type $elem] != "bar" } {
     1377            set options { -symbol -color -dashes -label }
     1378        } else {
     1379            set options { -color -label }
     1380        }
     1381        foreach opt $options {
    13581382            set value [list [$_clone element cget $elem $opt]]
    13591383            append out " $opt $value"
  • trunk/gui/scripts/xyresult.tcl

    r1839 r1930  
    44#  This widget is an X/Y plot, meant to view line graphs produced
    55#  as output from the run of a Rappture tool.  Use the "add" and
    6 #  "delete" methods to control the curves showing on the plot.
     6#  "delete" methods to control the dataobjs showing on the plot.
    77# ======================================================================
    88#  AUTHOR:  Michael McLennan, Purdue University
     
    2525
    2626set autocolors {
    27     #0000ff #ff0000 #00cc00
    28     #cc00cc #ff9900 #cccc00
    29     #000080 #800000 #006600
    30     #660066 #996600 #666600
    31 }
    32 set autocolors {
    33 #0000cd
    34 #cd0000
    35 #00cd00
    36 #3a5fcd
    37 #cdcd00
    38 #cd1076
    39 #009acd
    40 #00c5cd
    41 #a2b5cd
    42 #7ac5cd
    43 #66cdaa
    44 #a2cd5a
    45 #cd9b9b
    46 #cdba96
    47 #cd3333
    48 #cd6600
    49 #cd8c95
    50 #cd00cd
    51 #9a32cd
    52 #6ca6cd
    53 #9ac0cd
    54 #9bcd9b
    55 #00cd66
    56 #cdc673
    57 #cdad00
    58 #cd5555
    59 #cd853f
    60 #cd7054
    61 #cd5b45
    62 #cd6889
    63 #cd69c9
    64 #551a8b
     27    #0000cd
     28    #cd0000
     29    #00cd00
     30    #3a5fcd
     31    #cdcd00
     32    #cd1076
     33    #009acd
     34    #00c5cd
     35    #a2b5cd
     36    #7ac5cd
     37    #66cdaa
     38    #a2cd5a
     39    #cd9b9b
     40    #cdba96
     41    #cd3333
     42    #cd6600
     43    #cd8c95
     44    #cd00cd
     45    #9a32cd
     46    #6ca6cd
     47    #9ac0cd
     48    #9bcd9b
     49    #00cd66
     50    #cdc673
     51    #cdad00
     52    #cd5555
     53    #cd853f
     54    #cd7054
     55    #cd5b45
     56    #cd6889
     57    #cd69c9
     58    #551a8b
    6559}
    6660
     
    7670    itk_option define -autocolors autoColors AutoColors ""
    7771
    78     constructor {args} { # defined below }
    79     destructor { # defined below }
    80 
    81     public method add {curve {settings ""}}
     72    constructor {args} {
     73        # defined below
     74    }
     75    destructor {
     76        # defined below
     77    }
     78    public method add {dataobj {settings ""}}
    8279    public method get {}
    8380    public method delete {args}
    8481    public method scale {args}
    85     public method parameters {title args} { # do nothing }
     82    public method parameters {title args} {
     83        # do nothing
     84    }
    8685    public method download {option args}
    8786
     
    9190    protected method _hilite {state x y}
    9291    protected method _axis {option args}
    93     protected method _getAxes {curve}
     92    protected method _getAxes {dataobj}
    9493    protected method _getLineMarkerOptions { style }
    9594    protected method _getTextMarkerOptions { style }
     
    9897
    9998    private variable _dispatcher "" ;# dispatcher for !events
    100     private variable _clist ""     ;# list of curve objects
    101     private variable _curve2color  ;# maps curve => plotting color
    102     private variable _curve2width  ;# maps curve => line width
    103     private variable _curve2dashes ;# maps curve => BLT -dashes list
    104     private variable _curve2raise  ;# maps curve => raise flag 0/1
    105     private variable _curve2desc   ;# maps curve => description of data
    106     private variable _elem2curve   ;# maps graph element => curve
     99    private variable _dlist ""     ;# list of dataobj objects
     100    private variable _dataobj2color  ;# maps dataobj => plotting color
     101    private variable _dataobj2width  ;# maps dataobj => line width
     102    private variable _dataobj2dashes ;# maps dataobj => BLT -dashes list
     103    private variable _dataobj2raise  ;# maps dataobj => raise flag 0/1
     104    private variable _dataobj2desc   ;# maps dataobj => description of data
     105    private variable _elem2dataobj   ;# maps graph element => dataobj
    107106    private variable _label2axis   ;# maps axis label => axis ID
    108107    private variable _limits       ;# axis limits:  x-min, x-max, etc.
     
    174173        -outline black -fill red -color black
    175174
    176     #
    177175    # Add bindings so you can mouse over points to see values:
    178     #
    179176    bind $itk_component(plot) <Motion> \
    180177        [itcl::code $this _hilite at %x %y]
     
    182179        [itcl::code $this _hilite off %x %y]
    183180
    184     #
    185181    # Add support for editing axes:
    186     #
    187182    Rappture::Balloon $itk_component(hull).axes -title "Axis Options"
    188183    set inner [$itk_component(hull).axes component inner]
     
    206201    Rappture::Combobox $inner.format -width 15 -editable no
    207202    $inner.format choices insert end \
    208         "%.3g"  "Auto"         \
     203        "%.6g"  "Auto"         \
    209204        "%.0f"  "X"          \
    210205        "%.1f"  "X.X"          \
     
    231226
    232227    foreach axis {x y} {
    233         set _axisPopup(format-$axis) "%.3g"
     228        set _axisPopup(format-$axis) "%.6g"
    234229    }
    235230    _axis scale x linear
     
    250245    }
    251246    pack $itk_component(legend) -expand yes -fill both
    252 
    253247    after idle [subst {
    254248        update idletasks
     
    270264
    271265# ----------------------------------------------------------------------
    272 # USAGE: add <curve> ?<settings>?
    273 #
    274 # Clients use this to add a curve to the plot.  The optional <settings>
     266# USAGE: add <dataobj> ?<settings>?
     267#
     268# Clients use this to add a dataobj to the plot.  The optional <settings>
    275269# are used to configure the plot.  Allowed settings are -color,
    276270# -brightness, -width, -linestyle and -raise.
    277271# ----------------------------------------------------------------------
    278 itcl::body Rappture::XyResult::add {curve {settings ""}} {
     272itcl::body Rappture::XyResult::add {dataobj {settings ""}} {
    279273    array set params {
    280274        -color auto
     
    337331    }
    338332
    339     set pos [lsearch -exact $curve $_clist]
     333    set pos [lsearch -exact $dataobj $_dlist]
    340334    if {$pos < 0} {
    341         lappend _clist $curve
    342         set _curve2color($curve) $params(-color)
    343         set _curve2width($curve) $params(-width)
    344         set _curve2dashes($curve) $params(-linestyle)
    345         set _curve2raise($curve) $params(-raise)
    346         set _curve2desc($curve) $params(-description)
     335        lappend _dlist $dataobj
     336        set _dataobj2color($dataobj) $params(-color)
     337        set _dataobj2width($dataobj) $params(-width)
     338        set _dataobj2dashes($dataobj) $params(-linestyle)
     339        set _dataobj2raise($dataobj) $params(-raise)
     340        set _dataobj2desc($dataobj) $params(-description)
    347341
    348342        $_dispatcher event -idle !rebuild
     
    358352itcl::body Rappture::XyResult::get {} {
    359353    # put the dataobj list in order according to -raise options
    360     set clist $_clist
     354    set clist $_dlist
    361355    foreach obj $clist {
    362         if {[info exists _curve2raise($obj)] && $_curve2raise($obj)} {
     356        if {[info exists _dataobj2raise($obj)] && $_dataobj2raise($obj)} {
    363357            set i [lsearch -exact $clist $obj]
    364358            if {$i >= 0} {
     
    372366
    373367# ----------------------------------------------------------------------
    374 # USAGE: delete ?<curve1> <curve2> ...?
    375 #
    376 # Clients use this to delete a curve from the plot.  If no curves
    377 # are specified, then all curves are deleted.
     368# USAGE: delete ?<dataobj1> <dataobj2> ...?
     369#
     370# Clients use this to delete a dataobj from the plot.  If no dataobjs
     371# are specified, then all dataobjs are deleted.
    378372# ----------------------------------------------------------------------
    379373itcl::body Rappture::XyResult::delete {args} {
    380374    if {[llength $args] == 0} {
    381         set args $_clist
    382     }
    383 
    384     # delete all specified curves
     375        set args $_dlist
     376    }
     377
     378    # delete all specified dataobjs
    385379    set changed 0
    386     foreach curve $args {
    387         set pos [lsearch -exact $_clist $curve]
     380    foreach dataobj $args {
     381        set pos [lsearch -exact $_dlist $dataobj]
    388382        if {$pos >= 0} {
    389             set _clist [lreplace $_clist $pos $pos]
    390             catch {unset _curve2color($curve)}
    391             catch {unset _curve2width($curve)}
    392             catch {unset _curve2dashes($curve)}
    393             catch {unset _curve2raise($curve)}
    394             foreach elem [array names _elem2curve] {
    395                 if {$_elem2curve($elem) == $curve} {
    396                     unset _elem2curve($elem)
     383            set _dlist [lreplace $_dlist $pos $pos]
     384            catch {unset _dataobj2color($dataobj)}
     385            catch {unset _dataobj2width($dataobj)}
     386            catch {unset _dataobj2dashes($dataobj)}
     387            catch {unset _dataobj2raise($dataobj)}
     388            foreach elem [array names _elem2dataobj] {
     389                if {$_elem2dataobj($elem) == $dataobj} {
     390                    unset _elem2dataobj($elem)
    397391                }
    398392            }
     
    407401
    408402    # Nothing left? then start over with auto colors
    409     if {[llength $_clist] == 0} {
     403    if {[llength $_dlist] == 0} {
    410404        set _autoColorI 0
    411405    }
     
    413407
    414408# ----------------------------------------------------------------------
    415 # USAGE: scale ?<curve1> <curve2> ...?
     409# USAGE: scale ?<dataobj1> <dataobj2> ...?
    416410#
    417411# Sets the default limits for the overall plot according to the
    418 # limits of the data for all of the given <curve> objects.  This
    419 # accounts for all curves--even those not showing on the screen.
    420 # Because of this, the limits are appropriate for all curves as
     412# limits of the data for all of the given <dataobj> objects.  This
     413# accounts for all dataobjs--even those not showing on the screen.
     414# Because of this, the limits are appropriate for all dataobjs as
    421415# the user scans through data in the ResultSet viewer.
    422416# ----------------------------------------------------------------------
     
    435429
    436430    catch {unset _limits}
    437     foreach curve $args {
    438         # find the axes for this curve (e.g., {x y2})
    439         foreach {map(x) map(y)} [_getAxes $curve] break
     431    foreach dataobj $args {
     432        # find the axes for this dataobj (e.g., {x y2})
     433        foreach {map(x) map(y)} [_getAxes $dataobj] break
    440434
    441435        foreach axis {x y} {
     
    444438                # store results -- ex: _limits(x2log-min)
    445439                set id $map($axis)$type
    446                 foreach {min max} [$curve limits $axis$type] break
     440                foreach {min max} [$dataobj limits $axis$type] break
    447441                if {"" != $min && "" != $max} {
    448442                    if {![info exists _limits($id-min)]} {
     
    460454            }
    461455
    462             if {[$curve hints ${axis}scale] == "log"} {
     456            if {[$dataobj hints ${axis}scale] == "log"} {
    463457                _axis scale $map($axis) log
    464458            }
     
    530524                        append csvdata "[string repeat - 60]\n"
    531525                        append csvdata " [$dataobj hints label]\n"
    532                         if {[info exists _curve2desc($dataobj)]
    533                             && [llength [split $_curve2desc($dataobj) \n]] > 1} {
     526                        if {[info exists _dataobj2desc($dataobj)]
     527                            && [llength [split $_dataobj2desc($dataobj) \n]] > 1} {
    534528                            set indent "for:"
    535                             foreach line [split $_curve2desc($dataobj) \n] {
     529                            foreach line [split $_dataobj2desc($dataobj) \n] {
    536530                                append csvdata " $indent $line\n"
    537531                                set indent "    "
     
    599593    set g $itk_component(plot)
    600594
    601     # first clear out the widget
     595    # First clear out the widget
    602596    eval $g element delete [$g element names]
    603597    eval $g marker delete [$g marker names]
     
    608602    $g xaxis configure -hide no
    609603    $g yaxis configure -hide no
    610     catch {unset _label2axis}
     604    array unset _label2axis
    611605
    612606    #
     
    618612    set anum(x) 0
    619613    set anum(y) 0
    620     foreach curve [get] {
     614    foreach dataobj [get] {
    621615        foreach ax {x y} {
    622             set label [$curve hints ${ax}label]
     616            set label [$dataobj hints ${ax}label]
    623617            if {"" != $label} {
    624618                if {![info exists _label2axis($ax-$label)]} {
     
    636630
    637631                    # if this axis has a description, add it as a tooltip
    638                     set desc [string trim [$curve hints ${ax}desc]]
     632                    set desc [string trim [$dataobj hints ${ax}desc]]
    639633                    Rappture::Tooltip::text $g-$axis $desc
    640634                }
     
    663657
    664658    foreach axis $all {
    665         set _axisPopup(format-$axis) "%.3g"
     659        set _axisPopup(format-$axis) "%.6g"
    666660
    667661        $g axis bind $axis <Enter> \
     
    669663        $g axis bind $axis <Leave> \
    670664            [itcl::code $this _axis hilite $axis off]
    671         $g axis bind $axis <ButtonPress> \
     665        $g axis bind $axis <ButtonPress-1> \
    672666            [itcl::code $this _axis click $axis %x %y]
    673667        $g axis bind $axis <B1-Motion> \
    674668            [itcl::code $this _axis drag $axis %x %y]
    675         $g axis bind $axis <ButtonRelease> \
     669        $g axis bind $axis <ButtonRelease-1> \
    676670            [itcl::code $this _axis release $axis %x %y]
    677671        $g axis bind $axis <KeyPress> \
     
    680674
    681675    #
    682     # Plot all of the curves.
     676    # Plot all of the dataobjs.
    683677    #
    684678    set count 0
    685     foreach curve $_clist {
    686         set label [$curve hints label]
    687         foreach {mapx mapy} [_getAxes $curve] break
    688 
    689         foreach comp [$curve components] {
    690             set xv [$curve mesh $comp]
    691             set yv [$curve values $comp]
    692 
    693             if {[info exists _curve2color($curve)]} {
    694                 set color $_curve2color($curve)
     679    foreach dataobj $_dlist {
     680        set label [$dataobj hints label]
     681        foreach {mapx mapy} [_getAxes $dataobj] break
     682
     683        foreach comp [$dataobj components] {
     684            set xv [$dataobj mesh $comp]
     685            set yv [$dataobj values $comp]
     686
     687            if {[info exists _dataobj2color($dataobj)]} {
     688                set color $_dataobj2color($dataobj)
    695689            } else {
    696                 set color [$curve hints color]
     690                set color [$dataobj hints color]
    697691                if {"" == $color} {
    698692                    set color black
     
    700694            }
    701695
    702             if {[info exists _curve2width($curve)]} {
    703                 set lwidth $_curve2width($curve)
     696            if {[info exists _dataobj2width($dataobj)]} {
     697                set lwidth $_dataobj2width($dataobj)
    704698            } else {
    705699                set lwidth 2
    706700            }
    707701
    708             if {[info exists _curve2dashes($curve)]} {
    709                 set dashes $_curve2dashes($curve)
     702            if {[info exists _dataobj2dashes($dataobj)]} {
     703                set dashes $_dataobj2dashes($dataobj)
    710704            } else {
    711705                set dashes ""
     
    721715
    722716            set elem "elem[incr count]"
    723             set _elem2curve($elem) $curve
     717            set _elem2dataobj($elem) $dataobj
    724718            lappend label2elem($label) $elem
    725719            $g element create $elem -x $xv -y $yv \
     
    737731        }
    738732        foreach elem $label2elem($label) {
    739             set curve $_elem2curve($elem)
    740             scan [$curve hints xmlobj] "::libraryObj%d" suffix
     733            set dataobj $_elem2dataobj($elem)
     734            scan [$dataobj hints xmlobj] "::libraryObj%d" suffix
    741735            incr suffix
    742736            set elabel [format "%s \#%d" $label $suffix]
     
    745739    }       
    746740
    747     foreach curve $_clist {
     741    foreach dataobj $_dlist {
    748742        set xmin -Inf
    749743        set ymin -Inf
     
    753747        # Create text/line markers for each *axis.marker specified.
    754748        #
    755         foreach m [$curve xmarkers] {
     749        foreach m [$dataobj xmarkers] {
    756750            foreach {at label style} $m break
    757751            set id [$g marker create line -coords [list $at $ymin $at $ymax]]
     
    773767            }
    774768        }
    775         foreach m [$curve ymarkers] {
     769        foreach m [$dataobj ymarkers] {
    776770            foreach {at label style} $m break
    777771            set id [$g marker create line -coords [list $xmin $at $xmax $at]]
     
    914908
    915909            # Some elements are generated dynamically and therefore will
    916             # not have a curve object associated with them.
     910            # not have a dataobj object associated with them.
    917911            set mapx [$g element cget $elem -mapx]
    918912            set mapy [$g element cget $elem -mapy]
    919             if {[info exists _elem2curve($elem)]} {
    920                 foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
     913            if {[info exists _elem2dataobj($elem)]} {
     914                foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break
    921915            }
    922916
     
    930924                set y [$g axis transform $mapy $info(y)]
    931925               
    932                 if {[info exists _elem2curve($elem)]} {
    933                     set curve $_elem2curve($elem)
    934                     set yunits [$curve hints yunits]
    935                     set xunits [$curve hints xunits]
     926                if {[info exists _elem2dataobj($elem)]} {
     927                    set dataobj $_elem2dataobj($elem)
     928                    set yunits [$dataobj hints yunits]
     929                    set xunits [$dataobj hints xunits]
    936930                } else {
    937931                    set xunits ""
     
    951945
    952946            # Some elements are generated dynamically and therefore will
    953             # not have a curve object associated with them.
     947            # not have a dataobj object associated with them.
    954948            set mapx [$g element cget $elem -mapx]
    955949            set mapy [$g element cget $elem -mapy]
    956             if {[info exists _elem2curve($elem)]} {
    957                 foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
     950            if {[info exists _elem2dataobj($elem)]} {
     951                foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break
    958952            }
    959953
     
    962956            set y [$g axis transform $mapy $info(y)]
    963957               
    964             if {[info exists _elem2curve($elem)]} {
    965                 set curve $_elem2curve($elem)
    966                 set yunits [$curve hints yunits]
    967                 set xunits [$curve hints xunits]
     958            if {[info exists _elem2dataobj($elem)]} {
     959                set dataobj $_elem2dataobj($elem)
     960                set yunits [$dataobj hints yunits]
     961                set xunits [$dataobj hints xunits]
    968962            } else {
    969963                set xunits ""
     
    999993        set mapx [$g element cget $elem -mapx]
    1000994        set mapy [$g element cget $elem -mapy]
    1001         if {[info exists _elem2curve($elem)]} {
    1002             foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
     995        if {[info exists _elem2dataobj($elem)]} {
     996            foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break
    1003997        }
    1004998        set allx [$g x2axis use]
     
    11201114itcl::body Rappture::XyResult::_axis {option args} {
    11211115    set inner [$itk_component(hull).axes component inner]
    1122 
    11231116    switch -- $option {
    11241117        hilite {
     
    14391432
    14401433            if {[$itk_component(plot) axis cget $axis -logscale]} {
    1441                 set fmt "%.3g"
     1434                set fmt "%.6g"
    14421435            } else {
    14431436                set fmt $_axisPopup(format-$axis)
     
    15201513
    15211514# ----------------------------------------------------------------------
    1522 # USAGE: _getAxes <curveObj>
     1515# USAGE: _getAxes <dataobj>
    15231516#
    15241517# Used internally to figure out the axes used to plot the given
    1525 # <curveObj>.  Returns a list of the form {x y}, where x is the
     1518# <dataobj>.  Returns a list of the form {x y}, where x is the
    15261519# x-axis name (x, x2, x3, etc.), and y is the y-axis name.
    15271520# ----------------------------------------------------------------------
    1528 itcl::body Rappture::XyResult::_getAxes {curve} {
     1521itcl::body Rappture::XyResult::_getAxes {dataobj} {
    15291522    # rebuild if needed, so we know about the axes
    15301523    if {[$_dispatcher ispending !rebuild]} {
     
    15341527
    15351528    # what is the x axis?  x? x2? x3? ...
    1536     set xlabel [$curve hints xlabel]
     1529    set xlabel [$dataobj hints xlabel]
    15371530    if {[info exists _label2axis(x-$xlabel)]} {
    15381531        set mapx $_label2axis(x-$xlabel)
     
    15421535
    15431536    # what is the y axis?  y? y2? y3? ...
    1544     set ylabel [$curve hints ylabel]
     1537    set ylabel [$dataobj hints ylabel]
    15451538    if {[info exists _label2axis(y-$ylabel)]} {
    15461539        set mapy $_label2axis(y-$ylabel)
  • trunk/lang/tcl/src/Makefile.in

    r1916 r1930  
    7171FFMPEG          = @HAVE_FFMPEG_LIBS@
    7272ifeq ($(FFMPEG),yes)
    73     # OBJS += RpMediaPlayerTclInterface.o
    7473    OBJS += RpVideoTclInterface.o
    7574    LIBS += -L../../../src/objects -lRpObjects
  • trunk/lang/tcl/src/Rappture_Init.c

    r1916 r1930  
    3838
    3939#ifdef BUILD_with_ffmpeg
    40 // extern Tcl_AppInitProc RpMediaPlayer_Init;
    4140extern Tcl_AppInitProc RpVideo_Init;
    4241#endif
     
    7271    }
    7372#ifdef BUILD_with_ffmpeg
    74 //    if (RpMediaPlayer_Init(interp) != TCL_OK) {
    75 //        return TCL_ERROR;
    76 //    }
    7773    if (RpVideo_Init(interp) != TCL_OK) {
    7874        return TCL_ERROR;
Note: See TracChangeset for help on using the changeset viewer.