Changeset 1166 for trunk/distrest.tcl


Ignore:
Timestamp:
Aug 17, 2011 6:17:04 PM (9 years ago)
Author:
toby
Message:

bring sandbox changes over to main release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/distrest.tcl

    r1025 r1166  
    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
    8384    set ::entryvar(distrestweight) [SoftConst weight]
     85    RecordMacroEntry "set ::entryvar(distrestweight) [SoftConst weight]" 0
    8486    set ::entrycmd(trace) 1
    85 
     87    incr ::expgui(changed)
    8688
    8789    #Run Disagl Commands *****************************************************
     
    9597    grid [button $editorbox.edit -text "Activate Restraint \n Editor" -command SR_TEST] -column 0 -row 4 \
    9698        -columnspan 2 -pady 5
    97         $editorbox.edit config -bg LightGreen -bd 6
     99    $editorbox.edit config -bg LightGreen -bd 6
    98100
    99101    grid [button $editorbox.search -text "Edit Search Distance \n Parameters" -command DA_Control_Panel] -column 0 -row 3 \
    100102        -columnspan 2
    101         $editorbox.edit config -bd 4
     103    $editorbox.edit config -bd 4
    102104
    103105
     
    114116
    115117    label  $top.rlabel1 -text "Restraint" -width 9 -anchor center
    116     label  $top.rlabel2 -text "esd"      -width 9 -anchor center
     118    label  $top.rlabel2 -text "Tolerance" -width 9 -anchor center
    117119
    118120    grid $top.alabel1 -column 1 -row 2 -padx 3
     
    139141    SR_Show_RestraintsOnly $main $rightfr
    140142    foreach item [trace vinfo ::sr_entryvar(softphase)] {
    141     eval trace vdelete ::sr_entryvar(softphase) $item
     143        eval trace vdelete ::sr_entryvar(softphase) $item
    142144    }
    143145
     
    148150    SR_Fill_Display  $main
    149151    ResizeScrollTable $rightfr
     152    #puts $rightfr
    150153}
    151154
     
    336339
    337340    label  $sr_top.rlabel1 -text "Restraint"
    338     label  $sr_top.rlabel2 -text "esd"
     341    label  $sr_top.rlabel2 -text "Tolerance"
    339342    grid $sr_top.rlabel1 -column 4 -row 2 -padx 20
    340343    grid $sr_top.rlabel2 -column 5 -row 2 -padx 20
    341344
    342345
    343     button $sr_top.rcon1   -text "Check All" -width 10 -command "
     346    button $sr_top.rcon1   -text "Check\nAll" -width 4 -command "
    344347        set ::sr_checkall 1;
    345348        SR_Set_All_Check_Buttons;
     
    348351    "
    349352
    350     button $sr_top.rcon2   -text "Clear All" -width 10 -command "
     353    button $sr_top.rcon2   -text "Clear\nAll" -width 4 -command "
    351354        set ::sr_checkall 0;
    352355        SR_Set_All_Check_Buttons;
     
    396399                                label $main.rdistance$i -text [lindex $rprint 8] -justify center -anchor center
    397400                                entry $main.restraint$i -width 8 -textvariable ::sr_restraintdist([lindex $rprint 13]) -takefocus 1
    398                                       $main.restraint$i selection range 0 end
     401                                $main.restraint$i selection range 0 end
    399402                                bind  $main.restraint$i <KeyRelease> {SR_Validate_Soft %W distance}
    400403                                entry $main.restesd$i -width 8 -textvariable ::sr_restraintesd([lindex $rprint 13]) -takefocus 1
    401                                       $main.restesd$i selection range 0 end
     404                                $main.restesd$i selection range 0 end
    402405                                bind  $main.restesd$i <KeyRelease> {SR_Validate_Soft %W esd}
    403406                                checkbutton $main.sr_crestraint$i -variable ::sr_crestraint([lindex $rprint 13])
     
    458461        # valid value
    459462        $win config -fg black
    460         $::srcb3.rbutton3 config -bg LightGreen -text "Save Restraints to EXP File"
     463        $::srcb3.rbutton3 config -bg LightGreen -text "Save Changes"
    461464        set ::sr_error 0
    462465    }
     
    515518        set sr_write ""
    516519        set new_list ""
    517 #       set len [llength $::sr_bond_list]
     520        #       set len [llength $::sr_bond_list]
    518521        set ::sr_key_list ""
    519522        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] \
     523            #   for {set i 0} {$i <= [expr $len-1]} {incr i} {}
     524            #       set temp [lindex $::sr_bond_list $i]
     525
     526            if {[catch {
     527                if {[string trim $::sr_restraintdist([lindex $temp 13])] != ""} {
     528                    set softrest "[lindex $temp 0] [lindex $temp 1] \
    527529                                [lindex $temp 2] [lindex $temp 3] [lindex $temp 4] \
    528530                                [lindex $temp 5] [lindex $temp 6] [lindex $temp 7]\
    529531                                $::sr_restraintdist([lindex $temp 13])\
    530532                                $::sr_restraintesd([lindex $temp 13])"
    531                 lappend sr_write $softrest
    532 puts $softrest
    533                 lappend new_list $temp
    534             }
    535             }
     533                    lappend sr_write $softrest
     534                    #lappend new_list $temp
     535                }
     536            } errmsg]} {puts "error: $errmsg"}
    536537        }
    537 #
     538        #
    538539        #puts $sr_write
    539540        # put the entire restraint list back into the .EXP file
     541        #puts "SoftConst restraintlist set $sr_write"
    540542        SoftConst restraintlist set $sr_write
    541         set ::sr_bond_list $new_list
     543        RecordMacroEntry "SoftConst restraintlist set $sr_write" 0
     544        #set ::sr_bond_list $new_list
    542545        # indicate a change to the .EXP file
    543546        incr ::expgui(changed)
     
    623626    label $srcb1.dmaxlabel    -text "Dmax"
    624627    label $srcb2.restlabel    -text "Restraint Value" -width 16 -anchor w
    625     label $srcb2.restlabelesd -text "esd"
     628    label $srcb2.restlabelesd -text "Tolerance"
    626629
    627630    eval tk_optionMenu $srcb1.atom1 ::sr_entryvar(softatom1) "[lsort [array names ::sr_lookuplist1${::sr_entryvar(softphase)}]] all"
     
    630633
    631634    entry  $srcb1.sr_dminvalue -width 8 -textvariable ::sr_dminvalue        -takefocus 1
    632            $srcb1.sr_dminvalue selection range 0 end
     635    $srcb1.sr_dminvalue selection range 0 end
    633636    entry  $srcb1.sr_dmaxvalue -width 8 -textvariable ::sr_dmaxvalue        -takefocus 1
    634            $srcb1.sr_dmaxvalue selection range 0 end
     637    $srcb1.sr_dmaxvalue selection range 0 end
    635638    entry  $srcb2.sr_rvalue    -width 8 -textvariable ::sr_rvalue           -takefocus 1
    636            $srcb2.sr_rvalue selection range 0 end
     639    $srcb2.sr_rvalue selection range 0 end
    637640    entry  $srcb2.sr_resd      -width 8 -textvariable ::sr_resd             -takefocus 1
    638            $srcb2.sr_resd selection range 0 end
     641    $srcb2.sr_resd selection range 0 end
    639642
    640643    bind  $srcb1.sr_dminvalue <KeyRelease> {SR_Validate_Soft %W dmin}
     
    644647
    645648    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
     649    button $srcb2.rbutton1 -text "Set checked" -command {SR_Update_Restraints}
     650    button $srcb2.rbutton2 -text "Delete checked" -command {SR_Delete_Restraints}
     651    button $::srcb3.rbutton3 -text "Save changes" -bd 6 -bg LightGreen -command {SR_Write_Restraints}
     652    button $::srcb3.rbutton4 -text "Cancel" -command {
     653        destroy .mainrestraintbox
    650654        afterputontop
    651655        SR_Rest_Only
    652         DisplayDistanceRestraints}
    653     wm protocol .mainrestraintbox WM_DELETE_WINDOW {destroy .mainrestraintbox
     656        DisplayDistanceRestraints
     657    }
     658    wm protocol .mainrestraintbox WM_DELETE_WINDOW {
     659        destroy .mainrestraintbox
    654660        afterputontop
    655661        SR_Rest_Only
    656         DisplayDistanceRestraints}
     662        DisplayDistanceRestraints
     663    }
    657664
    658665    grid $srcb1.atomlabel1   -column 1 -row 0
     
    725732    set ::sr_distance_button 1
    726733    set ::sr_entryvar(choicenum) 0
    727 #    set ::sr_entryvar(softphase) "1"
    728 #    set ::sr_phaselist $::expmap(phaselist)
     734    #    set ::sr_entryvar(softphase) "1"
     735    #    set ::sr_phaselist $::expmap(phaselist)
    729736    set ::sr_entryvar(softatom1) "all"
    730737    set ::sr_entryvar(softatom2) "all"
Note: See TracChangeset for help on using the changeset viewer.