Changeset ea8283d in sasview


Ignore:
Timestamp:
Oct 12, 2011 5:26:19 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
6b3edc1
Parents:
4a52223
Message:

small fix for loading a state file

Location:
fittingview/src/sans/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fittingview/src/sans/perspectives/fitting/basepage.py

    re3f6ef5 rea8283d  
    12231223        self.pinhole_smearer.SetValue(state.pinhole_smearer) 
    12241224        self.slit_smearer.SetValue(state.slit_smearer) 
    1225          
    1226         self.dI_noweight.SetValue(state.dI_noweight) 
    1227         self.dI_didata.SetValue(state.dI_didata) 
    1228         self.dI_sqrdata.SetValue(state.dI_sqrdata) 
    1229         self.dI_idata.SetValue(state.dI_idata) 
    1230          
    1231          
     1225        try: 
     1226            self.dI_noweight.SetValue(state.dI_noweight) 
     1227            self.dI_didata.SetValue(state.dI_didata) 
     1228            self.dI_sqrdata.SetValue(state.dI_sqrdata) 
     1229            self.dI_idata.SetValue(state.dI_idata) 
     1230        except: 
     1231            # to support older state file formats 
     1232            self.dI_noweight.SetValue(False) 
     1233            self.dI_didata.SetValue(True) 
     1234            self.dI_sqrdata.SetValue(False) 
     1235            self.dI_idata.SetValue(False) 
     1236  
    12321237        ## we have two more options for smearing 
    12331238        if self.pinhole_smearer.GetValue(): self.onPinholeSmear(event=None) 
  • fittingview/src/sans/perspectives/fitting/fitpanel.py

    r05efe88 rea8283d  
    215215                    page_is_opened = True 
    216216            if not page_is_opened: 
    217                 panel = self._manager.add_fit_page(data=state.data) 
     217                if state.data.__class__.__name__ != 'list': 
     218                    #To support older state file format 
     219                    list_data = [state.data] 
     220                else: 
     221                    #Todo: need new file format for the list 
     222                    list_data = state.data 
     223                panel = self._manager.add_fit_page(data=list_data) 
    218224                # add data associated to the page created 
    219225                if panel is not None:   
    220226                    self._manager.store_data(uid=panel.uid,  
    221                                              data=state.data, 
     227                                             data_list=list_data, 
    222228                                             caption=panel.window_caption) 
    223229                    panel.reset_page(state=state) 
Note: See TracChangeset for help on using the changeset viewer.