Changeset 3dc83be in sasview
- Timestamp:
- Jan 18, 2009 12:20:09 PM (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:
- a2c38de
- Parents:
- 3f1af74
- Location:
- sansview/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpanel.py
r3f1af74 r3dc83be 115 115 panel.set_manager(self.manager) 116 116 panel.set_owner(self.event_owner) 117 self.nb.AddPage(page=panel,text=page_title,select=True) 117 #self.nb.AddPage(page=panel,text=page_title,select=True) 118 self.nb.AddPage(page=panel,text="Model",select=True) 118 119 panel.populate_box( self.model_list_box) 119 120 self.draw_model_name=page_title … … 125 126 self.model_page.set_range(qmin, qmax, npts) 126 127 127 128 def add_model_page(self,model,description,page_title, qmin=0, qmax=0.1, npts=50): 128 # We just created a model page, we are ready to plot the model 129 self.manager.draw_model(model, model.name) 130 131 132 def add_model_page(self,model,description,page_title, qmin=0, qmax=0.1, npts=50, topmenu=False): 129 133 """ 130 134 Add a model page only one to display any model selected from the menu or the page combo box. … … 141 145 if self.draw_model_name ==None: 142 146 self._help_add_model_page(model,description,page_title, qmin=qmin, qmax=qmax, npts=npts) 143 else: 144 if self.draw_model_name !=page_title: 145 self.onClose(self.model_page, self.model_page_number) 146 self._help_add_model_page(model,description,page_title, qmin=qmin, qmax=qmax, npts=npts) 147 147 elif topmenu==True: 148 self.model_page.select_model(model) 148 149 149 150 def get_notebook(self): -
sansview/perspectives/fitting/fitting.py
rcfc68540 r3dc83be 642 642 name = evt.model.name 643 643 model=evt.model() 644 #name="Model View"645 #print "mon menu",model.name646 644 description=model.description 647 #self.fit_panel.add_model_page(model,description,name) 648 649 self.draw_model(model=model,name=name) 645 646 # Create a model page. If a new page is created, the model 647 # will be plotted automatically. If a page already exists, 648 # the content will be updated and the plot refreshed 649 self.fit_panel.add_model_page(model,description,name,topmenu=True) 650 650 651 651 def draw_model(self,model,name ,description=None,enable1D=True, enable2D=False, … … 654 654 draw model with default data value 655 655 """ 656 657 self.fit_panel.add_model_page(model=model,description=model.description,page_title=name,658 qmin=qmin, qmax=qmax, npts=qstep)659 656 self._draw_model2D(model=model, 660 657 description=model.description, … … 702 699 new_plot.id ="Model" 703 700 new_plot.group_id ="Model" 701 702 # Pass the reset flag to let the plotting event handler 703 # know that we are replacing the whole plot 704 704 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 705 title="Analytical model 1D " ))705 title="Analytical model 1D ", reset=True )) 706 706 707 707 except: … … 742 742 print "model draw comptele xmax",theory.xmax 743 743 wx.PostEvent(self.parent, NewPlotEvent(plot=theory, 744 title="Analytical model 2D %s" %str(model.name) ))744 title="Analytical model 2D %s" %str(model.name), reset=True)) 745 745 746 746 -
sansview/perspectives/fitting/modelpage.py
rcfc68540 r3dc83be 229 229 return 0 230 230 231 232 231 def select_model(self, model): 232 """ 233 Select a new model 234 @param model: model object 235 """ 236 self.model= model 237 self.set_panel(model) 238 self._draw_model() 239 240 # Select the model from the combo box 241 items = self.modelbox.GetItems() 242 for i in range(len(items)): 243 if items[i]==model.__class__.__name__: 244 self.modelbox.SetSelection(i) 245 233 246 def _on_select_model(self,event): 234 247 """ … … 245 258 self.model= model 246 259 self.set_panel(model) 247 print "name in model page", name,event.GetString()248 260 self.name= name 249 261 #self.manager.draw_model(model, name)
Note: See TracChangeset
for help on using the changeset viewer.