Changeset 1215 for branches/sandbox


Ignore:
Timestamp:
Aug 19, 2012 8:40:46 AM (8 years ago)
Author:
toby
Message:

Split restraints & constraints; add compositional (chemical) constraint

Location:
branches/sandbox
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/atomcons.tcl

    r999 r1215  
    1111    grid [NoteBook $expgui(consFrame).n -bd 2 -side bottom] -sticky news
    1212    source [file join $expgui(scriptdir) profcons.tcl]
    13     source [file join $expgui(scriptdir) distrest.tcl]
    1413}
    1514
     
    2120    catch {$expgui(consFrame).n delete macro}
    2221    catch {$expgui(consFrame).n delete profile}
    23     catch {$expgui(consFrame).n delete distrest}
    2422    set atom normal
    2523    set mm disabled
     
    4745            -createcmd "MakeProfileConstraintsPane" \
    4846            -raisecmd "DisplayProfileConstraints"]   
    49     set expcons(distmaster) [\
    50             $expgui(consFrame).n insert end distrest -text "Distance Restraints" \
    51             -state $atom \
    52             -createcmd "" \
    53             -raisecmd "DisplayDistanceRestraints"]
    54  
     47
    5548    set page [$expgui(consFrame).n raise]
    5649    # open the atom constraints page if no page is open
     
    829822    DisplayAtomConstraints $mode
    830823}
     824######################################################################
     825# restraints codes
     826######################################################################
     827# this is used once to create the constraint page
     828proc MakeRestraintsPane {} {
     829    global expgui expcons expmap
     830    # create the notebook
     831    grid [NoteBook $expgui(restrFrame).n -bd 2 -side bottom] -sticky news
     832    source [file join $expgui(scriptdir) distrest.tcl]
     833    source [file join $expgui(scriptdir) chemrest.tcl]
     834}
     835
     836# this is used to update the contents of the constraint page when displayed
     837proc DisplayRestraintsPane {} {
     838    global expgui expcons expmap
     839    # create pages for each of the constraint "subpages"
     840    catch {$expgui(restrFrame).n delete distrest}
     841    catch {$expgui(restrFrame).n delete chemrest}
     842    set atom normal
     843    set mm disabled
     844    if {[llength $expmap(phasetype)] == 0} {
     845        set atom disabled
     846    } elseif {[lindex $expmap(phasetype) 0] == 4} {
     847        set mm normal
     848        if {[llength $expmap(phasetype)] == 1} {
     849            set atom disabled
     850        }
     851    }
     852    set expcons(distmaster) [\
     853            $expgui(restrFrame).n insert end distrest -text "Distance Restraints" \
     854            -state $atom \
     855            -createcmd "" \
     856            -raisecmd "DisplayDistanceRestraints"]
     857 
     858    set expcons(chemmaster) [\
     859            $expgui(restrFrame).n insert end chemrest -text "Chemical Restraints" \
     860            -state $atom \
     861            -createcmd "" \
     862            -raisecmd "DisplayChemRestraints"]
     863 
     864    set page [$expgui(restrFrame).n raise]
     865    # open the atom constraints page if no page is open
     866    if {$page == ""} {
     867        foreach page [$expgui(restrFrame).n pages] {
     868            # loop to the first non-disabled page
     869            if {[$expgui(restrFrame).n itemcget $page -state] == "normal"} {
     870                $expgui(restrFrame).n raise $page
     871                return
     872            }
     873        }
     874    } else {
     875        set pageupdate [$expgui(restrFrame).n itemcget $page -raisecmd]
     876        catch $pageupdate
     877    }
     878}
  • branches/sandbox/distrest.tcl

    r1141 r1215  
    3636#SR_Build
    3737
     38set ::sr_atom1_button 1
     39set ::sr_atom2_button 1
     40set ::sr_distance_button 1
     41set ::sr_entryvar(choicenum) 0
     42#    set ::sr_entryvar(softphase) "1"
     43#    set ::sr_phaselist $::expmap(phaselist)
     44set ::sr_entryvar(softatom1) "all"
     45set ::sr_entryvar(softatom2) "all"
     46set ::sr_phaselist $::expmap(phaselist)
     47set ::sr_error 0
     48set ::sr_bond_list ""
     49set ::sr_dminvalue 0
     50set ::sr_dmaxvalue 1000
     51set ::sr_display_mode noedit
     52set ::sr_key_list ""
     53
    3854proc DisplayDistanceRestraints {args} {
    3955    #puts DisplayDistanceRestraints
     
    8399    set ::entrycmd(trace) 0
    84100    set ::entryvar(distrestweight) [SoftConst weight]
    85     RecordMacroEntry "set ::entryvar(distrestweight) [SoftConst weight]" 0
     101    #RecordMacroEntry "set ::entryvar(distrestweight) [SoftConst weight]" 0
    86102    set ::entrycmd(trace) 1
    87     incr ::expgui(changed)
     103    #incr ::expgui(changed)
    88104
    89105    #Run Disagl Commands *****************************************************
     
    104120
    105121
    106     foreach {top main side lbl} [MakeScrollTable $rightfr] {}
     122    foreach {top main side lbl} [MakeScrollTable $rightfr 450 300] {}
    107123    MouseWheelScrollTable $rightfr
    108124    set atom1_state  1
     
    724740    putontop $mrb
    725741}
    726 #************************************************************************
    727 #Procedure to Initialize variables ***************************************
    728 #*************************************************************************
    729 proc SR_Initialize {} {
    730     set ::sr_atom1_button 1
    731     set ::sr_atom2_button 1
    732     set ::sr_distance_button 1
    733     set ::sr_entryvar(choicenum) 0
    734     #    set ::sr_entryvar(softphase) "1"
    735     #    set ::sr_phaselist $::expmap(phaselist)
    736     set ::sr_entryvar(softatom1) "all"
    737     set ::sr_entryvar(softatom2) "all"
    738     set ::sr_phaselist $::expmap(phaselist)
    739     set ::sr_error 0
    740     set ::sr_bond_list ""
    741     set ::sr_dminvalue 0
    742     set ::sr_dmaxvalue 1000
    743     set ::sr_display_mode noedit
    744     set ::sr_key_list ""
    745     #SR_Rest_Only
    746 }
    747742
    748743# load restraints w/o distances
     
    783778    donewait
    784779}
    785 
    786 #expload TEST3.EXP
    787 #mapexp
    788 SR_Initialize
    789 #SR_Read_Distances test2.disagl
    790 #SR_Load_Restraints
    791 #SR_Main_Editor
    792 #SR_Load_Restraints
    793 
    794 
  • branches/sandbox/expgui

    r1211 r1215  
    33373337            DisplayProfile \
    33383338            1  expgui5.html ""}
    3339     {consFrame    "Re/Constraints" \
     3339    {consFrame    "Constraints" \
    33403340            "source [file join $expgui(scriptdir) atomcons.tcl]; MakeConstraintsPane" \
    33413341            DisplayConstraintsPane \
     3342            0  expgui6.html ""}
     3343    {restrFrame    "Restraints" \
     3344            "source [file join $expgui(scriptdir) atomcons.tcl]; MakeRestraintsPane" \
     3345            DisplayRestraintsPane \
    33423346            0  expgui6.html ""}
    33433347    {rbFrame   "Rigid Body" \
  • branches/sandbox/export_drawxtl.tcl

    r1209 r1215  
    55set label "export to DRAWXTL (.str) file"
    66set action export_drawxtl
    7 set DXTLcolorlist "White Red Green Blue Yellow Cyan Magenta Black Orange Brown Grey Silver White"
     7set ::DXTLcolorlist "White Red Green Blue Yellow Cyan Magenta Black Orange Brown Grey Silver White"
    88proc export_drawxtl {} {
    99    global expmap expgui
     
    559559
    560560proc AddContour {} {
     561    global DXTL
     562    # if {$DXTL(bonds) == 0} {
     563    #     # insert header
     564    #     set row 0
     565    #     grid [label $DXTL(Blst).a$row -text "from " -bg yellow\
     566    #            ] -column 1 -row $row  -sticky ew
     567    #     grid [label $DXTL(Blst).b$row -text " to " -bg yellow\
     568    #            ] -column 2 -row $row  -sticky ew
     569    #     grid [label $DXTL(Blst).c$row -text " width " -bg yellow\
     570    #            ] -column 3 -row $row  -sticky ew
     571    #     grid [label $DXTL(Blst).d$row -text " min " -bg yellow\
     572    #          ] -column 4 -row $row  -sticky ew
     573    #     grid [label $DXTL(Blst).e$row -text " max " -bg yellow\
     574    #            ] -column 5 -row $row  -sticky ew
     575    #     grid [label $DXTL(Blst).f$row -text " color " -bg yellow\
     576    #            ] -column 6 -row $row  -sticky ew
     577    # }
     578    # set row [incr DXTL(bonds)]
     579    # eval tk_optionMenu $DXTL(Blst).ta$row DXTL(ba_$row) $DXTL(typelist)
     580    # grid $DXTL(Blst).ta$row -column 1 -row $row
     581    # eval tk_optionMenu $DXTL(Blst).tb$row DXTL(bb_$row) $DXTL(typelist)
     582    # grid $DXTL(Blst).tb$row -column 2 -row $row
     583    # grid [entry $DXTL(Blst).w$row -textvariable DXTL(bw_$row) \
     584    #           -width 5] -column 3 -row $row
     585    # grid [entry $DXTL(Blst).mi$row -textvariable DXTL(bmin_$row) \
     586    #           -width 5] -column 4 -row $row
     587    # grid [entry $DXTL(Blst).mx$row -textvariable DXTL(bmax_$row) \
     588    #           -width 5] -column 5 -row $row
     589    # eval tk_optionMenu $DXTL(Blst).c$row DXTL(bc_$row) $::DXTLcolorlist
     590    # grid $DXTL(Blst).c$row -column 6 -row $row
     591    # set DXTL(bw_$row) 0.02
     592    # set DXTL(bmin_$row) 1.0
     593    # set DXTL(bmax_$row) 2.0
     594    # set DXTL(bc_$row) [lindex $::DXTLcolorlist $row]
     595    # # Resize the list
     596    # update
     597    # set sizes [grid bbox $DXTL(Blst)]
     598    # [winfo parent $DXTL(Blst)] config -scrollregion $sizes \
     599    #     -width [lindex $sizes 2]
    561600    error
    562601}
  • branches/sandbox/gsascmds.tcl

    r1182 r1215  
    24272427# creates a table that is scrollable in both x and y, use ResizeScrollTable
    24282428# to set sizes after gridding the widgets
    2429 proc MakeScrollTable {box} {
     2429proc MakeScrollTable {box {width 200} {height 200}} {
    24302430    proc sync2boxes {cmd master slave scroll args} {
    24312431        $slave $cmd moveto [lindex [$master $cmd] 0]
     
    24462446            -yscrollcommand "sync2boxes yview $box.can $box.side $box.yscroll" \
    24472447            -xscrollcommand "sync2boxes xview $box.can $box.top $box.scroll" \
    2448             -width 200 -height 200 -bg lightgrey] -sticky news -row 1 -column 1
     2448            -width $width -height $height -bg lightgrey] -sticky news -row 1 -column 1
    24492449    grid [set sxbox [scrollbar $box.scroll -orient horizontal \
    24502450                         -command "move2boxes xview $box.can $box.top"]] \
  • branches/sandbox/readexp.tcl

    r1213 r1215  
    37383738                    incr j
    37393739                    set n [expr {($j + 2)/3}]
     3740                    if {$n > 99} break
    37403741                    validint n 2
    37413742                    foreach {phase atom mult} $term {}
Note: See TracChangeset for help on using the changeset viewer.