Changeset 707436d in sasview


Ignore:
Timestamp:
Apr 13, 2009 5:39:35 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:
fb8daaaf
Parents:
7959f297
Message:

switching between fitting engine when create new page fix

Location:
sansview/perspectives/fitting
Files:
2 edited

Legend:

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

    r60d6c23 r707436d  
    4040        self.text_disp_1=None 
    4141        ## default fitengine type 
    42         self.engine_type = "scipy" 
     42        self.engine_type = None 
    4343        ## draw sizer 
    4444        self._fill_datainfo_sizer() 
     
    630630        self.sizer3.Clear(True) 
    631631        self.parameters = [] 
    632         #self.page_info.parameters=[] 
    633632        self.param_toFit=[] 
    634633        self.fittable_param=[] 
     
    639638            self.SetScrollbars(20,20,200,100) 
    640639            return 
     640        ## the panel is drawn using the current value of the fit engine 
     641        if self.engine_type==None and self.manager !=None: 
     642            self.engine_type= self.manager._return_engine_type() 
     643             
    641644        box_description= wx.StaticBox(self, -1,str("Model Parameters")) 
    642645        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 
  • sansview/perspectives/fitting/fitting.py

    r60d6c23 r707436d  
    9696        id3 = wx.NewId() 
    9797        scipy_help= "Scipy Engine: Perform Simple fit. More in Help window...." 
    98         #self.menu1.Append(id3, "Scipy",scipy_help)  
    9998        self.menu1.AppendCheckItem(id3, "Simple Fit  [Scipy]",scipy_help)  
    10099        wx.EVT_MENU(owner, id3,  self._onset_engine_scipy) 
     
    104103        self.menu1.AppendCheckItem(id3, "Complex Fit  [Park]",park_help)  
    105104        wx.EVT_MENU(owner, id3,  self._onset_engine_park) 
     105         
     106        self.menu1.FindItemByPosition(0).Check(True) 
     107        self.menu1.FindItemByPosition(1).Check(False) 
     108             
    106109        self.menu1.AppendSeparator() 
    107110         
     
    405408        ## if simultaneous fit change automatically the engine to park 
    406409        if fitproblem_count >1: 
    407             self.menu1.FindItemByPosition(1).Check(True) 
    408             self.menu1.FindItemByPosition(0).Check(False) 
    409410            self._on_change_engine(engine='park') 
    410411             
     
    702703            set engine to park 
    703704        """ 
    704         if event.IsChecked(): 
    705             self.menu1.FindItemByPosition(0).Check(False) 
    706705        self._on_change_engine('park') 
    707706        
     
    711710            set engine to scipy 
    712711        """ 
    713         if event.IsChecked(): 
    714             self.menu1.FindItemByPosition(1).Check(False) 
    715712        self._on_change_engine('scipy') 
    716713        
     
    730727            new_panel 
    731728            self.mypanels.append(new_panel)  
    732         return     
    733     
     729        return   
     730     
     731       
     732    def _return_engine_type(self): 
     733        """ 
     734            return the current type of engine 
     735        """ 
     736        return self._fit_engine 
     737      
     738      
    734739    def _on_change_engine(self, engine='park'): 
    735740        """ 
     
    739744        ## saving fit engine name 
    740745        self._fit_engine = engine 
     746        ## change menu item state 
     747        if engine=="park": 
     748            self.menu1.FindItemByPosition(0).Check(False) 
     749            self.menu1.FindItemByPosition(1).Check(True) 
     750        else: 
     751            self.menu1.FindItemByPosition(0).Check(True) 
     752            self.menu1.FindItemByPosition(1).Check(False) 
     753             
    741754        ## post a message to status bar 
    742755        wx.PostEvent(self.parent, StatusEvent(status="Engine set to: %s" % self._fit_engine)) 
Note: See TracChangeset for help on using the changeset viewer.