Changeset 1004 for branches/sandbox/distrest.tcl
- Timestamp:
- Sep 15, 2010 4:17:02 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sandbox/distrest.tcl
r1003 r1004 1 1 2 2 3 … … 8 9 9 10 set leftfr $expcons(distmaster).f1 10 11 set rightfr $expcons(distmaster).f2 11 12 12 13 grid [frame $leftfr -bd 2 -relief groove] -column 0 -row 0 \ 13 14 -sticky nsew 14 grid [frame $ expcons(distmaster).f2-bd 2 -relief groove] -column 1 -row 0 \15 grid [frame $rightfr -bd 2 -relief groove] -column 1 -row 0 \ 15 16 -sticky nsew 16 grid [label $expcons(distmaster).f2.l -text "test message"] 17 17 18 grid rowconfigure $expcons(distmaster) 0 -weight 1 18 19 grid columnconfigure $expcons(distmaster) 1 -weight 1 … … 25 26 grid $leftfr.phlabel -column 0 -row 0 26 27 grid $leftfr.phase -column 1 -row 0 28 #************************************************************************** 29 30 # Run Disagl Commands ***************************************************** 31 button $leftfr.disagl -text "Refresh Disagl" 32 grid $leftfr.disagl -column 1 -row 1 27 33 #************************************************************************** 28 34 … … 35 41 grid [button $leftfr.edit -text "Edit Distance Restraints" -command SR_TEST] -column 0 -row 3 \ 36 42 -sticky sw -columnspan 2 43 44 set h_list .hard_list 45 foreach {top main side lbl} [MakeScrollTable $rightfr] {} 46 47 button $top.alabel1 -text "Atom 1 " 48 button $top.alabel2 -text "Atom 2 " 49 label $top.rlabel1 -text "Restraint" 50 label $top.rlabel2 -text "esd" 51 52 grid $top.alabel1 -column 1 -row 2 53 grid $top.alabel2 -column 2 -row 2 54 grid $top.rlabel1 -column 4 -row 2 55 grid $top.rlabel2 -column 5 -row 2 56 57 SR_Rest_Only 58 set ::sr_rb "" 59 SR_Fill_Display $main 60 ResizeScrollTable $rightfr 37 61 } 38 62 … … 153 177 #************************************************************************************** 154 178 proc SR_Sort {whichbutton main} { 155 179 # reset all button labels 156 180 $::sr_top.alabel1 config -text "Atom 1" 157 181 $::sr_top.alabel2 config -text "Atom 2" … … 161 185 if {$::sr_atom1_button == 1} { 162 186 set sr_prsort [lsort -integer -decreasing -index 1 $::sr_bond_list] 187 163 188 $::sr_top.alabel1 config -text "Atom 1 \u2193" 164 189 } else { … … 193 218 set ::sr_bond_list $sr_prsort 194 219 SR_Fill_Display $main 195 196 197 198 220 } 199 221 #********************************************************************************* … … 221 243 label $::sr_top.rlabel1 -text "Restraint" 222 244 label $::sr_top.rlabel2 -text "esd" 245 grid $::sr_top.rlabel1 -column 4 -row 2 -padx 20 246 grid $::sr_top.rlabel2 -column 5 -row 2 -padx 20 247 248 223 249 button $::sr_top.rcon1 -text "Check All" -width 10 -command { 224 250 set ::sr_checkall 1 … … 235 261 } 236 262 237 grid $::sr_top.rlabel1 -column 4 -row 2 -padx 20238 grid $::sr_top.rlabel2 -column 5 -row 2 -padx 20239 263 grid $::sr_top.rcon1 -column 6 -row 2 -padx 5 240 264 241 SR_Sort atom1 $main265 #SR_Sort atom1 $main 242 266 SR_Fill_Display $main 243 267 } … … 252 276 set atomreq2 $::sr_entryvar(softatom2) 253 277 set phasereq $::sr_entryvar(softphase) 278 set mode [string match "edit" $::sr_display_mode] 254 279 255 280 set len [llength $::sr_bond_list] … … 260 285 set atomid2 [lindex $rprint 10] 261 286 if {$::sr_entryvar(softphase) == [lindex $rprint 0]} { 262 if {[string trim $::sr_dminvalue] == ""} {set Dmin 0} else {set Dmin $::sr_dminvalue} 263 if {[string trim $::sr_dmaxvalue] == ""} {set Dmax 1000} else {set Dmax $::sr_dmaxvalue} 264 if {([lindex $rprint 8] >= $Dmin || [lindex $rprint 8] == "?.???") && ([lindex $rprint 8] <= $Dmax || [lindex $rprint 8] == "?.???")} { 265 if {$atomreq1 == "" || $atomreq1 == "all" || $atomreq1 == $atomid1} { 266 if {$atomreq2 == "" || $atomreq2 == "all" || $atomreq2 == $atomid2} { 267 if {$choice == 0 || ($choice == 1 && [string trim $::sr_restraintdist([lindex $rprint 13])] != "") \ 268 || ($choice == 2 && [string trim $::sr_restraintdist([lindex $rprint 13])] == "") } { 287 if {([lindex $rprint 8] >= $::sr_dminvalue || [lindex $rprint 8] == "?.???") && ([lindex $rprint 8] <= $::sr_dmaxvalue || [lindex $rprint 8] == "?.???")} { 288 if {$atomreq1 == "" || $atomreq1 == "all" || $atomreq1 == $atomid1} { 289 if {$atomreq2 == "" || $atomreq2 == "all" || $atomreq2 == $atomid2} { 290 if {$choice == 0 || ($choice == 1 && [string trim $::sr_restraintdist([lindex $rprint 13])] != "") \ 291 || ($choice == 2 && [string trim $::sr_restraintdist([lindex $rprint 13])] == "") } { 269 292 label $main.ratom1$i -text [lindex $rprint 11] -justify center -anchor center 270 293 label $main.ratom2$i -text [lindex $rprint 12] -justify center -anchor center 294 if {$mode} { 271 295 label $main.rdistance$i -text [lindex $rprint 8] -justify center -anchor center 272 296 entry $main.restraint$i -width 8 -textvariable ::sr_restraintdist([lindex $rprint 13]) -takefocus 1 … … 275 299 bind $main.restesd$i <KeyRelease> {SR_Validate_Soft %W esd} 276 300 checkbutton $main.sr_crestraint$i -variable ::sr_crestraint([lindex $rprint 13]) 301 } else { 302 label $main.restraint$i -width 8 -textvariable ::sr_restraintdist([lindex $rprint 13]) -takefocus 1 303 label $main.restesd$i -width 8 -textvariable ::sr_restraintesd([lindex $rprint 13]) -takefocus 1 304 } 277 305 incr rownum 278 306 grid $main.ratom1$i -column 1 -row $rownum 279 307 grid $main.ratom2$i -column 2 -row $rownum 308 if {$mode} { 280 309 grid $main.rdistance$i -column 3 -row $rownum 281 grid $main.restraint$i -column 4 -row $rownum282 grid $main.restesd$i -column 5 -row $rownum283 310 grid $main.sr_crestraint$i -column 6 -row $rownum 284 311 $main.ratom1$i conf -width 8 … … 286 313 $main.rdistance$i conf -width 8 287 314 bind $main.restraint$i <ButtonPress> {SR_Set_Rval %W} 315 } 316 grid $main.restraint$i -column 4 -row $rownum 317 grid $main.restesd$i -column 5 -row $rownum 288 318 } 289 319 } … … 396 426 } 397 427 } 428 puts $sr_write 398 429 # put the entire restraint list back into the .EXP file 399 430 SoftConst restraintlist set $sr_write … … 564 595 565 596 #list of global variables and procedures 566 #bond_dist_array 597 567 598 #::sr_lookuplist1 568 599 #::sr_lookuplist2 569 #bond_totals570 600 #::sr_rb 571 601 #::sr_top … … 614 644 set ::sr_error 0 615 645 set ::sr_bond_list "" 646 set ::sr_dminvalue 0 647 set ::sr_dmaxvalue 1000 648 649 } 650 651 proc SR_Rest_Only {} { 652 set ::sr_display_mode noedit 653 catch {unset ::sr_lookuplist1} 654 catch {unset ::sr_lookuplist2} 655 catch {unset ::sr_restraintdist} 656 catch {unset ::sr_restraintesd} 657 set ::sr_bond_list "" 658 set ::sr_key_list "" 659 SR_Load_Restraints 616 660 } 617 661 … … 627 671 628 672 proc SR_TEST {} { 629 SR_Read_Distances test2.disagl 673 set ::sr_display_mode edit 674 SR_Read_Distances test2.disagl 630 675 SR_Load_Restraints 631 676 SR_Main_Editor 632 677 } 633 678 634 #*********************************************************************** 635 #Build Hard List of Restraints ***************************************** 636 #*********************************************************************** 637 proc SR_Hard_List {args} { 638 639 destroy .sr_hardbox 640 set ::sr_hb .sr_hardbox 641 frame $::sr_hb 642 pack $::sr_hb -side top -fill both -expand 1 643 644 foreach {::sr_hard main side lbl} [MakeScrollTable $::sr_hb] {} 645 set ::contraintmainbox $main 646 647 648 set resnum [llength $::sr_restraints_only] 649 puts $resnum 650 651 652 653 } 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 679 680 681 682 683 684 685 686 687 688
Note: See TracChangeset
for help on using the changeset viewer.