Changeset 795
- Timestamp:
- Dec 4, 2009 5:12:09 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/liveplot
- Property rcs:date changed from 2004/04/27 14:07:39 to 2004/05/13 23:44:04
- Property rcs:lines changed from +70 -9 to +74 -48
- Property rcs:rev changed from 1.39 to 1.40
r780 r795 20 20 } 21 21 22 # get name of script 23 set expgui(script) [info script] 24 # what are we running here? 22 25 set program [file tail $argv0] 26 # fix up problem with starkit tcl 27 if {$program != "liveplot" && $program != "bkgedit"} { 28 set program [file tail $expgui(script)] 29 } 30 # for debug 23 31 #set program bkgedit 24 32 … … 137 145 138 146 #---------------------------------------------------------------- 139 # where are we? 140 set expgui(script) [info script] 141 # translate links -- go six levels deep 147 # find location of other files relative to the current script 148 # 1st, translate links -- go six levels deep 142 149 foreach i {1 2 3 4 5 6} { 143 150 if {[file type $expgui(script)] == "link"} { … … 574 581 setlegend $box $graph(legend) 575 582 # reconfigure the data 576 $box element configure 3 \577 -symbol $peakinfo(obssym) -color $graph(color_obs) \ 578 -pixels [expr 0.125 * $peakinfo(obssize)]i 583 catch {$box element configure 3 -symbol $peakinfo(obssym)} 584 catch {$box element configure 3 -color $graph(color_obs)} 585 catch {$box element configure 3 -pixels [expr 0.125 * $peakinfo(obssize)]i} 579 586 if $graph(chi2) { 580 $box element config 0 -dash 0 -line 3 -color $graph(color_chi2) 587 $box element config 0 -dash 0 -line 3 588 catch {$box element config 0 -color $graph(color_chi2)} 581 589 } else { 582 $box element config 0 -dash 4 -line 2 -color $graph(color_OmCoS) 583 } 584 $box element config 1 -color $graph(color_bkg) 585 $box element config 2 -color $graph(color_calc) 586 $box element config 4 -color $graph(color_diff) 590 $box element config 0 -dash 4 -line 2 591 catch {$box element config 0 -color $graph(color_OmCoS)} 592 } 593 catch {$box element config 1 -color $graph(color_bkg)} 594 catch {$box element config 2 -color $graph(color_calc)} 595 catch {$box element config 4 -color $graph(color_diff)} 587 596 global program 588 597 if {$program == "bkgedit"} { 589 $box element config 12 -color $graph(color_input) \ 590 -pixels [expr 0.125 * $peakinfo(inpsize)]i \ 591 -symbol $peakinfo(inpsym) 592 $box element config 11 -color $graph(color_fit) 598 catch {$box element config 12 -color $graph(color_input)} 599 catch {$box element config 12 600 -pixels [expr 0.125 * $peakinfo(inpsize)]i} 601 catch {$box element config 12 -symbol $peakinfo(inpsym)} 602 catch {$box element config 11 -color $graph(color_fit)} 593 603 } 594 604 xvec notify now … … 1122 1132 # change the binding of the mouse, based on the selected mode 1123 1133 proc bkgEditMode {b} { 1124 global zoomcommand box 1125 # get binding 1126 set bindtag $box 1127 catch { 1128 if {[bind bltZoomGraph] != ""} { 1129 set bindtag bltZoomGraph 1130 } 1131 } 1134 global zoomcommand graph box 1132 1135 # save the zoom command 1133 1136 if [catch {set zoomcommand}] { 1134 set zoomcommand [bind $ bindtag<1>]1137 set zoomcommand [bind $graph(bindtag) <1>] 1135 1138 .bkg.f.fit1 config -state disabled 1136 1139 .bkg.f.terms config -state disabled … … 1153 1156 } 1154 1157 if {$b == 2} { 1155 bind $ bindtag<1> "bkgAddPoint %x %y"1158 bind $graph(bindtag) <1> "bkgAddPoint %x %y" 1156 1159 .g config -cursor arrow 1157 1160 } elseif {$b == 3} { 1158 bind $ bindtag<1> "bkgDelPoint %x %y"1161 bind $graph(bindtag) <1> "bkgDelPoint %x %y" 1159 1162 .g config -cursor circle 1160 1163 } else { 1161 bind $ bindtag<1> $zoomcommand1164 bind $graph(bindtag) <1> $zoomcommand 1162 1165 .g config -cursor crosshair 1163 1166 } … … 1279 1282 proc bkgFit {button} { 1280 1283 global bkglist termlist expgui 1284 # if there <3 points, a fit is not possible 1285 if {[llength $bkglist] < 3} { 1286 bell 1287 return 1288 } 1281 1289 # keep the button down while working 1282 1290 $button config -relief sunken … … 1988 1996 proc blt::PushZoom {graph} $b1 1989 1997 } 1990 1991 $box element create 0 -xdata xvec -ydata wifdvec -color $graph(color_chi2) \ 1998 # get binding for zoom 1999 set graph(bindtag) $box 2000 catch { 2001 if {[bind zoom-$box] != ""} { 2002 # blt2.4z 2003 set graph(bindtag) zoom-$box 2004 } elseif {[bind bltZoomGraph] != ""} { 2005 # blt2.4? 2006 set graph(bindtag) bltZoomGraph 2007 } 2008 } 2009 2010 $box element create 0 -xdata xvec -ydata wifdvec \ 1992 2011 -line 3 -symbol none -label "Chi2" -mapy y2 2012 catch {$box element config 0 -color $graph(color_chi2)} 2013 1993 2014 $box element create 1 -label bckgr -symbol none 1994 $box element config 1 -xdata xvec -ydata bckvec -color $graph(color_bkg) 1995 $box element create 3 -color $graph(color_obs) -linewidth 0 -label Obs \ 1996 -symbol $peakinfo(obssym) \ 1997 -pixels [expr 0.125 * $peakinfo(obssize)]i 1998 $box element create 2 -label Calc -color $graph(color_calc) -symbol none 1999 $box element create 4 -label diff -color $graph(color_diff) -symbol none 2015 $box element config 1 -xdata xvec -ydata bckvec 2016 catch {$box element config 1 -color $graph(color_bkg)} 2017 $box element create 3 -linewidth 0 -label Obs 2018 catch {$box element configure 3 -symbol $peakinfo(obssym)} 2019 catch {$box element configure 3 -color $graph(color_obs)} 2020 catch {$box element configure 3 -pixels [expr 0.125 * $peakinfo(obssize)]i} 2021 $box element create 2 -label Calc -symbol none 2022 catch {$box element config 2 -color $graph(color_calc)} 2023 $box element create 4 -label diff -symbol none 2024 catch {$box element config 4 -color $graph(color_diff)} 2000 2025 2001 2026 if {$program == "liveplot"} { … … 2012 2037 $box element create 11 2013 2038 $box element create 12 2014 $box element configure 12 -color $graph(color_input) \ 2015 -pixels [expr 0.125 * $peakinfo(inpsize)]i \ 2016 -line 0 -symbol $peakinfo(inpsym) -label "bkg pts" 2017 $box element configure 11 -color $graph(color_fit) \ 2018 -symbol none -label "bkg fit" -dashes 5 -line 2 2039 $box element configure 12 -line 0 -label "bkg pts" 2040 catch {$box element config 12 -color $graph(color_input)} 2041 catch {$box element config 12 -pixels [expr 0.125 * $peakinfo(inpsize)]i} 2042 catch {$box element config 12 -symbol $peakinfo(inpsym)} 2043 $box element configure 11 -symbol none -label "bkg fit" -dashes 5 -line 2 2044 catch {$box element config 11 -color $graph(color_fit)} 2019 2045 $box element show "3 2 11 12" 2020 2046 } … … 2030 2056 bind . <Key-d> "delallhkllbl $box" 2031 2057 bind . <Key-D> "delallhkllbl $box" 2032 if {[bind bltZoomGraph] != ""} { 2033 bind bltZoomGraph <Shift-Button-1> "lblhkl $box %x" 2034 bind bltZoomGraph <Shift-Button-3> "delallhkllbl %W" 2035 } else { 2036 bind $box <Shift-Button-1> "lblhkl $box %x" 2037 bind $box <Shift-Button-3> "delallhkllbl %W" 2038 } 2058 bind $graph(bindtag) <Shift-Button-1> "lblhkl $box %x" 2059 bind $graph(bindtag) <Shift-Button-3> "delallhkllbl %W" 2039 2060 } else { 2040 2061 $box element config 1 -label "" … … 2255 2276 -label "Web page" 2256 2277 } 2278 if {![catch {package require tkcon} errmsg]} { 2279 .a.help.menu add command -label "Open console" -command {tkcon show} 2280 } elseif {$tcl_platform(platform) == "windows"} { 2281 .a.help.menu add command -label "Open console" -command {console show} 2282 } 2257 2283 .a.help.menu add command -command aboutliveplot -label About 2258 2284
Note: See TracChangeset
for help on using the changeset viewer.