Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    rd2007a8 ra3c59503  
    112112    def onLatexCopy(self): 
    113113        self.currentTab.onCopyToClipboard("Latex") 
     114 
     115    def serializeAllFitpage(self): 
     116        # serialize all active fitpages and return 
     117        # a dictionary: {data_id: fitpage_state} 
     118        params = {} 
     119        for i, tab in enumerate(self.tabs): 
     120            tab_data = self.getSerializedFitpage(tab) 
     121            if tab.tab_id is None: continue 
     122            id = tab_data['data_id'][0] 
     123            params[id] = tab_data 
     124        return params 
     125 
     126    def serializeCurrentFitpage(self): 
     127        # serialize current(active) fitpage 
     128        return self.getSerializedFitpage(self.currentTab) 
     129 
     130    def getSerializedFitpage(self, tab): 
     131        """ 
     132        get serialize requested fit tab 
     133        """ 
     134        fitpage_state = tab.getFitPage() 
     135        fitpage_state += tab.getFitModel() 
     136        # put the text into dictionary 
     137        line_dict = {} 
     138        for line in fitpage_state: 
     139            #content = line.split(',') 
     140            if len(line) > 1: 
     141                line_dict[line[0]] = line[1:] 
     142        return line_dict 
     143 
     144    def currentTabDataId(self): 
     145        """ 
     146        Returns the data ID of the current tab 
     147        """ 
     148        tab_id = None 
     149        if self.currentTab.data: 
     150            tab_id = self.currentTab.data.id 
     151        return tab_id 
     152 
     153    def updateFromParameters(self, parameters): 
     154        """ 
     155        Pass the update parameters to the current fit page 
     156        """ 
     157        self.currentTab.createPageForParameters(parameters) 
    114158 
    115159    def closeEvent(self, event): 
     
    258302        return True 
    259303 
     304    def isSerializable(self): 
     305        """ 
     306        Tell the caller that this perspective writes its state 
     307        """ 
     308        return True 
     309 
    260310    def setData(self, data_item=None, is_batch=False): 
    261311        """ 
     
    337387        pass 
    338388 
     389    def getCurrentStateAsXml(self): 
     390        """ 
     391        Returns an XML version of the current state 
     392        """ 
     393        state = {} 
     394        for tab in self.tabs: 
     395            pass 
     396        return state 
     397 
    339398    @property 
    340399    def currentTab(self): 
Note: See TracChangeset for help on using the changeset viewer.