Changeset 1688 for trunk/GSASIIgrid.py


Ignore:
Timestamp:
Mar 3, 2015 3:01:18 PM (7 years ago)
Author:
toby
Message:

allow non-identical sequential refinement when copynext is not used (still bugs on table display); implement tutorial downloads

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r1673 r1688  
    134134] = [wx.NewId() for item in range(10)]
    135135
    136 [ wxID_RENAMESEQSEL,wxID_SAVESEQSEL,wxID_SAVESEQSELCSV,wxID_PLOTSEQSEL,wxID_ORGSEQSEL,
    137   wxADDSEQVAR,wxDELSEQVAR,wxEDITSEQVAR,wxCOPYPARFIT,
     136[ wxID_RENAMESEQSEL,wxID_SAVESEQSEL,wxID_SAVESEQSELCSV,wxID_SAVESEQCSV,wxID_PLOTSEQSEL,
     137  wxID_ORGSEQSEL,wxADDSEQVAR,wxDELSEQVAR,wxEDITSEQVAR,wxCOPYPARFIT,
    138138  wxADDPARFIT,wxDELPARFIT,wxEDITPARFIT,wxDOPARFIT,
    139 ] = [wx.NewId() for item in range(13)]
     139] = [wx.NewId() for item in range(14)]
    140140
    141141[ wxID_MODELCOPY,wxID_MODELFIT,wxID_MODELADD,wxID_ELEMENTADD,wxID_ELEMENTDELETE,
     
    15761576        self.SequentialFile.Append(id=wxID_SAVESEQSEL, kind=wx.ITEM_NORMAL,text='Save selected as text',
    15771577            help='Save selected sequential refinement results as a text file')
     1578        self.SequentialFile.Append(id=wxID_SAVESEQCSV, kind=wx.ITEM_NORMAL,text='Save all as CSV',
     1579            help='Save all sequential refinement results as a CSV spreadsheet file')
    15781580        self.SequentialFile.Append(id=wxID_SAVESEQSELCSV, kind=wx.ITEM_NORMAL,text='Save selected as CSV',
    15791581            help='Save selected sequential refinement results as a CSV spreadsheet file')
     
    28802882        OnSaveSelSeq(event,csv=True)
    28812883       
    2882     def OnSaveSelSeq(event,csv=False):
    2883         'export the selected columns to a .txt file from menu command'
     2884    def OnSaveSeqCSV(event):
     2885        'export all columns to a .csv file from menu command'
     2886        OnSaveSelSeq(event,csv=True,allcols=True)
     2887       
     2888    def OnSaveSelSeq(event,csv=False,allcols=False):
     2889        'export the selected columns to a .txt or .csv file from menu command'
    28842890        def WriteCSV():
    28852891            def WriteList(headerItems):
     
    28922898            for col in cols:
    28932899                item = G2frame.SeqTable.GetColLabelValue(col)
     2900                # get rid of labels that have Unicode characters
     2901                if not all([ord(c) < 128 and ord(c) != 0 for c in item]): item = '?'
    28942902                if col in havesig:
    28952903                    head += [item,'esd-'+item]
     
    29252933
    29262934        # start of OnSaveSelSeq code
    2927         cols = sorted(G2frame.dataDisplay.GetSelectedCols()) # ignore selection order
     2935        if allcols:
     2936            cols = range(G2frame.SeqTable.GetNumberCols())
     2937        else:
     2938            cols = sorted(G2frame.dataDisplay.GetSelectedCols()) # ignore selection order
    29282939        nrows = G2frame.SeqTable.GetNumberRows()
    29292940        if not cols:
     
    34833494    G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveSelSeq, id=wxID_SAVESEQSEL)
    34843495    G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveSelSeqCSV, id=wxID_SAVESEQSELCSV)
     3496    G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveSeqCSV, id=wxID_SAVESEQCSV)
    34853497    G2frame.dataFrame.Bind(wx.EVT_MENU, OnPlotSelSeq, id=wxID_PLOTSEQSEL)
    34863498    G2frame.dataFrame.Bind(wx.EVT_MENU, OnReOrgSelSeq, id=wxID_ORGSEQSEL)
     
    37153727    )
    37163728    name = histNames[0]
    3717    
     3729
     3730    #******************************************************************************
     3731    # this does not work for refinements that have differing numbers of variables.
     3732    #raise Exception
    37183733    indepVarDict = {     #  values in table w/o ESDs
    37193734        var:colList[i][0] for i,var in enumerate(colLabels) if colSigs[i] is None
     
    37263741    # add recip cell coeff. values
    37273742    depVarDict.update({var:val for var,val in data[name].get('newCellDict',{}).values()})
    3728    
     3743
    37293744    G2frame.dataDisplay = GSGrid(parent=G2frame.dataFrame)
    37303745    G2frame.SeqTable = Table(
Note: See TracChangeset for help on using the changeset viewer.