- Timestamp:
- Oct 16, 2008 11:28:59 AM (16 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:
- 4ddf1067
- Parents:
- f8ce013
- Location:
- sansview/perspectives/fitting
- Files:
-
- 1 added
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage2D.py
r00353b4 rbcd6d51 25 25 26 26 27 class FitPage (wx.Panel):27 class FitPage2D(wx.Panel): 28 28 """ 29 29 FitPanel class contains fields allowing to display results when -
sansview/perspectives/fitting/fitpanel.py
r2139c3f rbcd6d51 66 66 67 67 68 def add_fit_page( self, page_title):68 def add_fit_page( self,data ): 69 69 """ 70 70 Add a fitting page on the notebook contained by fitpanel … … 73 73 @return panel : page just added for futher used. is used by fitting module 74 74 """ 75 if self.fit_page_name != page_title: 76 from fitpage import FitPage 77 panel = FitPage(self.nb, -1) 75 try: 76 name = data.group_id # item in Data1D 77 except: 78 name = 'Fit' 79 if self.fit_page_name != name: 80 if data.__class__.__name__=='MetaData2D': 81 from fitpage2D import FitPage2D 82 panel = FitPage2D(self.nb, -1) 83 else: 84 from fitpage1D import FitPage1D 85 panel = FitPage1D(self.nb, -1) 78 86 panel.set_manager(self.manager) 79 87 panel.set_owner(self.event_owner) 80 self.nb.AddPage(page=panel,text= page_title,select=True)88 self.nb.AddPage(page=panel,text=name,select=True) 81 89 panel.populate_box( self.model_list_box) 82 self.fit_page_name = page_title90 self.fit_page_name = name 83 91 return panel 84 92 -
sansview/perspectives/fitting/fitting.py
r00353b4 rbcd6d51 14 14 15 15 import models 16 import fitpage 16 import fitpage1D 17 17 import park 18 18 … … 64 64 self.fit_panel.set_owner(owner) 65 65 self.fit_panel.set_model_list(self.menu_mng.get_model_list()) 66 owner.Bind(fitpage .EVT_MODEL_BOX,self._on_model_panel)66 owner.Bind(fitpage1D.EVT_MODEL_BOX,self._on_model_panel) 67 67 #create menubar items 68 68 return [(id, self.menu1, "Fitting"),(id2, menu2, "Model")] … … 146 146 if item.name == self.panel.graph.selected_plottable or item.__class__.__name__ is "MetaData2D": 147 147 #find a name for the page created for notebook 148 148 149 try: 149 name = item.group_id # item in Data1D 150 except: 151 name = 'Fit' 152 try: 153 page = self.fit_panel.add_fit_page(name) 150 page = self.fit_panel.add_fit_page(item) 154 151 # add data associated to the page created 155 if item.__class__.__name__=='MetaData1D' or item.__class__.__name__=='Data1D' : 156 new_item=FitData1D(item) 157 else: 158 new_item=FitData2D(item) 152 159 153 if page !=None: 160 page.set_data_name( new_item)154 page.set_data_name(item) 161 155 #create a fitproblem storing all link to data,model,page creation 162 156 self.page_finder[page]= FitProblem() … … 164 158 #datap = PlottableData(data=data_for_park,data1d=item) 165 159 #self.page_finder[page].add_data(datap) 166 self.page_finder[page].add_data( new_item)160 self.page_finder[page].add_data(item) 167 161 except: 168 raise169 162 wx.PostEvent(self.parent, StatusEvent(status="Creating Fit page: %s"\ 170 163 %sys.exc_value)) … … 201 194 list=value.get_model() 202 195 model=list[0] 203 print "fitting",model.name,modelname196 #print "fitting",model.name,modelname 204 197 if model.name== modelname: 205 198 value.set_model_param(names,values) … … 437 430 react to model selection on any combo box or model menu.plot the model 438 431 """ 432 439 433 model = evt.model 440 434 name = evt.name … … 444 438 current_pg.set_model_name(name) 445 439 current_pg.set_panel(model) 440 446 441 try: 447 fitdata=self.page_finder[current_pg].get_data()448 M_name="M"+str(self.index_model)+"= "+name+"("+ fitdata.data.group_id+")"442 metadata=self.page_finder[current_pg].get_data() 443 M_name="M"+str(self.index_model)+"= "+name+"("+metadata.group_id+")" 449 444 except: 450 raise451 445 M_name="M"+str(self.index_model)+"= "+name 452 446 model.name="M"+str(self.index_model) … … 479 473 for page in self.page_finder.iterkeys(): 480 474 if page==currpage : 475 data=self.page_finder[page].get_data() 476 list=self.page_finder[page].get_model() 477 model=list[0] 481 478 break 482 fitdata=self.page_finder[page].get_data()483 list=self.page_finder[page].get_model()484 model=list[0]485 data=fitdata.data486 479 487 480 if data!=None and data.__class__.__name__ != 'MetaData2D':
Note: See TracChangeset
for help on using the changeset viewer.