Changeset 4914


Ignore:
Timestamp:
May 25, 2021 2:37:39 PM (3 years ago)
Author:
toby
Message:

ignore & highlight bad General Restraints; minor GUI fixes

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r4913 r4914  
    48814881
    48824882    def Reset(self):
    4883         self._tc.SetValue(self.startValue)
     4883        self._tc.SetValue(str(self.startValue))
    48844884        self._tc.SetInsertionPointEnd()
    48854885
  • trunk/GSASIIphsGUI.py

    r4911 r4914  
    34243424            atomTable = G2G.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types)
    34253425            try:
    3426                 Atoms.SetTable(atomTable, True)    # Paint may be called after the Grid has been deleted
     3426                Atoms.SetTable(atomTable, True, useFracEdit=False)    # Paint may be called after the Grid has been deleted
    34273427            except:
    34283428                return
     
    66976697            atomTable = G2G.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=colTypes)
    66986698            atomGrid = G2G.GSGrid(layerData)
    6699             atomGrid.SetTable(atomTable,True)
     6699            atomGrid.SetTable(atomTable,True,useFracEdit=False)
    67006700#            atomGrid.SetScrollRate(0,0)    #get rid of automatic scroll bars
    67016701            # loop over all cols in table, set cell editor for numerical items
     
    67856785                transTable = G2G.Table(table,rowLabels=rowLabels,colLabels=transLabels,types=transTypes)
    67866786                transGrid = G2G.GSGrid(layerData)
    6787                 transGrid.SetTable(transTable,True)
     6787                transGrid.SetTable(transTable,True,useFracEdit=False)
    67886788#                transGrid.SetScrollRate(0,0)    #get rid of automatic scroll bars
    67896789                Indx[transGrid.GetId()] = Yi
  • trunk/GSASIIrestrGUI.py

    r4913 r4914  
    20012001        if generalRestData['General']:
    20022002            parmDict = SetupParmDict(G2frame)
    2003             GridSiz = wx.FlexGridSizer(0,7,10,2)
    2004             for lbl in ('expression =','target\nvalue','current\nvalue','esd'):
     2003            GridSiz = wx.FlexGridSizer(0,9,10,2)
     2004            GridSiz.Add((-1,-1))
     2005            GridSiz.Add(
     2006                    wx.StaticText(GeneralRestr,wx.ID_ANY,'Expression'),
     2007                    0,wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL)
     2008            GridSiz.Add((-1,-1))
     2009#            for lbl in ('expression',' ','target\nvalue','current\nvalue','esd'):
     2010            for lbl in ('target\nvalue','current\nvalue','esd'):
    20052011                GridSiz.Add(
    20062012                    wx.StaticText(GeneralRestr,wx.ID_ANY,lbl,style=wx.CENTER),
     
    20132019            for i,rest in enumerate(generalRestData['General']):
    20142020                eq = rest[0]
    2015                 txt = eq.expression+' ='
     2021                txt = '{}: '.format(i+1)
     2022                GridSiz.Add(wx.StaticText(GeneralRestr,wx.ID_ANY,txt))
     2023                txt = eq.expression
    20162024                if len(txt) > 50:
    20172025                    txt = txt[:47]+'... '
    2018                 GridSiz.Add(wx.StaticText(GeneralRestr,wx.ID_ANY,txt))
     2026                txtC = wx.StaticText(GeneralRestr,wx.ID_ANY,txt)
     2027                GridSiz.Add(txtC)
     2028                GridSiz.Add(wx.StaticText(GeneralRestr,wx.ID_ANY,' = '))
    20192029                GridSiz.Add(
    20202030                    G2G.ValidatedTxtCtrl(GeneralRestr,rest,1,nDig=(10,3,'g'),typeHint=float)
     
    20272037                except:
    20282038                    txt = ' (error) '
     2039                    txtC.SetForegroundColour("red")
    20292040                GridSiz.Add(wx.StaticText(GeneralRestr,wx.ID_ANY,txt))
    20302041                GridSiz.Add(
  • trunk/GSASIIstrMath.py

    r4869 r4914  
    422422                elif name == 'General':
    423423                    for i,(eq,obs,esd) in enumerate(itemRest[rest]):
    424                         pNames.append(str(pId)+':'+name+':'+str(i))
    425424                        calcobj = G2obj.ExpressionCalcObj(eq)
    426425                        calcobj.SetupCalc(parmDict)
    427426                        calc = calcobj.EvalExpression()
    428                         pVals.append(obs-calc)
    429                         pWt.append(wt/esd**2)                   
    430                         pWsum[name] += wt*((obs-calc)/esd)**2
    431                         pWnum[name] += 1
    432        
     427                        try:
     428                            pVals.append(obs-calc)
     429                            pWt.append(wt/esd**2)                   
     430                            pWsum[name] += wt*((obs-calc)/esd)**2
     431                            pWnum[name] += 1
     432                            pNames.append(str(pId)+':'+name+':'+str(i))
     433                        except:
     434                            print('Error computing General restraint #{}'.format(i+1))
    433435    for phase in Phases:
    434436        name = 'SH-Pref.Ori.'
Note: See TracChangeset for help on using the changeset viewer.