Changeset 1133 for branches/sandbox


Ignore:
Timestamp:
Apr 15, 2011 2:48:50 PM (14 years ago)
Author:
lake
Message:

Bug fixes:
1 - sorter in Edit Matrix works correctly.
2 - the last coordinate is no longer dropped when reading in coordinates imported from cartesian and zmatrix.

Location:
branches/sandbox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/sandbox/rbimport_cartesian.tcl

    r1131 r1133  
    7373
    7474     set ::rb_colnum 0
    75      for {set linenum 1} {$linenum <= [expr $::rb_linenum - 1]} {incr linenum} {
     75     for {set linenum 1} {$linenum <= $::rb_linenum} {incr linenum} {
    7676         for {set colnum 0} {$colnum <= [expr [llength $::tline($linenum)] -1]} {incr colnum} {
    7777             grid [label $main.cart$::rb_colnum -text [lindex $::tline($linenum) $colnum] -width 8] -padx 5 -row $linenum -column [expr $colnum + 1]
     
    116116     set ::rb_num 1
    117117     set ::rb_matrix_num($bodytyp) 1
    118      set sitenum [expr $::rb_linenum - 1]
    119      set temp [expr $::rb_linenum - 1]
     118     set sitenum $::rb_linenum
     119     set temp $::rb_linenum
    120120     set colnum [llength $::tline(1)]
    121121
     
    146146
    147147     set ::rb_coord_num($bodytyp,1) $temp
    148    
     148
    149149
    150150    #$::rb_notebook raise [$::rb_notebook page 0]
  • TabularUnified branches/sandbox/rbimport_zmatrix.tcl

    r1121 r1133  
    157157     NewBodyTypeWindow
    158158
     159
    159160#     $::rb_notebook raise [$::rb_notebook page 0]
    160161#     set pane [$::rb_notebook getframe rb_body0]
  • TabularUnified branches/sandbox/rigid.tcl

    r1132 r1133  
    169169     set ::rb_matrix_num($bodytyp) 1
    170170     set ::rb_mult($bodytyp,1) 1.000
    171      
     171
    172172     if {[info vars ::rb_coord_num($bodytyp,1)] == ""} {set ::rb_coord_num($bodytyp,1) 1}
    173173
     
    293293     set really $location.delete
    294294     toplevel $really
    295      putontop $really
     295#     putontop $really
    296296     wm title $really "Delete Rigid Body"
    297297     #wm geometry $really 250x250+10+10
     
    328328
    329329proc RB_Populate {rb_notebook bodytyp args} {
     330     RB_Load_RBdata
    330331     set ::rb_panel $bodytyp
    331332     set phaselist $::expmap(phaselist)
     
    357358     }
    358359
    359      button $con.rb_vmatrix -text "Edit Matrix" -command "RB_Edit_Matrix $matrixnum" -width 18
     360     button $con.rb_vmatrix -text "Edit Matrix" -command "RB_Edit_Matrix $bodytyp" -width 18
    360361     grid   $con.rb_vmatrix -row 4 -column 1 -padx 5 -pady 5
    361362     grid [button $con.refine -text "Refinement \n Flags" -command "RB_Refine_Con" -width 18 ] -row 5 -column 1
     
    597598    }
    598599    # show deviations
     600   
    599601    foreach atom $atoms rms $rmsbyatom {
    600 #       puts "[atominfo $phase $atom label]\t$rms"
     602        puts "[atominfo $phase $atom label]\t$rms"
    601603    }
    602604    #puts "CalcBody $Euler $cell $coords $origin"
     
    804806
    805807proc RB_Edit_Matrix {bodnum args} {
     808     puts "Bodnum = $bodnum"
    806809     catch {destroy .viewmatrix}
    807810     set em .viewmatrix
    808811     toplevel $em
    809 #     putontop $em
     812     putontop $em
    810813     wm title $em "Edit Matrices for Rigid Body $bodnum"
    811814
     
    817820     grid [frame $sm -bd 2 -relief groove] -row 1 -column 0
    818821
    819      grid [label $sm.sort -text "Sort Atoms"] -row 1 -column 0 -columnspan 2
     822     grid [label $sm.sort -text "Sort Matrix"] -row 1 -column 0 -columnspan 2
    820823     grid [button $sm.inc -text "\u2191" -command "RB_Sort_Inc $bodnum inc"] -row 2 -column 0
    821824     grid [button $sm.dec -text "\u2193" -command "RB_Sort_Inc $bodnum dec"] -row 2 -column 1
     
    887890             }
    888891     }
    889 
     892     if {$dir == "dec"} {set sortlist [RB_String_Reverse $sortlist]}
    890893
    891894     for {set i 1} {$i <= $::rb_matrix_num($bodnum)} {incr i} {
     
    893896             if {$dir == "inc"} {set line1 [expr $sort - 1]}
    894897             if {$dir == "dec"} {set line1 [expr $sort + 1]}
    895 
    896 
    897 #                      if {$line1 >= 0 && $line1 < $::rb_coord_num($bodnum,1)} {
    898                          set x1dum $::x($i,$line1)
    899                          set y1dum $::y($i,$line1)
    900                          set z1dum $::z($i,$line1)
    901                          set ::x($i,$line1) $::x($i,$sort)
    902                          set ::y($i,$line1) $::y($i,$sort)
    903                          set ::z($i,$line1) $::z($i,$sort)
    904                          set ::x($i,$sort) $x1dum
    905                          set ::y($i,$sort) $y1dum
    906                          set ::z($i,$sort) $z1dum
    907 #                      } else {bell}
     898             set x1dum $::x($i,$line1)
     899             set y1dum $::y($i,$line1)
     900             set z1dum $::z($i,$line1)
     901             set ::x($i,$line1) $::x($i,$sort)
     902             set ::y($i,$line1) $::y($i,$sort)
     903             set ::z($i,$line1) $::z($i,$sort)
     904             set ::x($i,$sort) $x1dum
     905             set ::y($i,$sort) $y1dum
     906             set ::z($i,$sort) $z1dum
     907
    908908             set ::rb_sort($sort) 0
    909909             if {$dir == "inc"} {set ::rb_sort([expr $sort - 1]) 1}
     
    913913                }
    914914             }
    915 
    916 
    917           }
    918      }
     915        }
     916     }
     917
     918}
     919
     920proc RB_String_Reverse {string args} {
     921    puts "$string"
     922    set rstring ""
     923    set len [expr [llength $string] - 1]
     924    while {$len > -1} {
     925        lappend rstring [lindex $string $len]
     926        incr len -1
     927    }
     928    puts "contents of rstring = $rstring"
     929    return $rstring
    919930}
    920931
     
    10551066     destroy .nbt
    10561067     toplevel .nbt
     1068     putontop .nbt
    10571069     set con1 .nbt.1
    10581070     set con2 .nbt.2
     
    10641076     grid [label $con1.lbl -text "New Rigid Body Type $bodytyp"] -row 0 -column 0
    10651077     grid [label $con1.mat -text "Number of Matricies Describing Rigid Body"] -row 1 -column 0
    1066      
     1078
    10671079
    10681080
     
    13981410                  foreach mapnum $rb_map_num($phasenum,$bodnum) {
    13991411#                         puts "mapnum = $mapnum"
    1400                          grid [checkbutton $main.check($phasenum,$bodnum,$mapnum)] -row $row -column 0
     1412#                         grid [checkbutton $main.check($phasenum,$bodnum,$mapnum)] -row $row -column 0
    14011413                         grid [label $main.body($phasenum,$bodnum,$mapnum) -text $bodnum] -row $row -column 1
    14021414                         grid [label $main.phase($phasenum,$bodnum,$mapnum) -text $phasenum] -row $row -column 2
Note: See TracChangeset for help on using the changeset viewer.