Changeset 1925 for trunk/GSASIIphsGUI.py
- Timestamp:
- Jul 10, 2015 3:50:10 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r1924 r1925 1537 1537 1538 1538 def OnHydAtomAdd(event): 1539 print "Doesn't do anything yet!"1540 1539 indx = Atoms.GetSelectedRows() 1541 1540 if indx: 1541 DisAglCtls = {} 1542 1542 generalData = data['General'] 1543 1543 if 'DisAglCtls' in generalData: 1544 1544 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) 1546 1550 if dlg.ShowModal() == wx.ID_OK: 1547 1551 DisAglCtls = dlg.GetData() … … 1551 1555 dlg.Destroy() 1552 1556 generalData['DisAglCtls'] = DisAglCtls 1557 cx,ct,cs,cia = generalData['AtomPtrs'] 1553 1558 atomData = data['Atoms'] 1559 AtNames = [atom[ct-1] for atom in atomData] 1554 1560 colLabels = [Atoms.GetColLabelValue(c) for c in range(Atoms.GetNumberCols())] 1561 Neigh = [] 1555 1562 for ind in indx: 1556 1563 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) 1557 1580 1558 1581 def OnAtomMove(event):
Note: See TracChangeset
for help on using the changeset viewer.