Changeset e3d1423 in sasview for sansview


Ignore:
Timestamp:
Jun 21, 2010 3:32:20 PM (15 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:
3ad91de
Parents:
43db4a8
Message:

work on save state

Location:
sansview/perspectives/fitting
Files:
2 edited

Legend:

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

    r0b12abb5 re3d1423  
    6262        self.npts = None 
    6363        ## default fitengine type 
    64         self.engine_type = None 
     64        self.engine_type = 'scipy' 
    6565        ## smear default 
    6666        self.smearer = None 
     
    113113        ## check that the fit range is correct to plot the model again 
    114114        self.fitrange= True 
    115  
    116          
    117          
    118          
    119115        ## Create memento to save the current state 
    120116        self.state= PageState(parent= self.parent,model=self.model, data=self.data) 
     
    721717        Store current state 
    722718        """ 
    723         if hasattr(self, "engine_type"): 
    724             self.state.engine_type = copy.deepcopy(self.engine_type) 
     719        self.state.engine_type = copy.deepcopy(self.engine_type) 
    725720        ## save model option 
    726721        if self.model!= None: 
     
    919914        self.disp_cb_dict = state.disp_cb_dict 
    920915        self.disp_list = state.disp_list 
    921  
     916       
    922917        ## set the state of the radio box 
    923918        self.shape_rbutton.SetValue(state.shape_rbutton ) 
    924919        self.shape_indep_rbutton.SetValue(state.shape_indep_rbutton) 
    925         self.struct_rbutton.SetValue(state.struct_rbutton ) 
     920        self.struct_rbutton.SetValue(state.struct_rbutton) 
    926921        self.plugin_rbutton.SetValue(state.plugin_rbutton) 
    927922         
     
    929924        self._show_combox_helper() 
    930925        #select the current model 
     926        self.formfactorbox.Select(int(state.formfactorcombobox)) 
    931927        self.structurebox.SetSelection(state.structurecombobox ) 
    932         self.formfactorbox.SetSelection(state.formfactorcombobox) 
     928        
    933929        #reset the fitting engine type 
    934930        self.engine_type = state.engine_type 
    935931        #draw the pnael according to the new model parameter  
    936932        self._on_select_model(event=None) 
    937    
     933        
    938934        if self.manager !=None: 
    939935            self.manager._on_change_engine(engine=self.engine_type) 
     
    17951791            self.structurebox.Enable() 
    17961792            self.text2.Enable() 
    1797         #if self.data.__class__.__name__ =="Data2D": 
    1798             #self.smear_description_2d.Show(True) 
    1799              
    18001793        s_id = self.structurebox.GetCurrentSelection() 
    18011794        struct_factor = self.structurebox.GetClientData( s_id ) 
     
    18111804                self.model = None 
    18121805                return self.model 
    1813          
    18141806        ## post state to fit panel 
    18151807        self.state.parameters =[] 
  • sansview/perspectives/fitting/pagestate.py

    r0b12abb5 re3d1423  
    3737                      ["name", "name", "string"], 
    3838                      ["data_name", "data_name", "string"]] 
    39 list_of_state_attributes = [["qmin", "qmin", "float"], 
     39list_of_state_attributes = [["engine_type", "engine_type", "string"], 
     40                       ["qmin", "qmin", "float"], 
    4041                      ["qmax", "qmax", "float"], 
    4142                      ["npts", "npts", "float"], 
     
    105106        elif item[2] == "bool": 
    106107            try: 
    107                 exec "value = bool(node.get(item[0]).strip())" 
    108                 return value 
     108                return node.get(item[0]).strip() == "True" 
     109                 
    109110            except: 
    110111                return None 
Note: See TracChangeset for help on using the changeset viewer.