Changeset 6bbeacd4 in sasview for sansview/perspectives/fitting/simfitpage.py
- Timestamp:
- Feb 28, 2011 4:04:10 PM (14 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- a07e72f
- Parents:
- 1584fff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/simfitpage.py
r4ce74917 r6bbeacd4 50 50 ##Font size 51 51 self.SetWindowVariant(variant = FONT_VARIANT) 52 52 self.id = None 53 53 self.parent = parent 54 54 ## store page_finder 55 55 self.page_finder = page_finder 56 56 ## list contaning info to set constraint 57 ## look like self.constraint_dict[page ]= page57 ## look like self.constraint_dict[page_id]= page 58 58 self.constraint_dict={} 59 59 ## item list self.constraints_list=[combobox1, combobox2,=,textcrtl, button ] … … 135 135 self._set_constraint() 136 136 ## get the fit range of very fit problem 137 for page, value in self.page_finder.iteritems():138 qmin, qmax= page.get_range()137 for id, value in self.page_finder.iteritems(): 138 qmin, qmax= self.page_finder[id].get_range() 139 139 value.set_range(qmin, qmax) 140 140 ## model was actually selected from this page to be fit … … 162 162 check all models names 163 163 """ 164 self.model_toFit =[]165 if self.cb1.GetValue()== True:164 self.model_toFit = [] 165 if self.cb1.GetValue()== True: 166 166 for item in self.model_list: 167 167 item[0].SetValue(True) … … 270 270 for item in self.model_toFit: 271 271 model = item[3] 272 page = item[2]273 self.constraint_dict[page ] = model272 page_id= item[2] 273 self.constraint_dict[page_id] = model 274 274 275 275 def _display_constraint(self, event): … … 333 333 btRemove.SetToolTipString("Remove constraint.") 334 334 335 for page,model in self.constraint_dict.iteritems():335 for id,model in self.constraint_dict.iteritems(): 336 336 ## check if all parameters have been selected for constraint 337 337 ## then do not allow add constraint on parameters … … 364 364 hide buttons related constraint 365 365 """ 366 for pagein self.page_finder.iterkeys():367 self.page_finder[ page].clear_model_param()366 for id in self.page_finder.iterkeys(): 367 self.page_finder[id].clear_model_param() 368 368 369 369 self.nb_constraint =0 … … 539 539 msg+= " to set constraint! " 540 540 wx.PostEvent(self.parent.Parent, StatusEvent(status= msg )) 541 for page, value in self.constraint_dict.iteritems():541 for id, value in self.constraint_dict.iteritems(): 542 542 if model == value: 543 543 if constraint == "": … … 546 546 wx.PostEvent(self.parent.Parent, StatusEvent(status= msg )) 547 547 constraint = None 548 self.page_finder[ page].set_model_param(param,constraint)548 self.page_finder[id].set_model_param(param,constraint) 549 549 break 550 550 … … 575 575 sizer.Add(data_used,(iy, ix),(1,1), 576 576 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 577 578 for page, value in self.page_finder.iteritems(): 577 ix += 1 578 tab_used = wx.StaticText(self, -1, ' Fit Tab') 579 tab_used.SetBackgroundColour('grey') 580 sizer.Add(tab_used,(iy, ix),(1,1), 581 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 582 for id, value in self.page_finder.iteritems(): 579 583 try: 580 584 ix = 0 581 585 iy += 1 582 586 model = value.get_model() 583 cb = wx.CheckBox(self, -1, str(model.name)) 587 name = '_' 588 if model is not None: 589 name = str(model.name) 590 cb = wx.CheckBox(self, -1, name) 584 591 cb.SetValue(False) 592 cb.Enable(model is not None) 585 593 sizer.Add( cb,( iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 586 594 wx.EVT_CHECKBOX(self, cb.GetId(), self.check_model_name) 587 588 595 ix += 2 589 596 type = model.__class__.__name__ 590 597 model_type = wx.StaticText(self, -1, str(type)) 591 598 sizer.Add(model_type,( iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 599 data = value.get_fit_data() 600 name = '-' 601 if data is not None: 602 name = str(data.name) 603 data_used = wx.StaticText(self, -1, name) 604 ix += 1 605 sizer.Add(data_used,( iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 606 607 ix += 1 608 caption = value.get_fit_tab_caption() 609 tab_caption_used= wx.StaticText(self, -1, str(caption)) 610 sizer.Add(tab_caption_used,( iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 592 611 593 ix += 1 594 data = value.get_fit_data() 595 data_used= wx.StaticText(self, -1, str(data.name)) 596 sizer.Add(data_used,( iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 597 598 self.model_list.append([cb,value,page,model]) 612 self.model_list.append([cb,value,id,model]) 599 613 600 614 except: 601 pass 615 raise 616 #pass 602 617 iy += 1 603 618 sizer.Add((20,20),( iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
Note: See TracChangeset
for help on using the changeset viewer.