Changeset 186 for trunk/3DEES/UserInterface.tcl
- Timestamp:
- Mar 18, 2014, 3:10:11 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/3DEES/UserInterface.tcl
r184 r186 56 56 {3_2} 13 57 57 {3_3} 14 58 {3_4} 15 58 59 {4_0} 3 59 {4_1} 15 60 {4_2} 16 61 {4_3} 17 60 {4_1} 16 61 {4_2} 17 62 {4_3} 18 63 {4_4} 19 62 64 {5_0} 4 63 {5_1} 18 64 {5_2} 19 65 {5_3} 20 65 {5_1} 20 66 {5_2} 21 67 {5_3} 22 68 {5_4} 23 66 69 {6_0} 5 67 {6_1} 21 68 {6_2} 22 69 {6_3} 23 70 {6_1} 24 71 {6_2} 25 72 {6_3} 26 73 {6_4} 27 70 74 } 71 75 # ------------------------------------------------------------------------- … … 82 86 11 3000 83 87 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 99 } 100 101 88 12 10 89 13 31 90 14 52 91 15 79 92 3 10 93 16 60 94 17 135 95 18 171 96 19 233 97 4 10 98 20 249 99 21 348 100 22 495 101 23 693 102 5 10 103 24 505 104 25 606 105 26 707 106 27 808 107 } 108 109 102 110 # ------------------------------------------------------------------------- 103 111 … … 109 117 3 {af} 110 118 4 {bn} 119 5 {bf} 111 120 } 112 121 … … 328 337 trace add variable [myvar delay] write [myproc delay_update] 329 338 trace add variable [myvar thrs] write [myproc thrs_update] 330 339 331 340 my delay_update 332 341 my thrs_update … … 342 351 343 352 set thrs [frame ${master}.thrs] 353 set bins [frame ${master}.bins] 344 354 set clip [frame ${master}.clip] 345 355 … … 347 357 348 358 set column 0 349 foreach {input} [list "ADC" " thrs 1" "thrs 2" "thrs 3" "thrs 4"] {359 foreach {input} [list "ADC" "e thrs min" "e thrs max" "p thrs min" "p thrs max"] { 350 360 label ${config(thrs)}.label_${column} -text "${input}" 351 361 grid ${config(thrs)}.label_${column} -row 0 -column ${column} -sticky ew -padx 5 -pady 7 … … 353 363 } 354 364 355 foreach {ch id} [array get adcCodes ] {365 foreach {ch id} [array get adcCodes {[1-2]}] { 356 366 label ${config(thrs)}.chan_${ch} -text "${id} " 357 367 grid ${config(thrs)}.chan_${ch} -row ${ch} -column 0 -sticky ew -padx 5 -pady 7 … … 367 377 368 378 grid $config(thrs) -row 0 -column 0 -sticky news -padx 10 379 380 set config(bins) [labelframe ${bins}.frame -borderwidth 1 -relief sunken -text {Bins}] 381 382 set column 0 383 foreach {input} [list "ADC" "thrs 0" "thrs 1" "thrs 2" "thrs 3" "thrs 4"] { 384 label ${config(bins)}.label_${column} -text "${input}" 385 grid ${config(bins)}.label_${column} -row 0 -column ${column} -sticky ew -padx 5 -pady 7 386 incr column 387 } 388 389 foreach {ch id} [array get adcCodes {[3-6]}] { 390 label ${config(bins)}.chan_${ch} -text "${id} " 391 grid ${config(bins)}.chan_${ch} -row ${ch} -column 0 -sticky ew -padx 5 -pady 7 392 foreach {num} [list 0 1 2 3 4] { 393 set column [expr {$num + 1}] 394 set value $cfgCodes(${ch}_${num}) 395 spinbox ${config(bins)}.bins_${value} -from 0 -to 4095 \ 396 -increment 10 -width 10 -textvariable [myvar thrs($value)] \ 397 -validate all -vcmd {::mca::validate 4095 4 %P} 398 grid ${config(bins)}.bins_${value} -row ${ch} -column ${column} -sticky w -padx 5 -pady 7 399 } 400 } 401 402 grid $config(bins) -row 0 -column 0 -sticky news -padx 10 369 403 370 404 set config(clip) [labelframe ${clip}.frame -borderwidth 1 -relief sunken -text {Signal clipping}] … … 392 426 grid $config(clip) -row 0 -column 0 -sticky news -padx 10 393 427 394 grid ${thrs} -row 0 -column 1 -sticky news 428 grid ${thrs} -row 0 -column 2 -sticky news 429 grid ${bins} -row 0 -column 1 -sticky news 395 430 grid ${clip} -row 0 -column 0 -sticky news 396 431 397 432 grid columnconfigure ${master} 0 -weight 1 398 433 grid columnconfigure ${master} 1 -weight 1 434 grid columnconfigure ${master} 2 -weight 1 399 435 grid rowconfigure ${master} 0 -weight 1 400 436 401 437 grid rowconfigure ${thrs} 0 -weight 0 438 grid rowconfigure ${bins} 0 -weight 0 402 439 grid rowconfigure ${clip} 0 -weight 0 403 440 } … … 413 450 set b $decay($i).0 414 451 set value [expr int(exp(-${a}/${b})*1024*20)] 415 append command [format {000200%02x0004%04x} [expr {3 4+ 2 * (${i} - 1)}] $value]452 append command [format {000200%02x0004%04x} [expr {36 + 2 * (${i} - 1)}] $value] 416 453 } 417 454 … … 440 477 441 478 set command {} 442 for {set i 0} {$i <= 2 3} {incr i} {479 for {set i 0} {$i <= 27} {incr i} { 443 480 append command [format {000200%02x0004%04x} [expr {10 + ${i}}] $thrs($i)] 444 481 } … … 639 676 my set data {} 640 677 641 vector create [myvar xvec]( 64)642 vector create [myvar yvec]( 64)643 644 # fill one vector for the x axis with 64points645 [myvar xvec] seq -0.5 63.5678 vector create [myvar xvec](80) 679 vector create [myvar yvec](80) 680 681 # fill one vector for the x axis with 80 points 682 [myvar xvec] seq -0.5 79.5 646 683 647 684 my setup … … 684 721 $graph grid configure -hide no 685 722 $graph legend configure -hide yes 686 $graph axis configure x -min 0 -max 64723 $graph axis configure x -min 0 -max 80 687 724 688 725 set config [frame ${master}.config -width 170] … … 845 882 my instvar controller config number 846 883 847 set size 64884 set size 80 848 885 849 886 set prefix [format {%x} [expr {$number + 2}]] … … 892 929 893 930 HstDisplay instproc register {} { 894 my save_data [join [[myvar yvec] range 0 63] \n]931 my save_data [join [[myvar yvec] range 0 79] \n] 895 932 } 896 933
Note:
See TracChangeset
for help on using the changeset viewer.