Changeset 1012 for branches/sandbox


Ignore:
Timestamp:
Sep 20, 2010 3:49:53 PM (10 years ago)
Author:
chlake
Message:

1 - Atom filters show only atom types present in the phase.
2 - Added phase number to Restraint Only Control Box Label
3 - Reset dmin and dmax if set to ""
4 - Fixed centering on Restraint only display
5 - Had to reset sr_top to global. Would not work with check all button when local.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/distrest.tcl

    r1011 r1012  
    66#::sr_lookuplist1
    77#::sr_lookuplist2
    8 #sr_top
     8#::sr_top
    99#::sr_checkall
    1010#::sr_entryvar(choicenum)
     
    103103    set atom2_state  1
    104104
    105     button $top.alabel1 -text "Atom 1"    -width 6 -anchor center \
     105    button $top.alabel1 -text "Atom 1"    -width 7 -anchor center \
    106106        -command "SR_Sort atom1 $main $top.alabel1 $top.alabel2 {}"
    107107
    108     button $top.alabel2 -text "Atom 2"   -width 6  -anchor center \
     108    button $top.alabel2 -text "Atom 2"   -width 7  -anchor center \
    109109        -command "SR_Sort atom2 $main $top.alabel1 $top.alabel2 {}"
    110110
     
    117117    grid $top.rlabel2 -column 5 -row 2
    118118
     119
     120    #remove traces to reset ::sr_entryvar(softatom1) and ::sr_entryvar(softatom2)
     121    foreach item [trace vinfo ::sr_entryvar(softatom1)] {
     122        eval trace vdelete ::sr_entryvar(softatom1) $item
     123    }
     124    foreach item [trace vinfo ::sr_entryvar(softatom2)] {
     125        eval trace vdelete ::sr_entryvar(softatom2) $item
     126    }
     127    set ::sr_entryvar(softatom1) "all"
     128    set ::sr_entryvar(softatom2) "all"
     129    #restart traces
     130    trace variable ::sr_entryvar(softatom1) w SR_Display
     131    trace variable ::sr_entryvar(softatom2) w SR_Display
     132
     133
    119134    SR_Rest_Only
    120135    SR_Show_RestraintsOnly $main $rightfr
     
    122137    eval trace vdelete ::sr_entryvar(softphase) $item
    123138    }
     139
    124140    trace add variable ::sr_entryvar(softphase) write "SR_Show_RestraintsOnly $main $rightfr"
    125141}
    126142proc SR_Show_RestraintsOnly {main rightfr args} {
     143
    127144    SR_Fill_Display  $main
    128145    ResizeScrollTable $rightfr
     
    225242        #puts "$initsoftpar($x)"
    226243        #set atom types into array
    227         lappend ::sr_lookuplist1($type1) $x
    228         lappend ::sr_lookuplist2($type2) $x
     244        set i [lindex $bond_dist_array($x) 1]
     245
     246
     247        lappend ::sr_lookuplist1${i}($type1) $x
     248        lappend ::sr_lookuplist2${i}($type2) $x
    229249
    230250        #add bond code to list element and key list
     
    297317    pack $sr_rb -side top -fill both -expand 1
    298318
    299     foreach {sr_top main side lbl} [MakeScrollTable $sr_rb] {}
     319    foreach {::sr_top main side lbl} [MakeScrollTable $sr_rb] {}
    300320    set     ::contraintmainbox $main
    301321
    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 {
     322    button $::sr_top.alabel1 -text "Atom 1 " -width 7   \
     323        -command "SR_Sort atom1 $main $::sr_top.alabel1 $::sr_top.alabel2 $::sr_top.dlabel1"
     324    button $::sr_top.alabel2 -text "Atom 2 " -width 7 \
     325        -command "SR_Sort atom2 $main $::sr_top.alabel1 $::sr_top.alabel2 $::sr_top.dlabel1"
     326    button $::sr_top.dlabel1 -text "Distance " -width 9 \
     327        -command "SR_Sort distance $main $::sr_top.alabel1 $::sr_top.alabel2 $::sr_top.dlabel1"
     328
     329    grid $::sr_top.alabel1 -column 1 -row 2
     330    grid $::sr_top.alabel2 -column 2 -row 2
     331    grid $::sr_top.dlabel1 -column 3 -row 2
     332
     333    label  $::sr_top.rlabel1 -text "Restraint"
     334    label  $::sr_top.rlabel2 -text "esd"
     335    grid $::sr_top.rlabel1 -column 4 -row 2 -padx 20
     336    grid $::sr_top.rlabel2 -column 5 -row 2 -padx 20
     337
     338
     339    button $::sr_top.rcon1   -text "Check All" -width 10 -command {
    320340        set ::sr_checkall 1
    321341        SR_Set_All_Check_Buttons
    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 {
     342        grid forget $::sr_top.rcon1
     343        grid $::sr_top.rcon2 -column 6 -row 2 -padx 5
     344    }
     345
     346    button $::sr_top.rcon2   -text "Clear All" -width 10 -command {
    327347        set ::sr_checkall 0
    328348        SR_Set_All_Check_Buttons
    329         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
     349        grid forget $::sr_top.rcon2
     350        grid $::sr_top.rcon1 -column 6 -row 2 -padx 5
     351    }
     352
     353    grid $::sr_top.rcon1   -column 6 -row 2 -padx 5
    334354
    335355    #SR_Sort atom1 $main
     
    354374    set len [llength $::sr_bond_list]
    355375    set rownum 0
     376    if {[string trim $::sr_dminvalue] == ""} {set ::sr_dminvalue 0}
     377    if {[string trim $::sr_dmaxvalue] == ""} {set ::sr_dmaxvalue 1000}
    356378    for {set i 0} {$i <= $len} {incr i} {
    357379        set rprint  [lindex $::sr_bond_list $i]
     
    576598    toplevel $mrb
    577599    #pack $mrb -side top
    578     wm title $mrb "Soft Restraint Control Panel"
     600    wm title $mrb "Soft Restraint Control Panel for Phase $::sr_entryvar(softphase)"
    579601    #wm geometry $mrb 415x500+10+10
    580602    #wm geometry $mrb {}
     
    595617    label $srcb2.restlabel    -text "Restraint Value" -width 16 -anchor w
    596618    label $srcb2.restlabelesd -text "esd"
    597     eval tk_optionMenu $srcb1.atom1 ::sr_entryvar(softatom1) "[lsort [array names ::sr_lookuplist1]] all"
    598     eval tk_optionMenu $srcb1.atom2 ::sr_entryvar(softatom2) "[lsort [array names ::sr_lookuplist2]] all"
     619
     620    eval tk_optionMenu $srcb1.atom1 ::sr_entryvar(softatom1) "[lsort [array names ::sr_lookuplist1${::sr_entryvar(softphase)}]] all"
     621    eval tk_optionMenu $srcb1.atom2 ::sr_entryvar(softatom2) "[lsort [array names ::sr_lookuplist2${::sr_entryvar(softphase)}]] all"
    599622
    600623
Note: See TracChangeset for help on using the changeset viewer.