Changeset 874 for trunk/addcmds.tcl
- Timestamp:
- Dec 4, 2009 5:13:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/addcmds.tcl
- Property rcs:date changed from 2006/02/22 00:18:37 to 2006/03/29 03:47:44
- Property rcs:lines changed from +68 -12 to +60 -21
- Property rcs:rev changed from 1.39 to 1.40
r865 r874 242 242 } 243 243 trace variable newhist(setnum) w LabelInstParm 244 trace variable newhist(LimitMode) w ClearHistLimit 245 set newhist(LimitMode_boxes) {} 246 247 proc ClearHistLimit {args} { 248 global newhist 249 if {$newhist(LimitMode) == 1} {return} 250 foreach box $newhist(LimitMode_boxes) { 251 catch {$box delete 0 end} 252 } 253 } 254 244 255 proc MakeAddHistBox {} { 245 256 global expmap newhist … … 289 300 grid [entry $np.e3 -width 12 -textvariable newhist(2tLimit) \ 290 301 ] -column 1 -row 18 -rowspan 3 291 grid [radiobutton $np.cb3 -text " D-min" -variable newhist(LimitMode) \302 grid [radiobutton $np.cb3 -text "d-min" -variable newhist(LimitMode) \ 292 303 -value 0] -column 2 -row 18 -sticky w 293 304 grid [radiobutton $np.cb4 -textvariable newhist(limitLbl) \ 294 305 -variable newhist(LimitMode) -anchor w -justify l \ 295 306 -value 1] -column 2 -row 20 -sticky w 307 set newhist(LimitMode_boxes) $np.e3 296 308 grid [radiobutton $np.cb5 -text "Q-max" -variable newhist(LimitMode) \ 297 309 -value 2] -column 2 -row 19 -sticky w … … 499 511 set row 0 500 512 set col -1 513 set flag 0 501 514 foreach i $newhist(banklist) { 502 515 if {$col > 8} { … … 512 525 SetTmax 513 526 } else { 514 set newhist(2tLimit) {} 515 set newhist(LimitMode) {} 516 } 527 set flag 1 528 } 529 } 530 if {$flag} { 531 set newhist(2tLimit) {} 532 set newhist(LimitMode) {} 517 533 } 518 534 SetMultipleAdd $np … … 1097 1113 -scrollregion {0 0 5000 500} -width 0 -height 250 \ 1098 1114 -yscrollcommand "$top.scroll set"] \ 1099 -column 0 -columnspan 2 -row 1 -sticky nsew1115 -column 0 -columnspan 2 -row 2 -sticky ns 1100 1116 grid columnconfigure $top 0 -weight 1 1101 grid rowconfigure $top 1-weight 11117 grid rowconfigure $top 2 -weight 1 1102 1118 scrollbar $top.scroll \ 1103 1119 -command "$top.canvas yview" … … 1106 1122 grid [label $top.top -text "Select banks to add" -bg beige] \ 1107 1123 -column 0 -columnspan 3 -row 0 -sticky ew 1108 grid [button $top.add -text Add -command "destroy $np"] -column 0 -row 2 1124 grid [frame $top.vartyp -bd 2 -relief groove] \ 1125 -column 0 -columnspan 3 -row 1 -sticky ew 1126 grid [label $top.vartyp.top -text "Data limit units:"] -column 0 -row 0 -columnspan 3 -sticky w 1127 grid [radiobutton $top.vartyp.cb3 -text "d-min" -variable newhist(LimitMode) \ 1128 -value 0] -column 0 -row 1 -sticky w 1129 grid [radiobutton $top.vartyp.cb4 -textvariable newhist(datalimlbl) \ 1130 -variable newhist(LimitMode) -anchor w -justify l \ 1131 -value 1] -column 1 -row 1 -sticky w 1132 grid [radiobutton $top.vartyp.cb5 -text "Q-max" -variable newhist(LimitMode) \ 1133 -value 2] -column 2 -row 1 -sticky w 1134 set newhist(LimitMode) 1 1135 1136 grid [button $top.add -text Add -command "destroy $np"] -column 0 -row 3 1109 1137 grid [button $top.cancel -text Cancel -command "destroy $top"] \ 1110 -column 1 -row 2 -columnspan 2 1111 1138 -column 1 -row 3 -columnspan 2 1112 1139 set row 1 1113 1140 grid [label $cfr.t1 -text "Bank\n#"] -column 0 -row 0 1114 1141 switch $newhist(insttype) { 1115 TOF {set txt"T-min\n(ms)"}1116 ED {set txt"E-max\n(KeV)"}1117 default {set txt"2theta\nmax"}1118 } 1119 grid [label $cfr.t2 -text $txt] -column 1 -row 01142 TOF {set newhist(datalimlbl) "T-min\n(ms)"} 1143 ED {set newhist(datalimlbl) "E-max\n(KeV)"} 1144 default {set newhist(datalimlbl) "2theta\nmax"} 1145 } 1146 grid [label $cfr.t2 -textvariable newhist(datalimlbl)] -column 1 -row 0 1120 1147 foreach i $newhist(banklist) { 1121 1148 grid [checkbutton $cfr.c$i -text $i \ … … 1123 1150 -column 0 -row [incr row] -sticky w 1124 1151 set newhist(usebank$i) 1 1125 grid [entry $cfr.e$i -width 8] -column 1 -row $row -sticky w 1152 grid [entry $cfr.e$i -width 8 -textvariable newhist(tlimit$i)] \ 1153 -column 1 -row $row -sticky w 1154 lappend newhist(LimitMode_boxes) $cfr.e$i 1126 1155 if {$newhist(insttype) == "TOF"} { 1127 $cfr.e$i config -textvariablenewhist(tmin$i)1156 set newhist(tlimit$i) $newhist(tmin$i) 1128 1157 } else { 1129 $cfr.e$i config -textvariablenewhist(tmax$i)1158 set newhist(tlimit$i) $newhist(tmax$i) 1130 1159 } 1131 1160 } … … 1136 1165 # use the scroll for BIG lists 1137 1166 if {[lindex $sizes 3] > [winfo height $top.canvas]} { 1138 grid $top.scroll -sticky ns -column 3 -row 11167 grid $top.scroll -sticky ns -column 3 -row 2 1139 1168 } else { 1140 1169 grid forget $top.scroll … … 1157 1186 foreach i $newhist(banklist) { 1158 1187 if {$newhist(usebank$i)} { 1159 if {[catch {expr $newhist(t min$i)}]} {1188 if {[catch {expr $newhist(tlimit$i)}]} { 1160 1189 append err " The Max/Min limit is not valid for bank $i\n" 1161 } elseif {$newhist(t min$i) <= 0} {1190 } elseif {$newhist(tlimit$i) <= 0} { 1162 1191 append err " The Max/Min limit is not valid for bank $i\n" 1163 1192 } … … 1206 1235 puts $fp $i 1207 1236 puts $fp $k 1208 puts $fp "T" 1209 puts $fp "$newhist(tmin$i)" 1237 if {$newhist(LimitMode) == 1} { 1238 puts $fp "T" 1239 puts $fp "$newhist(tlimit$i)" 1240 } elseif {$newhist(LimitMode) == 2} { 1241 puts $fp "D" 1242 set Q 100 1243 catch {set Q [expr {4*acos(0)/$newhist(tlimit$i)}]} 1244 puts $fp "$Q" 1245 } else { 1246 puts $fp "D" 1247 puts $fp "$newhist(tlimit$i)" 1248 } 1210 1249 puts $fp "/" 1211 1250 puts $fp "X"
Note: See TracChangeset
for help on using the changeset viewer.