Changeset 2957


Ignore:
Timestamp:
Aug 1, 2017 3:18:41 PM (4 years ago)
Author:
toby
Message:

use grid scroll bars for Peak List and Index Peak List displays; increase convergence on SVD lam increase

Location:
branch/2frame
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASIIdataGUI.py

    r2954 r2957  
    47694769        '''Initializes the contents of the dataWindow panel
    47704770        '''
     4771        self.Unbind(wx.EVT_SIZE)
    47714772        #self.SetBackgroundColour(wx.WHITE)
    47724773        self.SetBackgroundColour(VERY_LIGHT_GREY)  # BHT: I prefer a gray background. Makes TextCtrls stand out, but
     
    47784779            print 'No sizer in dataWindow'
    47794780            if GSASIIpath.GetConfigValue('debug'): raise Exception
    4780        
     4781
     4782    def OnResize(self,event):
     4783        'Used for grids to match ScrolledWindow size'
     4784        event.Skip()
     4785        Sizer = self.GetSizer()
     4786        if not Sizer: return
     4787        if Sizer.GetItemCount() == 1: # if there is a single grid, resize it
     4788            if isinstance(Sizer.GetItem(0).GetWindow(), G2G.GSGrid):
     4789                Sizer.GetItem(0).GetWindow().SetSize(self.GetSize())
     4790                   
    47814791    def SetDataSize(self):
    47824792        '''Sizes the contents of the dataWindow panel
    47834793        '''
    47844794        Sizer = self.GetSizer()
    4785         if GSASIIpath.GetConfigValue('debug') and not Sizer:
     4795        if not Sizer:
    47864796            print 'No sizer in dataWindow'
    4787             raise Exception
     4797            if GSASIIpath.GetConfigValue('debug'): raise Exception
     4798            return
     4799        if Sizer.GetItemCount() == 1: # handle cases with a single grid in DataWindow differently
     4800            # note that Grid's scroll bars must be turned on with .SetScrollRate(1,1)
     4801            # just after the call to .GSGrid()
     4802            if isinstance(Sizer.GetItem(0).GetWindow(), G2G.GSGrid):
     4803                self.Bind(wx.EVT_SIZE,self.OnResize)
     4804                Sizer.GetItem(0).GetWindow().SetSize(self.GetSize())
     4805                self.SetAutoLayout(False)
     4806                self.SetScrollRate(0,0)
     4807                self.SendSizeEvent()
     4808                return
    47884809        self.SetAutoLayout(True)
    47894810        self.SetScrollRate(1,1)
    4790 #        self.SetupScrolling()      #TODO - setscrollbars here
    47914811        self.SendSizeEvent()
    47924812
  • branch/2frame/GSASIImath.py

    r2945 r2957  
    181181        if Print:
    182182            print 'initial chi^2 %.5g'%(chisq0)
     183        chitol = ftol
    183184        while True:
    184185            Lam = np.eye(Amat.shape[0])*lam
     
    195196            nfev += 1
    196197            chisq1 = np.sum(M2**2)
    197             if chisq1 > chisq0*(1.+ftol):
     198            if chisq1 > chisq0*(1.+chitol):
    198199                lam *= 10.
    199200                if Print:
     
    206207                print 'ouch #3 chisq1 ',chisq1,' stuck > chisq0 ',chisq0
    207208                break
     209            chitol *= 2
    208210        lamMax = max(lamMax,lam)
    209211        deltaChi2 = (chisq0-chisq1)/chisq0
  • branch/2frame/GSASIIpwdGUI.py

    r2956 r2957  
    860860#    G2frame.dataWindow.Bind(wg.EVT_GRID_CELL_LEFT_DCLICK, onCellListDClick)
    861861    reflGrid.AutoSizeColumns(False)
    862 #    reflGrid.SetScrollRate(0,0)
     862    reflGrid.SetScrollRate(1,1)
    863863    G2frame.reflGrid = reflGrid
    864     mainSizer.Add(reflGrid)         #,1,wx.ALL|wx.EXPAND,1)
     864    mainSizer.Add(reflGrid,1,wx.ALL|wx.EXPAND,1)
    865865    G2frame.dataWindow.SetDataSize()
    866866
     
    25902590    G2frame.indxPeaks = G2G.GSGrid(parent=G2frame.dataWindow)               
    25912591    G2frame.indxPeaks.SetTable(G2frame.IndexPeaksTable, True)
     2592    G2frame.indxPeaks.SetScrollRate(1,1)
    25922593    XY = []
    25932594    Sigs = []
Note: See TracChangeset for help on using the changeset viewer.