Changeset 255


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

# on 2000/08/04 18:29:16, toby did:
Change phase buttons, add "Add Phase" after last phase
change old "Add Phase" to "Replace Phase" (not yet implemented)
Add xform atoms button w/dialog
implement sort on occupancy
change error message when a non-existing atom is selected (happens with empty phase)
implement phase flags -- when more than one phase is present
move SetPhaseFlag? to readexp.tcl
/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 2000/07/28 20:29:34 to 2000/08/04 18:29:16
    • Property rcs:lines changed from +117 -49 to +41 -35
    • Property rcs:rev changed from 1.30 to 1.31
    r250 r255  
    666666    global expgui expmap
    667667    eval destroy [winfo children $expgui(phaseFrame).top.ps]
     668    pack [label $expgui(phaseFrame).top.ps.0 -text Phase:] -side left
    668669    foreach num $expmap(phaselist) type $expmap(phasetype) {
    669670        pack [button $expgui(phaseFrame).top.ps.$num -text $num \
    670                 -command "SelectOnePhase $num"] -side left
     671                -command "SelectOnePhase $num" -padx 1.5m] -side left
    671672        if {$type > 3} {
    672673            $expgui(phaseFrame).top.ps.$num config -state disabled
    673674        }
     675    }
     676    if {[file executable $expgui(exptool)] && \
     677            [llength $expmap(phaselist)]} {
     678        pack [button $expgui(phaseFrame).top.ps.10 -text "Add Phase" \
     679                -padx 1.5m -command MakeAddPhaseBox] -side left
    674680    }
    675681}
     
    680686    global entryvar entrycmd expmap expgui
    681687    set crsPhase {}
     688    $expgui(atomxform) config -text "Xform Atoms" -state disabled
    682689    foreach n $expmap(phaselist) type $expmap(phasetype) {
    683690        if {$n == $num && $type <= 3} {
     
    776783    set multhead "Mult"
    777784    set coordhead "   "
     785    set frachead "Occupancy"
    778786    if  {$expgui(asorttype) == "type"} {
    779787        # sort on atom type
     
    797805        }
    798806        set expmap(atomlistboxcontents) [lsort -integer -decreasing -index 1 $atomlist]
     807    } elseif {$expgui(asorttype) == "occupancy"} {
     808        # sort on atom number
     809        set frachead "  Occup* "
     810        foreach atom $expmap(atomlist_$phase) {
     811            lappend atomlist "$atom [atominfo $phase $atom frac] $phase"
     812        }
     813        set expmap(atomlistboxcontents) [lsort -real -decreasing -index 1 $atomlist]
    799814    } elseif {$expgui(asorttype) == "x"} {
    800815        # sort on x
     
    868883                $namehead $typehead "ref/damp  " \
    869884                "fractional coordinates$coordhead" \
    870                 "$multhead Occupancy" \
    871                 "Uiso/Uij                                            "]
     885                "$multhead $frachead" \
     886                " Uiso/Uij                                            "]
    872887    } else {
    873888        $expgui(atomtitle) insert end [format "%10s %6s %8s%29s %9s  %s" \
    874889                $namehead $typehead "ref/damp  " \
    875890                "fractional coordinates$coordhead" \
    876                 "$multhead Occupancy" \
    877                 "Uiso"]
     891                "$multhead $frachead" \
     892                " Uiso"]
    878893    }
    879894    if {$mode != "reset"} {
     
    904919
    905920    if {[llength $expgui(selectedatomlist)] == 0} {
    906         puts  "How did this happen: [$expgui(atomlistbox) curselection]"
     921        if $expgui(debug) {error "Attempt display non-existent atoms"}
    907922    } elseif {[llength $expgui(selectedatomlist)] == 1} {
    908923        editOneRecord $expgui(selectedatomlist)
     
    926941    DisplayRefFlags $atomnum $p
    927942    $expgui(EditingAtoms) config -text "Editing atom #$atomnum -- [atominfo $p $atomnum label]"
     943    $expgui(atomxform) config -text "Xform Atom" -state normal
    928944}
    929945
     
    947963    # this needs to track by phase
    948964    DisplayRefFlags $numberList $p
     965    $expgui(atomxform) config -text "Xform Atoms" -state normal
    949966}
    950967
     
    13031320    }
    13041321    # Top box
    1305     if $expgui(haveBW) {
    1306         catch {destroy $expgui(histFrame).pflag}
    1307     }
    13081322    if {$expgui(globalmode) != 0} {
     1323        if $expgui(haveBW) {
     1324            catch {destroy $expgui(histFrame).pflag}
     1325        }
    13091326        $expgui(histFrame).top.txt config \
    13101327                -text "Selected Histograms: [CompressList $histlist]"
     
    13141331        grid forget $expgui(histFrame).top
    13151332        set expgui(bkglbl) "Edit Background"
    1316         if {$expgui(haveBW) && [llength $expmap(phaselist)] > 1} {
     1333        if $expgui(haveBW) {
     1334            catch {destroy $expgui(histFrame).pflag}
    13171335            TitleFrame $expgui(histFrame).pflag  \
    13181336                    -borderwidth 4 -side left -relief groove \
     
    16381656}
    16391657
     1658# this gets the phase flags as set in the expgui(pflag*) elements
     1659# (linked to phase flag checkbuttons) and the sets the "HST xx NPHAS" flags
     1660# accordingly using SetPhaseFlag
    16401661proc GetPhaseFlags {hist} {
    16411662    global expmap expgui
     
    16471668    incr expgui(changed)
    16481669    mapexp
    1649 }
    1650 
    1651 proc SetPhaseFlag {hist plist} {
    1652     # make a 2 digit key -- hh
    1653     if {$hist < 10} {
    1654         set hh " $hist"
    1655     } else {
    1656         set hh $hist
    1657     }
    1658     set key "HST $hh NPHAS"
    1659     set str {}
    1660     foreach iph {1 2 3 4 5 6 7 8 9} {
    1661         if {[lsearch $plist $iph] != -1} {
    1662             append str {    1}
    1663         } else {
    1664             append str {    0}     
    1665         }
    1666     }
    1667     setexp $key $str 1 68
    16681670}
    16691671
     
    26442646    pack [label $expgui(phaseFrame).top.ps.0 -text "No Phases"] -side left
    26452647   
    2646     grid [label $expgui(phaseFrame).top.lA -text "  Phase name:" \
     2648    grid [label $expgui(phaseFrame).top.lA -text title: \
    26472649            -fg blue ] -column 1 -row 0 -sticky e
    26482650    grid [entry $expgui(phaseFrame).top.lB -textvariable entryvar(phasename) \
     
    26762678            -column 1 -row 0 -rowspan 2
    26772679    if [file executable $expgui(exptool)] {
    2678         button $frameLatt.newp -text Add\nPhase -command MakeAddPhaseBox
     2680        button $frameLatt.newp -text Replace\nPhase \
     2681                -command MakeReplacePhaseBox -state disabled
    26792682        grid $frameLatt.newp -column 0 -row 0 -rowspan 2 -sticky w
    26802683    }
     
    26882691    set expgui(atomtitle) $fbig.title
    26892692    bind $expgui(atomtitle) <Button-1> {
    2690         set i [lsearch {number type mult x y z} $expgui(asorttype)]
     2693        set i [lsearch {number type mult x y z occupancy} $expgui(asorttype)]
    26912694        incr i
    2692         set expgui(asorttype) [lindex {number type mult x y z number} $i]
     2695        set expgui(asorttype) [lindex {number type mult x y z occupancy number} $i]
    26932696        DisplayAllAtoms
    26942697    }
     
    27262729        grid $frame3.newa -column 11 -row 0
    27272730    }
    2728    
     2731    button [set expgui(atomxform) $frame3.xa] \
     2732            -command {MakeXformAtomsBox $expgui(curPhase)}
     2733    grid $expgui(atomxform) -column 11 -row 1 -sticky ew
     2734
    27292735    set f3l1 [label $frame3.l1 -text "Refinement Flags " -bg beige]
    27302736    grid $f3l1 -column 0 -row 1 -padx 2 -sticky nsw -pady 3
     
    31693175set expgui(asorttype) number
    31703176menu $expgui(fm).option.menu.asort
    3171 foreach opt {number type mult x y z} {
     3177foreach opt {number type mult x y z occupancy} {
    31723178    $expgui(fm).option.menu.asort add radiobutton -command DisplayAllAtoms \
    31733179            -label $opt -value $opt -variable expgui(asorttype)
Note: See TracChangeset for help on using the changeset viewer.