Changeset 1030 for branches/sandbox/widplt
- Timestamp:
- Oct 18, 2010 10:22:17 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sandbox/widplt
r1029 r1030 11 11 package require Tk 12 12 bind all <Control-KeyPress-c> {destroy .} 13 13 14 set expnam [lindex $argv 0] 14 15 if {$expnam != ""} { … … 442 443 global UVWP XY wave lblarr WidSetList WidDisplay ttrange 443 444 global ABS absSetList AbsDisplay 445 if {$program == "absplt"} { 446 $top yaxis config -title {Abs. Corr.} 447 } else { 448 $top yaxis config -title {FWHM} 449 } 444 450 if {$graph(plotunits) == "d"} { 445 451 $top xaxis configure -title "d (A)" 452 } elseif {$graph(plotunits) == "deltad"} { 453 $top xaxis configure -title "d (A)" 454 $top yaxis configure -title "delta-d/d" 446 455 } elseif {$graph(plotunits) == "q"} { 447 456 $top xaxis configure -title "Q (A-1)" … … 450 459 } else { 451 460 $top xaxis configure -title "2Theta @ $graph(equivwave)" 452 }453 if {$program == "absplt"} {454 $top yaxis config -title {Abs. Corr.}455 } else {456 $top yaxis config -title {FWHM}457 461 } 458 462 $top yaxis configure -min 0 … … 492 496 if {$graph(plotunits) == "d"} { 493 497 set ttlist [tod $ttlist $item] 498 } elseif {$graph(plotunits) == "deltad"} { 499 set ttlist [tod $ttlist $item] 494 500 } elseif {$graph(plotunits) == "q"} { 495 501 set ttlist [toQ $ttlist $item] … … 530 536 [eval LFWHM $tt $XY($item)]] 531 537 lappend lfwhmlist $lfwhm 538 } 539 } elseif {$graph(plotunits) == "deltad"} { 540 set d [tt2d $wave($item) $tt ] 541 lappend ttlist $d 542 set gfwhm [deltad $wave($item) $tt \ 543 [eval FWHM $tt $UVWP($item)]] 544 lappend fwhmlist [expr {$gfwhm/$d}] 545 if $lflag { 546 set lfwhm [deltad $wave($item) $tt \ 547 [eval LFWHM $tt $XY($item)]] 548 lappend lfwhmlist [expr {$lfwhm/$d}] 532 549 } 533 550 } elseif {$graph(plotunits) == "q"} { … … 982 999 } 983 1000 1001 proc BLTmanualZoom {} { 1002 global graph box 1003 catch {toplevel .zoom} 1004 eval destroy [grid slaves .zoom] 1005 raise .zoom 1006 wm title .zoom {Manual Scaling} 1007 grid [label .zoom.l1 -text minimum] -row 1 -column 2 1008 grid [label .zoom.l2 -text maximum] -row 1 -column 3 1009 grid [label .zoom.l3 -text x] -row 2 -column 1 1010 grid [label .zoom.l4 -text y] -row 3 -column 1 1011 grid [entry .zoom.xmin -textvariable graph(xmin) -width 10] -row 2 -column 2 1012 grid [entry .zoom.xmax -textvariable graph(xmax) -width 10] -row 2 -column 3 1013 grid [entry .zoom.ymin -textvariable graph(ymin) -width 10] -row 3 -column 2 1014 grid [entry .zoom.ymax -textvariable graph(ymax) -width 10] -row 3 -column 3 1015 grid [frame .zoom.b] -row 4 -column 1 -columnspan 3 1016 grid [button .zoom.b.1 -text "Set Scaling" \ 1017 -command "SetManualZoom set"] -row 4 -column 1 -columnspan 2 1018 grid [button .zoom.b.2 -text Reset \ 1019 -command "SetManualZoom clear"] -row 4 -column 3 1020 grid [button .zoom.b.3 -text Close -command "destroy .zoom"] -row 4 -column 4 1021 grid rowconfigure .zoom 1 -weight 1 -pad 5 1022 grid rowconfigure .zoom 2 -weight 1 -pad 5 1023 grid rowconfigure .zoom 3 -weight 1 -pad 5 1024 grid rowconfigure .zoom 4 -weight 0 -pad 5 1025 grid columnconfigure .zoom 1 -weight 1 -pad 20 1026 grid columnconfigure .zoom 1 -weight 1 1027 grid columnconfigure .zoom 3 -weight 1 -pad 10 1028 foreach item {min min max max} \ 1029 format {3 2 3 2} \ 1030 axis {x y x y} { 1031 set val [$box ${axis}axis cget -${item}] 1032 set graph(${axis}${item}) {(auto)} 1033 catch {set graph(${axis}${item}) [format %.${format}f $val]} 1034 } 1035 bind .zoom <Return> "SetManualZoom set" 1036 } 1037 1038 proc SetManualZoom {mode} { 1039 global graph box 1040 if {$mode == "clear"} { 1041 foreach item {xmin ymin xmax ymax} { 1042 set graph($item) {(auto)} 1043 } 1044 } 1045 foreach item {xmin ymin xmax ymax} { 1046 if {[catch {expr $graph($item)}]} { 1047 set $item "" 1048 } else { 1049 set $item $graph($item) 1050 } 1051 } 1052 # reset the zoomstack 1053 catch {Blt_ZoomStack $box} 1054 catch {$box xaxis config -min $xmin -max $xmax} 1055 catch {$box yaxis config -min $ymin -max $ymax} 1056 #global program 1057 #if {$program == "bkgedit"} {bkgEditMode ""} 1058 } 1059 984 1060 #------------------------------------------------------------------------- 985 1061 # export current plot to Grace … … 1242 1318 -variable graph(plotunits) \ 1243 1319 -command "plotdata $box" 1320 .a.options.menu add radiobutton -label "delta-d/d" -value deltad \ 1321 -variable graph(plotunits) \ 1322 -command "plotdata $box" 1244 1323 .a.options.menu add checkbutton -label "Include legend" \ 1245 1324 -variable graph(legend) \ … … 1274 1353 #---------------------------------------------------------------- 1275 1354 1276 trace variable newmenu(opt) w setoptmsg 1355 trace variable newmenu(opt) w setoptmsg 1356 1357 bind . <Key-z> {BLTmanualZoom} 1358 bind . <Key-Z> {BLTmanualZoom} 1277 1359 1278 1360 proc setoptmsg {args} {
Note: See TracChangeset
for help on using the changeset viewer.