Changeset 2298


Ignore:
Timestamp:
May 27, 2016 2:48:22 PM (6 years ago)
Author:
vondreele
Message:

Add stubs for BondDialog? & AngleDialog? for adding these to Seq results table
Add menu items for above
fix a bug in showing seq results
revert the occurrence counter for image integrations
capture bad pids in OnPageChanged?

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r2297 r2298  
    902902                    nOcc += 1
    903903                item, cookie = G2frame.PatternTree.GetNextChild(G2frame.root, cookie)
    904             Aname += '(%3d)'%(nOcc)
     904            if nOcc:
     905                Aname += '(%d)'%(nOcc)
    905906        Sample = G2pdG.SetDefaultSample()
    906907        Sample['Gonio. radius'] = data['distance']
  • trunk/GSASIIexprGUI.py

    r1770 r2298  
    676676        self.OKbtn.Enable()
    677677        if self.ExtraBtn: self.ExtraBtn.Enable()
     678           
     679#==========================================================================
     680#class BondDialog(wx.Dialog):
     681    '''A wx.Dialog that allows a user to select a bond length to be evaluated.
     682    What needs to be done here? Need phase info for atoms
     683    0. Select phase
     684    1. Select 1st atom from dialog
     685    2. Find neighbors & select one from dialog
     686    3. Set up distance equation & save it - has to look like result from Show in above ExpressionDialog       
     687    Use existing bond & esd calculate routines
     688    '''
     689#==========================================================================
     690#class AngleDialog(wx.Dialog):
     691    '''A wx.Dialog that allows a user to select a bond angle to be evaluated.
     692    What needs to be done here? Need phase info for atom
     693    0. Select phase
     694    1. Select 1st atom from dialog
     695    2. Find neighbors & select two from dialog
     696    3. Set up angle equation & save it - has to look like result from Show in above ExpressionDialog       
     697    Use existing angle & esd calculate routines
     698    '''
    678699       
    679700if __name__ == "__main__":
  • trunk/GSASIIgrid.py

    r2272 r2298  
    136136[ wxID_RENAMESEQSEL,wxID_SAVESEQSEL,wxID_SAVESEQSELCSV,wxID_SAVESEQCSV,wxID_PLOTSEQSEL,
    137137  wxID_ORGSEQSEL,wxADDSEQVAR,wxDELSEQVAR,wxEDITSEQVAR,wxCOPYPARFIT,wxID_AVESEQSEL,
    138   wxADDPARFIT,wxDELPARFIT,wxEDITPARFIT,wxDOPARFIT,
    139 ] = [wx.NewId() for item in range(15)]
     138  wxADDPARFIT,wxDELPARFIT,wxEDITPARFIT,wxDOPARFIT,wxADDSEQDIST,wxADDSEQANGLE
     139] = [wx.NewId() for item in range(17)]
    140140
    141141[ wxID_MODELCOPY,wxID_MODELFIT,wxID_MODELADD,wxID_ELEMENTADD,wxID_ELEMENTDELETE,
     
    14641464            help='Add a new pseudo-variable')
    14651465        self.SequentialPvars.Append(
     1466            id=wxADDSEQDIST, kind=wx.ITEM_NORMAL,text='Add dist',
     1467            help='Add a new bond distance pseudo-variable')
     1468        self.SequentialPvars.Append(
     1469            id=wxADDSEQANGLE, kind=wx.ITEM_NORMAL,text='Add angle',
     1470            help='Add a new bond angle pseudo-variable')
     1471        self.SequentialPvars.Append(
    14661472            id=wxDELSEQVAR, kind=wx.ITEM_NORMAL,text='Delete',
    14671473            help='Delete an existing pseudo-variable')
     
    27532759            Controls['SeqPseudoVars'][calcobj.eObj.expression] = obj
    27542760            UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables
    2755 
     2761           
     2762    def AddNewDistPseudoVar(event):
     2763        print 'Add bond distance pseudo-variable here - TBD'
     2764#        dlg = G2exG.BondDialog(
     2765#            G2frame.dataDisplay,PSvarDict,
     2766#            header='Select a Bond here',
     2767#            VarLabel = "New Bond",
     2768#            fit=False)
     2769#        obj = dlg.Show(True)
     2770#        dlg.Destroy()
     2771#        if obj:
     2772#            calcobj = G2obj.ExpressionCalcObj(obj)
     2773#            Controls['SeqPseudoVars'][calcobj.eObj.expression] = obj
     2774#            UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables
     2775
     2776    def AddNewAnglePseudoVar(event):
     2777        print 'Add bond angle pseudo-variable here - TBD'
     2778#        dlg = G2exG.AngleDialog(
     2779#            G2frame.dataDisplay,PSvarDict,
     2780#            header='Enter an Angle here',
     2781#            VarLabel = "New Angle",
     2782#            fit=False)
     2783#        obj = dlg.Show(True)
     2784#        dlg.Destroy()
     2785#        if obj:
     2786#            calcobj = G2obj.ExpressionCalcObj(obj)
     2787#            Controls['SeqPseudoVars'][calcobj.eObj.expression] = obj
     2788#            UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables
    27562789    def UpdateParmDict(parmDict):
    27572790        '''generate the atom positions and the direct & reciprocal cell values,
     
    31813214    G2frame.dataFrame.Bind(wx.EVT_MENU, OnReOrgSelSeq, id=wxID_ORGSEQSEL)
    31823215    G2frame.dataFrame.Bind(wx.EVT_MENU, AddNewPseudoVar, id=wxADDSEQVAR)
     3216    G2frame.dataFrame.Bind(wx.EVT_MENU, AddNewDistPseudoVar, id=wxADDSEQDIST)
     3217    G2frame.dataFrame.Bind(wx.EVT_MENU, AddNewAnglePseudoVar, id=wxADDSEQANGLE)
    31833218    G2frame.dataFrame.Bind(wx.EVT_MENU, DelPseudoVar, id=wxDELSEQVAR)
    31843219    G2frame.dataFrame.Bind(wx.EVT_MENU, EditPseudoVar, id=wxEDITSEQVAR)
     
    33823417    # Make dict needed for creating & editing pseudovars (PSvarDict).
    33833418    name = histNames[0]
    3384     parmDict = data[name].get('parmDict')
     3419    parmDict = data[name].get('parmDict',{})
    33853420    PSvarDict = parmDict.copy()
    33863421    PSvarDict.update(sampleParms)
  • trunk/GSASIIplot.py

    r2297 r2298  
    276276            treeItems, tabname = self.treeItem[tabLabel]
    277277            pid = self.G2frame.root
    278             for item in treeItems:
    279                 pid = G2gd.GetPatternTreeItemId(self.G2frame, pid, item)
    280             wx.CallLater(100,self.InvokeTreeItem,pid)
     278            try:
     279                for item in treeItems:
     280                    pid = G2gd.GetPatternTreeItemId(self.G2frame, pid, item)
     281                wx.CallLater(100,self.InvokeTreeItem,pid)
     282            except TypeError:
     283                pass
    281284        else:
    282285            print 'OnPageChanged: not found:',tabLabel
Note: See TracChangeset for help on using the changeset viewer.