Changeset 25 for trunk/gui


Ignore:
Timestamp:
Jul 18, 2005 7:31:19 AM (19 years ago)
Author:
mmc
Message:

Added <min>, <max>, and <scale> directives to the output plotter
for <curve> objects. If you specify any of these within an axis
for a curve, they set the default characteristics for the axis.

Location:
trunk/gui/scripts
Files:
3 edited

Legend:

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

    r17 r25  
    155155        xunits  xaxis.units
    156156        xscale  xaxis.scale
     157        xmin    xaxis.min
     158        xmax    xaxis.max
    157159        ylabel  yaxis.label
    158160        yunits  yaxis.units
    159161        yscale  yaxis.scale
     162        ymin    yaxis.min
     163        ymax    yaxis.max
    160164    } {
    161165        set str [$_curve get $path]
  • trunk/gui/scripts/loader.tcl

    r22 r25  
    117117    #
    118118    set str [$_owner xml get $path.default]
    119     if {$str != ""} { after 500 [itcl::code $this value $str] }
     119    if {$str != ""} { after 1000 [itcl::code $this value $str] }
    120120}
    121121
  • trunk/gui/scripts/xyresult.tcl

    r16 r25  
    277277    # first clear out the widget
    278278    eval $g element delete [$g element names]
    279     $g axis configure y -min "" -max ""
     279    $g axis configure x -min "" -max "" -logscale 0
     280    $g axis configure y -min "" -max "" -logscale 0
    280281
    281282    # extract axis information from the first curve
     
    304305    }
    305306
     307    foreach lim {xmin xmax ymin ymax} {
     308        set limits($lim) ""
     309    }
     310
    306311    # plot all of the curves
    307312    set count 0
    308313    foreach xydata $clist {
    309314        foreach comp [$xydata components] {
     315            catch {unset hints}
     316            array set hints [$xydata hints]
     317
    310318            set xv [$xydata mesh $comp]
    311319            set yv [$xydata values $comp]
     
    314322                set color $_curve2color($xydata)
    315323            } else {
    316                 set color [$xydata hints color]
    317                 if {"" == $color} {
     324                if {[info exists hints(color)]} {
     325                    set color $hints(color)
     326                } else {
    318327                    set color black
    319328                }
     
    341350            set _elem2curve($elem) $xydata
    342351
    343             set label [$xydata hints label]
     352            if {[info exists hints(label)]} {
     353                set label $hints(label)
     354            } else {
     355                set label ""
     356            }
    344357            $g element create $elem -x $xv -y $yv \
    345358                -symbol $sym -pixels 6 -linewidth $lwidth -label $label \
    346359                -color $color -dashes $dashes
    347         }
    348     }
    349 
     360
     361            if {[info exists hints(xscale)] && $hints(xscale) == "log"} {
     362                $g xaxis configure -logscale 1
     363            }
     364            if {[info exists hints(yscale)] && $hints(yscale) == "log"} {
     365                $g yaxis configure -logscale 1
     366            }
     367
     368            # see if there are any hints on limit
     369            foreach lim {xmin xmax ymin ymax} {
     370                if {[info exists hints($lim)] && "" != $hints($lim)} {
     371                    set limits($lim) $hints($lim)
     372                }
     373            }
     374        }
     375    }
     376
     377    # add any limit directives from the curve objects
     378    foreach lim {xmin xmax ymin ymax} var {_xmin _xmax _vmin _vmax} {
     379        if {"" != $limits($lim)} {
     380            set $var $limits($lim)
     381        }
     382    }
    350383    _fixLimits
    351384}
Note: See TracChangeset for help on using the changeset viewer.