Ignore:
Timestamp:
Jul 12, 2013, 7:39:50 PM (11 years ago)
Author:
mmc
Message:

Fixes for the xyresult reported on kronig_penney tool. The new bar/scatter
mode options were causing problems with the caching of existing segments.
Fixed the color options to work properly instead of showing black elements.
Fixed scatter plots so that colors are set correctly when you switch back
and forth between two results. Fixed dashed line styles so that they are
interpreted correctly. The kronig_penney tool seems to be working better now.

File:
1 edited

Legend:

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

    r3784 r3791  
    310310    set barwidth $params(-barwidth)
    311311    foreach {mapx mapy} [GetAxes $dataobj] break
     312    set label [$dataobj hints label]
    312313    foreach comp [$dataobj components] {
    313314        set tag $dataobj-$comp
     
    316317            # Ignore -type, it's already been set
    317318            switch -- [$g element type $elem] {
    318                 "line" - "scatter" {
     319                "line" {
     320                    set xv [$g line cget $elem -x]
     321                    if {([$xv length] <= 1) || ($lwidth == 0)} {
     322                        set sym square
     323                        set pixels 2
     324                    } else {
     325                        set sym ""
     326                        set pixels 6
     327                    }
    319328                    $g line configure $elem \
    320                         -linewidth $lwidth \
    321                         -dashes $dashes -hide no
    322                 } "bar" {
     329                        -symbol $sym -pixels $pixels \
     330                        -linewidth $lwidth -label $label \
     331                        -color $color -dashes $dashes \
     332                        -mapx $mapx -mapy $mapy -hide no
     333                }
     334                "scatter" {
     335                    $g line configure $elem \
     336                        -symbol square -pixels 2 \
     337                        -linewidth $lwidth -label $label \
     338                        -color $color -dashes $dashes \
     339                        -mapx $mapx -mapy $mapy -hide no
     340                }
     341                "bar" {
    323342                    $g bar configure $elem \
    324                         -barwidth $barwidth \
    325                         -hide no
     343                        -barwidth $barwidth -label $label \
     344                        -background $color -foreground $color \
     345                        -mapx $mapx -mapy $mapy -hide no
    326346                }
    327347            }
    328348        } else {
    329349            set elem "$type[incr _nextElement]"
    330             set label [$dataobj hints label]
    331350            set _elem2comp($elem) $tag
    332351            set _comp2elem($tag) $elem
     
    360379                        -barwidth $barwidth \
    361380                        -label $label \
    362                         -color $color \
     381                        -background $color -foreground $color \
    363382                        -mapx $mapx -mapy $mapy
    364383                }
     
    16311650        # Default
    16321651        if {[info exists params(-color)]} {
    1633             set color params(-color)
     1652            set color $params(-color)
    16341653        } else {
    16351654            set color black
     
    16381657            set type "line"
    16391658        }
    1640         if {[info exists parmas(-barwidth)]} {
     1659        if {[info exists params(-barwidth)]} {
    16411660            set barwidth $params(-barwidth)
    16421661        } else {
     
    16491668        }
    16501669        if {[info exists params(-linestyle)]} {
    1651             set dashes $parmas(-linestyle)
     1670            # convert -linestyle to BLT -dashes
     1671            switch -- $params(-linestyle) {
     1672                dashed { set dashes {4 4} }
     1673                dotted { set dashes {2 4} }
     1674                default { set dashes {} }
     1675            }
    16521676        } else {
    16531677            set dashes ""
Note: See TracChangeset for help on using the changeset viewer.