Changeset c9a4377 in sasview


Ignore:
Timestamp:
Mar 30, 2009 4:26:12 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
d16e396
Parents:
6355f4d
Message:

plotting range fixed

Location:
sansview/perspectives/fitting
Files:
6 edited

Legend:

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

    r6355f4d rc9a4377  
    371371            return the fitting range 
    372372        """ 
    373         return self.qmin_x , self.qmax_x 
     373        return float(self.qmin_x) , float(self.qmax_x) 
    374374         
    375375    def get_param_list(self): 
  • sansview/perspectives/fitting/fitpanel.py

    r6f023e8 rc9a4377  
    6262        """ 
    6363        page_info=self.get_current_page().page_info.clone() 
    64         self.manager._add_page_onmenu("Model", page_info) 
     64        page_info.page_name= self.get_current_page().page_info.page_name 
     65        
     66        self.manager._add_page_onmenu(page_info.page_name, page_info) 
    6567         
    6668        selected_page = self.GetPage(self.GetSelection()) 
     
    152154         
    153155        if not name in self.fit_page_name : 
     156             
    154157            from fitpage import FitPage 
    155158            panel = FitPage(parent= self, page_info=myinfo, name=name ) 
    156             panel.name=name 
     159            panel.name = name 
    157160            panel.window_name= "fitpage" 
    158161            panel.set_manager(self.manager) 
     
    167170            return None  
    168171         
    169     def _help_add_model_page(self,model,description,page_title, qmin=0, qmax=0.1, npts=50): 
     172    def _help_add_model_page(self,model,page_title, qmin=0, qmax=0.1, npts=50): 
    170173        """ 
    171174            #TODO: fill in description 
     
    205208      
    206209         
    207     def add_model_page(self,model,description,page_title, qmin=0, qmax=0.1, npts=50, topmenu=False): 
     210    def add_model_page(self,model,page_title, qmin=0, qmax=0.1, npts=50, topmenu=False): 
    208211        """ 
    209212            Add a model page only one  to display any model selected from the menu or the page combo box. 
     
    212215            @param model: the model for which paramters will be changed 
    213216            @param page_title: the name of the page 
    214             @param description: [Coder: fill your description!] 
    215217            @param page_title: [Coder: fill your description!] 
    216218            @param qmin: mimimum Q 
     
    220222        if topmenu==True: 
    221223            if  self.draw_model_name ==None: 
    222                 self._help_add_model_page(model,description,page_title, qmin=qmin, qmax=qmax, npts=npts) 
     224                self._help_add_model_page(model,page_title, qmin=qmin, qmax=qmax, npts=npts) 
    223225            else: 
    224226                self.model_page.select_model(model, page_title) 
  • sansview/perspectives/fitting/fitting.py

    r6f023e8 rc9a4377  
    383383        ## if simultaneous fit change automatically the engine to park 
    384384        if fitproblem_count >1: 
     385            self.menu1.FindItemByPosition(1).Check(True) 
     386            self.menu1.FindItemByPosition(0).Check(False) 
    385387            self._on_change_engine(engine='park') 
     388             
    386389        from sans.fit.Fitting import Fit 
    387390        self.fitter= Fit(self._fit_engine) 
    388391         
    389392        if self._fit_engine=="park": 
    390             engineType="Simutaneous Fit" 
     393            engineType="Simultaneous Fit" 
    391394        else: 
    392395            engineType="Single Fit" 
     
    459462            reopen a closed page 
    460463        """ 
    461         print "reopen" 
     464        if event.GetId() in self.closed_page_dict.keys(): 
     465            page_info= self.closed_page_dict[ event.GetId() ] 
     466            if page_info.page_name !="Model Page": 
     467                page = self.fit_panel.add_fit_page(page_info.data) 
     468            else: 
     469                model= page_info.model 
     470                self.fit_panel.add_model_page(model,model.name,topmenu=True) 
    462471         
    463472    def _reset_schedule_problem(self, value=0): 
     
    740749            # save the name containing the data name with the appropriate model 
    741750            self.page_finder[current_pg].set_model(model) 
     751            qmin, qmax= current_pg.get_range() 
     752            self.page_finder[current_pg].set_range(qmin=qmin, qmax=qmax) 
     753            
    742754            # save model name 
    743             self.draw_model( model=model, data= metadata) 
     755            self.draw_model( model=model, data= metadata, qmin=qmin, qmax=qmax) 
    744756             
    745757            if self.sim_page!=None: 
     
    756768        if hasattr(evt.model, "name"): 
    757769            name = evt.model.name 
    758         model=evt.model 
    759         description=model.description 
    760          
     770        model = evt.model 
     771      
    761772        # Create a model page. If a new page is created, the model 
    762773        # will be plotted automatically. If a page already exists, 
    763774        # the content will be updated and the plot refreshed 
    764         self.fit_panel.add_model_page(model,description,name,topmenu=True) 
     775        self.fit_panel.add_model_page(model,name,topmenu=True) 
    765776     
    766777    
  • sansview/perspectives/fitting/model_thread.py

    ra8ced02 rc9a4377  
    109109        y = self.y 
    110110        output = numpy.zeros((len(x),len(y))) 
    111          
    112111        if self.qmin==None: 
    113112            self.qmin = 0 
  • sansview/perspectives/fitting/modelpage.py

    r6f023e8 rc9a4377  
    3030        """ 
    3131        self.name ="Model" 
     32        page_info.page_name= "Model Page" 
    3233        self._fill_model_sizer( self.sizer1)   
    3334        self._fill_range_sizer()  
  • sansview/perspectives/fitting/pageInfo.py

    r6f023e8 rc9a4377  
    3030        # Event_owner is the owner of model event 
    3131        self.event_owner = None 
    32        
     32        ##page name 
     33        self.page_name="" 
    3334        # Contains link between  model ,all its parameters, and panel organization 
    3435        self.parameters=[] 
     
    5455        self.qmax=None 
    5556        self.npts=None 
    56         ##page name 
    57         self.page_name="" 
     57        
    5858         
    5959                   
Note: See TracChangeset for help on using the changeset viewer.