Changeset c0ff8cc in sasview for sansview/perspectives


Ignore:
Timestamp:
Apr 18, 2011 10:18:11 AM (14 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:
4bd492f
Parents:
69f9084
Message:

fixed problem in saving w/multifunctional models

File:
1 edited

Legend:

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

    r2296316 rc0ff8cc  
    4747                      ["formfactorcombobox", "formfactorcombobox", "float"], 
    4848                      ["structurecombobox", "structurecombobox", "float"], 
     49                      ["multi_factor","multi_factor","float"], 
    4950                      ["enable_smearer","enable_smearer","bool"], 
    5051                      ["disable_smearer","disable_smearer","bool"], 
     
    149150        self.is_data = None 
    150151        self.data_name = "" 
    151          
     152 
    152153        if self.data is not None: 
    153154            self.data_name = self.data.name 
     
    207208        self.values = {} 
    208209        self.weights = {} 
    209  
    210210                     
    211211        #contains link between a model and selected parameters to fit  
     
    218218        self.formfactorcombobox = None 
    219219        self.structurecombobox  = None 
     220 
    220221        ## radio box to select type of model 
    221222        self.shape_rbutton = False 
     
    314315        obj.qmin = copy.deepcopy(self.qmin) 
    315316        obj.qmax = copy.deepcopy(self.qmax) 
    316         obj.multi_factor = copy.deepcopy(self.multi_factor) 
     317        obj.multi_factor = self.multi_factor 
    317318        obj.npts = copy.deepcopy(self.npts ) 
    318319        obj.cb1 = copy.deepcopy(self.cb1) 
     
    341342            rep += "parameter unit: %s\n\n"%str(item[7]) 
    342343        return rep 
    343   
     344     
    344345    def __repr__(self): 
    345346        """  
     
    349350        t = time.localtime(self.timestamp) 
    350351        time_str = time.strftime("%b %d %H;%M of %Y", t) 
     352 
    351353        rep += "State created on : %s\n"%time_str 
    352354        rep += "State form factor combobox selection: %s\n"%self.formfactorcombobox 
     
    356358        rep += "data's id : %s\n"%self.data_id 
    357359        rep += "model type (form factor) selected: %s\n"%self.shape_rbutton  
     360        rep += "multi_factor : %s\n"% str(self.multi_factor) 
    358361        rep += "model type (shape independent) selected: %s\n"%self.shape_indep_rbutton 
    359362        rep += "model type (structure factor) selected: %s\n"%self.struct_rbutton 
     
    412415                rep = self._repr_helper( list=self.orientation_params_disp, rep=rep) 
    413416            """ 
    414          
    415417        return rep 
    416  
    417418 
    418419    def set_report_string(self): 
     
    429430        paramval_string = "" 
    430431        chi2_string = "" 
     432        multi_factor_string = "" 
    431433        q_range = "" 
    432434        strings = self.__repr__() 
     
    462464                chi2 = ("Chi2/Npts = " + value) 
    463465                chi2_string = CENTRE % chi2 
     466            if name == "multi_factor ": 
     467                muti_factor = ("muti_factor = " + value) 
     468                muti_factor_string = CENTRE % muti_factor 
    464469            if name == "Title": 
    465470                if len(value.strip()) == 0: 
     
    540545        else: 
    541546            add_str = "" 
     547 
    542548        # final report html strings 
    543549        report_str = html_str % ("%s") + add_str 
     
    548554        dialog = ReportDialog(report_list, None, -1, "") 
    549555        dialog.ShowModal() 
    550            
     556         
     557    
    551558    def _toXML_helper(self, list, element, newdoc): 
    552559        """ 
     
    638645            exec "element.setAttribute(item[0], str(self.%s))" % (item[1]) 
    639646            inputs.appendChild(element) 
    640  
     647             
    641648        # For self.values ={ disp_param_name: [vals,...],...}    
    642         # and for self.weights ={ disp_param_name: [weights,...],...}               
     649        # and for self.weights ={ disp_param_name: [weights,...],...}   
    643650        for item in list_of_model_attributes: 
    644651            element = newdoc.createElement(item[0]) 
     
    673680            exec com % item[1]                        
    674681            inputs.appendChild(element) 
    675                 
     682         
    676683        # Save the file 
    677684        if doc is None: 
     
    870877            images.append(fig) 
    871878             
    872         return images                    
     879        return images 
    873880 
    874881class Reader(CansasReader): 
     
    15011508             
    15021509        return doc  
    1503  
    15041510     
    15051511# Simple html report templet   
     
    15421548ELINE = "<p class=MsoNormal>&nbsp;</p>" 
    15431549 
    1544   
    15451550if __name__ == "__main__": 
    15461551    state = PageState(parent=None) 
Note: See TracChangeset for help on using the changeset viewer.