Changeset 2809 for trunk/GSASIIgrid.py


Ignore:
Timestamp:
Apr 26, 2017 9:51:43 AM (6 years ago)
Author:
vondreele
Message:

add new transform option for moving atoms from setting #1 --> #2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r2797 r2809  
    173173    'abc*':np.eye(3), }
    174174commonNames = ['abc','bca','cab','a-cb','ba-c','-cba','P->A','A->P','P->B','B->P','P->C','C->P',
    175     'P->I','I->P','P->F','F->P','H->R','R->H','R->O','O->R','abc*',]
     175    'P->I','I->P','P->F','F->P','H->R','R->H','R->O','O->R','abc*','setting 1->2']          #don't put any new ones after the setting one!
    176176
    177177# Should SGMessageBox, SymOpDialog, DisAglDialog be moved?
     
    554554                self.Phase['General']['SGData'] = SGData
    555555            else:
    556                 self.Trans = commonTrans[self.Common]
    557                 if 'R' == self.Common[-1]:
    558                     self.newSpGrp += ' r'
    559                     SGErr,SGData = G2spc.SpcGroup(self.newSpGrp)
    560                     self.Phase['General']['SGData'] = SGData
    561                     SGTxt.SetValue(self.newSpGrp)
     556                if self.Common == commonNames[-1]:
     557                    self.Vec = G2spc.spg2origins[self.oldSpGrp]
     558                    self.newSpGrp = self.oldSpGrp
     559                else:
     560                    self.Trans = commonTrans[self.Common]
     561                    if 'R' == self.Common[-1]:
     562                        self.newSpGrp += ' r'
     563                        SGErr,SGData = G2spc.SpcGroup(self.newSpGrp)
     564                        self.Phase['General']['SGData'] = SGData
     565                        SGTxt.SetValue(self.newSpGrp)
    562566            OnTest(event)
    563567       
     
    622626        commonSizer = wx.BoxSizer(wx.HORIZONTAL)
    623627        commonSizer.Add(wx.StaticText(self.panel,label=' Common transformations: '),0,WACV)
    624         common = wx.ComboBox(self.panel,value=self.Common,choices=commonNames,
    625             style=wx.CB_READONLY|wx.CB_DROPDOWN)
     628        if self.oldSpGrp not in G2spc.spg2origins:
     629            common = wx.ComboBox(self.panel,value=self.Common,choices=commonNames[-1],
     630                style=wx.CB_READONLY|wx.CB_DROPDOWN)
     631        else:
     632            common = wx.ComboBox(self.panel,value=self.Common,choices=commonNames,
     633                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    626634        common.Bind(wx.EVT_COMBOBOX,OnCommon)
    627635        commonSizer.Add(common,0,WACV)
     
    697705            self.Phase['General']['Name'] += ' %s'%(self.Common)
    698706        self.Phase['General']['Cell'][1:] = G2lat.TransformCell(self.oldCell[:6],self.Trans)           
    699         return self.Phase,self.Trans,self.Vec,self.ifMag,self.ifConstr
     707        return self.Phase,self.Trans,self.Vec,self.ifMag,self.ifConstr,self.Common
    700708
    701709    def OnOk(self,event):
     
    11441152            commonSizer = wx.BoxSizer(wx.HORIZONTAL)
    11451153            commonSizer.Add(wx.StaticText(self.panel,label=' Common transformations: '),0,WACV)
    1146             common = wx.ComboBox(self.panel,value=self.Common,choices=commonNames[:-1], #not the last one!
     1154            common = wx.ComboBox(self.panel,value=self.Common,choices=commonNames[:-2], #not the last two!
    11471155                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    11481156            common.Bind(wx.EVT_COMBOBOX,OnCommon)
Note: See TracChangeset for help on using the changeset viewer.