- Timestamp:
- Jun 6, 2020 3:52:50 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r4464 r4468 9832 9832 rbId = rbObj['RBId'] 9833 9833 rbAtmTypes = RBData[rbType][rbId]['rbTypes'] 9834 atomData = data['Atoms'] 9834 9835 if 'atNames' in RBData[rbType][rbId]: 9835 9836 rbAtmLbs = RBData[rbType][rbId]['atNames'] … … 9839 9840 newXYZ = G2mth.UpdateRBXYZ(Bmat,rbObj,RBData,rbType)[0] 9840 9841 atmTypes = [atomData[i][ct] for i in range(len(atomData))] 9842 notfound = [] 9843 for t in rbAtmTypes: 9844 if t not in atmTypes and t not in notfound: 9845 notfound.append(t) 9846 if notfound: 9847 print('Rigid body atom type(s) not in structure',notfound) 9848 return [] 9841 9849 # remove assigned atoms from search groups 9842 9850 for i in selDict: … … 9877 9885 if min(dist) == 100: 9878 9886 print('no atom matches, how could this happen?') 9879 GSASIIpath.IPyBreak()9880 return 9887 if GSASIIpath.GetConfigValue('debug'): GSASIIpath.IPyBreak() 9888 return [] 9881 9889 Ids.append(atomData[pid][-1]) 9882 9890 matchTable.append([t , lbl] + list(xyz) + [pid, atomData[pid][0]] … … 10151 10159 mainSizer.Add(wx.StaticText(RigidBodies,wx.ID_ANY,'No side chain torsions'),0,WACV) 10152 10160 matchTable = assignAtoms() 10153 OkBtn = wx.Button(RigidBodies,wx.ID_ANY,"Add") 10154 OkBtn.Bind(wx.EVT_BUTTON, OnOk) 10161 if not matchTable: 10162 OkBtn = None 10163 mainSizer.Add((15,15)) 10164 mainSizer.Add(wx.StaticText(RigidBodies,wx.ID_ANY, 10165 'Error: unable to match atoms in rigid body to structure (see console window)'), 10166 0,WACV) 10167 else: 10168 OkBtn = wx.Button(RigidBodies,wx.ID_ANY,"Add") 10169 OkBtn.Bind(wx.EVT_BUTTON, OnOk) 10155 10170 CancelBtn = wx.Button(RigidBodies,wx.ID_ANY,'Cancel') 10156 10171 CancelBtn.Bind(wx.EVT_BUTTON, OnCancel) 10157 10172 btnSizer = wx.BoxSizer(wx.HORIZONTAL) 10158 10173 btnSizer.Add((20,20),1) 10159 btnSizer.Add(OkBtn)10174 if OkBtn: btnSizer.Add(OkBtn) 10160 10175 btnSizer.Add(CancelBtn) 10161 10176 btnSizer.Add((20,20),1) … … 10164 10179 SetPhaseWindow(RigidBodies,mainSizer) 10165 10180 10181 if not matchTable: 10182 mainSizer.Layout() 10183 RigidBodies.SetScrollRate(10,10) 10184 RigidBodies.SendSizeEvent() 10185 RigidBodies.Scroll(0,0) 10186 return 10166 10187 G2plt.PlotStructure(G2frame,data,True,UpdateTable) 10167 10188 colLabels = ['RB\ntype','phase\n#','phase\nlabel','delta, A','Assign as atom'] -
trunk/GSASIIplot.py
r4467 r4468 8205 8205 except: 8206 8206 SetSelectedAtoms(i,Add) 8207 G2frame.G2plotNB.status.SetStatusText( 8208 ' Selected peak/atom: {}'.format(peak[0]),1) 8207 8209 return 8208 8210 elif G2frame.phaseDisplay.GetPageText(getSelection()) == 'Draw Atoms': 8209 8211 atomList = drawAtoms 8210 8212 cx = G2phG.getAtomPtrs(data,True)[0] 8213 sympt = cx+3 8211 8214 else: 8212 8215 atomList = data['Atoms'] 8213 8216 cx = G2phG.getAtomPtrs(data)[0] 8217 sympt = None 8214 8218 for i,atom in enumerate(atomList): 8215 8219 x,y,z = atom[cx:cx+3] … … 8225 8229 except: 8226 8230 SetSelectedAtoms(i,Add) 8231 lbl = atom[0] 8232 if sympt: 8233 lbl += ' ' + atom[sympt] 8234 G2frame.G2plotNB.status.SetStatusText( 8235 ' Selected atom: {}'.format(lbl),1) 8236 return 8227 8237 8228 8238 def OnMouseDown(event):
Note: See TracChangeset
for help on using the changeset viewer.