Changeset 4521 for trunk/testDeriv.py


Ignore:
Timestamp:
Jul 15, 2020 3:08:04 PM (15 months ago)
Author:
vondreele
Message:

complete pink Rietveld refinement
fix problem with weights
enhance testDeriv
put new pink parms in parm dictionary
fix problem with Instrument parm display after load

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/testDeriv.py

    r4213 r4521  
    5252    return testDeriv(parent)
    5353   
    54 [wxID_FILEEXIT, wxID_FILEOPEN, wxID_MAKEPLOTS, wxID_CLEARSEL,
    55 ] = [wx.NewId() for _init_coll_File_Items in range(4)]
     54[wxID_FILEEXIT, wxID_FILEOPEN, wxID_MAKEPLOTS, wxID_CLEARSEL,wxID_SELECTALL,
     55] = [wx.NewId() for _init_coll_File_Items in range(5)]
    5656
    5757def FileDlgFixExt(dlg,file):            #this is needed to fix a problem in linux wx.FileDialog
     
    7070        self.File.Append(wxID_FILEOPEN,'Open testDeriv file','Open testDeriv')
    7171        self.File.Append(wxID_MAKEPLOTS,'Make plots','Make derivative plots')
     72        self.File.Append(wxID_SELECTALL,'Select all')
    7273        self.File.Append(wxID_CLEARSEL,'Clear selections')
    7374        self.File.Append(wxID_FILEEXIT,'Exit','Exit from testDeriv')
     
    7576        self.Bind(wx.EVT_MENU,self.OnMakePlots,id=wxID_MAKEPLOTS)
    7677        self.Bind(wx.EVT_MENU,self.ClearSelect,id=wxID_CLEARSEL)
     78        self.Bind(wx.EVT_MENU,self.SelectAll,id=wxID_SELECTALL)
    7779        self.Bind(wx.EVT_MENU,self.OnFileExit, id=wxID_FILEEXIT)
    7880        self.testDerivMenu.Append(menu=self.File, title='File')
     
    106108        self.Close()
    107109       
     110    def SelectAll(self,event):
     111        self.use = [True for name in self.names]
     112        for i,name in enumerate(self.names):
     113            if 'Back' in name:
     114                self.use[i] = False
     115        self.UpdateControls(event)
     116       
    108117    def ClearSelect(self,event):
    109118        self.use = [False for i in range(len(self.names))]
     
    126135    def TestRead(self):
    127136        file = open(self.testFile,'rb')
    128         if '2' in platform.python_version_tuple()[0]:
    129             self.values = cPickle.load(file)
    130             self.HistoPhases = cPickle.load(file)
    131             (self.constrDict,self.fixedList,self.depVarList) = cPickle.load(file)
    132             self.parmDict = cPickle.load(file)
    133             self.varylist = cPickle.load(file)
    134             self.calcControls = cPickle.load(file)
    135             self.pawleyLookup = cPickle.load(file)
    136         else:
    137             self.values = cPickle.load(file,encoding='Latin-1')
    138             self.HistoPhases = cPickle.load(file,encoding='Latin-1')
    139             (self.constrDict,self.fixedList,self.depVarList) = cPickle.load(file,encoding='Latin-1')
    140             self.parmDict = cPickle.load(file,encoding='Latin-1')
    141             self.varylist = cPickle.load(file,encoding='Latin-1')
    142             self.calcControls = cPickle.load(file,encoding='Latin-1')
    143             self.pawleyLookup = cPickle.load(file,encoding='Latin-1')
     137        self.values = cPickle.load(file,encoding='Latin-1')
     138        self.HistoPhases = cPickle.load(file,encoding='Latin-1')
     139        (self.constrDict,self.fixedList,self.depVarList) = cPickle.load(file,encoding='Latin-1')
     140        self.parmDict = cPickle.load(file,encoding='Latin-1')
     141        self.varylist = cPickle.load(file,encoding='Latin-1')
     142        self.calcControls = cPickle.load(file,encoding='Latin-1')
     143        self.pawleyLookup = cPickle.load(file,encoding='Latin-1')
    144144        self.names = self.varylist+self.depVarList
    145145        self.use = [False for i in range(len(self.names))]
Note: See TracChangeset for help on using the changeset viewer.