Changeset 4842


Ignore:
Timestamp:
Mar 7, 2021 11:35:19 AM (7 months ago)
Author:
toby
Message:

fix Refine Cell enable after cell copy; misc wx4.1 fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r4826 r4842  
    18041804        if len(data)>2:
    18051805            mainSizer.Add((0,5),0)
    1806             mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Excluded regions:'),0,WACV)
     1806            mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Excluded regions:'))
    18071807            mainSizer.Add(ExclSizer())
    18081808        G2frame.dataWindow.SetSizer(mainSizer)
     
    32273227def UpdateUnitCellsGrid(G2frame, data):
    32283228    '''respond to selection of PWDR Unit Cells data tree item.
    3229     '''
    3230     G2frame.ifGetExclude = False
    3231     UnitCellsId = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Unit Cells List')
    3232     SPGlist = G2spc.spglist
    3233     bravaisSymb = ['Fm3m','Im3m','Pm3m','R3-H','P6/mmm','I4/mmm','P4/mmm',
    3234         'Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm','I2/m','C2/m','P2/m','P1','C1']
    3235     spaceGroups = ['F m 3 m','I m 3 m','P m 3 m','R 3 m','P 6/m m m','I 4/m m m',
    3236         'P 4/m m m','F m m m','I m m m','A m m m','B m m m','C m m m','P m m m','I 2/m','C 2/m','P 2/m','P -1','C -1']
    3237     Inst = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters'))[0]
    3238     Limits = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Limits'))[1]
    3239     if 'T' in Inst['Type'][0]:
    3240         difC = Inst['difC'][1]
    3241         dmin = G2lat.Pos2dsp(Inst,Limits[0])
    3242     else:   #'C', 'B', or 'PKS'
    3243         wave = G2mth.getWave(Inst)
    3244         dmin = G2lat.Pos2dsp(Inst,Limits[1])
    3245    
     3229    '''   
    32463230    def SetLattice(controls):
    32473231        ibrav = bravaisSymb.index(controls[5])
     
    35223506                if Cell[-2]:
    35233507                    break
    3524             cell = Cell[2:9]
     3508            cell = Cell[2:10]
    35253509            controls[4] = 1
    35263510            controls[5] = bravaisSymb[cell[0]]
    35273511            controls[6:13] = cell[1:8]
    35283512            controls[13] = spaceGroups[bravaisSymb.index(controls[5])]
    3529             G2frame.dataWindow.RefineCell.Enable(True)
     3513            # G2frame.dataWindow.RefineCell.Enable(True) # set in UpdateUnitCellsGrid
    35303514        elif magcells:
    35313515            for phase in magcells:
     
    43604344        G2frame.OnFileSave(event)
    43614345        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
    4362        
     4346
     4347    #### UpdateIndexPeaksGrid code starts here
     4348    G2frame.ifGetExclude = False
     4349    UnitCellsId = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Unit Cells List')
     4350    SPGlist = G2spc.spglist
     4351    bravaisSymb = ['Fm3m','Im3m','Pm3m','R3-H','P6/mmm','I4/mmm','P4/mmm',
     4352        'Fmmm','Immm','Ammm','Bmmm','Cmmm','Pmmm','I2/m','C2/m','P2/m','P1','C1']
     4353    spaceGroups = ['F m 3 m','I m 3 m','P m 3 m','R 3 m','P 6/m m m','I 4/m m m',
     4354        'P 4/m m m','F m m m','I m m m','A m m m','B m m m','C m m m','P m m m','I 2/m','C 2/m','P 2/m','P -1','C -1']
     4355    Inst = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters'))[0]
     4356    Limits = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Limits'))[1]
     4357    if 'T' in Inst['Type'][0]:
     4358        difC = Inst['difC'][1]
     4359        dmin = G2lat.Pos2dsp(Inst,Limits[0])
     4360    else:   #'C', 'B', or 'PKS'
     4361        wave = G2mth.getWave(Inst)
     4362        dmin = G2lat.Pos2dsp(Inst,Limits[1])
    43634363    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.IndexMenu)
    43644364    G2frame.GetStatusBar().SetStatusText('')
     
    46354635            pass
    46364636        if mode:
    4637             mainSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label='\n Cell symmetry search:'),0,WACV)
     4637            mainSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label='\n Cell symmetry search:'))
    46384638            colLabels = ['use']
    46394639            Types = [wg.GRID_VALUE_BOOL]
    46404640        else:
    4641             mainSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label='\n Indexing Result:'),0,WACV)
     4641            mainSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label='\n Indexing Result:'))
    46424642            colLabels = ['M20','X20','use','Bravais']
    46434643            Types = [wg.GRID_VALUE_FLOAT+':10,2',wg.GRID_VALUE_NUMBER,
     
    46764676                else:
    46774677                    gridDisplay.SetReadOnly(r,c,isReadOnly=True)
    4678         mainSizer.Add(gridDisplay,0,WACV)
     4678        mainSizer.Add(gridDisplay)
    46794679    if magcells and len(controls) > 16:
    46804680        itemList = [phase.get('gid',ip+1) for ip,phase in enumerate(magcells)]
     
    46964696            Label += ', kvec3=(%s)' % kvec3
    46974697        Label += ':'
    4698         mainSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label=Label),0,WACV)
     4698        mainSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label=Label))
    46994699        rowLabels = [str(i+1) for i in range(len(baseList))]
    47004700        colLabels = ['Space Gp','Try','Keep','Uniq','nConj','nSup','Trans','Vec','a','b','c','alpha','beta','gamma','Volume']
     
    47304730                else:
    47314731                    magDisplay.SetReadOnly(r,c,isReadOnly=True)
    4732         mainSizer.Add(magDisplay,0,WACV)
     4732        mainSizer.Add(magDisplay)
    47334733       
    47344734    G2frame.dataWindow.SetSizer(mainSizer)
     
    68396839    G2frame.dataWindow.ClearData()
    68406840    mainSizer = wx.BoxSizer(wx.VERTICAL)
    6841     mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Reflectometry fitting for: '+Name),0,WACV)
    6842     mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Controls:'),0,WACV)
     6841    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Reflectometry fitting for: '+Name))
     6842    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Controls:'))
    68436843    mainSizer.Add(ControlSizer())
    68446844    G2G.HorizontalLine(mainSizer,G2frame.dataWindow)   
    6845     mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Global parameters:'),0,WACV)
     6845    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Global parameters:'))
    68466846    mainSizer.Add(OverallSizer())
    68476847    G2G.HorizontalLine(mainSizer,G2frame.dataWindow)
     
    68606860        for ilay,layer in enumerate(data['Layers'][1:-1]):
    68616861            Str += ' %d: %s'%(ilay+1,layer['Name'])
    6862         mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=Str),0,WACV)
    6863         mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' NB: Repeat sequence by e.g. 6*(1 2) '),0,WACV)
     6862        mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=Str))
     6863        mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' NB: Repeat sequence by e.g. 6*(1 2) '))
    68646864    G2G.HorizontalLine(mainSizer,G2frame.dataWindow)   
    6865     mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Layers: scatt. densities are 10%scm%s = 10%s%s%s'%(Pwr10,Pwrm2,Pwrm6,Angstr,Pwrm2)),0,WACV)
     6865    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Layers: scatt. densities are 10%scm%s = 10%s%s%s'%(Pwr10,Pwrm2,Pwrm6,Angstr,Pwrm2)))
    68666866    mainSizer.Add(LayerSizer())
    68676867    G2frame.dataWindow.SetSizer(mainSizer)
     
    77817781    mainSizer = wx.BoxSizer(wx.VERTICAL)
    77827782    mainSizer.Add((5,5),0)
    7783     mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' PDF peak fit controls:'),0,WACV)
     7783    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' PDF peak fit controls:'))
    77847784    mainSizer.Add((5,5),0)
    7785     mainSizer.Add(limitSizer(),0,WACV)
     7785    mainSizer.Add(limitSizer())
    77867786    mainSizer.Add((5,5),0)
    77877787    mainSizer.Add(backSizer())
Note: See TracChangeset for help on using the changeset viewer.