Changeset 161 for trunk/MultiChannelUSB/UserInterface.tcl
- Timestamp:
- Jan 24, 2012, 11:16:15 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MultiChannelUSB/UserInterface.tcl
r159 r161 7 7 package require zlib 8 8 9 wm minsize . 1000 7009 wm minsize . 990 660 10 10 11 11 namespace eval ::mca { … … 237 237 238 238 MuxDisplay instproc start {} { 239 my instvar config chan_val 239 my instvar config chan_val hstmux 240 240 241 241 set chan_val(1) 0 … … 246 246 set chan_val(6) 0 247 247 248 set hstmux(1) 0 249 set hstmux(2) 0 250 248 251 trace add variable [myvar chan_val] write [myproc chan_val_update] 249 252 trace add variable [myvar polar] write [myproc polar_update] 253 trace add variable [myvar hstmux] write [myproc hstmux_update] 250 254 251 255 $config(1).chan_1_1 select … … 257 261 258 262 for {set i 1} {$i <= 3} {incr i} { 259 $config(7).polar$i select 260 } 263 $config(7).polar_$i select 264 } 265 266 $config(8).hstmux_1_1 select 267 $config(9).hstmux_2_1 select 261 268 } 262 269 … … 276 283 277 284 foreach {osc title} $oscList { 278 set config($osc) [labelframe ${master}.mux_$osc -borderwidth 1 -relief sunken -text $title ]285 set config($osc) [labelframe ${master}.mux_$osc -borderwidth 1 -relief sunken -text $title -font {-weight bold}] 279 286 280 287 foreach {ch dummy} $adcList { … … 294 301 } 295 302 set column [expr {($osc - 1) % 3}] 296 set row [expr {($osc - 1) / 3 * 2 + 1}] 297 grid $config($osc) -row $row -column $column -sticky news -padx 10 298 } 299 300 set config(7) [labelframe ${master}.mux_8 -borderwidth 1 -relief sunken -text {polarity inversion}] 303 set row [expr {($osc - 1) / 3 + 1}] 304 grid $config($osc) -row $row -column $column -sticky news -padx 10 -pady 10 305 } 306 307 set config(7) [labelframe ${master}.mux_7 -borderwidth 1 -relief sunken -text {Polarity inversion} -font {-weight bold}] 308 set config(8) [labelframe ${master}.mux_8 -borderwidth 1 -relief sunken -text {Spectrum histogram} -font {-weight bold}] 309 set config(9) [labelframe ${master}.mux_9 -borderwidth 1 -relief sunken -text {Rate histogram} -font {-weight bold}] 301 310 for {set i 1} {$i <= 3} {incr i} { 302 checkbutton $config(7).polar$i -text "ADC $i" -variable [myvar polar($i)] 303 grid ${config(7)}.polar$i 304 } 305 grid $config(7) -row 2 -column 3 -sticky news -padx 10 311 set value [expr {$i - 1}] 312 313 checkbutton $config(7).polar_$i -text "ADC $i" -variable [myvar polar($i)] 314 grid ${config(7)}.polar_$i 315 316 radiobutton $config(8).hstmux_1_$i -text "ADC $i" -variable [myvar hstmux(1)] -value $value 317 grid ${config(8)}.hstmux_1_$i 318 319 radiobutton $config(9).hstmux_2_$i -text "ADC $i" -variable [myvar hstmux(2)] -value $value 320 grid ${config(9)}.hstmux_2_$i 321 } 322 grid $config(7) -row 3 -column 0 -sticky news -padx 10 -pady 50 323 grid $config(8) -row 3 -column 1 -sticky news -padx 10 -pady 50 324 grid $config(9) -row 3 -column 2 -sticky news -padx 10 -pady 50 306 325 307 326 grid columnconfigure ${master} 0 -weight 1 308 327 grid columnconfigure ${master} 1 -weight 1 309 328 grid columnconfigure ${master} 2 -weight 1 310 grid columnconfigure ${master} 3 -weight 1311 329 312 330 grid rowconfigure ${master} 0 -weight 1 … … 339 357 340 358 $controller usbCmd 0002000100040${value} 359 } 360 361 # ------------------------------------------------------------------------- 362 363 MuxDisplay instproc hstmux_update args { 364 my instvar controller hstmux 365 366 set value [format {%x%x} $hstmux(2) $hstmux(1)] 367 368 $controller usbCmd 00020008000400${value} 341 369 } 342 370
Note:
See TracChangeset
for help on using the changeset viewer.