Changeset 865


Ignore:
Timestamp:
Dec 4, 2009 5:13:22 PM (13 years ago)
Author:
toby
Message:

# on 2006/02/22 00:18:37, toby did:
fix bug in 2theta max for multiple hist addition
implement re-evaluation of multiplicities (ResetMultiplicities?)
add button to Reset Multiplicities to edit menu
update Multiplicities after an origin change
better explain origin shifts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/addcmds.tcl

    • Property rcs:date changed from 2005/12/16 00:36:40 to 2006/02/22 00:18:37
    • Property rcs:lines changed from +5 -5 to +68 -12
    • Property rcs:rev changed from 1.38 to 1.39
    r853 r865  
    11231123                -column 0 -row [incr row] -sticky w
    11241124        set newhist(usebank$i) 1
    1125         grid [entry $cfr.e$i -width 8 \
    1126                 -textvariable newhist(tmin$i)] \
    1127                 -column 1 -row $row -sticky w
     1125        grid [entry $cfr.e$i -width 8] -column 1 -row $row -sticky w
     1126        if {$newhist(insttype) == "TOF"} {
     1127            $cfr.e$i config -textvariable newhist(tmin$i)
     1128        } else {
     1129            $cfr.e$i config -textvariable newhist(tmax$i)
     1130        }
    11281131    }
    11291132    # resize the list
     
    16041607    grid [button $w1.d1 -text "Xform Origin 1 to Origin 2" \
    16051608              -command "XformAtoms2Origin2 $phase [list $numberList] $w1 [list $shift]" \
    1606              ] -row [incr row] -column 0 -columnspan 10 -sticky e
     1609             ] -row [incr row] -column 3 -columnspan 10 -sticky e
    16071610    if {$shift == ""} {$w1.d1 config -state disabled}
     1611
     1612    grid [button $w1.d4 -text "Reset Multiplicities" \
     1613                -command "ResetMultiplicities $phase $w" \
     1614                ] -row $row -column 0 -columnspan 3 -sticky w
    16081615
    16091616
     
    16471654    }
    16481655
    1649     grid rowconfigure $w 5 -minsize 5
     1656    grid rowconfigure $w 7 -minsize 5
    16501657    if {[lindex $expmap(phasetype) [expr {$p - 1}]] != 4} {
    16511658        grid [TitleFrame $w.8 -bd 6 -relief groove \
     
    16581665    }
    16591666
    1660     grid rowconfigure $w 9 -minsize 5
    1661     grid [frame $w.b] -row 10 -column 0 -columnspan 10 -sticky ew
     1667    grid rowconfigure $w 11 -minsize 5
     1668    grid [frame $w.b] -row 12 -column 0 -columnspan 10 -sticky ew
    16621669    pack [button $w.b.3 -text Close -command "destroy $w"] -side left \
    16631670            -padx 5 -pady 5
     
    17041711        incr expgui(changed)
    17051712    }
    1706     UpdateAtomLine $numberList $phase
     1713    # update multiplicities for the phase
     1714    set parent [winfo toplevel $w1]
     1715    ResetMultiplicities $phase $parent
     1716    SelectOnePhase $phase
     1717    MyMessageBox -parent $parent -type OK -default ok -title "Transform applied" \
     1718        -message "The coordinates of atoms [CompressList $numberList] have been transformed"
     1719#    UpdateAtomLine $numberList $phase
     1720    destroy $parent
    17071721}
    17081722
     
    23622376    }
    23632377
     2378    ResetMultiplicities $phase $parent
     2379    SelectOnePhase $phase
    23642380    MyMessageBox -parent $parent -type OK -default ok -title "Shift applied" \
    2365         -message "A shift of \"$shift\" has been applied to atoms [CompressList $numberList]"
    2366     UpdateAtomLine $numberList $phase
     2381        -message "A shift of \"$shift\" has been added to coordinates of atoms [CompressList $numberList]"
     2382#    UpdateAtomLine $numberList $phase
    23672383    destroy $parent
    23682384}
    2369 # default
     2385
     2386# reset the site multiplicities using the EXPEDT program
     2387proc ResetMultiplicities {phase parent} {
     2388    global expgui tcl_platform
     2389    set input [open resetmult.inp w]
     2390    puts $input "Y"
     2391    puts $input "l a p $phase"
     2392    puts $input "l"
     2393    puts $input "x x x"
     2394    puts $input "x"
     2395    close $input
     2396    # Save the current exp file
     2397    savearchiveexp
     2398    # disable the file changed monitor
     2399    set expgui(expModifiedLast) 0
     2400    set expnam [file root [file tail $expgui(expfile)]]
     2401    set err [catch {
     2402        if {$tcl_platform(platform) == "windows"} {
     2403            exec [file join $expgui(gsasexe) expedt.exe] $expnam < resetmult.inp >& resetmult.out
     2404        } else {
     2405            exec [file join $expgui(gsasexe) expedt] $expnam < resetmult.inp >& resetmult.out
     2406        }
     2407    } errmsg]
     2408    loadexp $expgui(expfile)
     2409    catch {file delete resetmult.inp}
     2410    if {$expgui(showexptool) || $err} {
     2411        set fp [open resetmult.out r]
     2412        set out [read $fp]
     2413        close $fp
     2414        if {$errmsg != ""} {
     2415            append errmsg "\n" $out
     2416        } else {
     2417            set errmsg $out
     2418        }
     2419        set msg "Please review the result from listing the phase."
     2420        if {$err} {append msg "\nIt appears an error occurred!"}
     2421        ShowBigMessage $parent.msg $msg $errmsg OK "" $err
     2422    }
     2423}
     2424
     2425# default values
    23702426set newhist(insttype) {}
    23712427set newhist(dummy) 0
Note: See TracChangeset for help on using the changeset viewer.