Ignore:
Timestamp:
Oct 22, 2018 7:48:54 AM (5 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
d00475d
Parents:
b8dccb8
Message:

Working project load/save. new format only. SASVIEW-983/984

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r2eeda93 ra3c59503  
    268268        self.communicator.statusBarUpdateSignal.emit("Saving Project... %s\n" % os.path.basename(filename)) 
    269269 
    270         with open(filename, 'w') as outfile: 
    271             self.saveDataToFile(outfile) 
     270        return filename 
    272271 
    273272    def saveAsAnalysisFile(self, tab_id=1): 
     
    318317            is_checked = item.checkState() 
    319318            properties['checked'] = is_checked 
    320             other_datas = GuiUtils.plotsFromFilename(filename, model) 
     319            other_datas = [] 
     320            # no need to save other_datas - things will be refit on read 
     321            #other_datas = GuiUtils.plotsFromFilename(filename, model) 
    321322            # skip the main plot 
    322             other_datas = list(other_datas.values())[1:] 
     323            #other_datas = list(other_datas.values())[1:] 
    323324            all_data[data.id] = [data, properties, other_datas] 
    324325        return all_data 
     
    375376        with open(filename, 'r') as infile: 
    376377            all_data = GuiUtils.readDataFromFile(infile) 
    377             items = self.updateModelFromData(all_data) 
     378 
     379        for key, value in all_data.items(): 
     380            data_dict = {key:value['fit_data']} 
     381            items = self.updateModelFromData(data_dict) 
     382            # send newly created item to its perspective 
     383            if 'fit_params' in value: 
     384                self.sendItemToPerspective(items[0]) 
     385                # Make the perspective read the rest of the read data 
     386                self._perspective().updateFromParameters(value['fit_params']) 
    378387 
    379388        pass # debugger 
Note: See TracChangeset for help on using the changeset viewer.