Changeset 2692


Ignore:
Timestamp:
Feb 4, 2017 5:54:36 PM (5 years ago)
Author:
toby
Message:

don't allow duplicate PDF entries; PWDR and PDF names must match.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimgGUI.py

    r2690 r2692  
    29152915                PDFnames = G2gd.GetPatternTreeDataNames(G2frame,['PDF ',])
    29162916                PDFid = G2obj.CreatePDFitems(G2frame,pwdr,ElList.copy(),Qlimits,PDFnames)
     2917                if not PDFid: continue
    29172918                PDFdata = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(
    29182919                    G2frame,PDFid, 'PDF Controls'))
  • trunk/GSASIIobj.py

    r2688 r2692  
    20972097    :returns: the Id of the newly created PDF entry
    20982098    '''
    2099     PDFname = 'PDF '+PWDRtree[4:] # this places two spaces after PDF which is needed is some places
    2100     PDFname = MakeUniqueLabel(PDFname,PDFnames)
     2099    PDFname = 'PDF '+PWDRtree[4:] # this places two spaces after PDF, which is needed is some places
     2100    if PDFname in PDFnames:
     2101        print('Skipping, entry already exists: '+PDFname)
     2102        return None
     2103    #PDFname = MakeUniqueLabel(PDFname,PDFnames)
    21012104    Id = G2frame.PatternTree.AppendItem(parent=G2frame.root,text=PDFname)
    21022105    Data = {
  • trunk/GSASIIpwdGUI.py

    r2689 r2692  
    52215221    powName = 'PWDR'+dataFile[4:]
    52225222    powId = G2gd.GetPatternTreeItemId(G2frame,G2frame.root, powName)
     5223    if not powId: # skip if no matching PWDR entry
     5224        G2G.G2MessageBox(G2frame,'matching PWDR record not found. PDF can not be used.')
     5225        return
    52235226    fullLimits,limits = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,powId, 'Limits'))[:2]
    52245227    inst = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,powId, 'Instrument Parameters'))[0]
Note: See TracChangeset for help on using the changeset viewer.