Changeset 4041


Ignore:
Timestamp:
Jun 26, 2019 11:12:23 AM (4 years ago)
Author:
vondreele
Message:

fix issues with rigid body GUI controls - mostly proper assignment of rbId

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r4020 r4041  
    17301730            print ('Rigid body UNKRB added')
    17311731        text.close()
    1732         UpdateResidueRB(rbId)
     1732        UpdateResidueRB()
    17331733       
    17341734    def FindNeighbors(Orig,XYZ,atTypes,atNames,AtInfo):
     
    17961796            rbData['rbSeq'].append([Orig,Piv,0.0,Riding])           
    17971797        dlg.Destroy()
    1798         UpdateResidueRB(rbId)
     1798        UpdateResidueRB()
    17991799
    18001800    def UpdateVectorRB(Scroll=0):
     
    20112011        VectorRB.Scroll(0,Scroll)
    20122012       
    2013     def UpdateResidueRB(rbId=0):
     2013    def UpdateResidueRB():
    20142014        '''Draw the contents of the Residue Rigid Body tab for Rigid Bodies tree entry
    20152015        '''
     2016        global rbId
    20162017        def rbNameSizer(rbId,rbData):
    20172018
     
    20192020                Obj = event.GetEventObject()
    20202021                rbData['RBname'] = Obj.GetValue()
    2021                 wx.CallAfter(UpdateResidueRB,rbId)
     2022                wx.CallAfter(UpdateResidueRB)
    20222023               
    20232024            def OnDelRB(event):
     
    20452046                    rbData['rbXYZ'] = newXYZ
    20462047                G2plt.PlotRigidBody(G2frame,'Residue',AtInfo,rbData,plotDefaults)
    2047                 wx.CallAfter(UpdateResidueRB,rbId)
     2048                wx.CallAfter(UpdateResidueRB)
    20482049                   
    20492050            def OnPlotRB(event):
     
    22262227                rbId,Seq = Indx[Obj.GetId()]
    22272228                data['Residue'][rbId]['rbSeq'].remove(Seq)       
    2228                 wx.CallAfter(UpdateResidueRB,rbId)
     2229                wx.CallAfter(UpdateResidueRB)
    22292230           
    22302231            seqSizer = wx.FlexGridSizer(0,5,2,2)
     
    22992300               
    23002301        def OnSelect(event):
     2302            global rbId
    23012303            rbname = rbchoice[select.GetSelection()]
    23022304            rbId = RBnames[rbname]
    2303             wx.CallLater(100,UpdateResidueRB,rbId)
     2305            wx.CallLater(100,UpdateResidueRB)
    23042306           
    23052307        #----- beginning of UpdateResidueRB -----------------------------------------------
     
    23332335            selSizer.Add(select,0)
    23342336            ResidueRBSizer.Add(selSizer,0)
    2335         if not rbId:
     2337        try:
     2338            if not rbId:
     2339                rbId = RBnames[rbchoice[0]]
     2340        except NameError:
    23362341            rbId = RBnames[rbchoice[0]]
    23372342        rbData = data['Residue'][rbId]
Note: See TracChangeset for help on using the changeset viewer.