Ignore:
Timestamp:
Jan 24, 2012, 11:16:15 AM (13 years ago)
Author:
demin
Message:

add multiplexers for spectrum and rate histograms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MultiChannelUSB/UserInterface.tcl

    r159 r161  
    77package require zlib
    88
    9 wm minsize . 1000 700
     9wm minsize . 990 660
    1010
    1111namespace eval ::mca {
     
    237237
    238238    MuxDisplay instproc start {} {
    239         my instvar config chan_val
     239        my instvar config chan_val hstmux
    240240
    241241        set chan_val(1) 0
     
    246246        set chan_val(6) 0
    247247
     248        set hstmux(1) 0
     249        set hstmux(2) 0
     250
    248251        trace add variable [myvar chan_val] write [myproc chan_val_update]
    249252        trace add variable [myvar polar] write [myproc polar_update]
     253        trace add variable [myvar hstmux] write [myproc hstmux_update]
    250254
    251255        $config(1).chan_1_1 select
     
    257261
    258262        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
    261268    }
    262269
     
    276283
    277284        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}]
    279286
    280287            foreach {ch dummy} $adcList {
     
    294301            }
    295302            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}]
    301310        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
    306325
    307326        grid columnconfigure ${master} 0 -weight 1
    308327        grid columnconfigure ${master} 1 -weight 1
    309328        grid columnconfigure ${master} 2 -weight 1
    310         grid columnconfigure ${master} 3 -weight 1
    311329
    312330        grid rowconfigure ${master} 0 -weight 1
     
    339357
    340358        $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}
    341369    }
    342370
Note: See TracChangeset for help on using the changeset viewer.