Changeset 3394


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

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3392 r3394  
    49894989        # PDR / Unit Cells List
    49904990        G2G.Define_wxId('wxID_INDEXPEAKS', 'wxID_REFINECELL', 'wxID_COPYCELL', 'wxID_MAKENEWPHASE',
    4991             'wxID_EXPORTCELLS',)
     4991            'wxID_EXPORTCELLS','wxID_LOADCELL','wxID_IMPORTCELL')
    49924992        self.IndexMenu = wx.MenuBar()
    49934993        self.PrefillDataMenu(self.IndexMenu)
     
    49974997        self.CopyCell = self.IndexEdit.Append(G2G.wxID_COPYCELL,'Copy Cell',
    49984998            'Copy selected unit cell from indexing to cell refinement fields')
     4999        self.LoadCell = self.IndexEdit.Append(G2G.wxID_LOADCELL,'Load Cell',
     5000            'Load unit cell from phase')
     5001        self.ImportCell = self.IndexEdit.Append(G2G.wxID_IMPORTCELL,'Import Cell',
     5002            'Import unit cell from file')
    49995003        self.RefineCell = self.IndexEdit.Append(G2G.wxID_REFINECELL,'Refine Cell',
    50005004            'Refine unit cell parameters from indexed peaks')
  • 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.