Changeset 2870


Ignore:
Timestamp:
Jun 19, 2017 4:30:36 PM (4 years ago)
Author:
toby
Message:

Allow hiding of columns in Seq Table

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2863 r2870  
    26542654        self.lastTreeSetting = []
    26552655        self.ExpandingAll = False
     2656        self.SeqTblHideList = []
    26562657               
    26572658        arg = sys.argv
     
    42794280            finally:
    42804281                dlg.Destroy()
     4282            self.SeqTblHideList = []
    42814283        else:
    42824284            self.ErrorDialog('Sequential refinement error',Msg)
  • trunk/GSASIIgrid.py

    r2867 r2870  
    139139[ wxID_RENAMESEQSEL,wxID_SAVESEQSEL,wxID_SAVESEQSELCSV,wxID_SAVESEQCSV,wxID_PLOTSEQSEL,
    140140  wxID_ORGSEQSEL,wxADDSEQVAR,wxDELSEQVAR,wxEDITSEQVAR,wxCOPYPARFIT,wxID_AVESEQSEL,
    141   wxADDPARFIT,wxDELPARFIT,wxEDITPARFIT,wxDOPARFIT,wxADDSEQDIST,wxADDSEQANGLE
    142 ] = [wx.NewId() for item in range(17)]
     141  wxADDPARFIT,wxDELPARFIT,wxEDITPARFIT,wxDOPARFIT,wxADDSEQDIST,wxADDSEQANGLE,wxID_ORGSEQINC,
     142] = [wx.NewId() for item in range(18)]
    143143
    144144[ wxID_MODELCOPY,wxID_MODELFIT,wxID_MODELADD,wxID_ELEMENTADD,wxID_ELEMENTDELETE,
     
    17751775        self.SequentialFile.Append(id=wxID_AVESEQSEL, kind=wx.ITEM_NORMAL,text='Compute average',
    17761776            help='Compute average for selected parameter')           
    1777         self.SequentialFile.Append(id=wxID_ORGSEQSEL, kind=wx.ITEM_NORMAL,text='Reorganize',
    1778             help='Reorganize variables where variables change')
     1777#        self.SequentialFile.Append(id=wxID_ORGSEQSEL, kind=wx.ITEM_NORMAL,text='Reorganize',
     1778#            help='Reorganize variables where variables change')
     1779        self.SequentialFile.Append(id=wxID_ORGSEQINC, kind=wx.ITEM_NORMAL,text='Hide columns...',
     1780            help='Select columns to remove from displayed table')
    17791781        self.SequentialPvars = wx.Menu(title='')
    17801782        self.SequentialMenu.Append(menu=self.SequentialPvars, title='Pseudo Vars')
     
    30893091           
    30903092    def OnReOrgSelSeq(event):
    3091         'Reorder the columns'
     3093        'Reorder the columns -- probably not fully implemented'
    30923094        G2G.GetItemOrder(G2frame,VaryListChanges,vallookup,posdict)   
    30933095        UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables
     
    37063708            print('Error: Id not found. This should not happen!')
    37073709        G2IO.ExportSequential(G2frame,data,*vals)
     3710
     3711    def onSelectSeqVars(event):
     3712        '''Select which variables will be shown in table'''
     3713        dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Select columns to hide',
     3714                'Hide columns',colLabels[1:])
     3715        if dlg.ShowModal() == wx.ID_OK:
     3716            G2frame.SeqTblHideList = [colLabels[1:][sel] for sel in dlg.GetSelections()]
     3717            dlg.Destroy()
     3718            UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables
     3719        else:
     3720            dlg.Destroy()
    37083721   
    37093722    #def GridRowLblToolTip(row): return 'Row ='+str(row)
     
    38073820    G2frame.dataFrame.Bind(wx.EVT_MENU, OnPlotSelSeq, id=wxID_PLOTSEQSEL)
    38083821    G2frame.dataFrame.Bind(wx.EVT_MENU, OnAveSelSeq, id=wxID_AVESEQSEL)
    3809     G2frame.dataFrame.Bind(wx.EVT_MENU, OnReOrgSelSeq, id=wxID_ORGSEQSEL)
     3822    #G2frame.dataFrame.Bind(wx.EVT_MENU, OnReOrgSelSeq, id=wxID_ORGSEQSEL)
     3823    G2frame.dataFrame.Bind(wx.EVT_MENU, onSelectSeqVars, id=wxID_ORGSEQINC)
    38103824    G2frame.dataFrame.Bind(wx.EVT_MENU, AddNewPseudoVar, id=wxADDSEQVAR)
    38113825    G2frame.dataFrame.Bind(wx.EVT_MENU, AddNewDistPseudoVar, id=wxADDSEQDIST)
     
    38663880    if missing:
    38673881        print ' Warning: Total of %d data sets missing from sequential results'%(missing)
    3868     if len(VaryListChanges) > 1:
    3869         G2frame.dataFrame.SequentialFile.Enable(wxID_ORGSEQSEL,True)
    3870     else:
    3871         G2frame.dataFrame.SequentialFile.Enable(wxID_ORGSEQSEL,False)
     3882    #if len(VaryListChanges) > 1:
     3883    #    G2frame.dataFrame.SequentialFile.Enable(wxID_ORGSEQSEL,True)
     3884    #else:
     3885    #    G2frame.dataFrame.SequentialFile.Enable(wxID_ORGSEQSEL,False)
    38723886    #-----------------------------------------------------------------------------------
    38733887    # build up the data table by columns -----------------------------------------------
     
    41254139    # add recip cell coeff. values
    41264140    VarDict.update({var:val for var,val in newCellDict.values()})
     4141
     4142    # remove items to be hidden from table
     4143    for l in reversed(range(len(colLabels))):
     4144        if colLabels[l] in G2frame.SeqTblHideList:
     4145            del colLabels[l]
     4146            del G2frame.colList[l]
     4147            del G2frame.colSigs[l]
    41274148
    41284149    G2frame.dataFrame.currentGrids = []
Note: See TracChangeset for help on using the changeset viewer.