Changeset 28


Ignore:
Timestamp:
Dec 4, 2009 4:59:10 PM (14 years ago)
Author:
toby
Message:

# on 1999/01/13 05:02:47, toby did:
redo loadexp so that page does not change on reload
Add SaveOptions?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 1999/01/07 04:43:03 to 1999/01/13 05:02:47
    • Property rcs:lines changed from +23 -6 to +59 -37
    • Property rcs:rev changed from 1.6 to 1.7
    r21 r28  
    33
    44# to do:
     5#
     6# new file menu box w/sort by that allows for new .EXP names
    57#
    68# global background editing & profile work differently: should both
     
    3739}
    3840if {$expgui(expfile) == ""} exit
    39 catch {cd [string trim [file dirname $expgui(expfile)]]}
    4041
    4142set expgui(debug) 0
     
    101102set expgui(gsasdir) [file dirname $expgui(scriptdir)]
    102103set expgui(gsasexe) [file join $expgui(gsasdir) exe]
     104catch {cd [string trim [file dirname $expgui(expfile)]]}
    103105#----------------------------------------------------------------
    104106# fetch EXP file processing routines
     
    150152    wm iconname . [file tail $expfile]
    151153
    152     set expgui(curPhase) ""
    153154    # set the number of phases on the phase page
    154155    setphases
    155156
    156     set expgui(pagenow) ""
    157 
    158     # update the histogram list
    159     sethistlist
    160 
    161     if !$expgui(havetix) {
    162         RaisePage lsFrame
    163     } else {
    164         .n raise lsPane
    165         set expgui(pagenow) lsFrame
    166     }
    167     # select the 1st phase
    168     SelectOnePhase [lindex $expmap(phaselist) 0]
    169     # disable the "global options" that don't make sense
     157    # disable the "global options" that don't make sense based
     158    # on the histograms present
    170159    foreach num {1 2 3 4 5} {
    171160        set flag($num) 0
     
    192181    set entrycmd(trace) 0
    193182
    194     # least squares page
     183    # propogate changes on the least squares page
    195184    set entryvar(cycles) [expinfo cycles]
    196185    set entrycmd(cycles) "expinfo cycles"
     
    207196    # set fo extaction on LS page
    208197    SetupExtractHist
     198
     199    # update the histogram list
     200    sethistlist
     201
    209202    # start checking for external changes
    210203    afterawhile
     
    342335
    343336    uplevel #0 {source $script}
     337}
     338
     339# save some of the global options in ~/.gsas_config
     340proc SaveOptions {} {
     341    global expgui env tcl_platform
     342    set fp [open [file join ~ .gsas_config] a]
     343    puts $fp "set expgui(archive) $expgui(archive)"
     344    puts $fp "set expgui(asorttype) $expgui(asorttype)"
     345    puts $fp "set expgui(hsorttype) $expgui(hsorttype)"
     346    if {$tcl_platform(platform) != "windows"} {
     347        puts $fp "set env(GSASBACKSPACE) $env(GSASBACKSPACE)"
     348    }
     349    close $fp
    344350}
    345351
     
    891897proc sethistlist {} {
    892898    global expgui expmap
    893     set expgui(curhist) {}
    894899    foreach lbox $expgui(HistSelectList) {
    895900        $lbox.title delete 0 end
     
    954959        set expmap(histlistboxcontents) [lsort -real -index 1 $histlist]
    955960    }
    956     # select the first histogram in the list by default (if there are any)
    957     if {[llength $histlist] > 0} {set expgui(curhist) 0}
    958961
    959962    # title field needs to match longest title
     
    15761579                grid [entry $expgui(ProfileBox).f.$i.ent${num}_${i} \
    15771580                        -textvariable entryvar(pterm${num}_$i)\
    1578                         -width 14] -row $row -column $col
     1581                        -width 12] -row $row -column $col
    15791582                set entrycmd(pterm${num}_$i) "hapinfo $hist $i pterm$num"
    15801583                set entryvar(pterm${num}_$i) [hapinfo $hist $i pterm$num]
     
    17511754            $expgui(lsFrame).f1.a.l$phase config -fg grey
    17521755            set expgui(Fextract$phase) {}
    1753             #foreach item "a.ca$phase a.cb$phase a.cc$phase"
    1754             foreach item "a.ca$phase a.cc$phase" {
    1755                 $expgui(lsFrame).f1.$item config -state disabled -bd 1
     1756            foreach item $expgui(ExtractSettingsRadiobuttons) {
     1757                ${item}$phase config -state disabled -bd 1
    17561758            }
    17571759        }
     
    17651767                $expgui(lsFrame).f1.a.l$phase config -fg grey
    17661768                set expgui(Fextract$phase) {}
    1767 #               foreach item "a.ca$phase a.cb$phase a.cc$phase"
    1768                 foreach item "a.ca$phase a.cc$phase" {
    1769                     $expgui(lsFrame).f1.$item config -state disabled -bd 1
     1769                foreach item $expgui(ExtractSettingsRadiobuttons) {
     1770                    ${item}$phase config -state disabled -bd 1
    17701771                }
    17711772            } else {
    17721773                $expgui(lsFrame).f1.a.l$phase config -fg black
    1773 #               foreach item "a.ca$phase a.cb$phase a.cc$phase"
    1774                 foreach item "a.ca$phase a.cc$phase" {
    1775                     $expgui(lsFrame).f1.$item config -state normal -bd 2
     1774                foreach item $expgui(ExtractSettingsRadiobuttons) {
     1775                    ${item}$phase config -state normal -bd 2
    17761776                }
    17771777                set expgui(Fextract$phase) [hapinfo $histlist $phase extmeth]
     
    17941794            if $gotphase($phase) {
    17951795                $expgui(lsFrame).f1.a.l$phase config -fg black
    1796                 foreach item "a.ca$phase a.cb$phase a.cc$phase" {
    1797                     $expgui(lsFrame).f1.$item config -state normal -bd 2
     1796                foreach item $expgui(ExtractSettingsRadiobuttons) {
     1797                    ${item}$phase config -state normal -bd 2
    17981798                }
    17991799            } else {
    18001800                $expgui(lsFrame).f1.a.l$phase config -fg grey
    1801                 foreach item "a.ca$phase a.cb$phase a.cc$phase" {
    1802                     $expgui(lsFrame).f1.$item config -state disabled -bd 1
     1801                foreach item $expgui(ExtractSettingsRadiobuttons) {
     1802                    ${item}$phase config -state disabled -bd 1
    18031803                }
    18041804            }
     
    27852785#           -row 4 -column $num
    27862786}
     2787set expgui(ExtractSettingsRadiobuttons) $expgui(lsFrame).f1.a.cc
     2788lappend expgui(ExtractSettingsRadiobuttons) $expgui(lsFrame).f1.a.ca
     2789#lappend expgui(ExtractSettingsRadiobuttons) $expgui(lsFrame).f1.a.cb
     2790
    27872791grid [label $expgui(lsFrame).f1.a.t -text "Intensity Extraction Method" -anchor c] \
    27882792        -column 0 -columnspan 11 -row 0
    2789 grid [label $expgui(lsFrame).f1.a.t0 -text "Histogram #" -anchor c] -column 0 -row 1
     2793grid [label $expgui(lsFrame).f1.a.t0 -text "Phase #" -anchor c] -column 0 -row 1
    27902794grid [label $expgui(lsFrame).f1.a.t1 -text "Rietveld" -anchor c] -column 0 -row 2
    27912795grid [label $expgui(lsFrame).f1.a.t2 -text "F(calc) Weighted" -anchor c] -column 0 -row 3
     
    28622866#---- Global mode menu button
    28632867$expgui(fm).option.menu add cascade -menu $expgui(fm).option.menu.editmode \
    2864         -label "Global mode"
     2868        -label "Multiple hist. selection"
    28652869menu $expgui(fm).option.menu.editmode
    28662870$expgui(fm).option.menu.editmode add radiobutton  -label "Off" \
     
    28912895            -variable env(GSASBACKSPACE)
    28922896}
     2897$expgui(fm).option.menu add command -label "Save Options" -underline 1 \
     2898        -command "SaveOptions"
    28932899
    28942900pack $expgui(fm).file $expgui(fm).option -side left  -in $expgui(fm)
     
    29502956bind . <Control-c> catchQuit
    29512957
     2958set expgui(curPhase) ""
     2959set expgui(pagenow) ""
     2960set expgui(curhist) {}
     2961
    29522962loadexp $expgui(expfile)
     2963
     2964# select the 1st phase
     2965SelectOnePhase [lindex $expmap(phaselist) 0]
     2966# select the first histogram in the list by default (if there are any)
     2967if {[llength $expmap(histlistboxcontents)] > 0} {set expgui(curhist) 0}
     2968
     2969if !$expgui(havetix) {
     2970    RaisePage lsFrame
     2971} else {
     2972    .n raise lsPane
     2973    set expgui(pagenow) lsFrame
     2974}
Note: See TracChangeset for help on using the changeset viewer.