Changeset 9e0aa69a in sasview for src/sas/sasgui


Ignore:
Timestamp:
Dec 21, 2016 10:48:26 AM (8 years ago)
Author:
krzywon
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:
a6fccd7
Parents:
0de74af
Message:

Added versioning to pagestate and fit saves for future use.

Location:
src/sas/sasgui/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r0de74af r9e0aa69a  
    15221522                        index_data = ((self.qmin_x <= self.data.x) & 
    15231523                                      (self.data.x <= self.qmax_x)) 
    1524                         val = self.data.x[index_data is True] 
    1525                         val = len(val) if isinstance(val, list) else 1 
    1526                         self.Npts_fit.SetValue(str(val)) 
     1524                        val = str(len(self.data.x[index_data])) 
     1525                        self.Npts_fit.SetValue(val) 
    15271526                    else: 
    15281527                        # No data in the panel 
  • src/sas/sasgui/perspectives/fitting/pagestate.py

    r0de74af r9e0aa69a  
    272272        # store value of chisqr 
    273273        self.tcChi = None 
     274        self.version = (1,0,0) 
    274275 
    275276    def clone(self): 
     
    470471        self._old_first_model() 
    471472        p = self.param_remap_to_sasmodels_convert(self.parameters) 
    472         structurefactor, params = \ 
    473             convert.convert_model(self.structurecombobox, p) 
    474         formfactor, params = \ 
    475             convert.convert_model(self.formfactorcombobox, params) 
     473        structurefactor, params = convert.convert_model(self.structurecombobox, 
     474                                                        p, False, self.version) 
     475        formfactor, params = convert.convert_model(self.formfactorcombobox, 
     476                                                   params, False, self.version) 
    476477        if len(self.str_parameters) > 0: 
    477478            str_pars = self.param_remap_to_sasmodels_convert( 
     
    819820 
    820821        attr = newdoc.createAttribute("version") 
    821         attr.nodeValue = '1.0' 
     822        import sasview 
     823        attr.nodeValue = sasview.__version__ 
     824        # attr.nodeValue = '1.0' 
    822825        top_element.setAttributeNode(attr) 
    823826 
     
    10121015            raise RuntimeError, msg 
    10131016 
    1014         if node.get('version') and node.get('version') == '1.0': 
    1015  
     1017        if node.get('version'): 
     1018 
     1019            self.version = tuple(int(e) for e in 
     1020                                 str.split(node.get('version'), ".")) 
    10161021            # Get file name 
    10171022            entry = get_content('ns:filename', node) 
Note: See TracChangeset for help on using the changeset viewer.