Changeset 5303 for trunk


Ignore:
Timestamp:
Jun 16, 2022 1:28:02 PM (3 years ago)
Author:
toby
Message:

export peaks to PreDICT

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASIIdataGUI.py

    r5301 r5303  
    64696469       
    64706470        # PWDR / Index Peak List
    6471         G2G.Define_wxId('wxID_INDXRELOAD','wxID_INDEXSAVE',)
     6471        G2G.Define_wxId('wxID_INDXRELOAD','wxID_INDEXSAVE','wxID_INDEXEXPORTDICVOL')
    64726472        self.IndPeaksMenu = wx.MenuBar()
    64736473        self.PrefillDataMenu(self.IndPeaksMenu)
     
    64766476        self.IndPeaksEdit.Append(G2G.wxID_INDXRELOAD,'Load/Reload','Load/Reload index peaks from peak list')
    64776477        self.IndPeaksEdit.Append(G2G.wxID_INDEXSAVE,'Save','Save index peaks to CSV file')
     6478        self.IndPeaksEdit.Append(G2G.wxID_INDEXEXPORTDICVOL,'Export to PreDICT','Export index peaks to PreDICT (.csv)')
    64786479        self.PostfillDataMenu()
    64796480       
  • TabularUnified trunk/GSASIIpwdGUI.py

    r5301 r5303  
    32763276            dlg.Destroy()
    32773277       
     3278    def OnExportPreDICT(event):
     3279        'Place 2theta positions from Index Peak List into clipboard for cut-&-paste'
     3280        if wx.TheClipboard.Open():
     3281            txt = ''
     3282            c = 0
     3283            for refl in data[0]:
     3284                if refl[2]:
     3285                    c += 1
     3286                    txt += '{}\n'.format(refl[0])
     3287            wx.TheClipboard.SetData(wx.TextDataObject(txt))
     3288            wx.TheClipboard.Close()
     3289        else:
     3290            G2frame.ErrorDialog('Clipboard locked','Sorry, unable to access the clipboard, try again later. You might need to restart GSAS-II or reboot')
     3291            return
     3292        G2G.G2MessageBox(G2frame,
     3293                '{} reflection positions placed in clipboard. '.format(c)+
     3294                'In PreDICT open the DICVOL input. Update the number of '
     3295                'reflections (& wavelength if needed) in GUI. Then'
     3296                '  use paste to replace the reflections '
     3297                '(starting at line 6...) in the DICVOL input.',
     3298                'DICVOL input generated')
     3299
    32783300    def KeyEditPickGrid(event):
    32793301        colList = G2frame.indxPeaks.GetSelectedCols()
     
    33013323        G2frame.Bind(wx.EVT_MENU, OnReload, id=G2G.wxID_INDXRELOAD)
    33023324        G2frame.Bind(wx.EVT_MENU, OnSave, id=G2G.wxID_INDEXSAVE)
     3325        G2frame.Bind(wx.EVT_MENU, OnExportPreDICT, id=G2G.wxID_INDEXEXPORTDICVOL)
    33033326    G2frame.dataWindow.IndexPeaks.Enable(False)
    33043327    G2frame.IndexPeaksTable = []
Note: See TracChangeset for help on using the changeset viewer.