Changeset 3855 for trunk/GSASIIdataGUI.py
- Timestamp:
- Mar 15, 2019 7:53:57 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r3848 r3855 3816 3816 else: 3817 3817 pth = '.' 3818 #if GSASIIpath.GetConfigValue('debug'): print('debug: open from '+pth) 3818 3819 dlg = wx.FileDialog(self, 'Choose GSAS-II project file', pth, 3819 3820 wildcard='GSAS-II project file (*.gpx)|*.gpx',style=wx.FD_OPEN) … … 3834 3835 if not filename: 3835 3836 GetGPX() 3837 filename = self.GSASprojectfile 3836 3838 else: 3837 3839 try: … … 3878 3880 self.GPXtree.Expand(Id) 3879 3881 SelectDataTreeItem(self,Id) 3880 # self.GPXtree.SelectItem(Id)3881 3882 elif phaseId: 3882 # self.GPXtree.SelectItem(phaseId)3883 3883 SelectDataTreeItem(self,phaseId) 3884 3884 self.CheckNotebook() … … 4360 4360 if name[:4] in hType: 4361 4361 HistogramNames.append(name) 4362 item, cookie = self.GPXtree.GetNextChild(self.root, cookie) 4363 4362 item, cookie = self.GPXtree.GetNextChild(self.root, cookie) 4364 4363 return HistogramNames 4364 4365 def GetHistogramNamesID(self,hType): 4366 """ Returns a list of histogram names found in the GSASII data tree 4367 and a lookup table of their Id values. Should replace GetHistogramNames 4368 since that will not be much faster (and there may be real speed gains from 4369 caching the Ids rather than keep searching for them). 4370 4371 N.B routine :func:`GSASIIstrIO.GetHistogramNames` also exists to 4372 get same info, but from GPX file. 4373 4374 :param str hType: list of histogram types 4375 :return: list of histogram names and a dict of histogram Ids 4376 keyed by histogram name. 4377 """ 4378 HistogramNames = [] 4379 HistogramIds = {} 4380 if self.GPXtree.GetCount(): 4381 item, cookie = self.GPXtree.GetFirstChild(self.root) 4382 while item: 4383 name = self.GPXtree.GetItemText(item) 4384 if name[:4] in hType: 4385 HistogramNames.append(name) 4386 HistogramIds[name] = item 4387 item, cookie = self.GPXtree.GetNextChild(self.root, cookie) 4388 return HistogramNames,HistogramIds 4365 4389 4366 4390 def GetUsedHistogramsAndPhasesfromTree(self): … … 4381 4405 phaseNames = self.GetPhaseNames() 4382 4406 phaseData = self.GetPhaseData() 4383 histoList = self.GetHistogramNames(['PWDR','HKLF'])4407 histoList,histIdList = self.GetHistogramNamesID(['PWDR','HKLF']) 4384 4408 4385 4409 for phase in phaseData: … … 4394 4418 Phases[phase] = Phase 4395 4419 if hist not in Histograms and Phase['Histograms'][hist]['Use']: 4396 item = GetGPXtreeItemId(self,self.root,hist)4420 item = histIdList[hist] 4397 4421 if item: 4398 4422 if 'PWDR' in hist[:4]: … … 4513 4537 Called from the Calculate/Refine menu. 4514 4538 ''' 4515 G2cnstG.CheckAllScalePhaseFractions(self)4516 4539 if self.testSeqRefineMode(): 4517 4540 self.OnSeqRefine(event) 4518 4541 return 4519 # Id = GetGPXtreeItemId(self,self.root,'Sequential results') 4520 # if Id: 4521 # dlg = wx.MessageDialog( 4522 # self, 4523 # 'Your last refinement was sequential. Continue with "Refine", removing previous sequential results?', 4524 # 'Remove sequential results?',wx.OK|wx.CANCEL) 4525 # if dlg.ShowModal() == wx.ID_OK: 4526 # self.GPXtree.Delete(Id) 4527 # dlg.Destroy() 4528 # else: 4529 # dlg.Destroy() 4530 # return 4542 G2cnstG.CheckAllScalePhaseFractions(self) # can be slow for sequential fits, skip 4531 4543 self.OnFileSave(event) 4532 4544 # check that constraints are OK here … … 4640 4652 def OnSeqRefine(self,event): 4641 4653 '''Perform a sequential refinement. 4642 Called from self.OnRefine (Called from the Calculate/Refine menu) 4643 4644 temporarily called from the Calculate/Sequential refine menu (to be removed) 4654 Called from self.OnRefine (Which is called from the Calculate/Refine menu) 4645 4655 ''' 4646 4656 seqList = self.testSeqRefineMode()
Note: See TracChangeset
for help on using the changeset viewer.