Changeset 214


Ignore:
Timestamp:
Nov 29, 2007 6:53:09 PM (15 years ago)
Author:
ajj
Message:

Added extraction of values from plotted datasets (#4, trans, sum and monitor)

File:
1 edited

Legend:

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

    r209 r214  
    3737set plotcolors [list darkblue darkred darkgreen darkorange darkmagenta darkcyan darkgrey black blue red green orange magenta cyan grey] 
    3838set plotcolor 0 
     39#array set plotVals [ 
     40 
    3941 
    4042proc loadBT5File  {fileName x c cr t m cn br bl fr fl} { 
     
    344346} 
    345347 
     348proc getDataVals {} { 
     349        global pointVals 
     350        global num4var 
     351        global transvar 
     352        global sumvar 
     353        global monvar 
     354 
     355        global graph 
     356 
     357        set elem [lindex [array get pointVals name] 1] 
     358        set vecindex [lindex [array get pointVals index] 1]   
     359        set xval [lindex [array get pointVals x] 1] 
     360        set yval [lindex [array get pointVals y] 1] 
     361 
     362 
     363        if { [string length $elem] != 0 } { 
     364        set num4var [lindex [[ join "$elem _cvec" ""] range $vecindex $vecindex] 0] 
     365        set transvar [lindex [[ join "$elem _transvec" ""] range $vecindex $vecindex] 0] 
     366        set sumvar [lindex [[ join "$elem _countvec" ""] range $vecindex $vecindex] 0] 
     367        set monvar [lindex [[ join "$elem _monvec" ""] range $vecindex $vecindex] 0] 
     368 
     369        if { [$graph element exists valMarker] == 1} {           
     370                $graph element configure valMarker -data "$xval $yval"  
     371        } else { 
     372                $graph element create valMarker -data "$xval $yval" -symbol circle 
     373        } 
     374        } 
     375} 
     376 
    346377#Create menu frame 
    347378set mf [frame .mf] 
     
    419450 
    420451# Create graph 
    421 set graph [blt::graph .vp.g] 
     452set graph [blt::graph .vp.g -halo 30] 
    422453pack $graph -fill both -expand true -side left -anchor w 
    423454 
     
    428459bind .filter.filterEntry <Return> {filterTree [%W get]} 
    429460 
    430 #button .filter.filterButton -text "Filter" -command {filterTree [.filter.filterEntry get]}  
    431461pack .filter.filterLabel -side left 
    432462pack .filter.filterEntry -side left  
    433 #pack .filter.filterButton -side left 
    434 #pack .filter.filterReset -side right -padx 25 
    435463 
    436464#Plot controls 
     
    439467button $pcf.filterReset -text "Clear Plot" -command {resetGraph} 
    440468 
    441 ##Frame for radiobutton set to control plot type 
    442 #set ptf [frame .filter.pc.pt -borderwidth 1 -relief raised] 
    443 #radiobutton $ptf.c -text "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    444 #radiobutton $ptf.cr -text "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    445 #radiobutton $ptf.t -text "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    446 #radiobutton $ptf.m -text "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    447 #$ptf.c select 
    448 #pack $ptf.m -side right 
    449 #pack $ptf.t -side right 
    450 #pack $ptf.cr -side right 
    451 #pack $ptf.c -side right  
    452  
    453 ##Frame for y-axis log/lin choice 
    454 #set logfy [frame .filter.pc.logy -borderwidth 1 -relief raised] 
    455 ##Log/lin radiobutton set 
    456 #radiobutton $logfy.log -text "Log Y" -variable loglinY -value "yes" -command { changeLogLinY } 
    457 #radiobutton $logfy.lin -text "Lin Y" -variable loglinY -value "no" -command { changeLogLinY } 
    458 #$logfy.lin select 
    459 #pack $logfy.log -side right 
    460 #pack $logfy.lin -side right 
    461  
    462 ##Frame for y-axis log/lin choice 
    463 #set logfx [frame .filter.pc.logx -borderwidth 1 -relief raised] 
    464 ##Log/lin radiobutton set 
    465 #radiobutton $logfx.log -text "Log X" -variable loglinX -value "yes" -command { changeLogLinX } 
    466 #radiobutton $logfx.lin -text "Lin X" -variable loglinX -value "no" -command { changeLogLinX } 
    467 #$logfx.lin select 
    468 #pack $logfx.log -side right 
    469 #pack $logfx.lin -side right 
    470  
    471469pack $pcf.filterReset -side right -padx 25 
    472 #pack $logfy -side right 
    473 #pack $logfx -side right 
    474 #pack $ptf -side right 
    475470pack $pcf -side right 
     471 
     472 
     473#Data Value Display 
     474set dvdf [frame .filter.dvd -padx 25] 
     475pack [label $dvdf.num4lbl -text "#4: "] -side left 
     476pack [label $dvdf.num4 -textvariable num4var] -side left 
     477pack [label $dvdf.translbl -text "Trans: "] -side left 
     478pack [label $dvdf.trans -textvariable transvar] -side left 
     479pack [label $dvdf.sumlbl -text "Sum: "] -side left 
     480pack [label $dvdf.sum -textvariable sumvar] -side left 
     481pack [label $dvdf.monlbl -text "Mon: "] -side left 
     482pack [label $dvdf.mon -textvariable monvar] -side left 
     483pack $dvdf -side right -anchor s 
    476484 
    477485 
     
    481489pack .filter -side bottom -fill x -anchor sw 
    482490 
    483 Blt_ZoomStack $graph 
    484  
    485  
    486  
    487  
     491#Blt_ZoomStack $graph 
     492 
     493bind $graph <ButtonPress-1> { 
     494%W element closest %x %y pointVals 
     495getDataVals  
     496#puts [array get pointVals name] 
     497} 
     498 
     499 
     500 
     501 
Note: See TracChangeset for help on using the changeset viewer.