Changes in / [20:30]


Ignore:
Location:
/sans
Files:
26 added
3 deleted
1 edited

Legend:

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

    r20 r30  
    33package require BLT 
    44 
     5#set images(normal) [image create photo -format gif -data { 
     6#    R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A 
     7#    AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6 
     8#    nQkAOw== 
     9#} ] 
     10 
     11#Red dot image 
    512set images(normal) [image create photo -format gif -data { 
    6     R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A 
    7     AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6 
    8     nQkAOw== 
     13R0lGODlhDAAMANUAAPUAAO0EBOsFBeYICOQJCeIKCtwNDdoODsIaGsAbG74cHLoeHrgfH7YgILQh 
     14IbAjI25FRWhISGRKSmJLS2BMTF1OTvv7+/n5+ff39/X19e3t7enp6ePj47a2trKysrCwsKysrKqq 
     15qqioqH19fXt7e3l5eXNzc3FxcW9vb21tbWtra2lpaWdnZ11dXVlZWVVVVVNTU////wAAAAAAAAAA 
     16AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADEALAAAAAAMAAwAAAZjwFgs 
     17A1rBYKkPRhjjsI5QmGozNEoUhMKCAkNdRDCIAEAGDCIwjxFRLjNgpmOgTS7AXC/YmG5vnWAJdAAN 
     18MCQhMBEDbQUTMB0YKjAUDgYHDxUwJxYxG5FRmRpMFx8lRyMdmzFBADs= 
    919} ] 
    1020 
     21#set images(active) [image create photo -format gif -data { 
     22#    R0lGODlhEAANAMIAAAAAAH9/f/////+/AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A 
     23#    AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp 
     24#    ZTKAsiCtWq0JADs= 
     25#} ] 
     26 
     27#Green dot image 
    1128set images(active) [image create photo -format gif -data { 
    12     R0lGODlhEAANAMIAAAAAAH9/f/////+/AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A 
    13     AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp 
    14     ZTKAsiCtWq0JADs= 
     29R0lGODlhDAAMANUAAADIAATCBAXBBQi9CAm8CQq6Cg22DQ61DhqjGhuhGxygHB6dHh+cHyCbICGZ 
     30ISOWI0VmRUhiSEpfSkteS0xdTE5aTvv7+/n5+ff39/X19e3t7enp6ePj47a2trKysrCwsKysrKqq 
     31qqioqH19fXt7e3l5eXNzc3FxcW9vb21tbWtra2lpaWdnZ11dXVlZWVVVVVNTU////wAAAAAAAAAA 
     32AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADEALAAAAAAMAAwAAAZjwFgs 
     33A1rBYKkPRhjjsI5QmGozNEoUhMKCAkNdRDCIAEAGDCIwjxFRLjNgpmOgTS7AXC/YmG5vnWAJdAAN 
     34MCQhMBEDbQUTMB0YKjAUDgYHDxUwJxYxG5FRmRpMFx8lRyMdmzFBADs= 
    1535} ] 
    1636 
     
    184204        } 
    185205} 
    186          
     206 
     207proc changeLogLinY {} { 
     208        global graph 
     209        global loglinY 
     210 
     211        $graph axis configure y -logscale $loglinY 
     212}        
     213 
     214proc changeLogLinX {} { 
     215        global graph 
     216        global loglinX 
     217 
     218        $graph axis configure x -logscale $loglinX 
     219}        
     220 
    187221proc LoadTree { tree parentNode dir } { 
    188222        cd $dir 
     
    204238        if {$dir ne ""} { 
    205239                EmptyTree .tree 
    206                 LoadTree .tree 0 $dir 
     240                catch { LoadTree .tree 0 $dir } result 
    207241                cd $dir 
    208242        }        
     
    235269} 
    236270 
    237 # Create menu 
    238 menubutton .mb -text File -menu .mb.fileMenu 
    239 set m [menu .mb.fileMenu -tearoff 0] 
    240 $m add command -label "Set Data Dir" -command selectDirectory 
     271#Create menu frame 
     272set mf [frame .mf] 
     273 
     274# Create File menu 
     275menubutton $mf.filemb -text File -menu $mf.filemb.fileMenu 
     276set fm [menu $mf.filemb.fileMenu -tearoff 0] 
     277$fm add command -label "Set Data Dir" -command selectDirectory 
     278 
     279#Create Plot menu 
     280menubutton $mf.plotmb -text Plot -menu $mf.plotmb.plotMenu 
     281set pm [menu $mf.plotmb.plotMenu -tearoff 0] 
     282$pm add cascade -label "Type" -menu $pm.type 
     283$pm add cascade -label "X-Axis" -menu $pm.xaxis 
     284$pm add cascade -label "Y-Axis" -menu $pm.yaxis 
     285#Create sub menus 
     286set xam [menu $pm.xaxis -tearoff 0] 
     287$xam add radio -label "Lin" -variable loglinX -value "no" -command {changeLogLinX} 
     288$xam add radio -label "Log" -variable loglinX -value "yes" -command {changeLogLinX} 
     289 
     290set yam [menu $pm.yaxis -tearoff 0] 
     291$yam add radio -label "Lin" -variable loglinY -value "no" -command {changeLogLinY} 
     292$yam add radio -label "Log" -variable loglinY -value "yes" -command {changeLogLinY} 
     293 
     294set ptm [menu $pm.type -tearoff 0] 
     295$ptm add radio  -label "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     296$ptm add radio -label "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     297$ptm add radio -label "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     298$ptm add radio -label "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     299 
     300#Set defaults 
     301set loglinX "no" 
     302set loglinY "no" 
     303set plotType "count" 
     304 
     305#pack menubuttons into menu 
     306pack $mf.filemb -side left 
     307pack $mf.plotmb -side left 
    241308 
    242309# Create tree 
     
    284351#Plot controls 
    285352set pcf [frame .filter.pc] 
     353#Clear plot button 
    286354button $pcf.filterReset -text "Clear Plot" -command {resetGraph} 
    287 radiobutton $pcf.c -text "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    288 radiobutton $pcf.cr -text "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    289 radiobutton $pcf.t -text "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    290 radiobutton $pcf.m -text "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    291 $pcf.c select 
     355 
     356##Frame for radiobutton set to control plot type 
     357#set ptf [frame .filter.pc.pt -borderwidth 1 -relief raised] 
     358#radiobutton $ptf.c -text "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     359#radiobutton $ptf.cr -text "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     360#radiobutton $ptf.t -text "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     361#radiobutton $ptf.m -text "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     362#$ptf.c select 
     363#pack $ptf.m -side right 
     364#pack $ptf.t -side right 
     365#pack $ptf.cr -side right 
     366#pack $ptf.c -side right  
     367 
     368##Frame for y-axis log/lin choice 
     369#set logfy [frame .filter.pc.logy -borderwidth 1 -relief raised] 
     370##Log/lin radiobutton set 
     371#radiobutton $logfy.log -text "Log Y" -variable loglinY -value "yes" -command { changeLogLinY } 
     372#radiobutton $logfy.lin -text "Lin Y" -variable loglinY -value "no" -command { changeLogLinY } 
     373#$logfy.lin select 
     374#pack $logfy.log -side right 
     375#pack $logfy.lin -side right 
     376 
     377##Frame for y-axis log/lin choice 
     378#set logfx [frame .filter.pc.logx -borderwidth 1 -relief raised] 
     379##Log/lin radiobutton set 
     380#radiobutton $logfx.log -text "Log X" -variable loglinX -value "yes" -command { changeLogLinX } 
     381#radiobutton $logfx.lin -text "Lin X" -variable loglinX -value "no" -command { changeLogLinX } 
     382#$logfx.lin select 
     383#pack $logfx.log -side right 
     384#pack $logfx.lin -side right 
     385 
    292386pack $pcf.filterReset -side right -padx 25 
    293 pack $pcf.m -side right 
    294 pack $pcf.t -side right 
    295 pack $pcf.cr -side right 
    296 pack $pcf.c -side right  
     387#pack $logfy -side right 
     388#pack $logfx -side right 
     389#pack $ptf -side right 
    297390pack $pcf -side right 
    298391 
    299392 
    300393# Pack  widgets 
    301 pack .mb -side top -anchor w 
     394pack $mf -side top -anchor w 
    302395pack .vp -fill both -expand true -anchor w 
    303396pack .filter -side bottom -fill x -anchor sw 
Note: See TracChangeset for help on using the changeset viewer.