Changeset 3394 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
May 18, 2018 3:23:49 PM (4 years ago)
Author:
vondreele
Message:

implement "Load Unit Cell" from phase on phase list to Unit Cell for testing against pattern

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r3391 r3394  
    30213021        G2frame.GPXtree.SetItemPyData(UnitCellsId,[controls,bravais,cells,dmin,ssopt])
    30223022        G2frame.dataWindow.RefineCell.Enable(True)
    3023         wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)       
     3023        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
     3024
     3025    def LoadUnitCell(event):
     3026        print('Load unit cell from phase - TBD')    #TODO:
     3027        controls,bravais,cells,dminx,ssopt = G2frame.GPXtree.GetItemPyData(UnitCellsId)
     3028        pId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root, 'Phases')
     3029        if not pId: return
     3030        Phases = []
     3031        item, cookie = G2frame.GPXtree.GetFirstChild(pId)
     3032        while item:
     3033            Phases.append(G2frame.GPXtree.GetItemText(item))
     3034            item, cookie = G2frame.GPXtree.GetNextChild(pId, cookie)   
     3035        pNum = G2G.ItemSelector(Phases,G2frame,'Select phase',header='Phase')
     3036        if pNum is None: return
     3037        Phase = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,pId,Phases[pNum]))
     3038        Cell = Phase['General']['Cell']
     3039        SGData = Phase['General']['SGData']
     3040        controls[4] = 1
     3041        controls[5] = SGData['SGLatt']+SGData['SGLaue']
     3042        controls[6:12] = Cell[1:8]
     3043        controls[13] = spaceGroups[bravaisSymb.index(controls[5])]
     3044        G2frame.GPXtree.SetItemPyData(UnitCellsId,[controls,bravais,cells,dmin,ssopt])
     3045        G2frame.dataWindow.RefineCell.Enable(True)
     3046        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
     3047       
     3048    def ImportUnitCell(event):
     3049        print('Import unit cell from file - TBD')   #TODO:
     3050        controls,bravais,cells,dminx,ssopt = G2frame.GPXtree.GetItemPyData(UnitCellsId)
     3051        G2frame.GPXtree.SetItemPyData(UnitCellsId,[controls,bravais,cells,dmin,ssopt])
     3052        G2frame.dataWindow.RefineCell.Enable(True)
     3053        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
    30243054               
    30253055    def RefineCell(event):
     
    32283258    G2frame.Bind(wx.EVT_MENU, OnIndexPeaks, id=G2G.wxID_INDEXPEAKS)
    32293259    G2frame.Bind(wx.EVT_MENU, CopyUnitCell, id=G2G.wxID_COPYCELL)
     3260    G2frame.Bind(wx.EVT_MENU, LoadUnitCell, id=G2G.wxID_LOADCELL)
     3261    G2frame.Bind(wx.EVT_MENU, ImportUnitCell, id=G2G.wxID_IMPORTCELL)
    32303262    G2frame.Bind(wx.EVT_MENU, RefineCell, id=G2G.wxID_REFINECELL)
    32313263    G2frame.Bind(wx.EVT_MENU, MakeNewPhase, id=G2G.wxID_MAKENEWPHASE)
Note: See TracChangeset for help on using the changeset viewer.