Changeset 354


Ignore:
Timestamp:
Dec 4, 2009 5:04:43 PM (16 years ago)
Author:
toby
Message:

# on 2000/11/27 21:05:56, toby did:
line up >10 banks in Hist add
set 2theta max from Bank header

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/addcmds.tcl

    • Property rcs:date changed from 2000/10/17 23:59:32 to 2000/11/27 21:05:56
    • Property rcs:lines changed from +10 -10 to +51 -9
    • Property rcs:rev changed from 1.14 to 1.15
    r326 r354  
    366366    }
    367367    set newhist(banklist) {}
    368     foreach child [pack slaves $np.bank] {destroy $child}
     368    foreach child [winfo children $np.bank] {destroy $child}
    369369    # is this a properly formatted file?
    370370    if {$tcl_platform(platform) == "windows"} {
     
    394394                scan $line "BANK%d" num
    395395                lappend newhist(banklist) $num
     396                # compute last point
     397                set tmax 0
     398                catch {
     399                    scan $line "BANK%d%d%d%s%f%f" num nchan nrec rest start step
     400                    set tmax [expr ($start + $step*($nchan-1))/100.]
     401                }
     402                set newhist(tmax$num) $tmax
    396403            }
    397404            # check for "Instrument parameter file" line
     
    433440            # scan for BANK lines
    434441            if {[string first BANK $line] == 0} {
    435                 scan $line "BANK%d" num
     442                scan $line "BANK%d" num 
    436443                lappend newhist(banklist) $num
     444                # compute last point
     445                set tmax 0
     446                catch {
     447                    scan $line "BANK%d%d%d%s%f%f" num nchan nrec rest start step
     448                    set tmax [expr ($start + $step*($nchan-1))/100.]
     449                }
     450                set newhist(tmax$num) $tmax
    437451            }
    438452            # check for "Instrument parameter file" line
     
    457471        set newhist(rawfile) $inp
    458472    }
     473    set row 0
     474    set col -1
    459475    foreach i $newhist(banklist) {
    460         pack [radiobutton $np.bank.$i -text $i \
    461                 -variable newhist(banknum) -value $i] -side left
     476        if {$col > 8} {
     477            set col -1
     478            incr row
     479        }
     480        grid [radiobutton $np.bank.$i -text $i -command SetTmax \
     481                -variable newhist(banknum) -value $i] \
     482                -column [incr col] -row $row -sticky w
    462483        # only 1 choice, so set it
    463         if {[llength $newhist(banklist)] == 1} {set newhist(banknum) $i}
    464     }
     484        if {[llength $newhist(banklist)] == 1} {
     485            set newhist(banknum) $i
     486            SetTmax
     487        } else {
     488            set newhist(2tLimit) {}
     489            set newhist(LimitMode) {}
     490        }
     491    }
     492}
     493
     494proc SetTmax {} {
     495    global newhist
     496    set num $newhist(banknum)
     497    set newhist(2tLimit) $newhist(tmax$num)
     498    set newhist(LimitMode) 1
    465499}
    466500
     
    495529    }
    496530    set newhist(instbanks) {}
    497     foreach child [pack slaves $np.set] {destroy $child}
     531    foreach child [winfo children $np.set] {destroy $child}
    498532    # is this a properly formatted file?
    499533    if {$tcl_platform(platform) == "windows"} {
     
    568602        set newhist(instfile) $inp
    569603    }
     604    set col -1
     605    set row 0
    570606    for {set i 1} {$i <= $newhist(instbanks)} {incr i} {
    571         pack [radiobutton $np.set.$i -text $i \
    572                 -variable newhist(setnum) -value $i] -side left
     607        if {$col > 8} {
     608            set col -1
     609            incr row
     610        }
     611        grid [radiobutton $np.set.$i -text $i \
     612                -variable newhist(setnum) -value $i] \
     613                -column [incr col] -row $row -sticky w
     614
    573615        if {$newhist(instbanks) == 1} {set newhist(setnum) $i}
    574616    }
Note: See TracChangeset for help on using the changeset viewer.