Ignore:
Timestamp:
Oct 18, 2010 10:22:17 PM (10 years ago)
Author:
toby
Message:

add delta-d/d & manual zoom to widplt; distrest & distagledit: remove some puts & fix up some indentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/distrest.tcl

    r1024 r1030  
    3737
    3838proc DisplayDistanceRestraints {args} {
     39    #puts DisplayDistanceRestraints
    3940    global expcons
    4041    eval destroy [winfo children $expcons(distmaster)]
     
    5152        -sticky nsew
    5253    grid [frame $phasebox -bd 2 -relief groove] -column 0 -row 0 \
    53          -sticky new -columnspan 2
     54        -sticky new -columnspan 2
    5455
    5556
    5657    grid [frame $editorbox -bd 2 -relief groove] -column 0 -row 2 \
    57          -sticky sew -columnspan 2
     58        -sticky sew -columnspan 2
    5859
    5960
     
    6465    # Pick Phase to be Evaluated **********************************************
    6566    label $phasebox.phlabel -text Phase
    66 #    set ::sr_phaselist $::expmap(phaselist)
     67    #    set ::sr_phaselist $::expmap(phaselist)
    6768
    6869    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}
     70    #    eval tk_optionMenu $phasebox.phase ::sr_entryvar(softphase) $::sr_phaselist
     71    #   trace variable ::sr_entryvar(softphase) w DisplayDistanceRestraints
     72    #   bind $phasebox.phase <ButtonRelease> {DisplayDistanceRestraints}
    7273
    7374    grid $phasebox.phlabel -column 0 -row 0
     
    7879    grid [label $leftfr.lweight -text "Restraint Weight"] -column 0 -row 1 -sticky sw -pady 10
    7980    grid [entry $leftfr.weight -width 8 -textvariable entryvar(distrestweight)] -column 1 -row 1 -sticky sw \
    80          -padx 5 -pady 10
     81        -padx 5 -pady 10
    8182    set ::entrycmd(distrestweight) "SoftConst weight"
    8283    set ::entrycmd(trace) 0
     
    9596    grid [button $editorbox.edit -text "Activate Restraint \n Editor" -command SR_TEST] -column 0 -row 4 \
    9697        -columnspan 2 -pady 5
    97         $editorbox.edit config -bg LightGreen -bd 6
     98    $editorbox.edit config -bg LightGreen -bd 6
    9899
    99100    grid [button $editorbox.search -text "Edit Search Distance \n Parameters" -command DA_Control_Panel] -column 0 -row 3 \
    100101        -columnspan 2
    101         $editorbox.edit config -bd 4
     102    $editorbox.edit config -bd 4
    102103
    103104
     
    139140    SR_Show_RestraintsOnly $main $rightfr
    140141    foreach item [trace vinfo ::sr_entryvar(softphase)] {
    141     eval trace vdelete ::sr_entryvar(softphase) $item
     142        eval trace vdelete ::sr_entryvar(softphase) $item
    142143    }
    143144
     
    148149    SR_Fill_Display  $main
    149150    ResizeScrollTable $rightfr
     151    #puts $rightfr
    150152}
    151153
     
    396398                                label $main.rdistance$i -text [lindex $rprint 8] -justify center -anchor center
    397399                                entry $main.restraint$i -width 8 -textvariable ::sr_restraintdist([lindex $rprint 13]) -takefocus 1
    398                                       $main.restraint$i selection range 0 end
     400                                $main.restraint$i selection range 0 end
    399401                                bind  $main.restraint$i <KeyRelease> {SR_Validate_Soft %W distance}
    400402                                entry $main.restesd$i -width 8 -textvariable ::sr_restraintesd([lindex $rprint 13]) -takefocus 1
    401                                       $main.restesd$i selection range 0 end
     403                                $main.restesd$i selection range 0 end
    402404                                bind  $main.restesd$i <KeyRelease> {SR_Validate_Soft %W esd}
    403405                                checkbutton $main.sr_crestraint$i -variable ::sr_crestraint([lindex $rprint 13])
     
    515517        set sr_write ""
    516518        set new_list ""
    517 #       set len [llength $::sr_bond_list]
     519        #       set len [llength $::sr_bond_list]
    518520        set ::sr_key_list ""
    519521        foreach temp $::sr_bond_list  {
    520 puts $temp
    521 #       for {set i 0} {$i <= [expr $len-1]} {incr i} {}
    522 #           set temp [lindex $::sr_bond_list $i]
    523 
    524            catch {
    525             if {[string trim $::sr_restraintdist([lindex $temp 13])] != ""} {
    526                 set softrest "[lindex $temp 0] [lindex $temp 1] \
     522            #   for {set i 0} {$i <= [expr $len-1]} {incr i} {}
     523            #       set temp [lindex $::sr_bond_list $i]
     524
     525            catch {
     526                if {[string trim $::sr_restraintdist([lindex $temp 13])] != ""} {
     527                    set softrest "[lindex $temp 0] [lindex $temp 1] \
    527528                                [lindex $temp 2] [lindex $temp 3] [lindex $temp 4] \
    528529                                [lindex $temp 5] [lindex $temp 6] [lindex $temp 7]\
    529530                                $::sr_restraintdist([lindex $temp 13])\
    530531                                $::sr_restraintesd([lindex $temp 13])"
    531                 lappend sr_write $softrest
    532 puts $softrest
    533                 lappend new_list $temp
    534             }
     532                    lappend sr_write $softrest
     533                    lappend new_list $temp
     534                }
    535535            }
    536536        }
    537 #
     537        #
    538538        #puts $sr_write
    539539        # put the entire restraint list back into the .EXP file
     
    630630
    631631    entry  $srcb1.sr_dminvalue -width 8 -textvariable ::sr_dminvalue        -takefocus 1
    632            $srcb1.sr_dminvalue selection range 0 end
     632    $srcb1.sr_dminvalue selection range 0 end
    633633    entry  $srcb1.sr_dmaxvalue -width 8 -textvariable ::sr_dmaxvalue        -takefocus 1
    634            $srcb1.sr_dmaxvalue selection range 0 end
     634    $srcb1.sr_dmaxvalue selection range 0 end
    635635    entry  $srcb2.sr_rvalue    -width 8 -textvariable ::sr_rvalue           -takefocus 1
    636            $srcb2.sr_rvalue selection range 0 end
     636    $srcb2.sr_rvalue selection range 0 end
    637637    entry  $srcb2.sr_resd      -width 8 -textvariable ::sr_resd             -takefocus 1
    638            $srcb2.sr_resd selection range 0 end
     638    $srcb2.sr_resd selection range 0 end
    639639
    640640    bind  $srcb1.sr_dminvalue <KeyRelease> {SR_Validate_Soft %W dmin}
     
    644644
    645645    button $srcb1.recalc   -text "Filter" -bd 6 -command {SR_Display}
    646     button $srcb2.rbutton1 -text "check update" -command {SR_Update_Restraints}
    647     button $srcb2.rbutton2 -text "check delete" -command {SR_Delete_Restraints}
    648     button $::srcb3.rbutton3 -text "Save Restraints to EXP File" -bd 6 -bg LightGreen -command {SR_Write_Restraints}
    649     button $::srcb3.rbutton4 -text "Cancel" -command {destroy .mainrestraintbox
     646    button $srcb2.rbutton1 -text "Set checked" -command {SR_Update_Restraints}
     647    button $srcb2.rbutton2 -text "Delete checked" -command {SR_Delete_Restraints}
     648    button $::srcb3.rbutton3 -text "Save changes" -bd 6 -bg LightGreen -command {SR_Write_Restraints}
     649    button $::srcb3.rbutton4 -text "Cancel" -command {
     650        destroy .mainrestraintbox
    650651        afterputontop
    651652        SR_Rest_Only
    652         DisplayDistanceRestraints}
    653     wm protocol .mainrestraintbox WM_DELETE_WINDOW {destroy .mainrestraintbox
     653        DisplayDistanceRestraints
     654    }
     655    wm protocol .mainrestraintbox WM_DELETE_WINDOW {
     656        destroy .mainrestraintbox
    654657        afterputontop
    655658        SR_Rest_Only
    656         DisplayDistanceRestraints}
     659        DisplayDistanceRestraints
     660    }
    657661
    658662    grid $srcb1.atomlabel1   -column 1 -row 0
     
    725729    set ::sr_distance_button 1
    726730    set ::sr_entryvar(choicenum) 0
    727 #    set ::sr_entryvar(softphase) "1"
    728 #    set ::sr_phaselist $::expmap(phaselist)
     731    #    set ::sr_entryvar(softphase) "1"
     732    #    set ::sr_phaselist $::expmap(phaselist)
    729733    set ::sr_entryvar(softatom1) "all"
    730734    set ::sr_entryvar(softatom2) "all"
Note: See TracChangeset for help on using the changeset viewer.