Changeset 3566 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Aug 22, 2018 9:34:36 AM (3 years ago)
Author:
vondreele
Message:

enable Copy cell for magcells in Unit Cell List
fix OnSortCells? & CopyUnitCell? bug (missing magcells in data)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r3565 r3566  
    30123012           
    30133013    def OnSortCells(event):
    3014         controls,bravais,cells,dminx,ssopt = G2frame.GPXtree.GetItemPyData(UnitCellsId)
     3014        controls,bravais,cells,dminx,ssopt,magcells = G2frame.GPXtree.GetItemPyData(UnitCellsId)
    30153015        c =  event.GetCol()
    30163016        if colLabels[c] == 'M20':
     
    30223022        else:
    30233023            return
    3024         data = [controls,bravais,cells,dmin,ssopt]
     3024        data = [controls,bravais,cells,dmin,ssopt,magcells]
    30253025        G2frame.GPXtree.SetItemPyData(UnitCellsId,data)
    30263026        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
    30273027       
    30283028    def CopyUnitCell(event):
    3029         controls,bravais,cells,dminx,ssopt = G2frame.GPXtree.GetItemPyData(UnitCellsId)
     3029        controls,bravais,cells,dminx,ssopt,magcells = G2frame.GPXtree.GetItemPyData(UnitCellsId)
    30303030        controls = controls[:5]+10*[0.,]
    3031         for Cell in cells:
    3032             if Cell[-2]:
    3033                 break
    3034         cell = Cell[2:9]
    3035         controls[4] = 1
    3036         controls[5] = bravaisSymb[cell[0]]
    3037         controls[6:13] = cell[1:8]
    3038 #        controls[12] = G2lat.calc_V(G2lat.cell2A(controls[6:12]))
    3039         controls[13] = spaceGroups[bravaisSymb.index(controls[5])]
    3040         G2frame.GPXtree.SetItemPyData(UnitCellsId,[controls,bravais,cells,dmin,ssopt])
    3041         G2frame.dataWindow.RefineCell.Enable(True)
     3031        if len(cells):
     3032            for Cell in cells:
     3033                if Cell[-2]:
     3034                    break
     3035            cell = Cell[2:9]
     3036            controls[4] = 1
     3037            controls[5] = bravaisSymb[cell[0]]
     3038            controls[6:13] = cell[1:8]
     3039            controls[13] = spaceGroups[bravaisSymb.index(controls[5])]
     3040            G2frame.dataWindow.RefineCell.Enable(True)
     3041        elif magcells:
     3042            for phase in magcells:
     3043                if phase['Use']:
     3044                    break
     3045            SGData = phase['SGData']
     3046            controls[4] = 1
     3047            controls[5] = (SGData['SGLatt']+SGData['SGLaue']).replace('-','')
     3048            controls[6:13] = phase['Cell']
     3049            controls[13] = SGData['SpGrp']
     3050            ssopt['SGData'] = SGData
     3051        data = [controls,bravais,cells,dminx,ssopt,magcells]
     3052        G2frame.GPXtree.SetItemPyData(UnitCellsId,data)
     3053        OnHklShow(None)
    30423054        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
    30433055
     
    34973509        G2frame.dataWindow.MakeNewPhase.Enable(True)
    34983510        G2frame.dataWindow.ExportCells.Enable(True)
    3499 #    G2frame.dataWindow.RunSubGroupsMag.Enable(False)
     3511    elif magcells:
     3512        G2frame.dataWindow.CopyCell.Enable(True)       
    35003513    G2frame.dataWindow.ClearData()
    35013514    mainSizer = G2frame.dataWindow.GetSizer()
Note: See TracChangeset for help on using the changeset viewer.