Changeset 1175


Ignore:
Timestamp:
Oct 24, 2011 11:17:42 PM (9 years ago)
Author:
toby
Message:

update stable release to fix bugs & match sandbox: many RB updates; show RB atoms in phase

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    r1166 r1175  
    13331333}
    13341334
    1335 # format a coordinate from a non-mm phase as 10 chars; mark fixed coordinates differently
     1335# format a coordinate from a non-mm phase as 10 chars; mark fixed
     1336# and Rigid body coordinates differently
    13361337proc ShowFixAtom {phase atom var} {
    1337   # is this fixed?
    1338   set param [string toupper $var]
    1339   if {[array name ::fix_param "$phase,$atom,$param"] != ""} {
    1340     return [format "%9.5fF" [atominfo $phase $atom $var]]
    1341   } else {
     1338    # is this fixed?
     1339    set param [string toupper $var]
     1340    if {[array name ::fix_param "$phase,$atom,$param"] != ""} {
     1341        return [format "%9.5fF" [atominfo $phase $atom $var]]
     1342    }
     1343    # is this atom in a rigid body?
     1344    if {[lsearch $::expmap(rbatoms_$phase) $atom] != -1} {
     1345        return [format "%9.5fr" [atominfo $phase $atom $var]]
     1346    }
    13421347    return [format "%10.6f" [atominfo $phase $atom $var]]
    1343   }
    13441348}
    13451349
     
    33323336            "source  [file join $expgui(scriptdir) rigid.tcl]; MakeRBPane" \
    33333337            DisplayRB \
    3334             1  expguiRB.html ""}
     3338            1  expgui6A.html ""}
    33353339    {orientFrame  "MD Pref Orient" \
    33363340            MakeOrientPane \
  • trunk/gsascmds.tcl

    r1166 r1175  
    28652865            close $fp
    28662866            update
    2867             regexp {GNLS  RUN on (.*) +Total.*run *([0-9]+) } \
     2867            regexp -linestop {GNLS  RUN on (.*) +Total.*run *([0-9]+) } \
    28682868                    $testline a last cycles
    28692869            pack [label $expgui(FileInfoBox).2 -justify left \
     
    37793779
    37803780proc CheckAndDoUpdate { } {
     3781    pleasewait "... Checking with software repository..."
    37813782    if {! [CheckSVNinstalled]} {
     3783        donewait
    37823784        MyMessageBox -parent . -title "SVN not found" \
    37833785            -message "Unable to upgrade: Could not locate a copy of the subversion program. It does not appear that one of self-updating GSAS/EXPGUI releases was installed" \
     
    37873789    #is there a svn directory in the source?
    37883790    if {! [file exists [file join $::expgui(gsasdir)  .svn]]} {
     3791        donewait
    37893792        MyMessageBox -parent . -title "No .svn directory" \
    37903793            -message "Unable to upgrade: It does not appear that one of self-updating GSAS/EXPGUI releases was installed" \
     
    37953798    set SVN [auto_execok svn]
    37963799    if [catch {set res [eval exec $SVN status [list $::expgui(gsasdir)] -u]} err] {
     3800        donewait
    37973801        set ans [MyMessageBox -parent . -title "Error checking status" \
    37983802                     -message "Error checking for updates: $err\n\nTry to update manually?" \
     
    38013805            forknewterm "manually update in subversion" \
    38023806                "$SVN update [file normalize $::expgui(gsasdir)]"
     3807            forknewterm "manually update in subversion" \
     3808                "$SVN update [file normalize $::expgui(scriptdir)]"
    38033809        }
    38043810        return
    38053811     } else {
    38063812        if {[string first "*" $res] == -1} {
     3813            catch {set res [eval exec $SVN status [list $::expgui(scriptdir)] -u]} err
     3814        }
     3815        if {[string first "*" $res] == -1} {
     3816            donewait
    38073817            MyMessageBox -parent . -title "No updates" \
    38083818                -message "GSAS & EXPGUI appear up-to-date" \
     
    38123822    }
    38133823
     3824    donewait
    38143825    if {[MyMessageBox -parent . -title "Ready to Update" \
    38153826             -message {
     
    38243835    # special upgrade for windows, where the wish exec blocks upgrade of the exe directory
    38253836    if {$::tcl_platform(platform) == "windows" && $::tcl_platform(os) != "Windows 95"} {
    3826         if {![file exists [file join $::expgui(gsasdir) update.bat]]} {
    3827             MyMessageBox -parent . -title "No update.bat" \
    3828                 -message "File update.bat was not found. This should not happen. Will try to create it now."
    3829             set fp [open [file join $::expgui(gsasdir) update.bat] w]
    3830             puts $fp {@REM this script must be run from the GSAS installation directory
     3837        set fp [open [file join $::expgui(gsasdir) selfupdate.bat] w]
     3838        puts $fp {@REM this script must be run from the GSAS installation directory
    38313839@REM This is run to update the installation, the name of the EXP file is
    38323840@REM expected as an argument
     
    38373845.\svn\bin\svn cleanup .
    38383846.\svn\bin\svn update .
    3839 @if (%1)==() goto Install2
     3847}
     3848        puts $fp ".\\svn\\bin\\svn cleanup $::expgui(scriptdir)"
     3849        puts $fp ".\\svn\\bin\\svn update $::expgui(scriptdir)"
     3850        puts $fp {@if (%1)==() goto Install2
    38403851@echo ****************************************************
    38413852@echo Update has completed. Press return to restart EXPGUI
     
    38513862%COMSPEC% /c "start exe\ncnrpack.exe expgui\expgui"
    38523863exit
    3853             }
    3854             close $fp
    3855         }
     3864        }
     3865        close $fp
    38563866        # split the directory and EXP file and get rid os spaces in the directory name
    38573867        set exp [file normalize $::expgui(expfile)]
     
    38593869        cd $::expgui(gsasdir)
    38603870        #run the batch file
    3861         exec $::env(COMSPEC) /c {start .\update.bat [file join $dir [file tail $exp]]} &
     3871        exec $::env(COMSPEC) /c "start .\\selfupdate.bat [file join $dir [file tail $exp]]" &
    38623872        exit
    38633873    }
     
    38693879            -icon error
    38703880    }
     3881    # do a quiet cleanup. Sometimes needed after install, and never hurts
     3882    if [catch {set res [eval exec $SVN cleanup [list $::expgui(scriptdir)]]} err] {
     3883        MyMessageBox -parent . -title "Error in cleanup" \
     3884            -message "Error performing cleanup. Will try to continue anyway. Error:\n$err" \
     3885            -icon error
     3886    }
    38713887    if [catch {set res [exec $SVN up $::expgui(gsasdir)]} err] {
    38723888        MyMessageBox -parent . -title "Error updating" \
    38733889            -message "Error performing update:\n$err" \
     3890            -icon error
     3891        return
     3892    } elseif [catch {set res [exec $SVN up $::expgui(scriptdir)]} err] {
     3893        MyMessageBox -parent . -title "Error updating" \
     3894            -message "Error performing scriptdir update:\n$err" \
    38743895            -icon error
    38753896        return
  • trunk/rb.tcl

    r1166 r1175  
    141141    close $fp
    142142    #puts "[file join $expgui(gsasexe) geometry] $expgui(expfile) < geom.inp > geom.out"
     143    # Save any change sin the current exp file
     144    savearchiveexp
    143145    catch {
    144146        exec [file join $expgui(gsasexe) geometry] $expgui(expfile) < geom.inp > geom.out
     
    182184    if {[llength $origin] == 0 || [llength $Euler] == 0 || [llength $coordlist] == 0} {
    183185       puts "Error: run of GEOMETRY failed"
     186       error "Run of Program GEOMETRY failed, cannot continue"
    184187    }
    185188    return [list $origin $Euler $coordlist]
  • trunk/readexp.tcl

    r1166 r1175  
    191191    # load the constrained parameters
    192192    atom_constraint_load
     193    # construct tables of mapped atoms in rigid bodies
     194    foreach phase $::expmap(phaselist) {
     195        set expmap(rbatoms_$phase) {}
     196        foreach bodnum [RigidBodyList] {
     197            set natoms [llength [lindex [lindex [lindex [ReadRigidBody $bodnum] 1] 0] 3]]
     198            foreach mapnum [RigidBodyMappingList $phase $bodnum] {
     199                set atomnum [lindex [ReadRigidBodyMapping $phase $bodnum $mapnum] 0]
     200                set st [lsearch $::expmap(atomlist_$phase) $atomnum]
     201                set en [expr {$st+$natoms-1}]
     202                set atoms [lrange $::expmap(atomlist_$phase) $st $en]
     203                set expmap(rbatoms_$phase) [concat $expmap(rbatoms_$phase) $atoms]
     204            }
     205        }
     206    }
    193207    set expgui(mapstat) 1
    194208}
     
    41914205    makeexprec "${key} LSTF"
    41924206    setexp "${key} LSTF" [format "%5d" 0] 1 5
     4207    # turn off the X refinement flags for the new body
     4208    set st [lsearch $::expmap(atomlist_$phase) $firstatom]
     4209    set natoms [llength [lindex [lindex [lindex [ReadRigidBody $bodytyp] 1] 0] 3]]
     4210    set en [expr {$st+$natoms-1}]
     4211    set atomlist [lrange $::expmap(atomlist_$phase) $st $en]
     4212    atominfo $phase $atomlist xref set 0
     4213    # redo the mapping to capture the newly mapped atoms
     4214    mapexp
    41934215    return $rbnum
    41944216}
  • trunk/rigid.tcl

    r1166 r1175  
    8888    # test code (package already loaded in expgui)
    8989    lappend auto_path [file dirname [info script]]
    90     package require La
    9190    source C:/gsas/sandboxexpgui/rb.tcl
    9291#    puts beforeread
     
    9796    source [file join $expgui(scriptdir) rb.tcl]
    9897}
     98package require La
    9999
    100100# Procedure to determine possible RB file formats available
    101101
     102set rbtypelist ""
    102103proc RB_Import_Data_Type {args} {
    103104    global expgui tcl_platform
    104105    # only needs to be done once
    105     set ::rbtypelist ""
    106 
    107     set files [glob -nocomplain [file join $expgui(scriptdir) rbimport_*.tcl]]
    108     foreach filetype $files {
    109           set temp [lindex [string map {_ " "} $filetype] 1]
    110           lappend ::rbtypelist $temp
    111     }
    112     if {$::rbtypelist == ""} {lappend ::rbtypelist "no rigid body file types available"}
    113     foreach filetype $::rbtypelist {
    114             source $::expgui(scriptdir)/rbimport_$filetype
    115     }
    116     return $::rbtypelist
     106    if {$::rbtypelist != ""} return
     107
     108    set ::rbtypelist [glob -nocomplain [file join $expgui(scriptdir) rbimport_*.tcl]]
     109    if {$::rbtypelist == ""} {
     110        MyMessageBox -parent . -title "Installation error" -icon warning \
     111            -message "No rigid body import routines were found.\nSomething is wrong with the EXPGUI installation"
     112        set ::rbtypelist " "
     113    }
     114    foreach file $::rbtypelist {
     115        source $file
     116    }
    117117}
    118118
     
    365365#     puts "cartesian coords:   $temp_car"
    366366     AddRigidBody $temp_mat $temp_car
    367      RecordMacroEntry "AddRigidBody $temp_mat $temp_car" 0
    368 
     367    RecordMacroEntry "AddRigidBody $temp_mat [list $temp_car]" 0
     368    RecordMacroEntry "incr expgui(changed)" 0
    369369     incr ::expgui(changed)
    370370     destroy .nbt
     
    406406#    increment expgui
    407407     incr ::expgui(changed)
     408    RecordMacroEntry "incr expgui(changed)" 0
    408409     RB_Load_RBdata
    409410     RB_Control_Panel 0
     
    424425
    425426     #Rigid body mapping control panel along with matrix multipliers and damping factor labels
    426      grid [label  $con.rb_num -text "Rigid Body Type $bodnum"] -row 0 -column 0 -padx 5 -pady 5
     427    set n [lindex [ReadRigidBody $bodnum] 0]
     428    if {$n == 0} {
     429        set str "(not mapped)"
     430    } elseif {$n == 1} {
     431        set str "(mapped 1 time)"
     432    } else {
     433        set str "(mapped $n times)"
     434    }
     435     grid [label  $con.rb_num -text "Rigid Body Type $bodnum\n$str"] -row 0 -column 0 -padx 5 -pady 5
    427436     grid [button $con.rb_newmap -text "Map Body $bodnum" -command "RB_Map_New $bodnum" -width 18] -row 0 -column 1 -padx 5 -pady 5
    428437     grid [button $con.rb_unmap -text "Unmap Body $bodnum" -command "RB_Unmap $bodnum" -width 18] -row 0 -column 2 -padx 5 -pady 5
     
    498507                      set col 11
    499508                      set atomnum $::rb_map_beginning($phase,$bodnum,$mapnum)
    500                       for {set coordnum 1} {$coordnum <=$::rb_coord_num($bodnum,1)} {incr coordnum} {
    501                           set atom [atominfo $phase $atomnum label]
    502                           grid [label $main.rb_site$phase$mapnum$coordnum -text "$atom"] -row $row -column $col -padx 5
    503                           incr atomnum
    504                           incr col
    505                       }
     509                 # get a list of the atoms in the RB
     510                 set st [lsearch $::expmap(atomlist_$phase) $atomnum]
     511                 set en [expr {$st+$::rb_coord_num($bodnum,1)-1}]
     512                 set atoms [lrange $::expmap(atomlist_$phase) $st $en]
     513                 foreach a $atoms {
     514                     set lbl [atominfo $phase $a label]
     515                     grid [label $main.rb_site$phase$mapnum$a -text $lbl] -row $row -column $col -padx 5
     516                     incr col
     517                 }
    506518             }
    507519     incr row
     
    789801#   puts "position = $origin"
    790802#   puts "Euler = $euler"
    791    MapRigidBody $::rb_phase $::body_type $::rb_firstatom $origin $euler
    792    RecordMacroEntry "MapRigidBody $::rb_phase $::body_type $::rb_firstatom $origin $euler" 0
     803    MapRigidBody $::rb_phase $::body_type $::rb_firstatom $origin $euler
     804    RecordMacroEntry "MapRigidBody $::rb_phase $::body_type $::rb_firstatom [list $origin] [list $euler]" 0
    793805   incr ::rb_map($::body_type)
    794    incr ::expgui(changed)
    795806   set curpage [$::rb_notebook raise]
    796807   $::rb_notebook raise [$::rb_notebook page end]
     
    799810   RunRecalcRBCoords
    800811   incr ::expgui(changed)
     812   RecordMacroEntry "incr expgui(changed)" 0
    801813   RB_Populate $::rb_notebook $::body_type
    802814   $::rb_notebook raise rb_body$::body_type
     
    871883    grid [label $main.ph -text "Phase"] -row 1 -column 2 -padx 5
    872884    set matrixnum $::rb_matrix_num($bodnum)
     885    grid [label $main.rb_sitelbl -text "Site number"] -row 0 -column 3 -columnspan 5 -sticky w
    873886    for {set coordnum 1} {$coordnum <= $::rb_coord_num($bodnum,$matrixnum)} {incr coordnum} {
    874         label $main.rb_site$coordnum -text "Site $coordnum"
     887        label $main.rb_site$coordnum -text "$coordnum"
    875888        grid $main.rb_site$coordnum -row 1 -column [expr 2 + $coordnum]
    876889    }
     
    879892        incr row
    880893        foreach coordnum [RigidBodyMappingList $phase $bodnum] {
    881                 set row [expr $row + $coordnum]
    882                 RB_Load_Mapdata $phase $bodnum $coordnum
    883                 checkbutton $main.unmap$phase$coordnum -variable ::rb_unmap($phase,$bodnum,$coordnum)
    884                 grid $main.unmap$phase$coordnum -row $row -column 0
    885                 grid [label $main.rb_map$phase$coordnum -text "$coordnum"] -row $row -column 1
    886                 grid [label $main.rb_cb$phase$coordnum -text $phase] -row $row -column 2
    887                       set atomnum $::rb_map_beginning($phase,$bodnum,$coordnum)
    888                       set col 3
    889                       for {set j 1} {$j <=$::rb_coord_num($bodnum,$matrixnum)} {incr j} {
    890                           set atom [atominfo $phase $atomnum label]
    891                           grid [label $main.rb_site$phase$coordnum$j -text "$atom"] -row $row -column $col
    892                           incr atomnum
    893                           incr col
    894                       }
    895              }
    896      incr row
    897      }
    898      ResizeScrollTable $um
     894            set row [expr $row + $coordnum]
     895            RB_Load_Mapdata $phase $bodnum $coordnum
     896            checkbutton $main.unmap$phase$coordnum -variable ::rb_unmap($phase,$bodnum,$coordnum)
     897            grid $main.unmap$phase$coordnum -row $row -column 0
     898            grid [label $main.rb_map$phase$coordnum -text "$coordnum"] -row $row -column 1
     899            grid [label $main.rb_cb$phase$coordnum -text $phase] -row $row -column 2
     900            set atomnum $::rb_map_beginning($phase,$bodnum,$coordnum)
     901            # get a list of the atoms in the RB
     902            set st [lsearch $::expmap(atomlist_$phase) $atomnum]
     903            set en [expr {$st+$::rb_coord_num($bodnum,0)-1}]
     904            set atoms [lrange $::expmap(atomlist_$phase) $st $en]
     905            set col 3
     906            foreach a $atoms {
     907                set lbl [atominfo $phase $a label]
     908                grid [label $main.rb_site$phase$coordnum$col -text $lbl -padx 3] -row $row -column $col
     909                incr col
     910            }
     911        }
     912        incr row
     913    }
     914    ResizeScrollTable $um
    899915
    900916     grid [frame $um.update -bd 2 -relief groove] -row 0 -column 1 -pady 10
     
    912928        foreach mapnum [RigidBodyMappingList $phase $bodnum] {
    913929                if {$::rb_unmap($phase,$bodnum,$mapnum) == 1} {
     930                   RecordMacroEntry "UnMapRigidBody $phase $bodnum $mapnum" 0
    914931                   UnMapRigidBody $phase $bodnum $mapnum
    915                    RecordMacroEntry "MapRigidBody $::rb_phase $::body_type $::rb_firstatom $origin $euler" 0
    916932                }
    917933        }
    918934        incr ::expgui(changed)
     935         RecordMacroEntry "incr expgui(changed)" 0
    919936        destroy $panel
    920937        set curpage [$::rb_notebook raise]
     
    953970     grid [button $sm.swap -width 21 -text "Swap Checked Elements" -command "RB_Sort_Swap $bodnum"] -row 2 -column 0 -columnspan 3
    954971     grid [button $sm.delete -width 21 -text "Delete Checked Elements" -command "RB_Delete_Element $bodnum"] -row 3 -column 0 -columnspan 3
    955      grid [button $sm.add   -width 21 -text "Add New Matrix Elements" -command "RB_Add_Element $bodnum"] -row 4 -column 0 -columnspan 3
     972     grid [button $sm.add   -width 21 -text "Increase Number of Sites" -command "RB_Add_Element $bodnum"] -row 4 -column 0 -columnspan 3
    956973     grid [button $sm.addmatrix -width 21 -text "Add New Matrix" -command "RB_Add_New_Matrix $bodnum"] -row 5 -column 0 -columnspan 3
    957974
    958975#    Save Options
    959      grid [button $um.update -width 24 -text "Update Matrix Info" -bg green -command "RB_Matrix_Update $bodnum"] -row 3 -column 0 -padx 5
    960      grid [button $um.new -width 24 -text "New Rigid Body Type" -command "RB_Create_from_Edit"] -row 0 -column 1 -padx 5
     976     grid [button $um.update -width 24 -text "Save Changes" -bg green -command "RB_Matrix_Update $bodnum"] -row 3 -column 0 -padx 5
     977     grid [button $um.new -width 24 -text "Save Rigid Body Type" -command "RB_Create_from_Edit"] -row 0 -column 1 -padx 5
    961978 #    grid [button $um.sort -text "Sort Matrix Info" -command "RB_Cart_Sort $bodnum"] -row 0 -column 1
    962979
    963      grid [button $um.print -width 24 -text "Save Cartesian \n Coordinates to File" -command "RB_CartesianTextFile $bodnum"] -row 2 -column 1 -pady 5
    964      grid [button $um.restore -width 24 -text "Restore Original Matrix" -command "RB_Restore_Matrix $bodnum"] -row 3 -column 1 -padx 5
     980     grid [button $um.print -width 24 -text "Export Cartesian \n Coordinates to File" -command "RB_CartesianTextFile $bodnum"] -row 2 -column 1 -pady 5
     981     grid [button $um.restore -width 24 -text "Undo Changes" -command "RB_Restore_Matrix $bodnum"] -row 3 -column 1 -padx 5
    965982     grid [button $um.abort -text "Abort" -width 24 -command "RB_Edit_Matrix_Abort $bodnum $em"] -row 3 -column 2 -padx 5
    966983
     
    10351052
    10361053}
    1037 
    1038 
    10391054
    10401055proc RB_Edit_Matrix_Abort {bodnum location} {
     
    12681283#     puts "Matrix vars = $temp_var"
    12691284     SetRigidBodyVar $bodnum $temp_var $temp_damp
    1270      RecordMacroEntry "SetRigidBodyVar $bodnum $temp_var $temp_damp" 0
     1285    RecordMacroEntry "SetRigidBodyVar $bodnum [list $temp_var] [list $temp_damp]" 0
    12711286     ReplaceRigidBody $bodnum $temp_mat $temp_car $temp_var $temp_damp
    1272      RecordMacroEntry "SetRigidBodyVar $bodnum $temp_var $temp_damp" 0
     1287    RecordMacroEntry "ReplaceRigidBody $bodnum [list $temp_mat] [list $temp_car] [list $temp_var] [list $temp_damp]" 0
    12731288     #SetRigidBodyVar $bodnum $temp_var $temp_damp
    12741289     incr ::expgui(changed)
     1290    RecordMacroEntry "incr expgui(changed)" 0
    12751291     RB_Load_RBdata
    12761292     RB_Control_Panel $bodnum
     
    13261342
    13271343     grid [button $con3.save -text "Save \n Rigid Body" -command "RB_Create_Save $bodnum"] -row 0 -column 2 -padx 5 -pady 5
    1328      grid [button $con3.print -text "Save Cartesian \n Coordinates to File" -command "RB_CartesianTextFile $bodnum"] -row 0 -column 3 -padx 5
     1344     grid [button $con3.print -text "Export Cartesian \n Coordinates to File" -command "RB_CartesianTextFile $bodnum"] -row 0 -column 3 -padx 5
    13291345#     $con3.print configure -status disable
    13301346     grid [button $con3.abort -text "Abort \n Rigid Body" -command "destroy .nbt; RB_Control_Panel end"] -row 0 -column 4 -padx 5 -pady 5
     
    13691385     grid [button $gcon2.save -text "Save and Map \n Rigid Body" -width 15 -command "RB_Geom_Save"] -row 0 -column 0 -padx 5
    13701386          $gcon2.save config -state disable
    1371      grid [button $gcon2.savec -text "Save Cartesian \n Coordinates" -width 15 -command "RB_FixFragSaveCoord"] -row 0 -column 1 -padx 5
     1387     grid [button $gcon2.savec -text "Export Cartesian \n Coordinates" -width 15 -command "RB_FixFragSaveCoord"] -row 0 -column 1 -padx 5
    13721388          $gcon2.savec config -state disable
    13731389     grid [button $gcon2.abort -text "Abort" -width 15 -command "destroy .geometry"] -row 0 -column 2 -sticky ns -padx 5
     
    13981414        set temp1 [ExtractRigidBody $::rb_phase $::gcon_atoms $::gcon_start $::gcon_origin_list $vector1list $vector2list]
    13991415        if {[lindex $temp1 0] == {} || [lindex $temp1 1] == {} || [lindex $temp1 2] == {}} {
    1400    }
     1416            # an error occurred
     1417            return
     1418        }
    14011419
    14021420   set coordlist ""
     
    16281646
    16291647        set bodnum [AddRigidBody 1 $cartesian]
     1648     RecordMacroEntry "AddRigidBody 1 [list $cartesian]" 0
    16301649        # set ::rb_damp($bodnum,1) 0
    16311650        set ::rb_coord_num($bodnum,1) $::gcon_atoms
    16321651
    1633         MapRigidBody $::rb_phase $bodnum $::gcon_start [lindex $temp1 0] [lindex $temp1 1]
    1634         RecordMacroEntry "MapRigidBody $::rb_phase $bodnum $::gcon_start [lindex $temp1 0] [lindex $temp1 1]" 0
    1635         destroy .geometry
    1636         RB_Control_Panel 0
     1652     MapRigidBody $::rb_phase $bodnum $::gcon_start [lindex $temp1 0] [lindex $temp1 1]
     1653     RecordMacroEntry "MapRigidBody $::rb_phase $bodnum $::gcon_start [lindex $temp1 0] [lindex $temp1 1]" 0
     1654     incr ::expgui(changed)
     1655     RecordMacroEntry "incr expgui(changed)" 0
     1656     destroy .geometry
     1657     RB_Control_Panel 0
    16371658}
    16381659
     
    17681789#                         puts "first atom = $atomnum"
    17691790#                         set atomlist "atoms in rigid body #$bodnum:    "
    1770                          set atomlist "atoms in rigid body:    "
    1771                          for {set j 1} {$j <=$::rb_coord_num($bodnum,1)} {incr j} {
    1772                              set atom [atominfo $phasenum $atomnum label]
    1773                              lappend atomlist $atom
    1774 #                            grid [label $main.rb_site$phasenum$mapnum$j -text "$atom"] -row [expr $row +1] -column $col -padx 5
    1775                              incr atomnum
    1776 #                             incr col
     1791                         set atomlist {}
     1792                         # get a list of the atoms in the RB
     1793                         set st [lsearch $::expmap(atomlist_$phase) $atomnum]
     1794                         set en [expr {$st+$::rb_coord_num($bodnum,1)-1}]
     1795                         set atoms [lrange $::expmap(atomlist_$phase) $st $en]
     1796                         foreach a $atoms {
     1797                             if {$atomlist != ""} {append atomlist ", "}
     1798                             set lbl [atominfo $phase $a label]
     1799                             append atomlist $lbl
    17771800                        }
    1778                         grid [label $main.rb_site$phasenum$bodnum$mapnum -text "$atomlist"] -row [expr $row + 1] -column 4 -padx 5 -columnspan 999 -sticky w
     1801                        grid [label $main.rb_site$phasenum$bodnum$mapnum \
     1802                                  -text "atoms in rigid body:    $atomlist"] \
     1803                             -row [expr $row + 1] -column 4 -padx 5 -columnspan 999 -sticky w
    17791804                        incr row 2
    17801805                     }
     
    19061931#procedure for enabling refinement flags
    19071932proc RB_Ref_FlagEnable {phasenum bodnum mapnum var val args} {
    1908           set atomlist ""
    1909           set atomnum $::rb_map_beginning($phasenum,$bodnum,$mapnum)
    1910           for {set j 1} {$j <=$::rb_coord_num($bodnum,1)} {incr j} {
    1911                lappend atomlist $atomnum
    1912                incr atomnum
    1913           }
    1914           atominfo $phasenum $atomlist $var set $val
    1915 
     1933    set atomnum $::rb_map_beginning($phasenum,$bodnum,$mapnum)
     1934    # get a list of the atoms in the RB
     1935    set st [lsearch $::expmap(atomlist_$phase) $atomnum]
     1936    set en [expr {$st+$::rb_coord_num($bodnum,1)-1}]
     1937    set atomlist [lrange $::expmap(atomlist_$phase) $st $en]
     1938    atominfo $phasenum $atomlist $var set $val
    19161939 }
    19171940
     
    19651988                       }
    19661989                       incr ::expgui(changed)
    1967                        #RecordMacroEntry "incr expgui(changed)" 0
     1990                       RecordMacroEntry "incr expgui(changed)" 0
    19681991
    19691992               }
Note: See TracChangeset for help on using the changeset viewer.