Changeset 1099


Ignore:
Timestamp:
Oct 10, 2013 1:03:26 PM (10 years ago)
Author:
vondreele
Message:

improvements to torsion & Ramachandran plot routines

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1098 r1099  
    18591859        msg = 'atoms:'+names[ind]
    18601860        Page.canvas.SetToolTipString(msg)
    1861    
     1861        try:
     1862            page = G2frame.dataDisplay.GetSelection()
     1863        except:
     1864            return
     1865        if G2frame.dataDisplay.GetPageText(page) == 'Torsion restraints':
     1866            torGrid = G2frame.dataDisplay.GetPage(page).Torsions
     1867            torGrid.ClearSelection()
     1868            for row in range(torGrid.GetNumberRows()):
     1869                if names[ind] in torGrid.GetCellValue(row,0):
     1870                    torGrid.SelectRow(row)
     1871            torGrid.ForceRefresh()
     1872               
    18621873    def OnMotion(event):
    18631874        if event.xdata and event.ydata:                 #avoid out of frame errors
     
    19311942        msg = 'atoms:'+names[ind]
    19321943        Page.canvas.SetToolTipString(msg)
     1944        try:
     1945            page = G2frame.dataDisplay.GetSelection()
     1946        except:
     1947            return
     1948        if G2frame.dataDisplay.GetPageText(page) == 'Ramachandran restraints':
     1949            ramaGrid = G2frame.dataDisplay.GetPage(page).Ramas
     1950            ramaGrid.ClearSelection()
     1951            for row in range(ramaGrid.GetNumberRows()):
     1952                if names[ind] in ramaGrid.GetCellValue(row,0):
     1953                    ramaGrid.SelectRow(row)
     1954            ramaGrid.ForceRefresh()
    19331955
    19341956    def OnMotion(event):
  • trunk/GSASIIrestrGUI.py

    r1097 r1099  
    13971397                    del torsionList[ibad]
    13981398            torsionTable = G2gd.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types)
    1399             Torsions = G2gd.GSGrid(TorsionRestr)
    1400             Torsions.SetTable(torsionTable, True)
    1401             Torsions.AutoSizeColumns(False)
     1399            TorsionRestr.Torsions = G2gd.GSGrid(TorsionRestr)
     1400            TorsionRestr.Torsions.SetTable(torsionTable, True)
     1401            TorsionRestr.Torsions.AutoSizeColumns(False)
    14021402            for r in range(len(torsionList)):
    14031403                for c in range(5):
    1404                     Torsions.SetReadOnly(r,c,True)
    1405                     Torsions.SetCellStyle(r,c,VERY_LIGHT_GREY,True)
    1406             Torsions.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    1407             Torsions.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
     1404                    TorsionRestr.Torsions.SetReadOnly(r,c,True)
     1405                    TorsionRestr.Torsions.SetCellStyle(r,c,VERY_LIGHT_GREY,True)
     1406            TorsionRestr.Torsions.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
     1407            TorsionRestr.Torsions.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    14081408            G2frame.dataFrame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
    14091409            G2frame.dataFrame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD)
     
    14111411                'Torsion restraints: sum(wt*(delt/sig)^2) =    %.2f, mean(wt*(delt/sig)^2) =    %.2f'    \
    14121412                %(chisq,chisq/len(torsionList))),0,wx.ALIGN_CENTER_VERTICAL)
    1413             mainSizer.Add(Torsions,0,)
     1413            mainSizer.Add(TorsionRestr.Torsions,0,)
    14141414           
    14151415            mainSizer.Add((5,5))
     
    15171517                    del ramaList[ibad]
    15181518            ramaTable = G2gd.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types)
    1519             Ramas = G2gd.GSGrid(RamaRestr)
    1520             Ramas.SetTable(ramaTable, True)
    1521             Ramas.AutoSizeColumns(False)
     1519            RamaRestr.Ramas = G2gd.GSGrid(RamaRestr)
     1520            RamaRestr.Ramas.SetTable(ramaTable, True)
     1521            RamaRestr.Ramas.AutoSizeColumns(False)
    15221522            for r in range(len(ramaList)):
    15231523                for c in range(6):
    1524                     Ramas.SetReadOnly(r,c,True)
    1525                     Ramas.SetCellStyle(r,c,VERY_LIGHT_GREY,True)
    1526             Ramas.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    1527             Ramas.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
     1524                    RamaRestr.Ramas.SetReadOnly(r,c,True)
     1525                    RamaRestr.Ramas.SetCellStyle(r,c,VERY_LIGHT_GREY,True)
     1526            RamaRestr.Ramas.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
     1527            RamaRestr.Ramas.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    15281528            G2frame.dataFrame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
    15291529            G2frame.dataFrame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD)
     
    15311531                'Ramachandran restraints: sum(wt*(delt/sig)^2) =    %.2f, mean(wt*(delt/sig)^2) =    %.2f'    \
    15321532                %(chisq,chisq/len(ramaList))),0,wx.ALIGN_CENTER_VERTICAL)
    1533             mainSizer.Add(Ramas,0,)
     1533            mainSizer.Add(RamaRestr.Ramas,0,)
    15341534        else:
    15351535            mainSizer.Add(wx.StaticText(RamaRestr,-1,'No Ramachandran restraints for this phase'),0,)
Note: See TracChangeset for help on using the changeset viewer.