Changeset 1562 for trunk/gui/scripts/xyresult.tcl
- Timestamp:
- Sep 14, 2009 2:14:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/xyresult.tcl
r1527 r1562 91 91 protected method _hilite {state x y} 92 92 protected method _axis {option args} 93 protected method _getAxes { xydata}93 protected method _getAxes {curve} 94 94 protected method _getLineMarkerOptions { style } 95 95 protected method _getTextMarkerOptions { style } … … 435 435 436 436 catch {unset _limits} 437 foreach xydata$args {437 foreach curve $args { 438 438 # find the axes for this curve (e.g., {x y2}) 439 foreach {map(x) map(y)} [_getAxes $ xydata] break439 foreach {map(x) map(y)} [_getAxes $curve] break 440 440 441 441 foreach axis {x y} { … … 444 444 # store results -- ex: _limits(x2log-min) 445 445 set id $map($axis)$type 446 foreach {min max} [$ xydatalimits $axis$type] break446 foreach {min max} [$curve limits $axis$type] break 447 447 if {"" != $min && "" != $max} { 448 448 if {![info exists _limits($id-min)]} { … … 460 460 } 461 461 462 if {[$ xydatahints ${axis}scale] == "log"} {462 if {[$curve hints ${axis}scale] == "log"} { 463 463 _axis scale $map($axis) log 464 464 } … … 633 633 set anum(x) 0 634 634 set anum(y) 0 635 foreach xydata[get] {635 foreach curve [get] { 636 636 foreach ax {x y} { 637 set label [$ xydatahints ${ax}label]637 set label [$curve hints ${ax}label] 638 638 if {"" != $label} { 639 639 if {![info exists _label2axis($ax-$label)]} { … … 651 651 652 652 # if this axis has a description, add it as a tooltip 653 set desc [string trim [$ xydatahints ${ax}desc]]653 set desc [string trim [$curve hints ${ax}desc]] 654 654 Rappture::Tooltip::text $g-$axis $desc 655 655 } … … 698 698 # 699 699 set count 0 700 foreach xydata$_clist {701 set label [$ xydatahints label]702 foreach {mapx mapy} [_getAxes $ xydata] break703 704 foreach comp [$ xydatacomponents] {705 set xv [$ xydatamesh $comp]706 set yv [$ xydatavalues $comp]707 708 if {[info exists _curve2color($ xydata)]} {709 set color $_curve2color($ xydata)700 foreach curve $_clist { 701 set label [$curve hints label] 702 foreach {mapx mapy} [_getAxes $curve] break 703 704 foreach comp [$curve components] { 705 set xv [$curve mesh $comp] 706 set yv [$curve values $comp] 707 708 if {[info exists _curve2color($curve)]} { 709 set color $_curve2color($curve) 710 710 } else { 711 set color [$ xydatahints color]711 set color [$curve hints color] 712 712 if {"" == $color} { 713 713 set color black … … 715 715 } 716 716 717 if {[info exists _curve2width($ xydata)]} {718 set lwidth $_curve2width($ xydata)717 if {[info exists _curve2width($curve)]} { 718 set lwidth $_curve2width($curve) 719 719 } else { 720 720 set lwidth 2 721 721 } 722 722 723 if {[info exists _curve2dashes($ xydata)]} {724 set dashes $_curve2dashes($ xydata)723 if {[info exists _curve2dashes($curve)]} { 724 set dashes $_curve2dashes($curve) 725 725 } else { 726 726 set dashes "" … … 736 736 737 737 set elem "elem[incr count]" 738 set _elem2curve($elem) $ xydata739 738 set _elem2curve($elem) $curve 739 lappend label2elem($label) $elem 740 740 $g element create $elem -x $xv -y $yv \ 741 -symbol $sym -pixels $pixels -linewidth $lwidth -label $label \ 741 -symbol $sym -pixels $pixels -linewidth $lwidth \ 742 -label $label \ 742 743 -color $color -dashes $dashes \ 743 744 -mapx $mapx -mapy $mapy … … 745 746 } 746 747 747 foreach xydata $_clist { 748 # Fix duplicate labels by appending the simulation number 749 foreach label [array names label2elem] { 750 if { [llength $label2elem($label)] == 1 } { 751 continue 752 } 753 foreach elem $label2elem($label) { 754 set curve $_elem2curve($elem) 755 scan [$curve hints xmlobj] "::libraryObj%d" suffix 756 incr suffix 757 set elabel [format "%s \#%d" $label $suffix] 758 $g element configure $elem -label $elabel 759 } 760 } 761 762 foreach curve $_clist { 748 763 set xmin -Inf 749 764 set ymin -Inf … … 753 768 # Create text/line markers for each *axis.marker specified. 754 769 # 755 foreach m [$ xydataxmarkers] {770 foreach m [$curve xmarkers] { 756 771 foreach {at label style} $m break 757 772 set id [$g marker create line -coords [list $at $ymin $at $ymax]] … … 773 788 } 774 789 } 775 foreach m [$ xydataymarkers] {790 foreach m [$curve ymarkers] { 776 791 foreach {at label style} $m break 777 792 set id [$g marker create line -coords [list $xmin $at $xmax $at]] … … 1521 1536 # x-axis name (x, x2, x3, etc.), and y is the y-axis name. 1522 1537 # ---------------------------------------------------------------------- 1523 itcl::body Rappture::XyResult::_getAxes { xydata} {1538 itcl::body Rappture::XyResult::_getAxes {curve} { 1524 1539 # rebuild if needed, so we know about the axes 1525 1540 if {[$_dispatcher ispending !rebuild]} { … … 1529 1544 1530 1545 # what is the x axis? x? x2? x3? ... 1531 set xlabel [$ xydatahints xlabel]1546 set xlabel [$curve hints xlabel] 1532 1547 if {[info exists _label2axis(x-$xlabel)]} { 1533 1548 set mapx $_label2axis(x-$xlabel) … … 1537 1552 1538 1553 # what is the y axis? y? y2? y3? ... 1539 set ylabel [$ xydatahints ylabel]1554 set ylabel [$curve hints ylabel] 1540 1555 if {[info exists _label2axis(y-$ylabel)]} { 1541 1556 set mapy $_label2axis(y-$ylabel)
Note: See TracChangeset
for help on using the changeset viewer.