Changeset 20 for sans/utils


Ignore:
Timestamp:
Dec 13, 2006 10:56:57 AM (16 years ago)
Author:
ajj
Message:

Made radio buttons work - now change plot type for all plotted graphs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/utils/bt5/bt5plot/bt5plot

    r19 r20  
    165165} 
    166166 
    167  
     167proc changePlotType {elem} { 
     168        global graph 
     169        global plotType 
     170 
     171        set xvec [join "$elem _xvec" ""] 
     172        set countratevec [join "$elem _countratevec" ""] 
     173        set countvec [join "$elem _countvec" ""] 
     174        set transvec [join "$elem _transvec" ""] 
     175        set monvec [join "$elem _monvec" ""] 
     176 
     177        global $xvec $countvec $transvec $monvec 
     178         
     179        switch -exact $plotType { 
     180                        count { $graph element configure $elem -ydata $countvec} 
     181                        countrate { $graph element configure $elem -ydata $countratevec} 
     182                        trans { $graph element configure $elem -ydata $transvec} 
     183                        mon { $graph element configure $elem -ydata  $monvec} 
     184        } 
     185} 
     186         
    168187proc LoadTree { tree parentNode dir } { 
    169188        cd $dir 
     
    266285set pcf [frame .filter.pc] 
    267286button $pcf.filterReset -text "Clear Plot" -command {resetGraph} 
    268 radiobutton $pcf.c -text "Counts" -variable plotType -value "count" 
    269 radiobutton $pcf.cr -text "Count Rate" -variable plotType -value "countrate" 
    270 radiobutton $pcf.t -text "Trans" -variable plotType -value "trans" 
    271 radiobutton $pcf.m -text "Mon" -variable plotType -value "mon" 
     287radiobutton $pcf.c -text "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     288radiobutton $pcf.cr -text "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     289radiobutton $pcf.t -text "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     290radiobutton $pcf.m -text "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    272291$pcf.c select 
    273292pack $pcf.filterReset -side right -padx 25 
Note: See TracChangeset for help on using the changeset viewer.