Changeset 184 for trunk/3DEES/UserInterface.tcl
- Timestamp:
- Jan 27, 2014, 3:49:22 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/3DEES/UserInterface.tcl
r183 r184 46 46 {1_0} 0 47 47 {1_1} 6 48 {1_2} 7 49 {1_3} 8 48 50 {2_0} 1 49 {2_1} 7 51 {2_1} 9 52 {2_2} 10 53 {2_3} 11 50 54 {3_0} 2 51 {3_1} 852 {3_2} 953 {3_3} 1 055 {3_1} 12 56 {3_2} 13 57 {3_3} 14 54 58 {4_0} 3 55 {4_1} 1 156 {4_2} 1 257 {4_3} 1 359 {4_1} 15 60 {4_2} 16 61 {4_3} 17 58 62 {5_0} 4 59 {5_1} 1 460 {5_2} 1 561 {5_3} 1663 {5_1} 18 64 {5_2} 19 65 {5_3} 20 62 66 {6_0} 5 63 {6_1} 1764 {6_2} 1865 {6_3} 1967 {6_1} 21 68 {6_2} 22 69 {6_3} 23 66 70 } 67 71 # ------------------------------------------------------------------------- … … 69 73 variable cfgThrs 70 74 array set cfgThrs { 71 0 8 72 6 50 73 1 8 74 7 50 75 2 10 76 8 31 77 9 52 78 10 79 79 3 60 80 11 135 81 12 171 82 13 233 83 4 249 84 14 348 85 15 495 86 16 693 87 5 505 88 17 606 89 18 707 90 19 808 75 0 8 76 6 150 77 7 200 78 8 3000 79 1 8 80 9 150 81 10 200 82 11 3000 83 2 10 84 12 31 85 13 52 86 14 79 87 3 60 88 15 135 89 16 171 90 17 233 91 4 249 92 18 348 93 19 495 94 20 693 95 5 505 96 21 606 97 22 707 98 23 808 91 99 } 92 100 … … 334 342 335 343 set thrs [frame ${master}.thrs] 336 set bins [frame ${master}.bins]337 344 set clip [frame ${master}.clip] 338 345 … … 340 347 341 348 set column 0 342 foreach {input} [list "ADC" " noise thrs" "e/p thrs"] {349 foreach {input} [list "ADC" "thrs 1" "thrs 2" "thrs 3" "thrs 4"] { 343 350 label ${config(thrs)}.label_${column} -text "${input}" 344 351 grid ${config(thrs)}.label_${column} -row 0 -column ${column} -sticky ew -padx 5 -pady 7 … … 346 353 } 347 354 348 foreach {ch id} [array get adcCodes {[1-2]}] {355 foreach {ch id} [array get adcCodes] { 349 356 label ${config(thrs)}.chan_${ch} -text "${id} " 350 357 grid ${config(thrs)}.chan_${ch} -row ${ch} -column 0 -sticky ew -padx 5 -pady 7 351 foreach {num} [list 0 1 ] {358 foreach {num} [list 0 1 2 3] { 352 359 set column [expr {$num + 1}] 353 360 set value $cfgCodes(${ch}_${num}) … … 360 367 361 368 grid $config(thrs) -row 0 -column 0 -sticky news -padx 10 362 363 set config(bins) [labelframe ${bins}.frame -borderwidth 1 -relief sunken -text {Thresholds}]364 365 set column 0366 foreach {input} [list "ADC" "thrs 1" "thrs 2" "thrs 3" "thrs 4"] {367 label ${config(bins)}.label_${column} -text "${input}"368 grid ${config(bins)}.label_${column} -row 0 -column ${column} -sticky ew -padx 5 -pady 7369 incr column370 }371 372 foreach {ch id} [array get adcCodes {[3-6]}] {373 label ${config(bins)}.chan_${ch} -text "${id} "374 grid ${config(bins)}.chan_${ch} -row ${ch} -column 0 -sticky ew -padx 5 -pady 7375 foreach {num} [list 0 1 2 3] {376 set column [expr {$num + 1}]377 set value $cfgCodes(${ch}_${num})378 spinbox ${config(bins)}.thrs_${value} -from 0 -to 4095 \379 -increment 10 -width 10 -textvariable [myvar thrs($value)] \380 -validate all -vcmd {::mca::validate 4095 4 %P}381 grid ${config(bins)}.thrs_${value} -row ${ch} -column ${column} -sticky w -padx 5 -pady 7382 }383 }384 385 grid $config(bins) -row 0 -column 0 -sticky news -padx 10386 369 387 370 set config(clip) [labelframe ${clip}.frame -borderwidth 1 -relief sunken -text {Signal clipping}] … … 409 392 grid $config(clip) -row 0 -column 0 -sticky news -padx 10 410 393 411 grid ${thrs} -row 0 -column 2 -sticky news 412 grid ${bins} -row 0 -column 1 -sticky news 394 grid ${thrs} -row 0 -column 1 -sticky news 413 395 grid ${clip} -row 0 -column 0 -sticky news 414 396 415 397 grid columnconfigure ${master} 0 -weight 1 416 398 grid columnconfigure ${master} 1 -weight 1 417 grid columnconfigure ${master} 2 -weight 1418 399 grid rowconfigure ${master} 0 -weight 1 419 400 420 401 grid rowconfigure ${thrs} 0 -weight 0 421 grid rowconfigure ${bins} 0 -weight 0422 402 grid rowconfigure ${clip} 0 -weight 0 423 403 } … … 433 413 set b $decay($i).0 434 414 set value [expr int(exp(-${a}/${b})*1024*20)] 435 append command [format {000200%02x0004%04x} [expr {3 0+ 2 * (${i} - 1)}] $value]415 append command [format {000200%02x0004%04x} [expr {34 + 2 * (${i} - 1)}] $value] 436 416 } 437 417 … … 446 426 set command {} 447 427 for {set i 1} {$i <= 6} {incr i} { 448 append command [format {000200%02x0004%04x} [expr {3 1+ 2 * (${i} - 1)}] $delay($i)]428 append command [format {000200%02x0004%04x} [expr {35 + 2 * (${i} - 1)}] $delay($i)] 449 429 } 450 430 … … 460 440 461 441 set command {} 462 for {set i 0} {$i <= 19} {incr i} {442 for {set i 0} {$i <= 23} {incr i} { 463 443 append command [format {000200%02x0004%04x} [expr {10 + ${i}}] $thrs($i)] 464 444 }
Note:
See TracChangeset
for help on using the changeset viewer.