Ignore:
Timestamp:
Jan 18, 2009 12:20:09 PM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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
Message:

Fix model change bug. Models can now be selected from the top menu or the model page menu with the same result. The 2D plot, if enabled, will also be correctly updated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitting.py

    rcfc68540 r3dc83be  
    642642            name = evt.model.name 
    643643        model=evt.model() 
    644         #name="Model View" 
    645         #print "mon menu",model.name 
    646644        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) 
    650650         
    651651    def draw_model(self,model,name ,description=None,enable1D=True, enable2D=False, 
     
    654654             draw model with default data value 
    655655        """ 
    656          
    657         self.fit_panel.add_model_page(model=model,description=model.description,page_title=name, 
    658                                       qmin=qmin, qmax=qmax, npts=qstep)  
    659656        self._draw_model2D(model=model, 
    660657                           description=model.description, 
     
    702699                    new_plot.id ="Model" 
    703700                    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 
    704704                    wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 
    705                                      title="Analytical model 1D " )) 
     705                                     title="Analytical model 1D ", reset=True )) 
    706706                     
    707707                except: 
     
    742742        print "model draw comptele xmax",theory.xmax 
    743743        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)) 
    745745          
    746746         
Note: See TracChangeset for help on using the changeset viewer.