- Timestamp:
- Sep 20, 2010 12:44:02 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sandbox/distrest.tcl
r1010 r1011 6 6 #::sr_lookuplist1 7 7 #::sr_lookuplist2 8 #::sr_rb 9 #::sr_top 8 #sr_top 10 9 #::sr_checkall 11 10 #::sr_entryvar(choicenum) … … 37 36 #SR_Build 38 37 39 proc DisplayDistanceRestraints { } {38 proc DisplayDistanceRestraints {args} { 40 39 global expcons 41 40 eval destroy [winfo children $expcons(distmaster)] … … 65 64 # Pick Phase to be Evaluated ********************************************** 66 65 label $phasebox.phlabel -text Phase 67 set ::sr_phaselist $::expmap(phaselist) 68 eval tk_optionMenu $phasebox.phase sr_entryvar(softphase) $::sr_phaselist 69 foreach item [trace vinfo ::sr_entryvar(softphase)] { 70 eval trace vdelete ::sr_entryvar(softphase) $item 71 } 72 #trace variable ::sr_entryvar(softphase) w "SR_Fill_Display $main" 66 # set ::sr_phaselist $::expmap(phaselist) 67 68 eval tk_optionMenu $phasebox.phase ::sr_entryvar(softphase) $::expmap(phaselist) 69 # eval tk_optionMenu $phasebox.phase ::sr_entryvar(softphase) $::sr_phaselist 70 # trace variable ::sr_entryvar(softphase) w DisplayDistanceRestraints 71 # bind $phasebox.phase <ButtonRelease> {DisplayDistanceRestraints} 72 73 73 grid $phasebox.phlabel -column 0 -row 0 74 74 grid $phasebox.phase -column 1 -row 0 … … 117 117 grid $top.rlabel2 -column 5 -row 2 118 118 119 set ::sr_rb ""120 119 SR_Rest_Only 120 SR_Show_RestraintsOnly $main $rightfr 121 foreach item [trace vinfo ::sr_entryvar(softphase)] { 122 eval trace vdelete ::sr_entryvar(softphase) $item 123 } 124 trace add variable ::sr_entryvar(softphase) write "SR_Show_RestraintsOnly $main $rightfr" 125 } 126 proc SR_Show_RestraintsOnly {main rightfr args} { 121 127 SR_Fill_Display $main 122 128 ResizeScrollTable $rightfr 123 129 } 124 125 130 126 131 #********************************************************************************************* … … 208 213 set num1 [lindex $bond_dist_array($x) 5] 209 214 set num2 [lindex $bond_dist_array($x) 6] 210 set type1 [atominfo 1[lindex $bond_dist_array($x) 5] type]215 set type1 [atominfo [lindex $bond_dist_array($x) 1] [lindex $bond_dist_array($x) 5] type] 211 216 set type1 [lindex [split $type1 {+-}] 0] 212 set type2 [atominfo 1[lindex $bond_dist_array($x) 6] type]217 set type2 [atominfo [lindex $bond_dist_array($x) 1] [lindex $bond_dist_array($x) 6] type] 213 218 set type2 [lindex [split $type2 {+-}] 0] 214 219 lappend initsoftpar($x) $type1 215 220 lappend initsoftpar($x) $type2 216 221 217 lappend initsoftpar($x) [atominfo 1[lindex $bond_dist_array($x) 5] label]218 lappend initsoftpar($x) [atominfo 1[lindex $bond_dist_array($x) 6] label]222 lappend initsoftpar($x) [atominfo [lindex $bond_dist_array($x) 1] [lindex $bond_dist_array($x) 5] label] 223 lappend initsoftpar($x) [atominfo [lindex $bond_dist_array($x) 1] [lindex $bond_dist_array($x) 6] label] 219 224 220 225 #puts "$initsoftpar($x)" … … 282 287 #********************************************************************************* 283 288 #Procedure to set up soft display ************************************************ 289 # used for editing window 284 290 #********************************************************************************* 285 291 … … 287 293 #global rprint 288 294 destroy .mainrestraintbox.sr_rvaluebox 289 set ::sr_rb .mainrestraintbox.sr_rvaluebox290 frame $ ::sr_rb291 pack $ ::sr_rb -side top -fill both -expand 1292 293 foreach { ::sr_top main side lbl} [MakeScrollTable $::sr_rb] {}295 set sr_rb .mainrestraintbox.sr_rvaluebox 296 frame $sr_rb 297 pack $sr_rb -side top -fill both -expand 1 298 299 foreach {sr_top main side lbl} [MakeScrollTable $sr_rb] {} 294 300 set ::contraintmainbox $main 295 301 296 button $ ::sr_top.alabel1 -text "Atom 1 " -width 7 \297 -command "SR_Sort atom1 $main $ ::sr_top.alabel1 $::sr_top.alabel2 $::sr_top.dlabel1"298 button $ ::sr_top.alabel2 -text "Atom 2 " -width 7 \299 -command "SR_Sort atom2 $main $ ::sr_top.alabel1 $::sr_top.alabel2 $::sr_top.dlabel1"300 button $ ::sr_top.dlabel1 -text "Distance " -width 9 \301 -command "SR_Sort distance $main $ ::sr_top.alabel1 $::sr_top.alabel2 $::sr_top.dlabel1"302 303 grid $ ::sr_top.alabel1 -column 1 -row 2304 grid $ ::sr_top.alabel2 -column 2 -row 2305 grid $ ::sr_top.dlabel1 -column 3 -row 2306 307 label $ ::sr_top.rlabel1 -text "Restraint"308 label $ ::sr_top.rlabel2 -text "esd"309 grid $ ::sr_top.rlabel1 -column 4 -row 2 -padx 20310 grid $ ::sr_top.rlabel2 -column 5 -row 2 -padx 20311 312 313 button $ ::sr_top.rcon1 -text "Check All" -width 10 -command {302 button $sr_top.alabel1 -text "Atom 1 " -width 7 \ 303 -command "SR_Sort atom1 $main $sr_top.alabel1 $sr_top.alabel2 $sr_top.dlabel1" 304 button $sr_top.alabel2 -text "Atom 2 " -width 7 \ 305 -command "SR_Sort atom2 $main $sr_top.alabel1 $sr_top.alabel2 $sr_top.dlabel1" 306 button $sr_top.dlabel1 -text "Distance " -width 9 \ 307 -command "SR_Sort distance $main $sr_top.alabel1 $sr_top.alabel2 $sr_top.dlabel1" 308 309 grid $sr_top.alabel1 -column 1 -row 2 310 grid $sr_top.alabel2 -column 2 -row 2 311 grid $sr_top.dlabel1 -column 3 -row 2 312 313 label $sr_top.rlabel1 -text "Restraint" 314 label $sr_top.rlabel2 -text "esd" 315 grid $sr_top.rlabel1 -column 4 -row 2 -padx 20 316 grid $sr_top.rlabel2 -column 5 -row 2 -padx 20 317 318 319 button $sr_top.rcon1 -text "Check All" -width 10 -command { 314 320 set ::sr_checkall 1 315 321 SR_Set_All_Check_Buttons 316 grid forget $ ::sr_top.rcon1317 grid $ ::sr_top.rcon2 -column 6 -row 2 -padx 5318 } 319 320 button $ ::sr_top.rcon2 -text "Clear All" -width 10 -command {322 grid forget $sr_top.rcon1 323 grid $sr_top.rcon2 -column 6 -row 2 -padx 5 324 } 325 326 button $sr_top.rcon2 -text "Clear All" -width 10 -command { 321 327 set ::sr_checkall 0 322 328 SR_Set_All_Check_Buttons 323 grid forget $ ::sr_top.rcon2324 grid $ ::sr_top.rcon1 -column 6 -row 2 -padx 5325 } 326 327 grid $ ::sr_top.rcon1 -column 6 -row 2 -padx 5329 grid forget $sr_top.rcon2 330 grid $sr_top.rcon1 -column 6 -row 2 -padx 5 331 } 332 333 grid $sr_top.rcon1 -column 6 -row 2 -padx 5 328 334 329 335 #SR_Sort atom1 $main 330 336 SR_Fill_Display $main 337 bind $sr_rb <Configure> "ResizeScrollTable $sr_rb" 338 # see if reset of grab fixes tk bug with tk_optionMenu 339 grab release .mainrestraintbox 331 340 } 332 341 333 342 #***************************************************************************************** 334 343 #Procedure to fill in sorted Restraint and esd data ************************************** 344 # used for both editing windows and restrain-only display in main EXPGUI window 335 345 #***************************************************************************************** 336 346 proc SR_Fill_Display {main args} { … … 386 396 } 387 397 } 388 389 bind $::sr_rb <Configure> {ResizeScrollTable $::sr_rb}390 398 } 391 399 #**************************************************************************** … … 449 457 if {$test == -1} { 450 458 set new_restraint "" 451 set type1 [atominfo 1[lindex $temp_res1 1] type]459 set type1 [atominfo [lindex $temp_res1 0] [lindex $temp_res1 1] type] 452 460 set type1 [lindex [split $type1 {+-}] 0] 453 set type2 [atominfo 1[lindex $temp_res1 2] type]461 set type2 [atominfo [lindex $temp_res1 0] [lindex $temp_res1 2] type] 454 462 set type2 [lindex [split $type2 {+-}] 0] 455 463 … … 458 466 [lindex $temp_res1 5] [lindex $temp_res1 6] [lindex $temp_res1 7] \ 459 467 "?.???" $type1 $type2 \ 460 [atominfo 1 [lindex $temp_res1 1] label] [atominfo 1[lindex $temp_res1 2] label] \468 [atominfo [lindex $temp_res1 0] [lindex $temp_res1 1] label] [atominfo [lindex $temp_res1 0] [lindex $temp_res1 2] label] \ 461 469 $t2 462 470 set x [llength $::sr_bond_list] … … 630 638 631 639 set choice {"Show All Bonds" "Restrained Bonds" "Unrestrained Bonds"} 632 set ::sr_entryvar(choice) "Show All Bonds"633 640 634 641 set m1 [eval tk_optionMenu $srcb1.rcon3 sr_entryvar(choice) $choice] … … 652 659 grid $::srcb3.rbutton4 -column 0 -row 1 -pady 5 653 660 654 655 656 SR_Display 657 661 # remove traces 658 662 foreach item [trace vinfo ::sr_entryvar(softatom1)] { 659 663 eval trace vdelete ::sr_entryvar(softatom1) $item 660 664 } 661 trace variable ::sr_entryvar(softatom1) w SR_Display662 663 665 foreach item [trace vinfo ::sr_entryvar(softatom2)] { 664 666 eval trace vdelete ::sr_entryvar(softatom2) $item 665 667 } 666 trace variable ::sr_entryvar(softatom2) w SR_Display667 668 668 foreach item [trace vinfo ::sr_entryvar(choicenum)] { 669 669 eval trace vdelete ::sr_entryvar(choicenum) $item 670 670 } 671 # reset filter vars 672 set ::sr_entryvar(choice) "Show All Bonds" 673 set ::sr_entryvar(choicenum) 0 674 set ::sr_entryvar(softatom1) "all" 675 set ::sr_entryvar(softatom2) "all" 676 # search out distances 677 SR_Display 678 # set traces for future changes to filter vars 679 trace variable ::sr_entryvar(softatom1) w SR_Display 671 680 trace variable ::sr_entryvar(choicenum) w SR_Display 672 681 trace variable ::sr_entryvar(softatom2) w SR_Display 682 # make editor window modal (lock it on top) 673 683 putontop $mrb 674 684 } … … 681 691 set ::sr_distance_button 1 682 692 set ::sr_entryvar(choicenum) 0 683 set ::sr_entryvar(softphase) "1" 693 # set ::sr_entryvar(softphase) "1" 694 # set ::sr_phaselist $::expmap(phaselist) 684 695 set ::sr_entryvar(softatom1) "all" 685 696 set ::sr_entryvar(softatom2) "all"
Note: See TracChangeset
for help on using the changeset viewer.