Changeset 4468 for trunk


Ignore:
Timestamp:
Jun 6, 2020 3:52:50 PM (3 years ago)
Author:
toby
Message:

add status msg on Shift-Click atom selection; error message with RB locate problems

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r4464 r4468  
    98329832            rbId = rbObj['RBId']
    98339833            rbAtmTypes = RBData[rbType][rbId]['rbTypes']
     9834            atomData = data['Atoms']
    98349835            if 'atNames' in RBData[rbType][rbId]:
    98359836                rbAtmLbs = RBData[rbType][rbId]['atNames']
     
    98399840            newXYZ = G2mth.UpdateRBXYZ(Bmat,rbObj,RBData,rbType)[0]
    98409841            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 []
    98419849            # remove assigned atoms from search groups
    98429850            for i in selDict:
     
    98779885                        if min(dist) == 100:
    98789886                            print('no atom matches, how could this happen?')
    9879                             GSASIIpath.IPyBreak()
    9880                             return
     9887                            if GSASIIpath.GetConfigValue('debug'): GSASIIpath.IPyBreak()
     9888                            return []
    98819889                Ids.append(atomData[pid][-1])
    98829890                matchTable.append([t , lbl] + list(xyz) + [pid, atomData[pid][0]]
     
    1015110159                mainSizer.Add(wx.StaticText(RigidBodies,wx.ID_ANY,'No side chain torsions'),0,WACV)
    1015210160            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)
    1015510170            CancelBtn = wx.Button(RigidBodies,wx.ID_ANY,'Cancel')
    1015610171            CancelBtn.Bind(wx.EVT_BUTTON, OnCancel)
    1015710172            btnSizer = wx.BoxSizer(wx.HORIZONTAL)
    1015810173            btnSizer.Add((20,20),1)
    10159             btnSizer.Add(OkBtn)
     10174            if OkBtn: btnSizer.Add(OkBtn)
    1016010175            btnSizer.Add(CancelBtn)
    1016110176            btnSizer.Add((20,20),1)
     
    1016410179            SetPhaseWindow(RigidBodies,mainSizer)
    1016510180           
     10181            if not matchTable:
     10182                mainSizer.Layout()
     10183                RigidBodies.SetScrollRate(10,10)
     10184                RigidBodies.SendSizeEvent()
     10185                RigidBodies.Scroll(0,0)
     10186                return
    1016610187            G2plt.PlotStructure(G2frame,data,True,UpdateTable)
    1016710188            colLabels = ['RB\ntype','phase\n#','phase\nlabel','delta, A','Assign as atom']
  • trunk/GSASIIplot.py

    r4467 r4468  
    82058205                    except:
    82068206                        SetSelectedAtoms(i,Add)
     8207                        G2frame.G2plotNB.status.SetStatusText(
     8208                            '  Selected peak/atom: {}'.format(peak[0]),1)
    82078209            return
    82088210        elif G2frame.phaseDisplay.GetPageText(getSelection()) == 'Draw Atoms':
    82098211            atomList = drawAtoms
    82108212            cx = G2phG.getAtomPtrs(data,True)[0]
     8213            sympt = cx+3
    82118214        else:
    82128215            atomList = data['Atoms']
    82138216            cx = G2phG.getAtomPtrs(data)[0]
     8217            sympt = None
    82148218        for i,atom in enumerate(atomList):
    82158219            x,y,z = atom[cx:cx+3]
     
    82258229                except:
    82268230                    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
    82278237                                       
    82288238    def OnMouseDown(event):
Note: See TracChangeset for help on using the changeset viewer.