Changeset 1231 for branches/sandbox


Ignore:
Timestamp:
Feb 28, 2013 3:17:18 PM (8 years ago)
Author:
toby
Message:

minor chem restraint fixes; Fix really old Biso conversion error (thanks Cyrus)

Location:
branches/sandbox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/chemrest.tcl

    r1220 r1231  
    4646    grid [label $top.mult -text "Multi-\nplicity" -anchor center -padx 3] -column 2 -row 3 -sticky ews
    4747    grid [label $top.occ  -text "Frac\nOccup." -anchor center -padx 3] -column 3 -row 3 -sticky ews
    48     grid [label $top.weight  -text "Weight" -anchor center -padx 5] -column 4 -row 3 -sticky ews
     48    grid [label $top.weight  -text "Multiplier" -anchor center -padx 5] -column 4 -row 3 -sticky ews
    4949    grid [label $top.prod  -text "Product" -anchor center -padx 5] -column 5 -row 3 -sticky ews
    5050    grid rowconfig  $top 3 -pad 10
     
    6565}
    6666
    67 # Add a new constraint to the list of chemical constraints
     67# Add a new restraint to the list of chemical restraints
    6868proc AddChemConstr {win} {
    6969    #puts AddChemConstr
     
    7575    lappend conslist {0 0.1}
    7676    ChemConst restraintlist set $conslist
     77    RecordMacroEntry "ChemConst restraintlist set [list $conslist]" 0
     78    RecordMacroEntry "incr expgui(changed)" 0
     79    incr ::expgui(changed)
    7780    ShowChemConstr $win
    7881    set ::expcons(ChemConsSelect) [llength $conslist]
     
    165168    }       
    166169    set ::expcons(ChemConstBox_count) 0
    167 
    168170    if {$::expcons(ChemConsSelect) == "" || $::expcons(ChemConsSelect) == 0} {
    169         set ::expcons(ChemTopLbl) "no constraint selected"
    170         set ::expcons(DeleteLbl) ""
    171         foreach item $::expcons(chemOnNoSelectDisablelist) {
    172             $item config -state disabled
    173         }
    174         grid forget $::expcons(chemmaster).f2
    175         return
     171        set conslist [ChemConst restraintlist get]
     172        if {$conslist == 1 || [llength $conslist] == 0} {
     173            set ::expcons(ChemTopLbl) "no restraint selected"
     174            set ::expcons(DeleteLbl) ""
     175            foreach item $::expcons(chemOnNoSelectDisablelist) {
     176                $item config -state disabled
     177            }
     178            grid forget $::expcons(chemmaster).f2
     179            return
     180        } else {
     181            # select the first if none are selected
     182            set ::expcons(ChemConsSelect) 1
     183        }
    176184    }
    177185    set consnum $::expcons(ChemConsSelect)
    178     set ::expcons(ChemTopLbl) "Constraint $::expcons(ChemConsSelect) selected"
    179     set ::expcons(DeleteLbl) "Delete Constraint $::expcons(ChemConsSelect)"
     186    set ::expcons(ChemTopLbl) "Restraint $::expcons(ChemConsSelect) selected"
     187    set ::expcons(DeleteLbl) "Delete Restraint $::expcons(ChemConsSelect)"
    180188    foreach item $::expcons(chemOnNoSelectDisablelist) {
    181189        $item config -state normal
     
    212220 }
    213221
    214 # Show a list of constraints in box to left; select first if only one
     222# Show a list of restraints in box to left; select first if only one
    215223proc ShowChemConstr {win} {
    216224    global expcons
     
    219227    set conslist [ChemConst restraintlist get]
    220228    if {$conslist == 1 || [llength $conslist] == 0} {
    221         grid [label $win.l -text "no constraints defined" \
     229        grid [label $win.l -text "no restraints defined" \
    222230                  -pady 10 -anchor center ] -column 0 -row 1 -sticky ns
    223231        set conslist {}
    224232    } else {
    225233        for {set i 1} {$i <= [llength $conslist]} {incr i} {
    226             grid [radiobutton $win.$i -text "Constraint $i" \
     234            grid [radiobutton $win.$i -text "Restraint $i" \
    227235                      -variable expcons(ChemConsSelect) \
    228236                      -command ShowSelectedChemConst -value $i] -column 0 -row $i
     
    232240    }
    233241    if { [llength $conslist] < 9} {
    234         grid [button $win.add -text "Add Constraint" -anchor center \
     242        grid [button $win.add -text "Add Restraint" -anchor center \
    235243                  -command "AddChemConstr $win"] \
    236244            -columnspan 2 -column 0 -row 99
  • branches/sandbox/import_cif.tcl

    r1230 r1231  
    164164        # convert Biso to Uiso (if needed)
    165165        if {$Uconv != 1} {
    166             catch {set $uiso [expr $Uconv*$uiso]}
     166            catch {set uiso [expr {$Uconv*$uiso}]} err
    167167        }
    168168        lappend atomlist [list $lbl $x $y $z $type $occ $uiso]
Note: See TracChangeset for help on using the changeset viewer.