Changeset 181 for trunk/3DEES/UserInterface.tcl
- Timestamp:
- Jan 15, 2014, 4:51:59 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/3DEES/UserInterface.tcl
r180 r181 32 32 variable adcCodes 33 33 array set adcCodes { 34 1 {ADC 1} 35 2 {ADC 2} 36 3 {ADC 3} 37 4 {ADC 4} 38 5 {ADC 5} 39 6 {ADC 6} 40 } 41 34 1 {S1_F} 35 2 {S1_S} 36 3 {S2} 37 4 {D1} 38 5 {D2} 39 6 {D3} 40 } 41 42 # ------------------------------------------------------------------------- 43 44 variable cfgCodes 45 array set cfgCodes { 46 {1_0} 0 47 {1_1} 6 48 {2_0} 1 49 {2_1} 7 50 {3_0} 2 51 {3_1} 8 52 {3_2} 9 53 {3_3} 10 54 {4_0} 3 55 {4_1} 11 56 {4_2} 12 57 {4_3} 13 58 {5_0} 4 59 {5_1} 14 60 {5_2} 15 61 {5_3} 16 62 {6_0} 5 63 {6_1} 17 64 {6_2} 18 65 {6_3} 19 66 } 67 # ------------------------------------------------------------------------- 68 69 variable cfgThrs 70 array set cfgThrs { 71 0 20 72 6 2000 73 1 20 74 7 2000 75 2 20 76 8 200 77 9 2000 78 10 3000 79 3 20 80 11 200 81 12 2000 82 13 3000 83 4 20 84 14 200 85 15 2000 86 16 3000 87 5 20 88 17 200 89 18 2000 90 19 3000 91 } 92 93 42 94 # ------------------------------------------------------------------------- 43 95 … … 253 305 CfgDisplay instproc start {} { 254 306 variable adcCodes 255 my instvar config 307 variable cfgThrs 308 309 foreach {ch id} [array get adcCodes] { 310 my set delay($ch) 32 311 my set decay($ch) 1000 312 } 313 314 foreach {i value} [array get cfgThrs] { 315 my set thrs($i) $value 316 } 256 317 257 318 trace add variable [myvar decay] write [myproc decay_update] 258 319 trace add variable [myvar delay] write [myproc delay_update] 259 320 trace add variable [myvar thrs] write [myproc thrs_update] 260 261 foreach {ch id} [array get adcCodes] { 262 ${config(clip)}.delay_${ch} set 32 263 ${config(clip)}.decay_${ch} set 1000 264 } 265 266 for {set i 0} {$i <= 3} {incr i} { 267 ${config(thrs)}.thrs_${i} set 100 268 } 269 270 for {set i 4} {$i <= 19} {incr i} { 271 ${config(bins)}.thrs_${i} set 100 272 } 321 322 my delay_update 323 my thrs_update 273 324 } 274 325 … … 277 328 CfgDisplay instproc setup {} { 278 329 variable adcCodes 330 variable cfgCodes 279 331 my instvar number master 280 332 my instvar config … … 294 346 295 347 foreach {ch id} [array get adcCodes {[1-2]}] { 296 label ${config(thrs)}.chan_${ch} -text "${ ch} "348 label ${config(thrs)}.chan_${ch} -text "${id} " 297 349 grid ${config(thrs)}.chan_${ch} -row ${ch} -column 0 -sticky ew -padx 5 -pady 7 298 350 foreach {num} [list 0 1] { 299 351 set column [expr {$num + 1}] 300 set value [expr {2 * ($ch - 1) + $num}]301 puts "${ num} ${ch} ${value}"352 set value $cfgCodes(${ch}_${num}) 353 puts "${ch} ${num} ${value}" 302 354 spinbox ${config(thrs)}.thrs_${value} -from 0 -to 4095 \ 303 355 -increment 10 -width 10 -textvariable [myvar thrs($value)] \ … … 319 371 320 372 foreach {ch id} [array get adcCodes {[3-6]}] { 321 label ${config(bins)}.chan_${ch} -text "${ ch} "373 label ${config(bins)}.chan_${ch} -text "${id} " 322 374 grid ${config(bins)}.chan_${ch} -row ${ch} -column 0 -sticky ew -padx 5 -pady 7 323 375 foreach {num} [list 0 1 2 3] { 324 376 set column [expr {$num + 1}] 325 set value [expr {4 * ($ch - 2) + $num}]326 puts "${ num} ${ch} ${value}"377 set value $cfgCodes(${ch}_${num}) 378 puts "${ch} ${num} ${value}" 327 379 spinbox ${config(bins)}.thrs_${value} -from 0 -to 4095 \ 328 380 -increment 10 -width 10 -textvariable [myvar thrs($value)] \ … … 344 396 345 397 foreach {ch id} [array get adcCodes] { 346 label ${config(clip)}.chan_${ch} -text "${ ch} "398 label ${config(clip)}.chan_${ch} -text "${id} " 347 399 grid ${config(clip)}.chan_${ch} -row ${ch} -column 0 -sticky ew -padx 5 -pady 7 348 400 spinbox ${config(clip)}.delay_${ch} -from 0 -to 62 \ … … 381 433 set a $delay($i).0 382 434 set b $decay($i).0 383 set value [expr int(exp(-${a}/${b})*1024* 17)]435 set value [expr int(exp(-${a}/${b})*1024*20)] 384 436 append command [format {000200%02x0004%04x} [expr {30 + 2 * (${i} - 1)}] $value] 385 437 } … … 492 544 incr column 493 545 } 494 foreach {ch dummy} $adcList {495 label $config($osc).chan_${ch} -text "${ ch} "546 foreach {ch id} $adcList { 547 label $config($osc).chan_${ch} -text "${id} " 496 548 grid $config($osc).chan_${ch} -row ${ch} -column 0 -sticky ew 497 549 foreach {code input} $inpList {
Note:
See TracChangeset
for help on using the changeset viewer.