Changeset 3503


Ignore:
Timestamp:
Jul 23, 2018 7:31:35 PM (5 years ago)
Author:
vondreele
Message:

add possibility of transforming test cell in Unit cell list

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3485 r3503  
    50025002        # PDR / Unit Cells List
    50035003        G2G.Define_wxId('wxID_INDEXPEAKS', 'wxID_REFINECELL', 'wxID_COPYCELL', 'wxID_MAKENEWPHASE',
    5004             'wxID_EXPORTCELLS','wxID_LOADCELL','wxID_IMPORTCELL')
     5004            'wxID_EXPORTCELLS','wxID_LOADCELL','wxID_IMPORTCELL','wxID_TRANSPOSECELL')
    50055005        self.IndexMenu = wx.MenuBar()
    50065006        self.PrefillDataMenu(self.IndexMenu)
     
    50145014        self.ImportCell = self.IndexEdit.Append(G2G.wxID_IMPORTCELL,'Import Cell',
    50155015            'Import unit cell from file')
     5016        self.TransposeCell = self.IndexEdit.Append(G2G.wxID_TRANSPOSECELL,'Transform Cell',
     5017            'Transform unit cell')
    50165018        self.RefineCell = self.IndexEdit.Append(G2G.wxID_REFINECELL,'Refine Cell',
    50175019            'Refine unit cell parameters from indexed peaks')
  • trunk/GSASIIpwdGUI.py

    r3496 r3503  
    4747import GSASIIplot as G2plt
    4848import GSASIIdataGUI as G2gd
     49import GSASIIphsGUI as G2phsG
    4950import GSASIIctrlGUI as G2G
    5051import GSASIIElemGUI as G2elemGUI
     
    33263327            SGData['SpnFlp'],False).Show()
    33273328       
     3329    def TransposeUnitCell(event):
     3330        Trans = np.eye(3)
     3331        Uvec = np.zeros(3)
     3332        Vvec = np.zeros(3)
     3333        ifMag = False
     3334        Type = 'nuclear'
     3335        newSpGrp = ''
     3336        BNSlatt = ''
     3337        phase = {'General':{'Name':'','Type':Type,'Cell':['',]+controls[6:13],'SGData':SGData}}
     3338        dlg = G2phsG.TransformDialog(G2frame,phase,Trans,Uvec,Vvec,ifMag,newSpGrp,BNSlatt)
     3339        try:
     3340            if dlg.ShowModal() == wx.ID_OK:
     3341                newPhase,Trans,Uvec,Vvec,ifMag,ifConstr,Common = dlg.GetSelection()
     3342                sgData = newPhase['General']['SGData']
     3343                controls[5] = sgData['SGLatt']+sgData['SGLaue']
     3344                controls[13] = sgData['SpGrp']
     3345                ssopt['SGData'] = G2spc.SpcGroup(controls[13])[1]
     3346                controls[6:13] = newPhase['General']['Cell'][1:8]
     3347            else:
     3348                return
     3349        finally:
     3350            dlg.Destroy()
     3351        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
     3352       
    33283353    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.IndexMenu)
    33293354    G2frame.Bind(wx.EVT_MENU, OnIndexPeaks, id=G2G.wxID_INDEXPEAKS)
     
    33313356    G2frame.Bind(wx.EVT_MENU, LoadUnitCell, id=G2G.wxID_LOADCELL)
    33323357    G2frame.Bind(wx.EVT_MENU, ImportUnitCell, id=G2G.wxID_IMPORTCELL)
     3358    G2frame.Bind(wx.EVT_MENU, TransposeUnitCell, id=G2G.wxID_TRANSPOSECELL)
    33333359    G2frame.Bind(wx.EVT_MENU, RefineCell, id=G2G.wxID_REFINECELL)
    33343360    G2frame.Bind(wx.EVT_MENU, MakeNewPhase, id=G2G.wxID_MAKENEWPHASE)
Note: See TracChangeset for help on using the changeset viewer.