Ignore:
Timestamp:
Jul 11, 2016 4:36:55 AM (8 years ago)
Author:
lewis
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
9c90cf3
Parents:
3901e7c
git-author:
Lewis O'Driscoll <lewis.o'driscoll@…> (07/06/16 11:20:28)
git-committer:
Lewis O'Driscoll <lewis.o'driscoll@…> (07/11/16 04:36:55)
Message:

Implement saving/loading state to/from a .svs project file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/corfunc/corfunc.py

    r2196f102 re02d8f6  
    1313from sas.sasgui.guiframe.dataFitting import Data1D 
    1414from sas.sasgui.perspectives.pr.pr_widgets import DataDialog 
     15from sas.sasgui.perspectives.corfunc.corfunc_state import Reader 
     16from sas.sascalc.dataloader.loader import Loader 
     17import sas.sascalc.dataloader 
    1518 
    1619 
     
    3033        self._always_active = True 
    3134 
     35        self.state_reader = Reader(self.set_state) 
     36        self._extensions = '.cor' 
     37        l = Loader() 
     38        l.associate_file_reader('.cor', self.state_reader) 
     39 
    3240    def get_panels(self, parent): 
    3341        """ 
     
    4351 
    4452        return [self.corfunc_panel] 
     53 
     54    def set_state(self, state=None, datainfo=None): 
     55        """ 
     56        Callback for CorfuncState reader. Called when a .cor file is loaded 
     57        """ 
     58        self.corfunc_panel.set_state(state=state, data=datainfo) 
    4559 
    4660    def set_data(self, data_list=None): 
     
    98112                                                id=self.data_id)) 
    99113                    self.data_id = data.id 
    100                     self.corfunc_panel._set_data(data) 
     114                    self.corfunc_panel.set_data(data) 
    101115                except: 
    102116                    msg = "Corfunc set_data: " + str(sys.exc_value) 
Note: See TracChangeset for help on using the changeset viewer.