Changeset 1925 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Jul 10, 2015 3:50:10 PM (8 years ago)
Author:
vondreele
Message:

create AddHatomDialog? & work on OnHydAtomAdd?
allow reading of .cor images made at APS 1ID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r1924 r1925  
    15371537       
    15381538    def OnHydAtomAdd(event):
    1539         print "Doesn't do anything yet!"
    15401539        indx = Atoms.GetSelectedRows()
    15411540        if indx:
     1541            DisAglCtls = {}
    15421542            generalData = data['General']
    15431543            if 'DisAglCtls' in generalData:
    15441544                DisAglCtls = generalData['DisAglCtls']
    1545             dlg = G2gd.DisAglDialog(G2frame,DisAglCtls,generalData)
     1545                if 'H' not in DisAglCtls['AtomTypes']:
     1546                    DisAglCtls['AtomTypes'].append('H')
     1547                    DisAglCtls['AngleRadii'].append(0.5)
     1548                    DisAglCtls['BondRadii'].append(0.5)
     1549            dlg = G2gd.DisAglDialog(G2frame,DisAglCtls,generalData,Reset=False)
    15461550            if dlg.ShowModal() == wx.ID_OK:
    15471551                DisAglCtls = dlg.GetData()
     
    15511555            dlg.Destroy()
    15521556            generalData['DisAglCtls'] = DisAglCtls
     1557            cx,ct,cs,cia = generalData['AtomPtrs']
    15531558            atomData = data['Atoms']
     1559            AtNames = [atom[ct-1] for atom in atomData]
    15541560            colLabels = [Atoms.GetColLabelValue(c) for c in range(Atoms.GetNumberCols())]
     1561            Neigh = []
    15551562            for ind in indx:
    15561563                atom = atomData[ind]
     1564                if atom[ct] not in ['C','N','O']:
     1565                    continue
     1566                neigh = [atom[ct-1],G2mth.FindNeighbors(data,atom[ct-1],AtNames),0]
     1567                if len(neigh[1]) > 3 or (atom[ct] == 'O' and len(neigh[1]) > 1):
     1568                    continue
     1569                Neigh.append(neigh)
     1570            if Neigh:
     1571                dlg = G2gd.AddHatomDialog(G2frame,Neigh,data)
     1572                if dlg.ShowModal() == wx.ID_OK:
     1573                    Neigh = dlg.GetData()
     1574                    for neigh in Neigh:
     1575                        print neigh
     1576                   
     1577                dlg.Destroy()
     1578            else:
     1579                wx.MessageBox('No candidates found',caption='Add H atom Error',style=wx.ICON_EXCLAMATION)
    15571580       
    15581581    def OnAtomMove(event):
Note: See TracChangeset for help on using the changeset viewer.