Changeset 399 for trunk/expgui


Ignore:
Timestamp:
Dec 4, 2009 5:05:31 PM (11 years ago)
Author:
toby
Message:

# on 2001/06/29 18:06:31, toby did:
Add Marquardt, convergence, LeBail? damping to LS page
bkgedit button to background edit dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 2001/05/23 20:11:12 to 2001/06/29 18:06:31
    • Property rcs:lines changed from +39 -7 to +90 -16
    • Property rcs:rev changed from 1.43 to 1.44
    r395 r399  
    379379    # set fo extraction on LS page
    380380    SetupExtractHist
     381    # set convergence criterion
     382    InitLSvars
    381383
    382384    # update the histogram list & update the page
     
    417419    set expgui(titleunchanged) 1
    418420    wm iconname . [file tail $expgui(expfile)]
     421    # set convergence criterion
     422    InitLSvars
    419423}
    420424
     
    783787    wm title . $expgui(expfile)
    784788    set expgui(titleunchanged) 1
     789    # set convergence criterion
     790    InitLSvars
    785791}
    786792
     
    22352241    set entrycmd(fobsextract) "histinfo [list $histlist] foextract"
    22362242    if {[llength $histlist] == 0 || [string trim $histlist] == ""} {
     2243        set entrycmd(LBdamp) ""
    22372244        foreach phase {1 2 3 4 5 6 7 8 9} {
    22382245            $expgui(FobsExtractFrame).l$phase config -fg grey
     
    22462253        set entrycmd(trace) 0
    22472254        set entryvar(fobsextract) [histinfo $histlist foextract]
     2255        set entrycmd(LBdamp) "histinfo $histlist LBdamp"
     2256        set entryvar(LBdamp) [histinfo $histlist LBdamp]
    22482257        foreach phase {1 2 3 4 5 6 7 8 9} {
    22492258            # is the phase present?
     
    22642273    } elseif {[llength $histlist] > 1} {
    22652274        # disable traces on entryvar
     2275        set entrycmd(LBdamp) "histinfo [list $histlist] LBdamp"
     2276        set entryvar(LBdamp) [histinfo [lindex $histlist 0] LBdamp]
    22662277        set entrycmd(trace) 0
    22672278        # multiple histograms need phases in any histogram
     
    23302341        grid [label $w.0.a \
    23312342            -text "Setting background terms for histogram $histlist" \
    2332             -bg beige] -row 0 -column 0 -columnspan 10
     2343            -bg beige] -row 0 -column 0 -columnspan 4
     2344        grid [button $w.0.bkg -text "Fit Background\nGraphically" \
     2345                -command "QuitEditBackground $w; bkgedit $histlist"] \
     2346                -row 0 -column 4 -rowspan 2
     2347        grid columnconfig $w.0 0 -weight 1
     2348        grid columnconfig $w.0 4 -weight 1
    23332349    }
    23342350    set hist [lindex $histlist 0]
    2335     grid [label $w.0.b -text "Function type"  -bg beige]  -row 1 -column 0
     2351    grid [label $w.0.b -text "Function type" -bg beige]  -row 1 -column 0 -sticky e
    23362352
    23372353    # disable traces on  expgui(backtype) & expgui(backterms) now
     
    23452361    $typemenu delete 0 end
    23462362    foreach item {
    2347         "1 - Shifted Chebyshev"
     2363        "1 - Shifted Chebyschev"
    23482364        "2 - Cosine Fourier series"
    23492365        "3 - Radial distribution peaks"
     
    32353251
    32363252pack [frame $expgui(lsFrame).f1] -fill both -expand true
    3237 grid rowconfigure $expgui(lsFrame).f1  4 -weight 1
    32383253set row 0
    32393254grid [label $expgui(lsFrame).f1.his1 -pady 6 -text "Last History:"] -row $row -column 0
     
    32493264
    32503265incr row
     3266grid rowconfigure $expgui(lsFrame).f1 $row -weight 1
     3267incr row
    32513268grid [frame $expgui(lsFrame).f1.b -bd 4 -relief groove] \
    3252         -row $row -column 0 -columnspan 2 -pady 3
     3269        -row $row -column 0 -columnspan 2 -pady 3  -sticky s
    32533270grid [label $expgui(lsFrame).f1.b.lcyc -text "Number of Cycles"] -row 0 -column 0
    32543271grid [entry $expgui(lsFrame).f1.b.ecyc -width 3 \
    32553272        -textvariable entryvar(cycles)] -row 0 -column 1
    32563273set entrybox(cycles) $expgui(lsFrame).f1.b.ecyc
     3274
     3275grid [frame $expgui(lsFrame).f1.cv -bd 4 -relief groove] \
     3276        -row $row -column 2 -sticky ew
     3277grid [label $expgui(lsFrame).f1.cv.l -text "Convgerence Criterion"] \
     3278        -row 0 -column 0 -columnspan 2
     3279grid [label $expgui(lsFrame).f1.cv.v -textvariable expgui(convlbl)] -row 1 -column 0
     3280grid [scale $expgui(lsFrame).f1.cv.s -orient horizontal \
     3281        -from -200 -to 200 -showvalue 0 -command SetConv -resolution 10 \
     3282        -variable expgui(convg)] -row 1 -column 1
     3283
     3284incr row
    32573285grid [menubutton $expgui(lsFrame).f1.lprint -textvariable expgui(printopt) \
    32583286        -menu $expgui(lsFrame).f1.lprint.menu -bd 4 -relief raised \
    3259         ] -row $row -column 2
     3287        ] -row $row -column 0 -columnspan 2
    32603288menu $expgui(lsFrame).f1.lprint.menu
    32613289foreach num [lsort [array names printopts]] {
     
    32643292        -variable entryvar(printopt$num)
    32653293}
    3266 #grid [frame $expgui(lsFrame).f1.c -bd 4 -relief groove] -row $row -column 3
    3267 #grid [label $expgui(lsFrame).f1.c.fol -text "Extract Fobs"] -row 0 -column 2
    3268 #grid [checkbutton $expgui(lsFrame).f1.c.foc -variable entryvar(fobsextract)] -row 0 -column 3
     3294
     3295grid [frame $expgui(lsFrame).f1.marq -bd 4 -relief groove] \
     3296        -row $row -column 2 -sticky ew
     3297grid [label $expgui(lsFrame).f1.marq.l -text "Marquardt Damping"] \
     3298        -row 0 -column 0 -columnspan 2
     3299grid [label $expgui(lsFrame).f1.marq.v -textvariable expgui(marq)] \
     3300        -row 1 -column 0
     3301grid [scale $expgui(lsFrame).f1.marq.s -orient horizontal \
     3302        -from 1.0 -to 9.99 -showvalue 0 -command SetMarq -resolution 0.01 \
     3303        -variable expgui(marq)] -row 1 -column 1
     3304
     3305incr row
     3306grid rowconfigure $expgui(lsFrame).f1 $row -weight 1
     3307
    32693308incr row
    32703309if {$expgui(haveBW)} {
     
    32783317    set expgui(FobsExtractFrame) $expgui(lsFrame).f1.a
    32793318}
    3280 grid rowconfigure $expgui(lsFrame).f1 $row -pad 16
     3319
    32813320grid [frame $expgui(FobsExtractFrame).c -bd 4 -relief groove] \
    3282         -row 0 -column 8 -columnspan 3 -sticky e
     3321        -row 0 -column 8 -columnspan 3 -sticky ens
    32833322grid [label $expgui(FobsExtractFrame).c.fol -text "Extract Fobs"] \
    32843323        -row 0 -column 2
    32853324grid [checkbutton $expgui(FobsExtractFrame).c.foc \
    32863325        -variable entryvar(fobsextract)] -row 0 -column 3
     3326
     3327grid [frame $expgui(FobsExtractFrame).d -bd 4 -relief groove] \
     3328        -row 0 -column 3 -columnspan 5 -sticky ens
     3329grid [label $expgui(FobsExtractFrame).d.fol -text "LeBail damping"] \
     3330        -row 0 -column 2
     3331tk_optionMenu $expgui(FobsExtractFrame).d.d entryvar(LBdamp) \
     3332        0 1 2 3 4 5 6 7 8 9
     3333grid $expgui(FobsExtractFrame).d.d -row 0 -column 3
     3334incr row
     3335grid rowconfigure $expgui(lsFrame).f1 $row -weight 1
     3336
     3337
     3338
    32873339foreach num {1 2 3 4 5 6 7 8 9} {
    32883340    grid [label $expgui(FobsExtractFrame).l$num -text $num] -row 1 -column $num
     
    33063358grid [label $expgui(FobsExtractFrame).t \
    33073359        -text "Extraction\nMethod" -anchor c] \
    3308         -column 0 -row 0 -rowspan 2 -sticky s
    3309 grid [label $expgui(FobsExtractFrame).t0 -text "Phase #" -anchor sw] \
    3310         -column 1 -row 0 -columnspan 7 -sticky sw
     3360        -column 0 -row 0 -sticky n
     3361grid [label $expgui(FobsExtractFrame).t0 -text "(Phase #)" -anchor c] \
     3362        -column 10 -row 1 -sticky w
    33113363grid [label $expgui(FobsExtractFrame).t1 -text "Rietveld" -anchor c] -column 0 -row 2
    33123364grid [label $expgui(FobsExtractFrame).t2 -text "F(calc) Weighted" -anchor c] -column 0 -row 3
     
    33143366grid [label $expgui(FobsExtractFrame).t2a -text "(Model biased)" -anchor c] -column 10 -row 3
    33153367grid [label $expgui(FobsExtractFrame).t3a -text "(Le Bail method)" -anchor c] -column 10 -row 4
     3368
     3369proc InitLSvars {} {
     3370    global expgui
     3371    set expgui(convg) [set expgui(convinit) [expinfo convg]]
     3372    set expgui(convlbl) [format %5.2f [expr pow(10,$expgui(convg)/100.)]]
     3373    set expgui(marq) [set expgui(marqinit) [expinfo marq]]
     3374}
     3375proc SetConv {x} {
     3376    global expgui
     3377    if {$x != $expgui(convinit) && $expgui(changed) <= 0} {
     3378        incr expgui(changed)
     3379    }
     3380    if {$expgui(changed)} {expinfo convg set $x}
     3381    set expgui(convlbl) [format %5.2f [expr {pow(10,$x/100.)}]]
     3382}
     3383proc SetMarq {x} {
     3384    global expgui
     3385    if {$x != $expgui(marqinit) && $expgui(changed) <= 0} {
     3386        incr expgui(changed)
     3387    }
     3388    if {$expgui(changed)} {expinfo marq set $x}
     3389}
    33163390# ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ END OF LS PANE CODE ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
    33173391#-------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.