Changeset 119 for trunk/gsascmds.tcl


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

# on 1999/11/17 22:02:36, toby did:
Add routine to delete history records
fix composition bug for multiphase refinements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsascmds.tcl

    • Property rcs:date changed from 1999/09/09 19:08:11 to 1999/11/17 22:02:36
    • Property rcs:lines changed from +13 -17 to +44 -11
    • Property rcs:rev changed from 1.14 to 1.15
    r102 r119  
    269269            if {$mult > $Z} {set Z $mult}
    270270        }
    271     }
    272    
    273     append text "Unit cell contents\n"
    274     foreach phase $expmap(phaselist) {
    275         append text "  Phase $phase\t"
     271        append text "\nPhase $phase\n"
     272        append text "  Unit cell contents\n"
    276273        foreach type [lsort [array names total]] {
    277274            append text "   $type[format %8.3f $total($type)]"
    278275        }
    279         append text "\n"
    280     }
     276        append text "\n\n"
    281277   
    282     append text "\n\nAsymmetric Unit contents\n"
    283     foreach phase $expmap(phaselist) {
    284         append text "  Phase $phase (Z=$Z)\t"
     278        append text "  Asymmetric Unit contents (Z=$Z)\n"
    285279        foreach type [lsort [array names total]] {
    286280            append text "   $type[format %8.3f [expr $total($type)/$Z]]"
     
    12791273    return $makenew(result)
    12801274}
     1275
     1276#------------------------------------------------------------------------------
     1277# Delete History Records
     1278proc DeleteHistoryRecords {{msg ""}} {
     1279    global expgui
     1280    set frm .history
     1281    catch {destroy $frm}
     1282    toplevel $frm
     1283    if {[string trim $msg] == ""} {
     1284        set msg "There are [CountHistory] history records"
     1285    }
     1286    pack [frame $frm.1 -bd 2 -relief groove] -padx 3 -pady 3 -side left
     1287    pack [label $frm.1.0 -text $msg] -side top
     1288    pack [frame $frm.1.1] -side top
     1289    pack [label $frm.1.1.1 -text "Number of entries to keep"] -side left
     1290    pack [entry $frm.1.1.2 -width 3 -textvariable expgui(historyKeep)\
     1291            ] -side left
     1292    set expgui(historyKeep) 10
     1293    pack [checkbutton $frm.1.2 -text renumber -variable expgui(renumber)] -side top
     1294    set expgui(renumber) 1
     1295    pack [frame $frm.2] -padx 3 -pady 3 -side left
     1296    pack [button $frm.2.3 -text OK \
     1297            -command {
     1298        if ![catch {expr $expgui(historyKeep)}] {
     1299            DeleteHistory $expgui(historyKeep) $expgui(renumber)
     1300            set expgui(changed) 1
     1301            destroy .history
     1302        }
     1303    }] -side top
     1304    pack [button $frm.2.4 -text Quit \
     1305            -command {destroy .history}] -side top
     1306    bind $frm <Return> "$frm.2.3 invoke"
     1307   
     1308    # force the window to stay on top
     1309    putontop $frm
     1310    focus $frm.2.3
     1311    tkwait window $frm
     1312    afterputontop
     1313}
Note: See TracChangeset for help on using the changeset viewer.